Skip to content

Commit

Permalink
Merge pull request #51 from tumult/pair_refreshes_from_body_values
Browse files Browse the repository at this point in the history
changed Pair.update to also update pair properties
  • Loading branch information
liabru committed Dec 5, 2014
2 parents 3e5abab + f0e7491 commit 7c1efb6
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 7c1efb6

Please sign in to comment.