mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-25 13:39:06 -05:00
optimised Pair.update
This commit is contained in:
parent
48673db79f
commit
1073ddeecf
1 changed files with 4 additions and 4 deletions
|
@ -65,10 +65,10 @@ var Contact = require('./Contact');
|
||||||
|
|
||||||
pair.collision = collision;
|
pair.collision = collision;
|
||||||
pair.inverseMass = parentA.inverseMass + parentB.inverseMass;
|
pair.inverseMass = parentA.inverseMass + parentB.inverseMass;
|
||||||
pair.friction = Math.min(parentA.friction, parentB.friction);
|
pair.friction = parentA.friction < parentB.friction ? parentA.friction : parentB.friction;
|
||||||
pair.frictionStatic = Math.max(parentA.frictionStatic, parentB.frictionStatic);
|
pair.frictionStatic = parentA.frictionStatic > parentB.frictionStatic ? parentA.frictionStatic : parentB.frictionStatic;
|
||||||
pair.restitution = Math.max(parentA.restitution, parentB.restitution);
|
pair.restitution = parentA.restitution > parentB.restitution ? parentA.restitution : parentB.restitution;
|
||||||
pair.slop = Math.max(parentA.slop, parentB.slop);
|
pair.slop = parentA.slop > parentB.slop ? parentA.slop : parentB.slop;
|
||||||
activeContacts.length = 0;
|
activeContacts.length = 0;
|
||||||
|
|
||||||
if (collision.collided) {
|
if (collision.collided) {
|
||||||
|
|
Loading…
Reference in a new issue