Skip to content

Commit

Permalink
fixed SAT overlap calculation for containment case
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Feb 24, 2015
1 parent bc9a051 commit 685f2bd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/collision/SAT.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 685f2bd

Please sign in to comment.