mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -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
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue