mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
Merge pull request #51 from tumult/pair_refreshes_from_body_values
changed Pair.update to also update pair properties
This commit is contained in:
commit
7c1efb6185
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue