Detecting collision between objects in a 3D space.