|
|
@ -21,6 +21,7 @@ class PhysicsEngine { |
|
|
|
this.previousStates = {}; |
|
|
|
this.freezeCache = {}; |
|
|
|
this.renderTimer = undefined; |
|
|
|
this.initialStabilizationEmitted = false; |
|
|
|
|
|
|
|
this.stabilized = false; |
|
|
|
this.startedStabilization = false; |
|
|
@ -237,7 +238,8 @@ class PhysicsEngine { |
|
|
|
} |
|
|
|
|
|
|
|
_emitStabilized() { |
|
|
|
if (this.stabilizationIterations > 0) { |
|
|
|
if (this.stabilizationIterations > 1 || this.initialStabilizationEmitted === false) { |
|
|
|
this.initialStabilizationEmitted = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.body.emitter.emit('stabilized', {iterations: this.stabilizationIterations}); |
|
|
|
this.stabilizationIterations = 0; |
|
|
|