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:
parent
3e5ababf3b
commit
f0e74912d5
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