0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

fixed an issue with timing.timeScale when at 0

This commit is contained in:
liabru 2014-04-24 19:45:06 +01:00
parent 88a703757b
commit 4c97284f0e

View file

@ -126,6 +126,10 @@ var Engine = {};
// time correction for time scaling
if (timeScalePrev !== 0)
correction *= timing.timeScale / timeScalePrev;
if (timing.timeScale === 0)
correction = 0;
timeScalePrev = timing.timeScale;
// update engine timing object
@ -239,7 +243,7 @@ var Engine = {};
// iteratively resolve position between collisions
for (i = 0; i < engine.positionIterations; i++) {
Resolver.solvePosition(pairs.list, timing.timeScale * timing.correction);
Resolver.solvePosition(pairs.list, timing.timeScale);
}
Resolver.postSolvePosition(allBodies);