0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-12-26 13:49:01 -05:00

When updating pairs use current values from bodies as they may have changed

This commit is contained in:
Jonathan Deutsch 2014-12-04 13:22:35 -08:00
parent 3e5ababf3b
commit f0e74912d5

View file

@ -51,6 +51,10 @@ var Pair = {};
activeContacts = pair.activeContacts;
pair.collision = collision;
pair.inverseMass = collision.bodyA.inverseMass + collision.bodyB.inverseMass;
pair.friction = Math.min(collision.bodyA.friction, collision.bodyB.friction);
pair.restitution = Math.max(collision.bodyA.restitution, collision.bodyB.restitution);
pair.slop = Math.max(collision.bodyA.slop, collision.bodyB.slop);
activeContacts.length = 0;
if (collision.collided) {