diff --git a/src/collision/SAT.js b/src/collision/SAT.js index f3f9a15..b9565a0 100644 --- a/src/collision/SAT.js +++ b/src/collision/SAT.js @@ -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;