Hello,
I think this question has been answered 100 times but I couldn't find a real answer,
especially because I call world.Step more than 1 time in Update()
because this
http://gafferongames.com/game-physics/f ... -timestep/ says so.
I want to move my character that it only moves during I press the movement keys.
So, I thought about a simple procedure like
Code:
case onleftkeydown:
body->applyimpulse
case onleftkeyup:
body->clearvelocity
but this would also clear the force which was added through other sources.
And because I call step() more than one time in an update and the force gets cleared after each call, its only useful for the first call to step().
If I only apply/set the force/impulse/velocity but dont clear it, the player doesn't stop to move.