- for (Uint32 i(0); i < deltaT && !StateChangePending(); ++i) {
- CurrentState()->PhysicsTimers().Update(1);
- CurrentState()->UpdateWorld(1);
+ remaining += deltaT;
+ Uint32 step = CurrentState()->Timestep();
+ if (step > 0) {
+ for (; remaining >= step && !StateChangePending(); remaining -= step) {
+ CurrentState()->PhysicsTimers().Update(step);
+ CurrentState()->UpdateWorld(step);
+ }
+ } else {
+ CurrentState()->PhysicsTimers().Update(deltaT);
+ CurrentState()->UpdateWorld(deltaT);