The raycasting process’ main goal is to figure out wether or not a ray is colliding with any of the meshes contained in a given world. This process can be launched form the file render.
The process is divided in several steps.
For every mesh in the world, the file mesh_renderer is in charge of computing the intersection between a given mesh and the ray.
From the root bbox of a given mesh, the bbox_renderer will recursively be called on all of its children as long as the given ray collides with the boundary box.
<aside> 💡 See bbox for any further explaination about the “children” of a boundary box and the meaning of “tree”.
</aside>
For every mesh in the world, the file triangle_renderer is in charge of computing the intersection between a given mesh and the ray.
This step loops through every sphere of the world and try finding the intersection point between the sphere and the provided ray