Skip to content

Instantly share code, notes, and snippets.

@MondayHopscotch
Created October 7, 2015 03:10
Show Gist options
  • Save MondayHopscotch/a1b895946bf2d920e9cf to your computer and use it in GitHub Desktop.
Save MondayHopscotch/a1b895946bf2d920e9cf to your computer and use it in GitHub Desktop.
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