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:
parent
ccbb98b8d0
commit
296059cba2
1 changed files with 19 additions and 17 deletions
|
@ -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 = {};
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue