public void test() { AABB copy = blocks.get(0).bounds.copy(); copy.offset(0.025f, 0, 0); if (!copy.collides(blocks.get(1).bounds)) { blocks.get(0).bounds = copy; } }
/** * Returns true if this AABB overlaps the given AABB. * * @param aabb2 The AABB to check for overlapping * @return True if overlapping */ public boolean overlaps(AABB aabb2) { if (maxX() < aabb2.minX() || minX() > aabb2.maxX()) return false; if (maxY() < aabb2.minY() || minY() > aabb2.maxY()) return false; if (maxZ() < aabb2.minZ() || minZ() > aabb2.maxZ()) return false; return true; }