--- 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);