Skip to content

Commit

Permalink
When updating pairs use current values from bodies as they may have c…
Browse files Browse the repository at this point in the history
…hanged
  • Loading branch information
jmfd committed Dec 4, 2014
1 parent 3e5abab commit f0e7491
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collision/Pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f0e7491

Please sign in to comment.