Polyphase Game Engine
Loading...
Searching...
No Matches
AABB Struct Reference

#include <EngineTypes.h>

Public Member Functions

 AABB ()=default
 
 AABB (glm::vec3 min, glm::vec3 max)
 
bool IsValid () const
 
bool IsLarge () const
 
glm::vec3 GetCenter () const
 
glm::vec3 GetExtents () const
 
glm::vec3 GetSize () const
 
float GetRadius () const
 
float GetVolume () const
 
bool Contains (glm::vec3 point) const
 
bool Contains (const AABB &other) const
 
bool Intersects (const AABB &other) const
 
bool Intersects (glm::vec3 sphereCenter, float sphereRadius) const
 
void Encapsulate (glm::vec3 point)
 
void Encapsulate (const AABB &other)
 
void Expand (float amount)
 
void Expand (glm::vec3 amount)
 
AABB Transform (const glm::mat4 &mat) const
 
Bounds ToBounds () const
 

Static Public Member Functions

static AABB MakeInvalid ()
 
static AABB MakeFromCenterExtents (glm::vec3 center, glm::vec3 extents)
 
static AABB MakeLarge ()
 

Public Attributes

glm::vec3 mMin = { -0.5f, -0.5f, -0.5f }
 
glm::vec3 mMax = { 0.5f, 0.5f, 0.5f }
 

Constructor & Destructor Documentation

◆ AABB() [1/2]

AABB::AABB ( )
default

◆ AABB() [2/2]

AABB::AABB ( glm::vec3  min,
glm::vec3  max 
)
inline

Member Function Documentation

◆ Contains() [1/2]

bool AABB::Contains ( const AABB other) const
inline

◆ Contains() [2/2]

bool AABB::Contains ( glm::vec3  point) const
inline

◆ Encapsulate() [1/2]

void AABB::Encapsulate ( const AABB other)
inline

◆ Encapsulate() [2/2]

void AABB::Encapsulate ( glm::vec3  point)
inline

◆ Expand() [1/2]

void AABB::Expand ( float  amount)
inline

◆ Expand() [2/2]

void AABB::Expand ( glm::vec3  amount)
inline

◆ GetCenter()

glm::vec3 AABB::GetCenter ( ) const
inline

◆ GetExtents()

glm::vec3 AABB::GetExtents ( ) const
inline

◆ GetRadius()

float AABB::GetRadius ( ) const
inline

◆ GetSize()

glm::vec3 AABB::GetSize ( ) const
inline

◆ GetVolume()

float AABB::GetVolume ( ) const
inline

◆ Intersects() [1/2]

bool AABB::Intersects ( const AABB other) const
inline

◆ Intersects() [2/2]

bool AABB::Intersects ( glm::vec3  sphereCenter,
float  sphereRadius 
) const
inline

◆ IsLarge()

bool AABB::IsLarge ( ) const
inline

◆ IsValid()

bool AABB::IsValid ( ) const
inline

◆ MakeFromCenterExtents()

static AABB AABB::MakeFromCenterExtents ( glm::vec3  center,
glm::vec3  extents 
)
inlinestatic

◆ MakeInvalid()

static AABB AABB::MakeInvalid ( )
inlinestatic

◆ MakeLarge()

static AABB AABB::MakeLarge ( )
inlinestatic

◆ ToBounds()

Bounds AABB::ToBounds ( ) const
inline

◆ Transform()

AABB AABB::Transform ( const glm::mat4 &  mat) const
inline

Member Data Documentation

◆ mMax

glm::vec3 AABB::mMax = { 0.5f, 0.5f, 0.5f }

◆ mMin

glm::vec3 AABB::mMin = { -0.5f, -0.5f, -0.5f }

The documentation for this struct was generated from the following file: