Box3
[Box3](/reference/math/box3)
represents a 3D volume bounded by two corners: min
and max
. It is used for spatial queries, frustum culling, and bounding volume computations. All operations assume the box is axis-aligned and defined in local space.
Properties
Functions
ApplyTransform() auto
auto vglx::Box3::ApplyTransform(const Matrix4 &transform)
Parameter | Description |
---|---|
transform | 4x4 matrix to apply to the box. |
Transforms the box by the given matrix. The resulting box is the axis-aligned bounding box that encloses the transformed corners of the original box.
Box3() constexpr
vglx::Box3::Box3(const Vector3 &v_min, const Vector3 &v_max)
Parameter | Description |
---|---|
v_min | Minimum point. |
v_max | Maximum point. |
Constructs a Box3 object from minimum and maximum corners.
ExpandWithPoint() auto
auto vglx::Box3::ExpandWithPoint(const Vector3 &p)
Parameter | Description |
---|---|
p | Point to include in the box. |
Expands the box to include the given point. If the point lies outside the current box bounds, the box is enlarged to include it.
IsEmpty() auto
auto vglx::Box3::IsEmpty() const
Checks whether the box is empty (invalid). A box is considered empty if any component of min
exceeds the corresponding component of max
, which means it contains no volume.
Reset() auto
auto vglx::Box3::Reset()
Resets the box to an empty state. This sets min
and max
to extreme values such that any point expanded into it will become the new bounds.
Translate() auto
auto vglx::Box3::Translate(const Vector3 &translation)
Parameter | Description |
---|---|
translation | Vector to add to both min and max . |
Translates the box by a constant vector.
Union() auto
auto vglx::Box3::Union(const Box3 &other)
Parameter | Description |
---|---|
other | The box to merge into this one. |
Expands this box to fully contain another box.