I was tracking down a bug when I came across this section of code in btDescreteDynamicsWorld.cpp:454:
for (int i=0;i<clampedSimulationSteps;i++)
{
// Urho3D: apply gravity and clear forces on each substep
applyGravity();
internalSingleStepSimulation(fixedTimeStep);
synchronizeMotionStates();
clearForces();
}
} else
{
synchronizeMotionStates();
}
When comparing this to bullet’s official repository, we see something different:
[code] applyGravity();
for (int i=0;i<clampedSimulationSteps;i++)
{
internalSingleStepSimulation(fixedTimeStep);
synchronizeMotionStates();
}
} else
{
synchronizeMotionStates();
}
clearForces();[/code]
applyGravity() and clearForces() are outside of the for loop. I’m interested why there is a discrepancy here.