Fixed some obvious mistakes.
authorsaiam
Tue, 18 Nov 2008 18:34:33 +0000
changeset 49 4740cab6eaaa
parent 48 fa1da22db8a0
child 50 9e1a6506f5a1
Fixed some obvious mistakes.
src/proto2/Physics.cc
--- 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.
 }