mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -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(projectionA, verticesA, axis);
|
||||||
_projectToAxis(projectionB, verticesB, axis);
|
_projectToAxis(projectionB, verticesB, axis);
|
||||||
|
|
||||||
overlap = projectionA.min < projectionB.min
|
overlap = Math.min(projectionA.max - projectionB.min, projectionB.max - projectionA.min);
|
||||||
? projectionA.max - projectionB.min
|
|
||||||
: projectionB.max - projectionA.min;
|
|
||||||
|
|
||||||
if (overlap <= 0) {
|
if (overlap <= 0) {
|
||||||
result.overlap = overlap;
|
result.overlap = overlap;
|
||||||
|
|
Loading…
Reference in a new issue