From 8210dbebb366e8cce39684c692f04814d6288c66 Mon Sep 17 00:00:00 2001 From: liabru Date: Wed, 2 Dec 2015 00:38:56 +0000 Subject: [PATCH] added early out in Constraint.postSolveAll, pass body.velocity when updating bounds --- src/constraint/Constraint.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/constraint/Constraint.js b/src/constraint/Constraint.js index ea72dcb..effbb2d 100644 --- a/src/constraint/Constraint.js +++ b/src/constraint/Constraint.js @@ -257,6 +257,10 @@ var Common = require('../core/Common'); var body = bodies[i], impulse = body.constraintImpulse; + if (impulse.x === 0 && impulse.y === 0 && impulse.angle === 0) { + continue; + } + // update geometry and reset for (var j = 0; j < body.parts.length; j++) { var part = body.parts[j]; @@ -276,7 +280,7 @@ var Common = require('../core/Common'); } } - Bounds.update(part.bounds, part.vertices); + Bounds.update(part.bounds, part.vertices, body.velocity); } impulse.angle = 0;