0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

fixed SAT overlap calculation for containment case

This commit is contained in:
liabru 2015-02-24 00:01:20 +00:00
parent bc9a051e73
commit 685f2bdc54

View file

@ -161,9 +161,7 @@ var SAT = {};
_projectToAxis(projectionA, verticesA, axis);
_projectToAxis(projectionB, verticesB, axis);
overlap = projectionA.min < projectionB.min
? projectionA.max - projectionB.min
: projectionB.max - projectionA.min;
overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min);
if (overlap <= 0) {
result.overlap = overlap;