From: Patrik Gornicz Date: Mon, 6 Sep 2010 17:03:34 +0000 (-0400) Subject: fixed velocity math mistake, updated gravtiy well force to look better X-Git-Url: http://gitweb.pgornicz.com/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=libbear.git fixed velocity math mistake, updated gravtiy well force to look better --- diff --git a/physics/src/Effects/GravityWell.cpp b/physics/src/Effects/GravityWell.cpp index 38711eb..71d80b0 100644 --- a/physics/src/Effects/GravityWell.cpp +++ b/physics/src/Effects/GravityWell.cpp @@ -18,7 +18,7 @@ #include "GravityWell.h" #include "Entities/PhysicsEntity.h" -float wellGravity = 0.5; +float wellGravity = 0.25; /// ***** Constructors/Destructors ***** diff --git a/physics/src/Entities/PhysicsEntity.cpp b/physics/src/Entities/PhysicsEntity.cpp index 752d5eb..745ab80 100644 --- a/physics/src/Entities/PhysicsEntity.cpp +++ b/physics/src/Entities/PhysicsEntity.cpp @@ -67,7 +67,7 @@ Vector2 PhysicsEntity::velocityAt(float time_step) const newForce += effect::forceDelta(this, time_step); newVelocity += effect::velocityDelta(this, time_step); - return newForce/m_mass / 2 * time_step + newVelocity; + return newForce/m_mass * time_step + newVelocity; } void PhysicsEntity::applyForce(const Vector2& force)