#include <PxRigidActor.h>
Public Member Functions | |
virtual void | release ()=0 |
Deletes the rigid actor object. | |
Global Pose Manipulation | |
virtual PxTransform | getGlobalPose () const =0 |
Retrieves the actors world space transform. | |
virtual void | setGlobalPose (const PxTransform &pose, bool autowake=true)=0 |
Method for setting an actor's pose in the world. | |
Shapes | |
virtual PX_DEPRECATED PxShape * | createShape (const PxGeometry &geometry, PxMaterial *const *materials, PxU16 materialCount, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE)=0 |
Creates a new shape with default properties and a list of materials and adds it to the list of shapes of this actor. | |
PX_DEPRECATED PX_FORCE_INLINE PxShape * | createShape (const PxGeometry &geometry, const PxMaterial &material, PxShapeFlags shapeFlags=PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE) |
Creates a new shape with default properties and a single material adds it to the list of shapes of this actor. | |
virtual void | attachShape (PxShape &shape)=0 |
virtual void | detachShape (PxShape &shape, bool wakeOnLostTouch=true)=0 |
virtual PxU32 | getNbShapes () const =0 |
Returns the number of shapes assigned to the actor. | |
virtual PxU32 | getShapes (PxShape **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Retrieve all the shape pointers belonging to the actor. | |
Constraints | |
virtual PxU32 | getNbConstraints () const =0 |
Returns the number of constraint shaders attached to the actor. | |
virtual PxU32 | getConstraints (PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
Retrieve all the constraint shader pointers belonging to the actor. | |
PX_INLINE | PxRigidActor (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxRigidActor (PxBaseFlags baseFlags) |
virtual | ~PxRigidActor () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. |
PxRigidActor objects specify the geometry of the object by defining a set of attached shapes (see PxShape, createShape()).
PX_INLINE PxRigidActor::PxRigidActor | ( | PxType | concreteType, | |
PxBaseFlags | baseFlags | |||
) | [inline, protected] |
PX_INLINE PxRigidActor::PxRigidActor | ( | PxBaseFlags | baseFlags | ) | [inline, protected] |
virtual PxRigidActor::~PxRigidActor | ( | ) | [inline, protected, virtual] |
virtual void PxRigidActor::attachShape | ( | PxShape & | shape | ) | [pure virtual] |
attach a shared shape to an actor
This call will increment the reference count of the shape.
Sleeping: Does NOT wake the actor up automatically.
[in] | shape | the shape to attach. |
Referenced by PxRigidActorExt::createExclusiveShape().
PX_DEPRECATED PX_FORCE_INLINE PxShape* PxRigidActor::createShape | ( | const PxGeometry & | geometry, | |
const PxMaterial & | material, | |||
PxShapeFlags | shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE | |||
) | [inline] |
Creates a new shape with default properties and a single material adds it to the list of shapes of this actor.
This is equivalent to the following
PxShape* shape(...) = PxGetPhysics().createShape(...); // reference count is 1 actor->attachShape(shape); // increments reference count shape->release(); // releases user reference, leaving reference count at 1
As a consequence, detachShape() will result in the release of the last reference, and the shape will be deleted.
Creating compounds with a very large number of shapes may adversely affect performance and stability.
[in] | geometry | the geometry of the shape |
[in] | material | the material for the shape |
[in] | shapeFlags | optional PxShapeFlags |
virtual PX_DEPRECATED PxShape* PxRigidActor::createShape | ( | const PxGeometry & | geometry, | |
PxMaterial *const * | materials, | |||
PxU16 | materialCount, | |||
PxShapeFlags | shapeFlags = PxShapeFlag::eVISUALIZATION|PxShapeFlag::eSCENE_QUERY_SHAPE|PxShapeFlag::eSIMULATION_SHAPE | |||
) | [pure virtual] |
Creates a new shape with default properties and a list of materials and adds it to the list of shapes of this actor.
This is equivalent to the following
PxShape* shape(...) = PxGetPhysics().createShape(...); // reference count is 1 actor->attachShape(shape); // increments reference count shape->release(); // releases user reference, leaving reference count at 1
As a consequence, detachShape() will result in the release of the last reference, and the shape will be deleted.
Creating compounds with a very large number of shapes may adversely affect performance and stability.
[in] | geometry | the geometry of the shape |
[in] | materials | a pointer to an array of material pointers |
[in] | materialCount | the count of materials |
[in] | shapeFlags | optional PxShapeFlags |
virtual void PxRigidActor::detachShape | ( | PxShape & | shape, | |
bool | wakeOnLostTouch = true | |||
) | [pure virtual] |
detach a shape from an actor.
This will also decrement the reference count of the PxShape, and if the reference count is zero, will cause it to be deleted.
Sleeping: Does NOT wake the actor up automatically.
[in] | shape | the shape to detach. |
[in] | wakeOnLostTouch | Specifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulation and PxRigidActor types. |
virtual PxU32 PxRigidActor::getConstraints | ( | PxConstraint ** | userBuffer, | |
PxU32 | bufferSize, | |||
PxU32 | startIndex = 0 | |||
) | const [pure virtual] |
Retrieve all the constraint shader pointers belonging to the actor.
You can retrieve the number of constraint shader pointers by calling getNbConstraints()
Note: Removing constraint shaders with PxConstraint::release() will invalidate the pointer of the released constraint.
[out] | userBuffer | The buffer to store the constraint shader pointers. |
[in] | bufferSize | Size of provided user buffer. |
[in] | startIndex | Index of first constraint pointer to be retrieved |
virtual PxTransform PxRigidActor::getGlobalPose | ( | ) | const [pure virtual] |
Retrieves the actors world space transform.
The getGlobalPose() method retrieves the actor's current actor space to world space transformation.
Referenced by PxShapeExt::getGlobalPose().
virtual PxU32 PxRigidActor::getNbConstraints | ( | ) | const [pure virtual] |
Returns the number of constraint shaders attached to the actor.
You can use getConstraints() to retrieve the constraint shader pointers.
virtual PxU32 PxRigidActor::getNbShapes | ( | ) | const [pure virtual] |
Returns the number of shapes assigned to the actor.
You can use getShapes() to retrieve the shape pointers.
virtual PxU32 PxRigidActor::getShapes | ( | PxShape ** | userBuffer, | |
PxU32 | bufferSize, | |||
PxU32 | startIndex = 0 | |||
) | const [pure virtual] |
Retrieve all the shape pointers belonging to the actor.
These are the shapes used by the actor for collision detection.
You can retrieve the number of shape pointers by calling getNbShapes()
Note: Removing shapes with PxShape::release() will invalidate the pointer of the released shape.
[out] | userBuffer | The buffer to store the shape pointers. |
[in] | bufferSize | Size of provided user buffer. |
[in] | startIndex | Index of first shape pointer to be retrieved |
virtual bool PxRigidActor::isKindOf | ( | const char * | superClass | ) | const [inline, protected, virtual] |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxActor.
Reimplemented in PxArticulationLink, PxRigidBody, PxRigidDynamic, and PxRigidStatic.
References PxActor::isKindOf().
Referenced by PxRigidStatic::isKindOf(), and PxRigidBody::isKindOf().
virtual void PxRigidActor::release | ( | ) | [pure virtual] |
Deletes the rigid actor object.
Also releases any shapes associated with the actor.
Releasing an actor will affect any objects that are connected to the actor (constraint shaders like joints etc.). Such connected objects will be deleted upon scene deletion, or explicitly by the user by calling release() on these objects. It is recommended to always remove all objects that reference actors before the actors themselves are removed. It is not possible to retrieve list of dead connected objects.
Sleeping: This call will awaken any sleeping actors contacting the deleted actor (directly or indirectly).
Calls PxActor::release() so you might want to check the documentation of that method as well.
Implements PxActor.
Implemented in PxArticulationLink.
virtual void PxRigidActor::setGlobalPose | ( | const PxTransform & | pose, | |
bool | autowake = true | |||
) | [pure virtual] |
Method for setting an actor's pose in the world.
This method instantaneously changes the actor space to world space transformation.
This method is mainly for dynamic rigid bodies (see PxRigidDynamic). Calling this method on static actors is likely to result in a performance penalty, since internal optimization structures for static actors may need to be recomputed. In addition, moving static actors will not interact correctly with dynamic actors or joints.
To directly control an actor's position and have it correctly interact with dynamic bodies and joints, create a dynamic body with the PxRigidBodyFlag::eKINEMATIC flag, then use the setKinematicTarget() commands to define its path.
Even when moving dynamic actors, exercise restraint in making use of this method. Where possible, avoid:
[in] | pose | Transformation from the actors local frame to the global frame. Range: rigid body transform. |
[in] | autowake | whether to wake the object if it is dynamic. This parameter has no effect for static or kinematic actors. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value. |