SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::Math::AABB Struct Reference

#include <AABB.hpp>

Public Member Functions

 AABB ()=default
 AABB (const Vector3D &mn, const Vector3D &mx)
Vector3D Center () const
bool Contains (const Vector3D &p) const
 True if p lies within (or on the boundary of) the box.
Vector3D Corner (int i) const
float DistanceSq (const Vector3D &p) const
void Expand (float amount)
 Pushes min/max outward by amount on every axis.
Vector3D Extents () const
bool IsValid () const
 True if min is componentwise <= max.
void Merge (const AABB &o)
 Grows this box to also cover o.

Public Attributes

Vector3D max {0.0f, 0.0f, 0.0f}
Vector3D min {0.0f, 0.0f, 0.0f}

Detailed Description

Axis-aligned bounding box (world or local space).

Definition at line 11 of file AABB.hpp.

Constructor & Destructor Documentation

◆ AABB() [1/2]

Sleak::Math::AABB::AABB ( )
default

◆ AABB() [2/2]

Sleak::Math::AABB::AABB ( const Vector3D & mn,
const Vector3D & mx )
inline

Definition at line 16 of file AABB.hpp.

Member Function Documentation

◆ Center()

Vector3D Sleak::Math::AABB::Center ( ) const
inline

Definition at line 24 of file AABB.hpp.

◆ Contains()

bool Sleak::Math::AABB::Contains ( const Vector3D & p) const
inline

True if p lies within (or on the boundary of) the box.

Definition at line 52 of file AABB.hpp.

◆ Corner()

Vector3D Sleak::Math::AABB::Corner ( int i) const
inline

Definition at line 29 of file AABB.hpp.

◆ DistanceSq()

float Sleak::Math::AABB::DistanceSq ( const Vector3D & p) const
inline

Definition at line 59 of file AABB.hpp.

◆ Expand()

void Sleak::Math::AABB::Expand ( float amount)
inline

Pushes min/max outward by amount on every axis.

Definition at line 46 of file AABB.hpp.

◆ Extents()

Vector3D Sleak::Math::AABB::Extents ( ) const
inline

Definition at line 26 of file AABB.hpp.

◆ IsValid()

bool Sleak::Math::AABB::IsValid ( ) const
inline

True if min is componentwise <= max.

Definition at line 19 of file AABB.hpp.

◆ Merge()

void Sleak::Math::AABB::Merge ( const AABB & o)
inline

Grows this box to also cover o.

Definition at line 36 of file AABB.hpp.

Member Data Documentation

◆ max

Vector3D Sleak::Math::AABB::max {0.0f, 0.0f, 0.0f}

Definition at line 13 of file AABB.hpp.

◆ min

Vector3D Sleak::Math::AABB::min {0.0f, 0.0f, 0.0f}

Definition at line 12 of file AABB.hpp.