RavEngine
Loading...
Searching...
No Matches
physx::PxBounds3 Class Reference

Class representing 3D range or axis aligned bounding box. More...

#include <PxBounds3.h>

Inheritance diagram for physx::PxBounds3:
[legend]
Collaboration diagram for physx::PxBounds3:
[legend]

Public Member Functions

PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 ()
 Default constructor, not performing any initialization for performance reason.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 (const PxVec3 &minimum, const PxVec3 &maximum)
 Construct from two bounding points.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void operator= (const PxBounds3 &other)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 (const PxBounds3 &other)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void setEmpty ()
 Sets empty to true.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void setMaximal ()
 Sets the bounds to maximum size [-PX_MAX_BOUNDS_EXTENTS, PX_MAX_BOUNDS_EXTENTS].
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void include (const PxVec3 &v)
 expands the volume to include v
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void include (const PxBounds3 &b)
 expands the volume to include b.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isEmpty () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool intersects (const PxBounds3 &b) const
 indicates whether the intersection of this and b is empty or not.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool intersects1D (const PxBounds3 &a, uint32_t axis) const
 computes the 1D-intersection between two AABBs, on a given axis.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool contains (const PxVec3 &v) const
 indicates if these bounds contain v.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isInside (const PxBounds3 &box) const
 checks a box is inside another box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getCenter () const
 returns the center of this axis aligned box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float getCenter (uint32_t axis) const
 get component of the box's center along a given axis
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float getExtents (uint32_t axis) const
 get component of the box's extents along a given axis
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getDimensions () const
 returns the dimensions (width/height/depth) of this axis aligned box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getExtents () const
 returns the extents, which are half of the width/height/depth.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void scaleSafe (float scale)
 scales the AABB.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void scaleFast (float scale)
 scales the AABB.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void fattenSafe (float distance)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void fattenFast (float distance)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isValid () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 closestPoint (const PxVec3 &p) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 ()
 Default constructor, not performing any initialization for performance reason.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 (const PxVec3 &minimum, const PxVec3 &maximum)
 Construct from two bounding points.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void setEmpty ()
 Sets empty to true.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void setMaximal ()
 Sets the bounds to maximum size [-PX_MAX_BOUNDS_EXTENTS, PX_MAX_BOUNDS_EXTENTS].
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void include (const PxVec3 &v)
 expands the volume to include v
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void include (const PxBounds3 &b)
 expands the volume to include b.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isEmpty () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool intersects (const PxBounds3 &b) const
 indicates whether the intersection of this and b is empty or not.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool intersects1D (const PxBounds3 &a, uint32_t axis) const
 computes the 1D-intersection between two AABBs, on a given axis.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool contains (const PxVec3 &v) const
 indicates if these bounds contain v.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isInside (const PxBounds3 &box) const
 checks a box is inside another box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getCenter () const
 returns the center of this axis aligned box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float getCenter (uint32_t axis) const
 get component of the box's center along a given axis
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float getExtents (uint32_t axis) const
 get component of the box's extents along a given axis
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getDimensions () const
 returns the dimensions (width/height/depth) of this axis aligned box.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getExtents () const
 returns the extents, which are half of the width/height/depth.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void scaleSafe (float scale)
 scales the AABB.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void scaleFast (float scale)
 scales the AABB.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void fattenSafe (float distance)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE void fattenFast (float distance)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isValid () const
 

Static Public Member Functions

