Should Force get cleared every frame.

Feb 11, 2010 at 11:12 AM

When I do body.ApplyForce, shouldn't the force be applied, but then cleared every frame?

Currently, it seems to just accumulate in definetly accross world steps with no way to clear it that I can see.

Or, am I missing something?

-Jeff

Feb 11, 2010 at 11:59 AM

Ok, I just found World.ClearForces()... didn't realize I need to call that myself.

Coordinator
Feb 11, 2010 at 6:16 PM

In older versions of Box2D you did not need to call it yourself.

I think in the latest revision (r56, which our latest source is synced to) it goes back to not needing to call World.ClearForces().

Feb 11, 2010 at 8:48 PM

I hope so, because I can think of very few cases where you would not want to clear the forces on bodies.

Instead, they should add a body.ApplyConstantForce(...)   Which would apply forces that are not cleared every step.