Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
AABox Class Reference

Axis aligned box. More...

#include <AABox.h>

Public Member Functions

JPH_OVERRIDE_NEW_DELETE AABox ()
 Constructor. More...
 
 AABox (Vec3Arg inMin, Vec3Arg inMax)
 
 AABox (DVec3Arg inMin, DVec3Arg inMax)
 
 AABox (Vec3Arg inCenter, float inRadius)
 
bool operator== (const AABox &inRHS) const
 Comparison operators. More...
 
bool operator!= (const AABox &inRHS) const
 
void SetEmpty ()
 Reset the bounding box to an empty bounding box. More...
 
bool IsValid () const
 Check if the bounding box is valid (max >= min) More...
 
void Encapsulate (Vec3Arg inPos)
 Encapsulate point in bounding box. More...
 
void Encapsulate (const AABox &inRHS)
 Encapsulate bounding box in bounding box. More...
 
void Encapsulate (const Triangle &inRHS)
 Encapsulate triangle in bounding box. More...
 
void Encapsulate (const VertexList &inVertices, const IndexedTriangle &inTriangle)
 Encapsulate triangle in bounding box. More...
 
AABox Intersect (const AABox &inOther) const
 Intersect this bounding box with inOther, returns the intersection. More...
 
void EnsureMinimalEdgeLength (float inMinEdgeLength)
 Make sure that each edge of the bounding box has a minimal length. More...
 
void ExpandBy (Vec3Arg inVector)
 Widen the box on both sides by inVector. More...
 
Vec3 GetCenter () const
 Get center of bounding box. More...
 
Vec3 GetExtent () const
 Get extent of bounding box (half of the size) More...
 
Vec3 GetSize () const
 Get size of bounding box. More...
 
float GetSurfaceArea () const
 Get surface area of bounding box. More...
 
float GetVolume () const
 Get volume of bounding box. More...
 
bool Contains (const AABox &inOther) const
 Check if this box contains another box. More...
 
bool Contains (Vec3Arg inOther) const
 Check if this box contains a point. More...
 
bool Contains (DVec3Arg inOther) const
 Check if this box contains a point. More...
 
bool Overlaps (const AABox &inOther) const
 Check if this box overlaps with another box. More...
 
bool Overlaps (const Plane &inPlane) const
 Check if this box overlaps with a plane. More...
 
void Translate (Vec3Arg inTranslation)
 Translate bounding box. More...
 
void Translate (DVec3Arg inTranslation)
 Translate bounding box. More...
 
AABox Transformed (Mat44Arg inMatrix) const
 Transform bounding box. More...
 
AABox Transformed (DMat44Arg inMatrix) const
 Transform bounding box. More...
 
AABox Scaled (Vec3Arg inScale) const
 Scale this bounding box, can handle non-uniform and negative scaling. More...
 
Vec3 GetSupport (Vec3Arg inDirection) const
 Calculate the support vector for this convex shape. More...
 
template<class VERTEX_ARRAY >
void GetSupportingFace (Vec3Arg inDirection, VERTEX_ARRAY &outVertices) const
 Get the vertices of the face that faces inDirection the most. More...
 
Vec3 GetClosestPoint (Vec3Arg inPoint) const
 Get the closest point on or in this box to inPoint. More...
 
float GetSqDistanceTo (Vec3Arg inPoint) const
 Get the squared distance between inPoint and this box (will be 0 if in Point is inside the box) More...
 

Static Public Member Functions

static AABox sFromTwoPoints (Vec3Arg inP1, Vec3Arg inP2)
 Create box from 2 points. More...
 
static AABox sBiggest ()
 Get bounding box of size 2 * FLT_MAX. More...
 

Public Attributes

Vec3 mMin
 Bounding box min and max. More...
 
Vec3 mMax
 

Detailed Description

Axis aligned box.

Constructor & Destructor Documentation

◆ AABox() [1/4]

JPH_OVERRIDE_NEW_DELETE AABox::AABox ( )
inline

Constructor.

◆ AABox() [2/4]

AABox::AABox ( Vec3Arg  inMin,
Vec3Arg  inMax 
)
inline

◆ AABox() [3/4]

AABox::AABox ( DVec3Arg  inMin,
DVec3Arg  inMax 
)
inline

◆ AABox() [4/4]

AABox::AABox ( Vec3Arg  inCenter,
float  inRadius 
)
inline

Member Function Documentation

◆ Contains() [1/3]

bool AABox::Contains ( const AABox inOther) const
inline

Check if this box contains another box.

◆ Contains() [2/3]

