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:
parent
bc9a051e73
commit
685f2bdc54
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue