En takaa et k??ntyy en?? 8)
authorekku
Wed, 19 Nov 2008 15:07:28 +0000
changeset 71 b5dbb83daa94
parent 70 a5b7499219a4
child 72 04428c5e548c
En takaa et k??ntyy en?? 8)
src/proto2/Physics.cc
src/proto2/Physics.hh
--- a/src/proto2/Physics.cc	Tue Nov 18 23:00:39 2008 +0000
+++ b/src/proto2/Physics.cc	Wed Nov 19 15:07:28 2008 +0000
@@ -73,10 +73,10 @@
  
 		if (abs(this->velocity.y) < 0.1) {
 			this->velocity.y = 0;
-			// Friction
+			// Static friction
 			this->velocity.x *= 0.95;
 		} else {
-        	// Bigger friction
+        	// Kinetic friction
 			this->velocity.x *= 0.75;
 		}
 
--- a/src/proto2/Physics.hh	Tue Nov 18 23:00:39 2008 +0000
+++ b/src/proto2/Physics.hh	Wed Nov 19 15:07:28 2008 +0000
@@ -7,6 +7,8 @@
 
 const uint16_t PHYSICS_TICK_MS = 10;
 
+const enum TerrainType {EMPTY, DIRT, ROCK};
+
 // forward-declare
 class PhysicsObject;
 
@@ -21,6 +23,8 @@
     Vector gravity;
     Vector dimensions;
     
+    std::vector<std::vector> terrain;
+
     CL_SlotContainer slots;
     
     PhysicsWorld (Vector gravity, Vector dimensions);
@@ -37,6 +41,9 @@
     float mass;
     Vector position;
     Vector velocity;
+	// Whether the object (worms mainly) is in the air or on the ground.
+	// Affects to physics.
+	bool inAir;
     
     PhysicsObject (PhysicsWorld &world, float mass, Vector position, Vector velocity);