foundation collision detection