PxGeometryHolder Class Reference

Geometry holder class. More...

#include <PxGeometryHelpers.h>

Public Member Functions

PX_FORCE_INLINE PxGeometryType::Enum getType () const
 
PX_FORCE_INLINE PxGeometryany ()
 
PX_FORCE_INLINE const PxGeometryany () const
 
PX_FORCE_INLINE PxSphereGeometrysphere ()
 
PX_FORCE_INLINE const PxSphereGeometrysphere () const
 
PX_FORCE_INLINE PxPlaneGeometryplane ()
 
PX_FORCE_INLINE const PxPlaneGeometryplane () const
 
PX_FORCE_INLINE PxCapsuleGeometrycapsule ()
 
PX_FORCE_INLINE const PxCapsuleGeometrycapsule () const
 
PX_FORCE_INLINE PxBoxGeometrybox ()
 
PX_FORCE_INLINE const PxBoxGeometrybox () const
 
PX_FORCE_INLINE PxConvexMeshGeometryconvexMesh ()
 
PX_FORCE_INLINE const PxConvexMeshGeometryconvexMesh () const
 
PX_FORCE_INLINE PxTriangleMeshGeometrytriangleMesh ()
 
PX_FORCE_INLINE const PxTriangleMeshGeometrytriangleMesh () const
 
PX_FORCE_INLINE PxHeightFieldGeometryheightField ()
 
PX_FORCE_INLINE const PxHeightFieldGeometryheightField () const
 
PX_FORCE_INLINE void storeAny (const PxGeometry &geometry)
 
PX_FORCE_INLINE PxGeometryHolder ()
 
PX_FORCE_INLINE PxGeometryHolder (const PxGeometry &geometry)
 

Private Member Functions

template<typename T >
void put (const PxGeometry &geometry)
 
template<typename T , PxGeometryType::Enum type>
T & get ()
 
template<typename T , PxGeometryType::Enum type>
T & get () const
 

Private Attributes

union {
   PxU8   geometry [sizeof(PxGeometry)]
 
   PxU8   box [sizeof(PxBoxGeometry)]
 
   PxU8   sphere [sizeof(PxSphereGeometry)]
 
   PxU8   capsule [sizeof(PxCapsuleGeometry)]
 
   PxU8   plane [sizeof(PxPlaneGeometry)]
 
   PxU8   convex [sizeof(PxConvexMeshGeometry)]
 
   PxU8   mesh [sizeof(PxTriangleMeshGeometry)]
 
   PxU8   heightfield [sizeof(PxHeightFieldGeometry)]
 
bytes
 

Detailed Description

Geometry holder class.

This class contains enough space to hold a value of any PxGeometry subtype.

Its principal use is as a convenience class to allow geometries to be returned polymorphically from functions. See PxShape::getGeometry();

Constructor & Destructor Documentation

◆ PxGeometryHolder() [1/2]

PX_FORCE_INLINE PxGeometryHolder::PxGeometryHolder ( )
inline

◆ PxGeometryHolder() [2/2]

PX_FORCE_INLINE PxGeometryHolder::PxGeometryHolder ( const PxGeometry geometry)
inline

Member Function Documentation

◆ any() [1/2]

◆ any() [2/2]

PX_FORCE_INLINE const PxGeometry& PxGeometryHolder::any ( ) const
inline

References bytes.

◆ box() [1/2]

PX_FORCE_INLINE PxBoxGeometry& PxGeometryHolder::box ( )
inline

◆ box() [2/2]

PX_FORCE_INLINE const PxBoxGeometry& PxGeometryHolder::box ( ) const
inline

◆ capsule() [1/2]

PX_FORCE_INLINE PxCapsuleGeometry& PxGeometryHolder::capsule ( )
inline

◆ capsule() [2/2]

PX_FORCE_INLINE const PxCapsuleGeometry& PxGeometryHolder::capsule ( ) const
inline

◆ convexMesh() [1/2]

PX_FORCE_INLINE PxConvexMeshGeometry& PxGeometryHolder::convexMesh ( )
inline

◆ convexMesh() [2/2]

PX_FORCE_INLINE const PxConvexMeshGeometry& PxGeometryHolder::convexMesh ( ) const
inline

◆ get() [1/2]

template<typename T , PxGeometryType::Enum type>
T& PxGeometryHolder::get ( )
inlineprivate

References any(), getType(), and PX_ASSERT.

◆ get() [2/2]

template<typename T , PxGeometryType::Enum type>
T& PxGeometryHolder::get ( ) const
inlineprivate

References any(), getType(), and PX_ASSERT.

◆ getType()

PX_FORCE_INLINE PxGeometryType::Enum PxGeometryHolder::getType ( ) const
inline

References any(), and PxGeometry::getType().

◆ heightField() [1/2]

PX_FORCE_INLINE PxHeightFieldGeometry& PxGeometryHolder::heightField ( )
inline

◆ heightField() [2/2]

PX_FORCE_INLINE const PxHeightFieldGeometry& PxGeometryHolder::heightField ( ) const
inline

◆ plane() [1/2]

PX_FORCE_INLINE PxPlaneGeometry& PxGeometryHolder::plane ( )
inline

◆ plane() [2/2]

PX_FORCE_INLINE const PxPlaneGeometry& PxGeometryHolder::plane ( ) const
inline

◆ put()

template<typename T >
void PxGeometryHolder::put ( const PxGeometry geometry)
inlineprivate

References any(), and geometry.

◆ sphere() [1/2]

PX_FORCE_INLINE PxSphereGeometry& PxGeometryHolder::sphere ( )
inline

◆ sphere() [2/2]

PX_FORCE_INLINE const PxSphereGeometry& PxGeometryHolder::sphere ( ) const
inline

◆ storeAny()

PX_FORCE_INLINE void PxGeometryHolder::storeAny ( const PxGeometry geometry)
inline

◆ triangleMesh() [1/2]

PX_FORCE_INLINE PxTriangleMeshGeometry& PxGeometryHolder::triangleMesh ( )
inline

◆ triangleMesh() [2/2]

PX_FORCE_INLINE const PxTriangleMeshGeometry& PxGeometryHolder::triangleMesh ( ) const
inline

Member Data Documentation

◆ box

PxU8 PxGeometryHolder::box[sizeof(PxBoxGeometry)]

◆ bytes

union { ... } PxGeometryHolder::bytes

◆ capsule

PxU8 PxGeometryHolder::capsule[sizeof(PxCapsuleGeometry)]

◆ convex

PxU8 PxGeometryHolder::convex[sizeof(PxConvexMeshGeometry)]

◆ geometry

PxU8 PxGeometryHolder::geometry[sizeof(PxGeometry)]

◆ heightfield

PxU8 PxGeometryHolder::heightfield[sizeof(PxHeightFieldGeometry)]

◆ mesh

PxU8 PxGeometryHolder::mesh[sizeof(PxTriangleMeshGeometry)]

◆ plane

PxU8 PxGeometryHolder::plane[sizeof(PxPlaneGeometry)]

◆ sphere

PxU8 PxGeometryHolder::sphere[sizeof(PxSphereGeometry)]

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