Struct AABB
Defined in File Geometry.hpp
Struct Documentation
Axis-aligned bounding box.
Stores component-wise minima/maxima and provides helpers for:
Union/expansion with points or other AABBs.
Longest axis query (for BVH splitting).
Robust ray-box intersection (slabs method).
XY containment with and without Z tolerance.
Public Functions
Expand the box to include a point
p.- Parameters:
p – Point to merge into this AABB.
Expand the box to include another box
b(component-wise union).- Parameters:
b – Other AABB to merge.
Return the index of the longest axis (0=x, 1=y, 2=z).
- Returns:
Axis index with the largest extent.
Robust ray-box intersection (slabs method).
Intersects ray (o + t * d) against the box. Handles zero components in direction
dby checking slab containment on that axis.
2D containment test on XY with tolerance in Z.
Checks if point
plies inside the XY rectangle and within a vertical band around [min.z, max.z] expanded byz_eps.- Parameters:
p – Query point.
z_eps – Extra vertical half-thickness tolerance.
- Returns:
True if inside XY and |z - [min.z,max.z]| <= z_eps.
2D containment test on XY only (no Z check).
- Parameters:
p – Query point.
- Returns:
True if inside XY rectangle [min,max].
Public Members
Minimum corner (x_min, y_min, z_min). Initialized to +inf.
Maximum corner (x_max, y_max, z_max). Initialized to -inf.