Make class CollisionDetection a friend class.