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