Content

bbox stands for boundary box. It is basically a virtual axis aligned bounded box that contains children (wether triangles or bboxes).

The bbox structure uses a tree implementation.

For any further explaination, see "Axis-Aligned Bounding Box."

It is a fairly computationally and memory-efficient way of representing a volume.

Since it is axis-aligned, it does not necessarily "fit" your real 3D object very well. Bbox checks are often used as a coarse first-approximation to see if objects might be colliding. Then, if the bbox check passes, more detailed checks are made.

In the raycasting process, it lets us reducing the number of computation as we can elimate every triangle contained in the given box if the ray does not intersect the box.

<aside> 💡 The file responsible for ray / bbox intersection is bbox_renderer

</aside>

Some visuals

Considering all of the geomtric elements as triangles, the outlined boxes would represent possible bboxes.

Considering all of the geomtric elements as triangles, the outlined boxes would represent possible bboxes.

<aside> 👁️ If the concept of boundary box is not familiar to you, it is higly recommended to give a look at “this website

</aside>

Attributes

c_size stands for “children size” and always contain the number of element accesible from the bbox (independently from the fact the bbox contains triangle or other bboxes)

min and max represent respectively the minimum and maximum values enclosed by the bbox

Behaviors

The bbox structure can behave in two distincts way. Both are computed the same but the parameters can differ from one to the other.

“Tree” bbox

A tree bbox is a bbox that contains other bboxes. It basically makes the bridge between the original root bbox of the mesh and the “leaf” bboxes.

“Leaf” bbox