#include <PxShape.h>
Public Member Functions | |
virtual void | release ()=0 |
Decrements the reference count of a shape and releases it if the new reference count is zero. | |
virtual void | acquireReference ()=0 |
Acquires a counted reference to a shape. | |
virtual PxGeometryType::Enum | getGeometryType () const =0 |
Get the geometry type of the shape. | |
virtual void | setGeometry (const PxGeometry &geometry)=0 |
Adjust the geometry of the shape. | |
virtual PxGeometryHolder | getGeometry () const =0 |
Retrieve the geometry from the shape in a PxGeometryHolder wrapper class. | |
virtual bool | getBoxGeometry (PxBoxGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getSphereGeometry (PxSphereGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getCapsuleGeometry (PxCapsuleGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getPlaneGeometry (PxPlaneGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getConvexMeshGeometry (PxConvexMeshGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getTriangleMeshGeometry (PxTriangleMeshGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual bool | getHeightFieldGeometry (PxHeightFieldGeometry &geometry) const =0 |
Fetch the geometry of the shape. | |
virtual PxRigidActor * | getActor () const =0 |
Retrieves the actor which this shape is associated with. | |
virtual void | setMaterials (PxMaterial *const *materials, PxU16 materialCount)=0 |
Assigns material(s) to the shape. | |
virtual PxU16 | getNbMaterials () const =0 |
Returns the number of materials assigned to the shape. | |
virtual PxU32 | getMaterials (PxMaterial **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Retrieve all the material pointers associated with the shape. | |
virtual PxMaterial * | getMaterialFromInternalFaceIndex (PxU32 faceIndex) const =0 |
Retrieve material from given triangle index. | |
virtual void | setContactOffset (PxReal contactOffset)=0 |
Sets the contact offset. | |
virtual PxReal | getContactOffset () const =0 |
Retrieves the contact offset. | |
virtual void | setRestOffset (PxReal restOffset)=0 |
Sets the rest offset. | |
virtual PxReal | getRestOffset () const =0 |
Retrieves the rest offset. | |
virtual void | setFlag (PxShapeFlag::Enum flag, bool value)=0 |
Sets shape flags. | |
virtual void | setFlags (PxShapeFlags inFlags)=0 |
Sets shape flags. | |
virtual PxShapeFlags | getFlags () const =0 |
Retrieves shape flags. | |
virtual bool | isExclusive () const =0 |
Returns true if the shape is exclusive to an actor. | |
virtual void | setName (const char *name)=0 |
Sets a name string for the object that can be retrieved with getName(). | |
virtual const char * | getName () const =0 |
retrieves the name string set with setName(). | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. | |
Pose Manipulation | |
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. | |
virtual PxTransform | getLocalPose () const =0 |
Retrieves the pose of the shape in actor space, i.e. relative to the actor they are owned by. | |
Collision Filtering | |
virtual void | setSimulationFilterData (const PxFilterData &data)=0 |
Sets the user definable collision filter data. | |
virtual PxFilterData | getSimulationFilterData () const =0 |
Retrieves the shape's collision filter data. | |
virtual void | setQueryFilterData (const PxFilterData &data)=0 |
Sets the user definable query filter data. | |
virtual PxFilterData | getQueryFilterData () const =0 |
Retrieves the shape's Query filter data. | |
Public Attributes | |
void * | userData |
user can assign this to whatever, usually to create a 1:1 relationship with a user object. | |
Protected Member Functions | |
PX_INLINE | PxShape (PxBaseFlags baseFlags) |
PX_INLINE | PxShape (PxType concreteType, PxBaseFlags baseFlags) |
virtual | ~PxShape () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. |
Shapes are shared, reference counted objects.
An instance can be created by calling the createShape() method of the PxRigidActor class, or the createShape() method of the PxPhysics class.
PX_INLINE PxShape::PxShape | ( | PxBaseFlags | baseFlags | ) | [inline, protected] |
PX_INLINE PxShape::PxShape | ( | PxType | concreteType, | |
PxBaseFlags | baseFlags | |||
) | [inline, protected] |
virtual PxShape::~PxShape | ( | ) | [inline, protected, virtual] |
virtual void PxShape::acquireReference | ( | ) | [pure virtual] |
Acquires a counted reference to a shape.
This method increases the reference count of the shape by 1. Decrement the reference count by calling release()
virtual PxRigidActor* PxShape::getActor | ( | ) | const [pure virtual] |
Retrieves the actor which this shape is associated with.
virtual bool PxShape::getBoxGeometry | ( | PxBoxGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual bool PxShape::getCapsuleGeometry | ( | PxCapsuleGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual const char* PxShape::getConcreteTypeName | ( | ) | const [inline, virtual] |
Returns string name of dynamic type.
Implements PxBase.
virtual PxReal PxShape::getContactOffset | ( | ) | const [pure virtual] |
virtual bool PxShape::getConvexMeshGeometry | ( | PxConvexMeshGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual PxShapeFlags PxShape::getFlags | ( | ) | const [pure virtual] |
virtual PxGeometryHolder PxShape::getGeometry | ( | ) | const [pure virtual] |
Retrieve the geometry from the shape in a PxGeometryHolder wrapper class.
Referenced by PxShapeExt::getWorldBounds(), PxShapeExt::overlap(), PxShapeExt::raycast(), and PxShapeExt::sweep().
virtual PxGeometryType::Enum PxShape::getGeometryType | ( | ) | const [pure virtual] |
virtual bool PxShape::getHeightFieldGeometry | ( | PxHeightFieldGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual PxTransform PxShape::getLocalPose | ( | ) | const [pure virtual] |
Retrieves the pose of the shape in actor space, i.e. relative to the actor they are owned by.
This transformation is identity by default.
Referenced by PxShapeExt::getGlobalPose().
virtual PxMaterial* PxShape::getMaterialFromInternalFaceIndex | ( | PxU32 | faceIndex | ) | const [pure virtual] |
Retrieve material from given triangle index.
The input index is the internal triangle index as used inside the SDK. This is the index returned to users by various SDK functions such as raycasts.
This function is only useful for triangle meshes or heightfields, which have per-triangle materials. For other shapes the function returns the single material associated with the shape, regardless of the index.
[in] | faceIndex | The internal triangle index whose material you want to retrieve. |
Scene queries set the value of PxQueryHit::faceIndex to 0xFFFFffff whenever it is undefined or does not apply.
virtual PxU32 PxShape::getMaterials | ( | PxMaterial ** | userBuffer, | |
PxU32 | bufferSize, | |||
PxU32 | startIndex = 0 | |||
) | const [pure virtual] |
Retrieve all the material pointers associated with the shape.
You can retrieve the number of material pointers by calling getNbMaterials()
Note: Removing materials with PxMaterial::release() will invalidate the pointer of the released material.
[out] | userBuffer | The buffer to store the material pointers. |
[in] | bufferSize | Size of provided user buffer. |
[in] | startIndex | Index of first material pointer to be retrieved |
virtual const char* PxShape::getName | ( | ) | const [pure virtual] |
virtual PxU16 PxShape::getNbMaterials | ( | ) | const [pure virtual] |
Returns the number of materials assigned to the shape.
You can use getMaterials() to retrieve the material pointers.
virtual bool PxShape::getPlaneGeometry | ( | PxPlaneGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual PxFilterData PxShape::getQueryFilterData | ( | ) | const [pure virtual] |
virtual PxReal PxShape::getRestOffset | ( | ) | const [pure virtual] |
virtual PxFilterData PxShape::getSimulationFilterData | ( | ) | const [pure virtual] |
virtual bool PxShape::getSphereGeometry | ( | PxSphereGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual bool PxShape::getTriangleMeshGeometry | ( | PxTriangleMeshGeometry & | geometry | ) | const [pure virtual] |
Fetch the geometry of the shape.
[in] | geometry | The descriptor to save the shape's geometry data to. |
virtual bool PxShape::isExclusive | ( | ) | const [pure virtual] |
virtual bool PxShape::isKindOf | ( | const char * | superClass | ) | const [inline, protected, virtual] |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxBase.
References PxBase::isKindOf().
virtual void PxShape::release | ( | ) | [pure virtual] |
Decrements the reference count of a shape and releases it if the new reference count is zero.
Note that in releases prior to PhysX 3.3 this method did not have reference counting semantics and was used to destroy a shape created with PxActor::createShape(). In PhysX 3.3 and above, this usage is deprecated, instead, use PxRigidActor::detachShape() to detach a shape from an actor. If the shape to be detached was created with PxActor::createShape(), the actor holds the only counted reference, and so when the shape is detached it will also be destroyed.
Implements PxBase.
Referenced by PxRigidActorExt::createExclusiveShape().
virtual void PxShape::setContactOffset | ( | PxReal | contactOffset | ) | [pure virtual] |
Sets the contact offset.
Shapes whose distance is less than the sum of their contactOffset values will generate contacts. The contact offset must be positive and greater than the rest offset. Having a contactOffset greater than than the restOffset allows the collision detection system to predictively enforce the contact constraint even when the objects are slightly separated. This prevents jitter that would occur if the constraint were enforced only when shapes were within the rest distance.
Default: 0.02f * PxTolerancesScale::length
Sleeping: Does NOT wake the associated actor up automatically.
[in] | contactOffset | Range: [maximum(0,restOffset), PX_MAX_F32) |
virtual void PxShape::setFlag | ( | PxShapeFlag::Enum | flag, | |
bool | value | |||
) | [pure virtual] |
Sets shape flags.
Sleeping: Does NOT wake the associated actor up automatically.
[in] | flag | The shape flag to enable/disable. See PxShapeFlag. |
[in] | value | True to set the flag. False to clear the flag specified in flag. |
virtual void PxShape::setFlags | ( | PxShapeFlags | inFlags | ) | [pure virtual] |
virtual void PxShape::setGeometry | ( | const PxGeometry & | geometry | ) | [pure virtual] |
Adjust the geometry of the shape.
It is not allowed to change the geometry type of a shape.
This function does not guarantee correct/continuous behavior when objects are resting on top of old or new geometry.
[in] | geometry | New geometry of the shape. |
virtual void PxShape::setLocalPose | ( | const PxTransform & | pose | ) | [pure virtual] |
Sets the pose of the shape in actor space, i.e. relative to the actors to which they are attached.
This transformation is identity by default.
The local pose is an attribute of the shape, and so will apply to all actors to which the shape is attached.
Sleeping: Does NOT wake the associated actor up automatically.
Note: Does not automatically update the inertia properties of the owning actor (if applicable); use the PhysX extensions method PxRigidBodyExt::updateMassAndInertia() to do this.
Default: the identity transform
[in] | pose | The new transform from the actor frame to the shape frame. Range: rigid body transform |
virtual void PxShape::setMaterials | ( | PxMaterial *const * | materials, | |
PxU16 | materialCount | |||
) | [pure virtual] |
Assigns material(s) to the shape.
Sleeping: Does NOT wake the associated actor up automatically.
[in] | materials | List of material pointers to assign to the shape. See PxMaterial |
[in] | materialCount | The number of materials provided. |
virtual void PxShape::setName | ( | const char * | name | ) | [pure virtual] |
virtual void PxShape::setQueryFilterData | ( | const PxFilterData & | data | ) | [pure virtual] |
virtual void PxShape::setRestOffset | ( | PxReal | restOffset | ) | [pure virtual] |
Sets the rest offset.
Two shapes will come to rest at a distance equal to the sum of their restOffset values. If the restOffset is 0, they should converge to touching exactly. Having a restOffset greater than zero is useful to have objects slide smoothly, so that they do not get hung up on irregularities of each others' surfaces.
Default: 0.0f
Sleeping: Does NOT wake the associated actor up automatically.
[in] | restOffset | Range: (-PX_MAX_F32, contactOffset) |
virtual void PxShape::setSimulationFilterData | ( | const PxFilterData & | data | ) | [pure virtual] |
Sets the user definable collision filter data.
Sleeping: Does wake up the actor if the filter data change causes a formerly suppressed collision pair to be enabled.
Default: (0,0,0,0)
void* PxShape::userData |
user can assign this to whatever, usually to create a 1:1 relationship with a user object.