Avoid the 'spiral of death'

move
scrawl 9 years ago
parent 383524c688
commit 796a4a795a

@ -1295,7 +1295,11 @@ namespace MWPhysics
mTimeAccum += dt;
const float physicsDt = 1.f/60.0f;
const int maxAllowedSteps = 20;
int numSteps = mTimeAccum / (physicsDt);
numSteps = std::min(numSteps, maxAllowedSteps);
mTimeAccum -= numSteps * physicsDt;
if (numSteps)

Loading…
Cancel
Save