Axis Aligned Bounding Box class.
More...
#include <aeongames/AABB.hpp>
|
|
DLL | AABB () |
| | Default constructor.
|
| DLL | AABB (const Vector3 &aCenter, const Vector3 &aRadii) |
| | Construct an AABB from a center point and radii.
|
| DLL const Vector3 & | GetCenter () const |
| | Get the center position of the AABB.
|
| DLL const Vector3 & | GetRadii () const |
| | Get the radii (half-extents) of the AABB.
|
| DLL void | SetCenter (const Vector3 &aCenter) |
| | Set the center position of the AABB.
|
| DLL void | SetRadii (const Vector3 &aRadii) |
| | Set the radii (half-extents) of the AABB.
|
| DLL std::array< Vector3, 8 > | GetPoints (const Vector3 &aOffset={ 0.0f, 0.0f, 0.0f, }) const |
| | Get the eight corner points of the AABB.
|
| DLL Transform | GetTransform () const |
| | Get the AABB as a transform, the AABB center becomes translation and the radii becomes scale.
|
| DLL float | GetDistanceToPlane (const Plane &aPlane) const |
| | Returns the shortest distance from any point in the plane's surface to the support point of the AABB in the plain normal inverted direction.
|
Axis Aligned Bounding Box class.
Definition at line 33 of file AABB.hpp.
◆ AABB()
| AeonGames::AABB::AABB |
( |
const Vector3 & | aCenter, |
|
|
const Vector3 & | aRadii ) |
Construct an AABB from a center point and radii.
- Parameters
-
| aCenter | Center position of the bounding box. |
| aRadii | Half-extents along each axis. |
Definition at line 26 of file AABB.cpp.
◆ GetCenter()
| const Vector3 & AeonGames::AABB::GetCenter |
( |
| ) |
const |
Get the center position of the AABB.
- Returns
- Const reference to the center vector.
Definition at line 29 of file AABB.cpp.
◆ GetDistanceToPlane()
| float AeonGames::AABB::GetDistanceToPlane |
( |
const Plane & | aPlane | ) |
const |
Returns the shortest distance from any point in the plane's surface to the support point of the AABB in the plain normal inverted direction.
In other words returns the required displacement of the AABB along the normal direction to leave the AABB just touching the plane from the positive side.
Definition at line 67 of file AABB.cpp.
◆ GetPoints()
| std::array< Vector3, 8 > AeonGames::AABB::GetPoints |
( |
const Vector3 & | aOffset = { 0.0f, 0.0f, 0.0f, } | ) |
const |
Get the eight corner points of the AABB.
- Parameters
-
| aOffset | Optional offset applied to all points. |
- Returns
- Array of eight corner vertices.
Definition at line 45 of file AABB.cpp.
◆ GetRadii()
| const Vector3 & AeonGames::AABB::GetRadii |
( |
| ) |
const |
Get the radii (half-extents) of the AABB.
- Returns
- Const reference to the radii vector.
Definition at line 33 of file AABB.cpp.
◆ GetTransform()
| Transform AeonGames::AABB::GetTransform |
( |
| ) |
const |
Get the AABB as a transform, the AABB center becomes translation and the radii becomes scale.
Definition at line 62 of file AABB.cpp.
◆ operator+=()
| AABB & AeonGames::AABB::operator+= |
( |
const AABB & | lhs | ) |
|
Expand this AABB to enclose another AABB.
- Parameters
-
| lhs | The AABB to merge into this one. |
- Returns
- Reference to this AABB after expansion.
Definition at line 78 of file AABB.cpp.
◆ SetCenter()
| void AeonGames::AABB::SetCenter |
( |
const Vector3 & | aCenter | ) |
|
Set the center position of the AABB.
- Parameters
-
| aCenter | New center position. |
Definition at line 37 of file AABB.cpp.
◆ SetRadii()
| void AeonGames::AABB::SetRadii |
( |
const Vector3 & | aRadii | ) |
|
Set the radii (half-extents) of the AABB.
- Parameters
-
Definition at line 41 of file AABB.cpp.
The documentation for this class was generated from the following files: