Browse Source

- PointForceController now supports negative force again (repulse).

MelvMay-GG 12 years ago
parent
commit
801cb07
1 changed files with 1 additions and 1 deletions
  1. 1 1
      engine/source/2d/controllers/PointForceController.cc

+ 1 - 1
engine/source/2d/controllers/PointForceController.cc

@@ -117,7 +117,7 @@ void PointForceController::integrate( Scene* pScene, const F32 totalTime, const
     const F32 radiusSqr = mRadius * mRadius;
 
     // Calculate the force squared in-case we need it.
-    const F32 forceSqr = mForce * mForce;
+    const F32 forceSqr = mForce * mForce * (( mForce < 0.0f ) ? -1.0f : 1.0f);
 
     // Calculate drag coefficients (time-integrated).
     const F32 linearDrag = mClampF( mLinearDrag, 0.0f, 1.0f ) * elapsedTime;