Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::AABB Class Reference

Axis Aligned Bounding Box class. More...

#include <aeongames/AABB.hpp>

Collaboration diagram for AeonGames::AABB:
Collaboration graph

Public Member Functions

DLL AABB ()
 Default constructor.
DLL AABB (const Vector3 &aCenter, const Vector3 &aRadii)
 Construct an AABB from a center point and radii.
DLL const Vector3GetCenter () const
 Get the center position of the AABB.
DLL const Vector3GetRadii () 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.

Operators

DLL AABBoperator+= (const AABB &lhs)
 Expand this AABB to enclose another AABB.

Detailed Description

Axis Aligned Bounding Box class.

Definition at line 33 of file AABB.hpp.

Constructor & Destructor Documentation

◆ AABB()

AeonGames::AABB::AABB ( const Vector3 & aCenter,
const Vector3 & aRadii )

Construct an AABB from a center point and radii.

Parameters
aCenterCenter position of the bounding box.
aRadiiHalf-extents along each axis.

Definition at line 26 of file AABB.cpp.

Member Function Documentation

◆ 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
aOffsetOptional 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
lhsThe 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
aCenterNew 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
aRadiiNew radii values.

Definition at line 41 of file AABB.cpp.


The documentation for this class was generated from the following files: