AGX Dynamics 2.41.1.2
Loading...
Searching...
No Matches
agxCollide::BoundingAABB Class Reference

Axis aligned bounding box implementation. More...

#include <BoundingAABB.h>

+ Inheritance diagram for agxCollide::BoundingAABB:

Public Member Functions

 BoundingAABB ()
 Creates an empty bounding volume. isCleared() will return 'true'.
 
 BoundingAABB (const agx::Bound3 &other, const agx::AffineMatrix4x4 &transform)
 Creates a bounding volume given a bounding volume given in another coordinate-system.
 
 BoundingAABB (const agx::Vec3 &min, const agx::Vec3 &max)
 Creates a bounding volume given a component-wise minimum and maximum point.
 
void expand (const agx::Bound3 &other)
 Expands a bounding volume to contain both itself and another bound.
 
void expand (const agx::Bound3 &other, const agx::AffineMatrix4x4 &transform)
 Expands a bounding volume given a bounding volume given in another coordinate-system.
 
void expand (const agx::Vec3 &otherMin, const agx::Vec3 &otherMax)
 Expands a bounding volume to contain both itself and another bound.
 
void expand (const agx::Vec3 &otherMin, const agx::Vec3 &otherMax, const agx::AffineMatrix4x4 &transform)
 Expands a bounding volume given a bounding volume given in another coordinate-system.
 
void expand (const agx::Vec3 &point)
 Expands a bounding volume to contain both itself and another point.
 
bool hasOverlap (const BoundingAABB *other) const
 Tests if the bound intersects with another bounding volume.
 
bool isCleared () const
 Is the bounding volume cleared? Will be true e.g.
 
void reset ()
 Removes any extent of the bound.
 
void set (const agx::Bound3 &other, const agx::AffineMatrix4x4 &transform)
 Sets a bounding volume given a bounding volume given in another coordinate-system.
 
bool testSphereOverlap (const agx::Vec3 &pos, agx::Real radius) const
 Test if a sphere overlaps the bound.
 
- Public Member Functions inherited from agx::BoundT< Vec3 >
 BoundT ()
 Create a bound initialized to the empty range located at the type's default value.
 
 BoundT (const BoundT &other)
 
 BoundT (const Vec3 &min, const Vec3 &max)
 
BoundT calculateOverlap (const BoundT &other) const
 
bool contains (const Vec3 &value) const
 
bool hasOverlap (const BoundT &other) const
 
bool isValid () const
 
Vec3max ()
 
const Vec3max () const
 
Vec3 mid () const
 
Vec3min ()
 
const Vec3min () const
 
 operator BoundT< T2 > () const
 Convert the bound to a bound with a different underlying type.
 
bool operator!= (const BoundT &other) const
 
BoundT operator* (T2 scale)
 Create a new bound that has the same midpoint as the current bound, but with a size that is scaled according to the given scale.
 
BoundT< Vec3operator* (T2 scale)
 
BoundToperator*= (T2 scale)
 Scale the bound so that is size is changed according to the given scale, but the midpoint remains unchanged.
 
BoundT< Vec3 > & operator*= (T2 scale)
 
BoundToperator= (const BoundT &other)
 
bool operator== (const BoundT &other) const
 
void set (const Vec3 &min, const Vec3 &max)
 Relocate the bound to the new location.
 
Vec3 size () const
 
BoundT translate (const Vec3 &offset) const
 Move the bound's midpoint without altering its size.
 

Additional Inherited Members

- Public Types inherited from agx::BoundT< Vec3 >
typedef Vec3 Type
 
- Protected Attributes inherited from agx::BoundT< Vec3 >
Vec3 m_max
 
Vec3 m_min
 

Detailed Description

Axis aligned bounding box implementation.

Definition at line 37 of file BoundingAABB.h.

Constructor & Destructor Documentation

◆ BoundingAABB() [1/3]

agxCollide::BoundingAABB::BoundingAABB ( )

Creates an empty bounding volume. isCleared() will return 'true'.

Definition at line 146 of file BoundingAABB.h.

References reset().

◆ BoundingAABB() [2/3]

agxCollide::BoundingAABB::BoundingAABB ( const agx::Vec3 min,
const agx::Vec3 max 
)

Creates a bounding volume given a component-wise minimum and maximum point.

Parameters
minThe component-wise minimum.
maxThe component-wise maximum. If min is not the component-wise minimum and max is not the component-wise maximum, unexpected results might occur.

Definition at line 152 of file BoundingAABB.h.

◆ BoundingAABB() [3/3]

agxCollide::BoundingAABB::BoundingAABB ( const agx::Bound3 other,
const agx::AffineMatrix4x4 transform 
)

Creates a bounding volume given a bounding volume given in another coordinate-system.

Parameters
otherThe bounding volume, given in another coordinate system.
transformThe transformation matrix from the coordinate system where 'other' is defined to the desired one.

Definition at line 157 of file BoundingAABB.h.

References expand(), and reset().

Member Function Documentation

◆ expand() [1/5]

void agxCollide::BoundingAABB::expand ( const agx::Bound3 other)

Expands a bounding volume to contain both itself and another bound.

If isCleared() was true before, the bound will be set to the other one.

Definition at line 184 of file BoundingAABB.h.

References expand(), agx::BoundT< T >::max(), and agx::BoundT< T >::min().

Referenced by BoundingAABB(), expand(), and set().

◆ expand() [2/5]

void agxCollide::BoundingAABB::expand ( const agx::Bound3 other,
const agx::AffineMatrix4x4 transform 
)

Expands a bounding volume given a bounding volume given in another coordinate-system.

If isCleared() was true before, the bound will be set to the point.

Parameters
otherThe bounding volume, given in another coordinate system.
transformThe transformation matrix from the coordinate system where 'other' is defined to the desired one.

Definition at line 203 of file BoundingAABB.h.

References expand(), agx::BoundT< T >::max(), and agx::BoundT< T >::min().

◆ expand() [3/5]

void agxCollide::BoundingAABB::expand ( const agx::Vec3 otherMin,
const agx::Vec3 otherMax 
)

Expands a bounding volume to contain both itself and another bound.

If isCleared() was true before, the bound will be set the other one.

Parameters
otherMinThe component-wise minimum.
otherMaxThe component-wise maximum. If min is not the component-wise minimum and max is not the component-wise maximum, unexpected results might occur.

Definition at line 196 of file BoundingAABB.h.

References agx::Vec3T< Real >::componentMax(), agx::Vec3T< Real >::componentMin(), agx::BoundT< Vec3 >::max(), and agx::BoundT< Vec3 >::min().

◆ expand() [4/5]

void agxCollide::BoundingAABB::expand ( const agx::Vec3 otherMin,
const agx::Vec3 otherMax,
const agx::AffineMatrix4x4 transform 
)

Expands a bounding volume given a bounding volume given in another coordinate-system.

If isCleared() was true before, the bound will be set to the point.

Parameters
otherMinThe component-wise minimum, given in another coordinate system.
otherMaxThe component-wise maximum, given in another coordinate system.
transformThe transformation matrix from the coordinate system where 'otherMin' and 'otherMax' are defined to the desired one.

◆ expand() [5/5]

void agxCollide::BoundingAABB::expand ( const agx::Vec3 point)

Expands a bounding volume to contain both itself and another point.

If isCleared() was true before, the bound will be set to the point.

Definition at line 190 of file BoundingAABB.h.

References expand().

◆ hasOverlap()

bool agxCollide::BoundingAABB::hasOverlap ( const BoundingAABB other) const

Tests if the bound intersects with another bounding volume.

Parameters
otherThe other bounding volume, to be given in same coordinate system.
Return values
Dothe bounding volumes overlap?

Definition at line 209 of file BoundingAABB.h.

References agx::BoundT< Vec3 >::hasOverlap().

◆ isCleared()

bool agxCollide::BoundingAABB::isCleared ( ) const

Is the bounding volume cleared? Will be true e.g.

after call to reset().

Definition at line 178 of file BoundingAABB.h.

References agx::BoundT< Vec3 >::max(), and agx::BoundT< Vec3 >::min().

◆ reset()

void agxCollide::BoundingAABB::reset ( )

Removes any extent of the bound.

isCleared() will return 'true'.

Definition at line 171 of file BoundingAABB.h.

References agx::BoundT< Vec3 >::max(), agx::BoundT< Vec3 >::min(), agx::RealMax, and agx::Vec3T< T >::set().

Referenced by BoundingAABB(), and set().

◆ set()

void agxCollide::BoundingAABB::set ( const agx::Bound3 other,
const agx::AffineMatrix4x4 transform 
)

Sets a bounding volume given a bounding volume given in another coordinate-system.

Parameters
otherThe bounding volume, given in another coordinate system.
transformThe transformation matrix from the coordinate system where 'other' is defined to the desired one.

Definition at line 164 of file BoundingAABB.h.

References expand(), and reset().

◆ testSphereOverlap()

bool agxCollide::BoundingAABB::testSphereOverlap ( const agx::Vec3 pos,
agx::Real  radius 
) const

Test if a sphere overlaps the bound.

May give false positives outside the bound's edges or corners.

Parameters
posThe position of the sphere.
radiusThe radius of the sphere
Return values
Dothe sphere and the bound overlap? May give false positives outside the bound's edges or corners.

Definition at line 215 of file BoundingAABB.h.

References agx::BoundT< Vec3 >::max(), and agx::BoundT< Vec3 >::min().


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