Starting from the concept, configuring and checking collisions in a scene can be done without mathematical notations. We all have the notion of gravity and ellipsoid, even if the ellipsoid word is not necessarily familiar.
Let's start with the following scene (a camera, light, plane, and box):
The goal is to prevent the currently active camera of the scene from crossing the objects in the scene. In other words, we want the camera to stay above the plane and stop moving forward if it collides with the box.
To perform these actions, the collisions system provided by Babylon.js uses a collider. A collider can be represented by the bounding box
of a simple object and it looks similar to the following image:
For information, a bounding box simply represents the minimum and maximum positions of a mesh's vertices and it is computed automatically by Babylon.js.
As explained in Chapter 3, Create, Load, and Draw 3D Objects on the Screen...