This project is read-only.

Should Force get cleared every frame.

Feb 11, 2010 at 12:12 PM

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 12:59 PM

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

Feb 11, 2010 at 7: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 9: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.