Added postUpdate NOOP

This commit is contained in:
Richard Davey 2017-11-08 17:17:58 +00:00
parent 4d976e59d1
commit 6947a68152

View file

@ -208,6 +208,11 @@ var World = new Class({
return this; return this;
}, },
postUpdate: function ()
{
// NOOP
},
update: function (time, delta) update: function (time, delta)
{ {
if (!this.enabled || this.bodies.size === 0) if (!this.enabled || this.bodies.size === 0)
@ -216,7 +221,10 @@ var World = new Class({
} }
// Impact uses a divided delta value that is clamped to the maxStep (20fps) maximum // Impact uses a divided delta value that is clamped to the maxStep (20fps) maximum
this.delta = Math.min(delta / 1000, this.maxStep) * this.timeScale;
var clampedDelta = Math.min(delta / 1000, this.maxStep) * this.timeScale;
this.delta = clampedDelta;
// Update all active bodies // Update all active bodies
@ -233,7 +241,7 @@ var World = new Class({
if (body.enabled) if (body.enabled)
{ {
body.update(this.delta); body.update(clampedDelta);
} }
} }