![]() |
Lysa
0.0
Lysa 3D Engine
|
Lightweight structure representing a 3D axis-aligned bounding box in the engine's right-handed coordinate system.
Public Member Functions | |
| AABB () = default | |
| AABB (const float3 &min, const float3 &max) | |
| AABB (const AABB &aabb) | |
| float3 | center () const |
| AABB | toGlobal (const float4x4 &transform) const |
| bool | intersectsRay (const float3 &origin, const float3 &invDir, float tMax, float &tMin) const |
Public Attributes | |
| float3 | min {} |
| float3 | max {} |
|
default |
Default-construct an empty/invalid AABB with zeroed corners. The box becomes valid once min/max are assigned meaningful values.
|
inline |
Construct a bounding box from its minimum and maximum corners.
| min | Minimum corner (x/y/z individually less-or-equal to max). |
| max | Maximum corner (x/y/z individually greater-or-equal to min). |
|
inline |
|
inline |
Compute the volumetric center of the box.
| bool intersectsRay | ( | const float3 & | origin, |
| const float3 & | invDir, | ||
| float | tMax, | ||
| float & | tMin | ||
| ) | const |
| AABB toGlobal | ( | const float4x4 & | transform | ) | const |
Compute the world-space AABB that encloses this box transformed by the given matrix.
| float3 max {} |
Maximum corner of the box (component-wise). Typically corresponds to the right/top/front corner: {max.x, max.y, max.z}.
| float3 min {} |
Minimum corner of the box (component-wise). Typically corresponds to the left/bottom/back corner: {min.x, min.y, min.z}.