Revert "Revert "AABB detection""

This reverts commit 0101b11b24baa361a1ddede844ef11b4a490bf4a.