|
sandbox
|
Plane-based box represented by six clipping planes. More...
#include <box.hpp>
Public Types | |
| using | value_type = Type |
| Underlying scalar value type. | |
| using | plane_type = basic_plane< value_type > |
| Plane type used by this box. | |
| using | volume_type = basic_volume< value_type > |
| Volume type tested for intersection. | |
| using | size_type = std::size_t |
| Index type for plane access. | |
Public Member Functions | |
| basic_box () noexcept=default | |
| Constructs an empty box. | |
| basic_box (const std::array< plane_type, 6u > &planes) noexcept | |
| Constructs a box from a plane array. More... | |
| basic_box (std::array< plane_type, 6u > &&planes) noexcept | |
| Constructs a box by moving in a plane array. More... | |
| auto | intersects (const volume_type &volume) const -> bool |
| Tests whether this box intersects a volume. More... | |
| auto | planes () const noexcept -> const std::array< plane_type, 6u > & |
| Returns the plane array backing this box. More... | |
| auto | plane (const size_type index) const noexcept -> const plane_type & |
| Returns the plane at a given index. More... | |
Plane-based box represented by six clipping planes.
The box stores a fixed set of six planes. The intersection test uses a "positive vertex" strategy against an AABB-like volume type.
| Type | Scalar value type. |
|
noexcept |
Constructs a box from a plane array.
| planes | Plane array describing the box. |
|
noexcept |
Constructs a box by moving in a plane array.
| planes | Plane array describing the box. |
| auto sbx::math::basic_box< Type >::intersects | ( | const volume_type & | volume | ) | const -> bool |
Tests whether this box intersects a volume.
The test evaluates the volume against each plane using the volume vertex most aligned with the plane normal.
| volume | Volume to test for intersection. |
|
noexcept |
Returns the plane at a given index.
| index | Plane index. |
index.
|
noexcept |
Returns the plane array backing this box.