From 685f2bdc5465fa821c401074b779615a21d941dd Mon Sep 17 00:00:00 2001 From: liabru Date: Tue, 24 Feb 2015 00:01:20 +0000 Subject: [PATCH] fixed SAT overlap calculation for containment case --- src/collision/SAT.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/collision/SAT.js b/src/collision/SAT.js index f3f9a15a..b9565a0b 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;