Skip to content

Instantly share code, notes, and snippets.

@brunofarache
Last active December 21, 2015 22:09
Show Gist options
  • Save brunofarache/6373573 to your computer and use it in GitHub Desktop.
Save brunofarache/6373573 to your computer and use it in GitHub Desktop.
Map<Integer, Integer> collided = new HashMap<Integer, Integer>();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 7; j++) {
Vec3D hand = hands[i];
AABB box = boxes[j];
if (box.containsPoint(hand) && pointClassification.equals(cutPlane.classifyPoint(hand, 0).toString())) {
boolean triggered = (collided.get(i) == j);
if (triggered) {
continue;
}
collided.put(i, j);
trigger();
}
else if (collided.get(i) == j) {
collided.remove(i);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment