What does the term "STEP" means in bullet physics?
What does the function stepSimulation()
and its parameters mean?
I have read the documentation but i could not get hold of anything.
Any valid explanation would be of great help.
What does the term "STEP" means in bullet physics?
What does the function stepSimulation()
and its parameters mean?
I have read the documentation but i could not get hold of anything.
Any valid explanation would be of great help.
timeStep
- time passed after last simulation.Internally simulation is done for some internal constant steps.
fixedTimeStep
fixedTimeStep
~~~ 0.01666666 = 1/60if
timeStep
is 0.1 then it will include 6 (timeStep / fixedTimeStep
) internal simulations.To make glider movements BulletPhysics interpolate final step results according reminder after division (
timeStep / fixedTimeStep
)timeStep
- the amount of time in seconds to step the simulation by. Typically you're going to be passing it the time since you last called it.maxSubSteps
- the maximum number of steps that Bullet is allowed to take each time you call it.fixedTimeStep
- regulates resolution of the simulation. If your balls penetrates your walls instead of colliding with them try to decrease it.Here i would like to address the issue in Proxy's answer about special meaning of value
1
formaxSubSteps
. There is only one special value, that is0
and you most likely don't want to use it because then simulation will go with non-constant time step. All other values are the same. Let's have a look at the actual code:So, there is nothing special about
maxSubSteps
equal to1
. You should really abide this formulatimeStep < maxSubSteps * fixedTimeStep
if you don't want to lose time.I know I'm late, but I thought the accepted answer was only marginally better than the documentation's description.
timeStep
: The amount of seconds, not milliseconds, passed since the last call tostepSimulation
.maxSubSteps
: Should generally stay at one so Bullet interpolates current values on its own. A value of zero implies a variable tick rate, meaning Bullet advances the simulation exactlytimeStep
seconds instead of interpolating. This feature is buggy and not recommended. A value greater than one must always satisfy the equationtimeStep < maxSubSteps * fixedTimeStep
or you're losing time in the simulation.fixedTimeStep
: Inversely proportional to the simulation's resolution. Resolution increases as this value decreases. Keep in mind that a higher resolution means it takes more CPU.