0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-01-13 16:18:50 -05:00

added early out in Constraint.postSolveAll, pass body.velocity when updating bounds

This commit is contained in:
liabru 2015-12-02 00:38:56 +00:00
parent c2b0f30250
commit 8210dbebb3

View file

@ -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;