Fixed some obvious mistakes.
--- a/src/proto2/Physics.cc Tue Nov 18 18:29:05 2008 +0000
+++ b/src/proto2/Physics.cc Tue Nov 18 18:34:33 2008 +0000
@@ -23,9 +23,9 @@
void PhysicsObject::updatePosition () {
// Calculate gravity's influence on the velocity vector
- this->velocity += GRAVITY_FORCEi / mass * 1.0i / mass * 1.0ff;
+ this->velocity += (GRAVITY_FORCE / this->mass) * PHYSICS_TICK_MS * 1000;
- Vector newPosition = position + velocity * PHYSICS_TICK_MS;
+ Vector newPosition = position + velocity * PHYSICS_TICK_MS * 1000;
//TODO Handle the object as a square or a polygon
if(newPosition.x < 0 || (newPosition.x > PHYSICS_WORLD_WIDTH)
@@ -39,7 +39,7 @@
}
void PhysicsObject::applyForce (Vector force) {
- this->velocity += force / mass * 1.0f; // The last factor denotes the time.
+ this->velocity += force / mass * PHYSICS_TICK_MS * 1000; // The last factor denotes the time.
// It should be scaled somehow.
}