applyForce and variable framerate

Evgeny
Posts: 3
Joined: Wed Feb 13, 2008 5:56 pm

applyForce and variable framerate

Post by Evgeny »

When Bullet applies force to RigidBody, it means, that this will be a constant force, that will be applied for a one simulationStep. Then all applied forces will be cleared. simulationStep may last variable amount of time. Moreover it definitly will last variable amount of time in real game. Next, simulationStep may consists of several (or even zero) substeps. In my game, I have a situation, when force sometime applied during a long period of time (when framerate becomes low), sometimes during small amount of time and sometime it's not applied at all (when framerate is high and timeStep goes bellow fixedTimeStep). I think, that this is not a normal behavior.
So, my suggestion is: apply force for constant amount of time and clear all of them after first substep if there are any. The partial solution may be not to clear forces if there is no substeps in simulationStep.

Sorry for bad English,
Regards, Evgeny Marchenko