RavEngine
Loading...
Searching...
No Matches
physx::Gu::Box Class Reference

Represents an oriented bounding box. More...

#include <GuBox.h>

Inheritance diagram for physx::Gu::Box:
[legend]
Collaboration diagram for physx::Gu::Box:
[legend]

Public Member Functions

PX_FORCE_INLINE Box ()
 Constructor.
 
PX_FORCE_INLINE Box (const PxVec3 &origin, const PxVec3 &extent, const PxMat33 &base)
 Constructor.
 
PX_FORCE_INLINE Box (const Box &other)
 Copy constructor.
 
PX_FORCE_INLINE ~Box ()
 Destructor.
 
PX_FORCE_INLINE const Box & operator= (const Box &other)
 Assignment operator.
 
PX_INLINE void setEmpty ()
 Setups an empty box.
 
PX_INLINE bool isValid () const
 Checks the box is valid.
 
PX_FORCE_INLINE void setAxes (const PxVec3 &axis0, const PxVec3 &axis1, const PxVec3 &axis2)
 
PX_FORCE_INLINE PxVec3 rotate (const PxVec3 &src) const
 
PX_FORCE_INLINE PxVec3 rotateInv (const PxVec3 &src) const
 
PX_FORCE_INLINE PxVec3 transform (const PxVec3 &src) const
 
PX_FORCE_INLINE PxTransform getTransform () const
 
PX_INLINE PxVec3 computeAABBExtent () const
 
PX_FORCE_INLINE void computeBoxPoints (PxVec3 *PX_RESTRICT pts) const
 
void create (const Gu::Capsule &capsule)
 

Public Attributes

PxMat33 rot
 
PxVec3 center
 
PxVec3 extents
 

Detailed Description

Represents an oriented bounding box.

As a center point, extents(radii) and a rotation. i.e. the center of the box is at the center point, the box is rotated around this point with the rotation and it is 2*extents in width, height and depth. Box geometry

The rot member describes the world space orientation of the box. The center member gives the world space position of the box. The extents give the local space coordinates of the box corner in the positive octant. Dimensions of the box are: 2*extent. Transformation to world space is: worldPoint = rot * localPoint + center Transformation to local space is: localPoint = T(rot) * (worldPoint - center) Where T(M) denotes the transpose of M.

Constructor & Destructor Documentation

◆ Box()

PX_FORCE_INLINE physx::Gu::Box::Box ( const PxVec3 &  origin,
const PxVec3 &  extent,
const PxMat33 &  base 
)
inline

Constructor.

Parameters
originCenter of the OBB
extentExtents/radii of the obb.
baserotation to apply to the obb. Construct from center, extent and rotation

Member Function Documentation

◆ computeBoxPoints()

PX_FORCE_INLINE void physx::Gu::Box::computeBoxPoints ( PxVec3 *PX_RESTRICT  pts) const
inline

Computes the obb points.

Parameters
pts[out] 8 box points

◆ isValid()

PX_INLINE bool physx::Gu::Box::isValid ( ) const
inline

Checks the box is valid.

Returns
true if the box is valid

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