0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

skip presolve when impulse 0

This commit is contained in:
liabru 2015-05-03 13:32:53 +01:00
parent ccbb98b8d0
commit 296059cba2

View file

@ -187,6 +187,7 @@ var Resolver = {};
normalImpulse = contact.normalImpulse;
tangentImpulse = contact.tangentImpulse;
if (normalImpulse !== 0 || tangentImpulse !== 0) {
// total impulse from contact
impulse.x = (normal.x * normalImpulse) + (tangent.x * tangentImpulse);
impulse.y = (normal.y * normalImpulse) + (tangent.y * tangentImpulse);
@ -207,6 +208,7 @@ var Resolver = {};
}
}
}
}
};
/**