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