mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
fixed support finding logic
This commit is contained in:
parent
757fffaf20
commit
bc7dfc74b8
1 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ var SAT = {};
|
||||||
if (Vertices.contains(bodyA.vertices, verticesB[0]))
|
if (Vertices.contains(bodyA.vertices, verticesB[0]))
|
||||||
supports.push(verticesB[0]);
|
supports.push(verticesB[0]);
|
||||||
|
|
||||||
if (verticesB[1] && Vertices.contains(bodyA.vertices, verticesB[1]))
|
if (verticesB.length > 1 && Vertices.contains(bodyA.vertices, verticesB[1]))
|
||||||
supports.push(verticesB[1]);
|
supports.push(verticesB[1]);
|
||||||
|
|
||||||
// find the supports from bodyA that are inside bodyB
|
// find the supports from bodyA that are inside bodyB
|
||||||
|
@ -127,7 +127,7 @@ var SAT = {};
|
||||||
if (Vertices.contains(bodyB.vertices, verticesA[0]))
|
if (Vertices.contains(bodyB.vertices, verticesA[0]))
|
||||||
supports.push(verticesA[0]);
|
supports.push(verticesA[0]);
|
||||||
|
|
||||||
if (verticesA[1] && supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1]))
|
if (verticesA.length > 1 && supports.length < 2 && Vertices.contains(bodyB.vertices, verticesA[1]))
|
||||||
supports.push(verticesA[1]);
|
supports.push(verticesA[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue