35#include "PxPhysXConfig.h"
36#include "common/PxBase.h"
37#include "geometry/PxGeometry.h"
38#include "geometry/PxGeometryHelpers.h"
46class PxSphereGeometry;
47class PxCapsuleGeometry;
49class PxConvexMeshGeometry;
50class PxTriangleMeshGeometry;
51class PxTetrahedronMeshGeometry;
52class PxHeightFieldGeometry;
53class PxParticleSystemGeometry;
54class PxHairSystemGeometry;
59class PxFEMSoftBodyMaterial;
60class PxFEMClothMaterial;
194 return getGeometry().getType();
211 return getGeometryT(PxGeometryType::eBOX, geometry);
228 return getGeometryT(PxGeometryType::eSPHERE, geometry);
245 return getGeometryT(PxGeometryType::eCAPSULE, geometry);
262 return getGeometryT(PxGeometryType::ePLANE, geometry);
279 return getGeometryT(PxGeometryType::eCONVEXMESH, geometry);
296 return getGeometryT(PxGeometryType::eTRIANGLEMESH, geometry);
313 return getGeometryT(PxGeometryType::eTETRAHEDRONMESH, geometry);
330 return getGeometryT(PxGeometryType::ePARTICLESYSTEM, geometry);
347 return getGeometryT(PxGeometryType::eHEIGHTFIELD, geometry);
364 return getGeometryT(PxGeometryType::eCUSTOM, geometry);
775 virtual ~PxShape() {}
781 if(getGeometryType() != type)
784 geom =
static_cast<const T&
>(getGeometry());
Base material class.
Definition PxBaseMaterial.h:49
Class representing the geometry of a box.
Definition PxBoxGeometry.h:49
Class representing the geometry of a capsule.
Definition PxCapsuleGeometry.h:54
Convex mesh geometry class.
Definition PxConvexMeshGeometry.h:79
Custom geometry class. This class allows user to create custom geometries by providing a set of virtu...
Definition PxCustomGeometry.h:52
Material class to represent a set of FEM material properties.
Definition PxFEMClothMaterial.h:48
Material class to represent a set of softbody FEM material properties.
Definition PxFEMSoftBodyMaterial.h:49
Container for bitfield flag variables associated with a specific enum type.
Definition PxFlags.h:73
A geometry object.
Definition PxGeometry.h:79
Height field geometry class.
Definition PxHeightFieldGeometry.h:55
Material class to represent a set of surface properties.
Definition PxMaterial.h:149
Particle system geometry class.
Definition PxParticleSystemGeometry.h:51
Class describing a plane geometry.
Definition PxPlaneGeometry.h:56
Base class for ref-counted objects.
Definition PxBase.h:200
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxBase.h:231
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Abstract class for collision shapes.
Definition PxShape.h:146
virtual PxFilterData getSimulationFilterData() const =0
Retrieves the shape's collision filter data.
virtual PxReal getRestOffset() const =0
Retrieves the rest offset.
PX_DEPRECATED PX_FORCE_INLINE bool getCapsuleGeometry(PxCapsuleGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:243
virtual void setGeometry(const PxGeometry &geometry)=0
Adjust the geometry of the shape.
virtual const PxGeometry & getGeometry() const =0
Retrieve a reference to the shape's geometry.
virtual void setDensityForFluid(PxReal densityForFluid)=0
Sets the density used to interact with fluids.
virtual PxReal getMinTorsionalPatchRadius() const =0
Gets minimum torsional patch radius.
PX_DEPRECATED PX_FORCE_INLINE PxGeometryType::Enum getGeometryType() const
Get the geometry type of the shape.
Definition PxShape.h:192
virtual bool isExclusive() const =0
Returns true if the shape is exclusive to an actor.
virtual const char * getName() const =0
retrieves the name string set with setName().
virtual PxU32 getMaterials(PxMaterial **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the material pointers associated with the shape.
PX_DEPRECATED PX_FORCE_INLINE bool getHeightFieldGeometry(PxHeightFieldGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:345
virtual void setFlag(PxShapeFlag::Enum flag, bool value)=0
Sets shape flags.
virtual void setClothMaterials(PxFEMClothMaterial *const *materials, PxU16 materialCount)=0
Assigns FEM cloth material(s) to the shape. Will remove existing materials from the shape.
virtual PxBaseMaterial * getMaterialFromInternalFaceIndex(PxU32 faceIndex) const =0
Retrieve material from given triangle index.
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxShape.h:776
virtual PxU32 getClothMaterials(PxFEMClothMaterial **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the FEM cloth material pointers associated with the shape.
virtual PxFilterData getQueryFilterData() const =0
Retrieves the shape's Query filter data.
virtual void setMaterials(PxMaterial *const *materials, PxU16 materialCount)=0
Assigns material(s) to the shape. Will remove existing materials from the shape.
PX_DEPRECATED PX_FORCE_INLINE bool getCustomGeometry(PxCustomGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:362
virtual void setFlags(PxShapeFlags inFlags)=0
Sets shape flags.
virtual void setSoftBodyMaterials(PxFEMSoftBodyMaterial *const *materials, PxU16 materialCount)=0
Assigns FEM soft body material(s) to the shape. Will remove existing materials from the shape.
virtual void setName(const char *name)=0
Sets a name string for the object that can be retrieved with getName().
PX_DEPRECATED PX_FORCE_INLINE bool getTetrahedronMeshGeometry(PxTetrahedronMeshGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:311
virtual void setSimulationFilterData(const PxFilterData &data)=0
Sets the user definable collision filter data.
PX_DEPRECATED PX_FORCE_INLINE bool getSphereGeometry(PxSphereGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:226
virtual void setMinTorsionalPatchRadius(PxReal radius)=0
Sets minimum torsional patch radius.
virtual void setContactOffset(PxReal contactOffset)=0
Sets the contact offset.
virtual PxReal getDensityForFluid() const =0
Retrieves the density used to interact with fluids.
PX_DEPRECATED PX_FORCE_INLINE bool getParticleSystemGeometry(PxParticleSystemGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:328
void * userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Definition PxShape.h:770
virtual PxShapeFlags getFlags() const =0
Retrieves shape flags.
virtual PxReal getTorsionalPatchRadius() const =0
Gets torsional patch radius.
virtual PxTransform getLocalPose() const =0
Retrieves the pose of the shape in actor space, i.e. relative to the actor they are owned by.
PX_DEPRECATED PX_FORCE_INLINE bool getPlaneGeometry(PxPlaneGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:260
virtual void setLocalPose(const PxTransform &pose)=0
Sets the pose of the shape in actor space, i.e. relative to the actors to which they are attached.
PX_DEPRECATED PX_FORCE_INLINE bool getConvexMeshGeometry(PxConvexMeshGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:277
PX_DEPRECATED PX_FORCE_INLINE bool getBoxGeometry(PxBoxGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:209
virtual void setQueryFilterData(const PxFilterData &data)=0
Sets the user definable query filter data.
virtual PxReal getContactOffset() const =0
Retrieves the contact offset.
virtual PxU16 getNbMaterials() const =0
Returns the number of materials assigned to the shape.
virtual PxU32 getSoftBodyMaterials(PxFEMSoftBodyMaterial **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
Retrieve all the FEM soft body material pointers associated with the shape.
virtual void setTorsionalPatchRadius(PxReal radius)=0
Sets torsional patch radius.
virtual PxRigidActor * getActor() const =0
Retrieves the actor which this shape is associated with.
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition PxShape.h:766
virtual void setRestOffset(PxReal restOffset)=0
Sets the rest offset.
virtual void release()=0
Decrements the reference count of a shape and releases it if the new reference count is zero.
PX_DEPRECATED PX_FORCE_INLINE bool getTriangleMeshGeometry(PxTriangleMeshGeometry &geometry) const
Fetch the geometry of the shape.
Definition PxShape.h:294
A class representing the geometry of a sphere.
Definition PxSphereGeometry.h:48
Tetrahedron mesh geometry class.
Definition PxTetrahedronMeshGeometry.h:50
Triangle mesh geometry class.
Definition PxTriangleMeshGeometry.h:81
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_INLINE
Definition PxPreprocessor.h:320
#define PX_DEPRECATED
Definition PxPreprocessor.h:418
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFlags< PxShapeFlag::Enum, PxU8 > PxShapeFlags
collection of set bits defined in PxShapeFlag.
Definition PxShape.h:126
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition PxFiltering.h:365
Enum
Definition PxGeometry.h:52
Flags which affect the behavior of PxShapes.
Definition PxShape.h:68
Enum
Definition PxShape.h:70
@ eSIMULATION_SHAPE
The shape will partake in collision in the physical simulation.
Definition PxShape.h:83
@ eVISUALIZATION
Enable debug renderer for this shape.
Definition PxShape.h:117
@ eSCENE_QUERY_SHAPE
The shape will partake in scene queries (ray casts, overlap tests, sweeps, ...).
Definition PxShape.h:88
@ eTRIGGER_SHAPE
The shape is a trigger which can send reports whenever other shapes enter/leave its volume.
Definition PxShape.h:110