bool AABox::Contains ( DVec3Arg  inOther) const
inline

Check if this box contains a point.

◆ Contains() [3/3]

bool AABox::Contains ( Vec3Arg  inOther) const
inline

Check if this box contains a point.

◆ Encapsulate() [1/4]

void AABox::Encapsulate ( const AABox inRHS)
inline

Encapsulate bounding box in bounding box.

◆ Encapsulate() [2/4]

void AABox::Encapsulate ( const Triangle inRHS)
inline

Encapsulate triangle in bounding box.

◆ Encapsulate() [3/4]

void AABox::Encapsulate ( const VertexList inVertices,
const IndexedTriangle inTriangle 
)
inline

Encapsulate triangle in bounding box.

◆ Encapsulate() [4/4]

void AABox::Encapsulate ( Vec3Arg  inPos)
inline

Encapsulate point in bounding box.

◆ EnsureMinimalEdgeLength()

void AABox::EnsureMinimalEdgeLength ( float  inMinEdgeLength)
inline

Make sure that each edge of the bounding box has a minimal length.

◆ ExpandBy()

void AABox::ExpandBy ( Vec3Arg  inVector)
inline

Widen the box on both sides by inVector.

◆ GetCenter()

Vec3 AABox::GetCenter ( ) const
inline

Get center of bounding box.

◆ GetClosestPoint()

Vec3 AABox::GetClosestPoint ( Vec3Arg  inPoint) const
inline

Get the closest point on or in this box to inPoint.

◆ GetExtent()

Vec3 AABox::GetExtent ( ) const
inline

Get extent of bounding box (half of the size)

◆ GetSize()

Vec3 AABox::GetSize ( ) const
inline

Get size of bounding box.

◆ GetSqDistanceTo()

float AABox::GetSqDistanceTo ( Vec3Arg  inPoint) const
inline

Get the squared distance between inPoint and this box (will be 0 if in Point is inside the box)

◆ GetSupport()

Vec3 AABox::GetSupport ( Vec3Arg  inDirection) const
inline

Calculate the support vector for this convex shape.

◆ GetSupportingFace()

template<class VERTEX_ARRAY >
void AABox::GetSupportingFace ( Vec3Arg  inDirection,
VERTEX_ARRAY &  outVertices 
) const
inline

Get the vertices of the face that faces inDirection the most.

◆ GetSurfaceArea()

float AABox::GetSurfaceArea ( ) const
inline

Get surface area of bounding box.

◆ GetVolume()

float AABox::GetVolume ( ) const
inline

Get volume of bounding box.

◆ Intersect()

AABox AABox::Intersect ( const AABox inOther) const
inline

Intersect this bounding box with inOther, returns the intersection.

◆ IsValid()

bool AABox::IsValid ( ) const
inline

Check if the bounding box is valid (max >= min)

◆ operator!=()

bool AABox::operator!= ( const AABox inRHS) const
inline

◆ operator==()

bool AABox::operator== ( const AABox inRHS) const
inline

Comparison operators.

◆ Overlaps() [1/2]

bool AABox::Overlaps ( const AABox inOther) const
inline

Check if this box overlaps with another box.

◆ Overlaps() [2/2]

bool AABox::Overlaps ( const Plane inPlane) const
inline

Check if this box overlaps with a plane.

◆ sBiggest()

static AABox AABox::sBiggest ( )
inlinestatic

Get bounding box of size 2 * FLT_MAX.

◆ Scaled()

AABox AABox::Scaled ( Vec3Arg  inScale) const
inline

Scale this bounding box, can handle non-uniform and negative scaling.

◆ SetEmpty()

void AABox::SetEmpty ( )
inline

Reset the bounding box to an empty bounding box.

◆ sFromTwoPoints()

static AABox AABox::sFromTwoPoints ( Vec3Arg  inP1,
Vec3Arg  inP2 
)
inlinestatic

Create box from 2 points.

◆ Transformed() [1/2]

AABox AABox::Transformed ( DMat44Arg  inMatrix) const
inline

Transform bounding box.

◆ Transformed() [2/2]

AABox AABox::Transformed ( Mat44Arg  inMatrix) const
inline

Transform bounding box.

◆ Translate() [1/2]

void AABox::Translate ( DVec3Arg  inTranslation)
inline

Translate bounding box.

◆ Translate() [2/2]

void AABox::Translate ( Vec3Arg  inTranslation)
inline

Translate bounding box.

Member Data Documentation

◆ mMax

Vec3 AABox::mMax

◆ mMin

Vec3 AABox::mMin

Bounding box min and max.


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