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:
parent
88a703757b
commit
4c97284f0e
1 changed files with 5 additions and 1 deletions
|
@ -126,6 +126,10 @@ var Engine = {};
|
||||||
// time correction for time scaling
|
// time correction for time scaling
|
||||||
if (timeScalePrev !== 0)
|
if (timeScalePrev !== 0)
|
||||||
correction *= timing.timeScale / timeScalePrev;
|
correction *= timing.timeScale / timeScalePrev;
|
||||||
|
|
||||||
|
if (timing.timeScale === 0)
|
||||||
|
correction = 0;
|
||||||
|
|
||||||
timeScalePrev = timing.timeScale;
|
timeScalePrev = timing.timeScale;
|
||||||
|
|
||||||
// update engine timing object
|
// update engine timing object
|
||||||
|
@ -239,7 +243,7 @@ var Engine = {};
|
||||||
|
|
||||||
// iteratively resolve position between collisions
|
// iteratively resolve position between collisions
|
||||||
for (i = 0; i < engine.positionIterations; i++) {
|
for (i = 0; i < engine.positionIterations; i++) {
|
||||||
Resolver.solvePosition(pairs.list, timing.timeScale * timing.correction);
|
Resolver.solvePosition(pairs.list, timing.timeScale);
|
||||||
}
|
}
|
||||||
Resolver.postSolvePosition(allBodies);
|
Resolver.postSolvePosition(allBodies);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue