Created
October 7, 2015 03:10
-
-
Save MondayHopscotch/a1b895946bf2d920e9cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
axes.sort((o1, o2) -> Float.compare(Math.abs(o1.overlap), Math.abs(o2.overlap))); | |
BitPoint relativeMovement = body.lastAttempt.minus(otherBody.lastAttempt); | |
float dotProd; | |
for (AxisOverlap axisOver : axes) { | |
dotProd = relativeMovement.dot(axisOver.axis); | |
if (dotProd != 0 && !sameSign(dotProd, axisOver.overlap)) { | |
axis = axisOver.axis; | |
distance = axisOver.overlap; | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment