31 #ifndef PX_PHYSICS_GEOMETRYHELPERS 32 #define PX_PHYSICS_GEOMETRYHELPERS 74 return *PxUnionCast<PxGeometry*>(&
bytes.geometry);
79 return *PxUnionCast<const PxGeometry*>(&
bytes.geometry);
84 return get<PxSphereGeometry, PxGeometryType::eSPHERE>();
89 return get<const PxSphereGeometry, PxGeometryType::eSPHERE>();
94 return get<PxPlaneGeometry, PxGeometryType::ePLANE>();
99 return get<const PxPlaneGeometry, PxGeometryType::ePLANE>();
104 return get<PxCapsuleGeometry, PxGeometryType::eCAPSULE>();
109 return get<const PxCapsuleGeometry, PxGeometryType::eCAPSULE>();
114 return get<PxBoxGeometry, PxGeometryType::eBOX>();
119 return get<const PxBoxGeometry, PxGeometryType::eBOX>();
124 return get<PxConvexMeshGeometry, PxGeometryType::eCONVEXMESH>();
129 return get<const PxConvexMeshGeometry, PxGeometryType::eCONVEXMESH>();
134 return get<PxTriangleMeshGeometry, PxGeometryType::eTRIANGLEMESH>();
139 return get<const PxTriangleMeshGeometry, PxGeometryType::eTRIANGLEMESH>();
144 return get<PxHeightFieldGeometry, PxGeometryType::eHEIGHTFIELD>();
149 return get<const PxHeightFieldGeometry, PxGeometryType::eHEIGHTFIELD>();
156 "Unexpected GeometryType in PxGeometryHolder::storeAny");
178 static_cast<T&
>(
any()) = static_cast<const T&>(
geometry);
181 template<
typename T, PxGeometryType::Enum type> T&
get()
184 return static_cast<T&
>(
any());
187 template<
typename T, PxGeometryType::Enum type> T&
get()
const 190 return static_cast<T&
>(
any());
Definition: GuContactBuffer.h:37
PX_CUDA_CALLABLE PX_FORCE_INLINE PxGeometryType::Enum getType() const
Returns the type of the geometry.
Definition: PxGeometry.h:82
PX_FORCE_INLINE const PxTriangleMeshGeometry & triangleMesh() const
Definition: PxGeometryHelpers.h:137
PX_FORCE_INLINE const PxHeightFieldGeometry & heightField() const
Definition: PxGeometryHelpers.h:147
PX_FORCE_INLINE void storeAny(const PxGeometry &geometry)
Definition: PxGeometryHelpers.h:152
PxU8 heightfield[sizeof(PxHeightFieldGeometry)]
Definition: PxGeometryHelpers.h:222
Class representing the geometry of a capsule.
Definition: PxCapsuleGeometry.h:55
PxU8 plane[sizeof(PxPlaneGeometry)]
Definition: PxGeometryHelpers.h:219
PX_FORCE_INLINE PxGeometry & any()
Definition: PxGeometryHelpers.h:93
PxU8 sphere[sizeof(PxSphereGeometry)]
Definition: PxGeometryHelpers.h:217
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:351
A class representing the geometry of a sphere.
Definition: PxSphereGeometry.h:49
PX_FORCE_INLINE PxGeometry & any()
Definition: PxGeometryHelpers.h:72
Definition: PxGeometry.h:57
Definition: PxGeometry.h:61
A geometry object.
Definition: PxGeometry.h:75
Definition: PxGeometry.h:55
internal use only!
Definition: PxGeometry.h:62
Height field geometry class.
Definition: PxHeightFieldGeometry.h:56
PX_FORCE_INLINE PxPlaneGeometry & plane()
Definition: PxGeometryHelpers.h:92
PX_FORCE_INLINE const PxCapsuleGeometry & capsule() const
Definition: PxGeometryHelpers.h:107
PxU8 mesh[sizeof(PxTriangleMeshGeometry)]
Definition: PxGeometryHelpers.h:221
PX_FORCE_INLINE PxConvexMeshGeometry & convexMesh()
Definition: PxGeometryHelpers.h:122
PX_FORCE_INLINE const PxGeometry & any() const
Definition: PxGeometryHelpers.h:77
PxU8 geometry[sizeof(PxGeometry)]
Definition: PxGeometryHelpers.h:215
internal use only!
Definition: PxGeometry.h:63
PX_FORCE_INLINE const PxPlaneGeometry & plane() const
Definition: PxGeometryHelpers.h:97
PX_FORCE_INLINE PxGeometryType::Enum getType() const
Definition: PxGeometryHelpers.h:88
#define PX_ALIGN_PREFIX(alignment)
Definition: PxPreprocessor.h:409
uint8_t PxU8
Definition: PxSimpleTypes.h:75
Enum
Definition: PxGeometry.h:53
PX_FORCE_INLINE PxGeometryHolder()
Definition: PxGeometryHelpers.h:172
PX_FORCE_INLINE const PxConvexMeshGeometry & convexMesh() const
Definition: PxGeometryHelpers.h:127
PX_FORCE_INLINE const PxBoxGeometry & box() const
Definition: PxGeometryHelpers.h:117
void put(const PxGeometry &geometry)
Definition: PxGeometryHelpers.h:176
Geometry holder class.
Definition: PxGeometryHelpers.h:64
Class describing a plane geometry.
Definition: PxPlaneGeometry.h:59
PxU8 convex[sizeof(PxConvexMeshGeometry)]
Definition: PxGeometryHelpers.h:220
PX_FORCE_INLINE PxSphereGeometry & sphere()
Definition: PxGeometryHelpers.h:82
PX_FORCE_INLINE PxTriangleMeshGeometry & triangleMesh()
Definition: PxGeometryHelpers.h:132
Definition: PxGeometry.h:59
#define PX_ASSERT_WITH_MESSAGE(condition, message)
Definition: PxAssert.h:61
PX_FORCE_INLINE void storeAny(const PxGeometry &geometry)
Definition: PxGeometryHelpers.h:173
PX_FORCE_INLINE PxGeometryHolder()
Definition: PxGeometryHelpers.h:193
Definition: PxGeometry.h:58
PxU8 box[sizeof(PxBoxGeometry)]
Definition: PxGeometryHelpers.h:216
PX_FORCE_INLINE PxGeometryType::Enum getType() const
Definition: PxGeometryHelpers.h:67
PxU8 capsule[sizeof(PxCapsuleGeometry)]
Definition: PxGeometryHelpers.h:218
#define PX_ASSERT(exp)
Definition: PxAssert.h:59
Definition: PxGeometry.h:60
class PxGeometryHolder PX_ALIGN_SUFFIX(4)
PX_FORCE_INLINE PxCapsuleGeometry & capsule()
Definition: PxGeometryHelpers.h:102
PX_FORCE_INLINE PxHeightFieldGeometry & heightField()
Definition: PxGeometryHelpers.h:142
PX_FORCE_INLINE const PxSphereGeometry & sphere() const
Definition: PxGeometryHelpers.h:87
Definition: PxGeometry.h:56
Triangle mesh geometry class.
Definition: PxTriangleMeshGeometry.h:82
Convex mesh geometry class.
Definition: PxConvexMeshGeometry.h:80
Class representing the geometry of a box.
Definition: PxBoxGeometry.h:50
PX_FORCE_INLINE PxBoxGeometry & box()
Definition: PxGeometryHelpers.h:112