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:
parent
c2b0f30250
commit
8210dbebb3
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue