SA_Maths
Sapphire Suite's C++ Maths Library
|
AABB 3D Sapphire's class. More...
#include <AABB3D.hpp>
Public Member Functions | |
AABB3D ()=default | |
Default constructor. | |
AABB3D (const Vec3< T > &_min, const Vec3< T > &_max) | |
Value constructor from min and max. | |
AABB3D (const AABB3D &_first, const AABB3D &_second) | |
Merge 2 AABB box. | |
AABB3D (const AABB2D< T > &_aabb2D) noexcept | |
Constructor from AABB2D. | |
bool | IsValid () const noexcept |
Wether this AABB has valid values (ie min < max);. | |
constexpr bool | Equals (const AABB3D &_other, T _epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
Compare 2 AABB3D. | |
constexpr bool | operator== (const AABB3D &_rhs) const noexcept |
Compare 2 AABB equality. | |
constexpr bool | operator!= (const AABB3D &_rhs) const noexcept |
Compare 2 AABB inequality. | |
bool | IsCollidingX (const AABB3D &_other) const |
Perform collision test on X axis only. | |
bool | IsCollidingY (const AABB3D &_other) const |
Perform collision test on Y axis only. | |
bool | IsCollidingZ (const AABB3D &_other) const |
Perform collision test on Z axis only. | |
bool | IsColliding (const AABB3D &_other) const |
Perform collision test on every axis. | |
float | Width () const |
Compute width (X axis) from min and max. | |
float | Height () const |
Compute height (Y axis) from min and max. | |
float | Depth () const |
Compute depth (Z axis) from min and max. | |
Vec3< T > | Center () const |
Compute center from min and max. | |
float | Area () const |
Compute area from min and max. | |
Static Public Member Functions | |
static AABB3D | Merge (const AABB3D &_first, const AABB3D &_second) |
Merge 2 AABB3D box to create a big AABB3D which wrap both boxes. | |
Public Attributes | |
Vec3< T > | min |
Min box component. | |
Vec3< T > | max |
Max box component. | |
AABB 3D Sapphire's class.
T | Type of the AABB. |
SA::AABB3D< T >::AABB3D | ( | const Vec3< T > & | _min, |
const Vec3< T > & | _max ) |
Value constructor from min and max.
_min | Min value |
_max | Max value. |
SA::AABB3D< T >::AABB3D | ( | const AABB3D< T > & | _first, |
const AABB3D< T > & | _second ) |
Merge 2 AABB box.
_first | First AABB to merge. |
_second | Second AABB to merge. |
|
noexcept |
Constructor from AABB2D.
_aabb2D | 2D AABB object. |
float SA::AABB3D< T >::Area | ( | ) | const |
Compute area from min and max.
Vec3< T > SA::AABB3D< T >::Center | ( | ) | const |
Compute center from min and max.
float SA::AABB3D< T >::Depth | ( | ) | const |
Compute depth (Z axis) from min and max.
|
constexprnoexcept |
Compare 2 AABB3D.
[in] | _other | Other AABB to compare to. |
[in] | _epsilon | Epsilon value for threshold comparison. |
float SA::AABB3D< T >::Height | ( | ) | const |
Compute height (Y axis) from min and max.
bool SA::AABB3D< T >::IsColliding | ( | const AABB3D< T > & | _other | ) | const |
Perform collision test on every axis.
_other | Other AABB box. |
bool SA::AABB3D< T >::IsCollidingX | ( | const AABB3D< T > & | _other | ) | const |
Perform collision test on X axis only.
_other | Other AABB box. |
bool SA::AABB3D< T >::IsCollidingY | ( | const AABB3D< T > & | _other | ) | const |
Perform collision test on Y axis only.
_other | Other AABB box. |
bool SA::AABB3D< T >::IsCollidingZ | ( | const AABB3D< T > & | _other | ) | const |
Perform collision test on Z axis only.
_other | Other AABB box. |
|
noexcept |
Wether this AABB has valid values (ie min < max);.
|
static |
|
constexprnoexcept |
Compare 2 AABB inequality.
[in] | _rhs | Other AABB to compare to. |
|
constexprnoexcept |
Compare 2 AABB equality.
[in] | _rhs | Other AABB to compare to. |
float SA::AABB3D< T >::Width | ( | ) | const |
Compute width (X axis) from min and max.