Keep Update() from advancing by very large chunks; use more double math
This commit is contained in:
parent
4346f20024
commit
c08defc656
@ -107,9 +107,11 @@ namespace SemiColinGames {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!paused) {
|
if (!paused) {
|
||||||
float modelTime = (float) gameTime.ElapsedGameTime.TotalSeconds;
|
double modelTime = gameTime.ElapsedGameTime.TotalSeconds;
|
||||||
|
// To prevent huge diffs, never update by more than 4 frames' worth of time.
|
||||||
|
modelTime = Math.Min(modelTime, TARGET_FRAME_TIME * 4.0f);
|
||||||
Clock.AddModelTime(modelTime);
|
Clock.AddModelTime(modelTime);
|
||||||
world.Update(modelTime, input);
|
world.Update((float) modelTime, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Update(gameTime);
|
base.Update(gameTime);
|
||||||
|
Loading…
Reference in New Issue
Block a user