From f0e74912d56b3a7bb6b76306c703e0cc6a926b57 Mon Sep 17 00:00:00 2001 From: Jonathan Deutsch Date: Thu, 4 Dec 2014 13:22:35 -0800 Subject: [PATCH] When updating pairs use current values from bodies as they may have changed --- src/collision/Pair.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/collision/Pair.js b/src/collision/Pair.js index 12de206..206d2fc 100644 --- a/src/collision/Pair.js +++ b/src/collision/Pair.js @@ -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) {