Skip to content

Commit

Permalink
added early out in Constraint.postSolveAll, pass body.velocity when u…
Browse files Browse the repository at this point in the history
…pdating bounds
  • Loading branch information
liabru committed Dec 2, 2015
1 parent c2b0f30 commit 8210dbe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
Expand Down

0 comments on commit 8210dbe

Please sign in to comment.