/** * Get all the entities who are touching this entity * * @param dest A list to store the entities in, or null, to construct a new one * @return dest, or a new List if dest was null */ public final List<Entity> checkCollisions(List<Entity> dest) { if (node != null) { return node.checkCollisions(this, dest); } else { // Haven't got a node in the quadtree. Use the root assert false : this + " is not in the quadtree!"; return COLLISIONMANAGER.checkCollisions(this, dest); } }
/** * Find out which entities are touching the specified rectangle * * @param rect * @param dest * @return */ public static List<Entity> getCollisions(ReadableRectangle rect, List<Entity> dest) { return COLLISIONMANAGER.checkCollisions(rect, dest); }
/** Process collisions */ public static void checkCollisions() { COLLISIONMANAGER.checkCollisions(); }