static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 empty ()
 Return empty bounds.
 
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 boundsOfPoints (const PxVec3 &v0, const PxVec3 &v1)
 returns the AABB containing v0 and v1.
 
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 centerExtents (const PxVec3 &center, const PxVec3 &extent)
 returns the AABB from center and extents vectors.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 basisExtent (const PxVec3 &center, const PxMat33 &basis, const PxVec3 &extent)
 Construct from center, extent, and (not necessarily orthogonal) basis.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 poseExtent (const PxTransform &pose, const PxVec3 &extent)
 Construct from pose and extent.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformSafe (const PxMat33 &matrix, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformFast (const PxMat33 &matrix, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformSafe (const PxTransform &transform, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformFast (const PxTransform &transform, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 empty ()
 Return empty bounds.
 
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 boundsOfPoints (const PxVec3 &v0, const PxVec3 &v1)
 returns the AABB containing v0 and v1.
 
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 centerExtents (const PxVec3 &center, const PxVec3 &extent)
 returns the AABB from center and extents vectors.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 basisExtent (const PxVec3 &center, const PxMat33 &basis, const PxVec3 &extent)
 Construct from center, extent, and (not necessarily orthogonal) basis.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 poseExtent (const PxTransform &pose, const PxVec3 &extent)
 Construct from pose and extent.
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformSafe (const PxMat33 &matrix, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformFast (const PxMat33 &matrix, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformSafe (const PxTransform &transform, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 
static PX_CUDA_CALLABLE PX_INLINE PxBounds3 transformFast (const PxTransform &transform, const PxBounds3 &bounds)
 gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
 

Public Attributes

PxVec3 minimum
 
PxVec3 maximum
 

Detailed Description

Class representing 3D range or axis aligned bounding box.

Stored as minimum and maximum extent corners. Alternate representation would be center and dimensions. May be empty or nonempty. For nonempty bounds, minimum <= maximum has to hold for all axes. Empty bounds have to be represented as minimum = PX_MAX_BOUNDS_EXTENTS and maximum = -PX_MAX_BOUNDS_EXTENTS for all axes. All other representations are invalid and the behavior is undefined.

Constructor & Destructor Documentation

◆ PxBounds3() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE physx::PxBounds3::PxBounds3 ( )
inline

Default constructor, not performing any initialization for performance reason.

Remarks
Use empty() function below to construct empty bounds.

◆ PxBounds3() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE physx::PxBounds3::PxBounds3 ( )
inline

Default constructor, not performing any initialization for performance reason.

Remarks
Use empty() function below to construct empty bounds.

Member Function Documentation

◆ boundsOfPoints() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 physx::PxBounds3::boundsOfPoints ( const PxVec3 &  v0,
const PxVec3 &  v1 
)
static

returns the AABB containing v0 and v1.

Parameters
v0first point included in the AABB.
v1second point included in the AABB.

◆ boundsOfPoints() [2/2]

static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 physx::PxBounds3::boundsOfPoints ( const PxVec3 &  v0,
const PxVec3 &  v1 
)
static

returns the AABB containing v0 and v1.

Parameters
v0first point included in the AABB.
v1second point included in the AABB.

◆ centerExtents() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 physx::PxBounds3::centerExtents ( const PxVec3 &  center,
const PxVec3 &  extent 
)
static

returns the AABB from center and extents vectors.

Parameters
centerCenter vector
extentExtents vector

◆ centerExtents() [2/2]

static PX_CUDA_CALLABLE PX_FORCE_INLINE PxBounds3 physx::PxBounds3::centerExtents ( const PxVec3 &  center,
const PxVec3 &  extent 
)
static

returns the AABB from center and extents vectors.

Parameters
centerCenter vector
extentExtents vector

◆ closestPoint()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 physx::PxBounds3::closestPoint ( const PxVec3 &  p) const

Finds the closest point in the box to the point p. If p is contained, this will be p, otherwise it will be the closest point on the surface of the box.

◆ contains() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::contains ( const PxVec3 &  v) const

indicates if these bounds contain v.

Parameters
vPoint to test against bounds.

◆ contains() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::contains ( const PxVec3 &  v) const

indicates if these bounds contain v.

Parameters
vPoint to test against bounds.

◆ fattenFast() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::fattenFast ( float  distance)

fattens the AABB in all 3 dimensions by the given distance.

Calling this method for empty bounds leads to undefined behavior. Use fattenSafe() instead.

◆ fattenFast() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::fattenFast ( float  distance)

fattens the AABB in all 3 dimensions by the given distance.

Calling this method for empty bounds leads to undefined behavior. Use fattenSafe() instead.

◆ fattenSafe() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::fattenSafe ( float  distance)

fattens the AABB in all 3 dimensions by the given distance.

This version is safe to call for empty bounds.

◆ fattenSafe() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::fattenSafe ( float  distance)

fattens the AABB in all 3 dimensions by the given distance.

This version is safe to call for empty bounds.

◆ include() [1/4]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::include ( const PxBounds3 &  b)

expands the volume to include b.

Parameters
bBounds to perform union with.

◆ include() [2/4]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::include ( const PxBounds3 &  b)

expands the volume to include b.

Parameters
bBounds to perform union with.

◆ include() [3/4]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::include ( const PxVec3 &  v)

expands the volume to include v

Parameters
vPoint to expand to.

◆ include() [4/4]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::include ( const PxVec3 &  v)

expands the volume to include v

Parameters
vPoint to expand to.

◆ intersects() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::intersects ( const PxBounds3 &  b) const

indicates whether the intersection of this and b is empty or not.

Parameters
bBounds to test for intersection.

◆ intersects() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::intersects ( const PxBounds3 &  b) const

indicates whether the intersection of this and b is empty or not.

Parameters
bBounds to test for intersection.

◆ intersects1D() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::intersects1D ( const PxBounds3 &  a,
uint32_t  axis 
) const

computes the 1D-intersection between two AABBs, on a given axis.

Parameters
athe other AABB
axisthe axis (0, 1, 2)

◆ intersects1D() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::intersects1D ( const PxBounds3 &  a,
uint32_t  axis 
) const

computes the 1D-intersection between two AABBs, on a given axis.

Parameters
athe other AABB
axisthe axis (0, 1, 2)

◆ isFinite() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isFinite ( ) const

checks that the AABB values are not NaN

◆ isFinite() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isFinite ( ) const

checks that the AABB values are not NaN

◆ isInside() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isInside ( const PxBounds3 &  box) const

checks a box is inside another box.

Parameters
boxthe other AABB

◆ isInside() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isInside ( const PxBounds3 &  box) const

checks a box is inside another box.

Parameters
boxthe other AABB

◆ isValid() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isValid ( ) const

checks that the AABB values describe a valid configuration.

◆ isValid() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE bool physx::PxBounds3::isValid ( ) const

checks that the AABB values describe a valid configuration.

◆ scaleFast() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::scaleFast ( float  scale)

scales the AABB.

Calling this method for empty bounds leads to undefined behavior. Use scaleSafe() instead.

Parameters
scaleFactor to scale AABB by.

◆ scaleFast() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::scaleFast ( float  scale)

scales the AABB.

Calling this method for empty bounds leads to undefined behavior. Use scaleSafe() instead.

Parameters
scaleFactor to scale AABB by.

◆ scaleSafe() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::scaleSafe ( float  scale)

scales the AABB.

This version is safe to call for empty bounds.

Parameters
scaleFactor to scale AABB by.

◆ scaleSafe() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE void physx::PxBounds3::scaleSafe ( float  scale)

scales the AABB.

This version is safe to call for empty bounds.

Parameters
scaleFactor to scale AABB by.

◆ transformFast() [1/4]

PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformFast ( const PxMat33 &  matrix,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

Calling this method for empty bounds leads to undefined behavior. Use transformSafe() instead.

Parameters
[in]matrixTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformFast() [2/4]

static PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformFast ( const PxMat33 &  matrix,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

Calling this method for empty bounds leads to undefined behavior. Use transformSafe() instead.

Parameters
[in]matrixTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformFast() [3/4]

PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformFast ( const PxTransform &  transform,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

Calling this method for empty bounds leads to undefined behavior. Use transformSafe() instead.

Parameters
[in]transformTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformFast() [4/4]

static PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformFast ( const PxTransform &  transform,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

Calling this method for empty bounds leads to undefined behavior. Use transformSafe() instead.

Parameters
[in]transformTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformSafe() [1/4]

PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformSafe ( const PxMat33 &  matrix,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

This version is safe to call for empty bounds.

Parameters
[in]matrixTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformSafe() [2/4]

static PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformSafe ( const PxMat33 &  matrix,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

This version is safe to call for empty bounds.

Parameters
[in]matrixTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformSafe() [3/4]

PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformSafe ( const PxTransform &  transform,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

This version is safe to call for empty bounds.

Parameters
[in]transformTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

◆ transformSafe() [4/4]

static PX_CUDA_CALLABLE PX_INLINE PxBounds3 physx::PxBounds3::transformSafe ( const PxTransform &  transform,
const PxBounds3 &  bounds 
)
static

gets the transformed bounds of the passed AABB (resulting in a bigger AABB).

This version is safe to call for empty bounds.

Parameters
[in]transformTransform to apply, can contain scaling as well
[in]boundsThe bounds to transform.

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