Public Member Functions | List of all members
PxRigidActor Class Referenceabstract

PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SDK. More...

#include <PxRigidActor.h>

Inheritance diagram for PxRigidActor:
Inheritance graph
[legend]
Collaboration diagram for PxRigidActor:
Collaboration graph
[legend]

Public Member Functions

virtual void release ()=0
 Deletes the rigid actor object. More...
 
Global Pose Manipulation
virtual PxTransform getGlobalPose () const =0
 Retrieves the actors world space transform. More...
 
virtual void setGlobalPose (const PxTransform &pose, bool autowake=true)=0
 Method for setting an actor's pose in the world. More...
 
Shapes
virtual PxShapecreateShape (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. More...
 
PX_DEPRECATED PX_INLINE PxShapecreateShape (const PxGeometry &geometry, PxMaterial *const *materials, PxU32 materialCount, const PxTransform &localPose)
 Deprecated function to create shapes with an initial transform. More...
 
PX_FORCE_INLINE PxShapecreateShape (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. More...
 
PX_DEPRECATED PX_INLINE PxShapecreateShape (const PxGeometry &geometry, const PxMaterial &material, const PxTransform &localPose)
 Deprecated function to create shapes with an initial transform. More...
 
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. More...
 
virtual PxU32 getShapes (PxShape **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the shape pointers belonging to the actor. More...
 
- Public Member Functions inherited from PxActor
virtual PxActorType::Enum getType () const =0
 Retrieves the type of actor. More...
 
PX_DEPRECATED PX_INLINE
PxRigidStatic
isRigidStatic ()
 Attempts to cast to specific actor type. More...
 
PX_DEPRECATED PX_INLINE const
PxRigidStatic
isRigidStatic () const
 
PX_DEPRECATED PX_INLINE
PxRigidDynamic
isRigidDynamic ()
 
PX_DEPRECATED PX_INLINE const
PxRigidDynamic
isRigidDynamic () const
 
PX_DEPRECATED PX_INLINE
PxParticleSystem
isParticleSystem ()
 
PX_DEPRECATED PX_INLINE const
PxParticleSystem
isParticleSystem () const
 
PX_DEPRECATED PX_INLINE
PxParticleFluid
isParticleFluid ()
 
PX_DEPRECATED PX_INLINE const
PxParticleFluid
isParticleFluid () const
 
PX_DEPRECATED PX_INLINE
PxArticulationLink
isArticulationLink ()
 
PX_DEPRECATED PX_INLINE const
PxArticulationLink
isArticulationLink () const
 
PX_DEPRECATED PX_INLINE PxClothisCloth ()
 
PX_DEPRECATED PX_INLINE const
PxCloth
isCloth () const
 
PX_DEPRECATED PX_INLINE
PxRigidActor
isRigidActor ()
 
PX_DEPRECATED PX_INLINE const
PxRigidActor
isRigidActor () const
 
PX_DEPRECATED PX_INLINE
PxRigidBody
isRigidBody ()
 
PX_DEPRECATED PX_INLINE const
PxRigidBody
isRigidBody () const
 
PX_DEPRECATED PX_INLINE
PxParticleBase
isParticleBase ()
 
PX_DEPRECATED PX_INLINE const
PxParticleBase
isParticleBase () const
 
virtual PxScenegetScene () const =0
 Retrieves the scene which this actor belongs to. More...
 
virtual void setName (const char *name)=0
 Sets a name string for the object that can be retrieved with getName(). More...
 
virtual const char * getName () const =0
 Retrieves the name string set with setName(). More...
 
virtual PxBounds3 getWorldBounds (float inflation=1.01f) const =0
 Retrieves the axis aligned bounding box enclosing the actor. More...
 
virtual void setActorFlag (PxActorFlag::Enum flag, bool value)=0
 Raises or clears a particular actor flag. More...
 
virtual void setActorFlags (PxActorFlags inFlags)=0
 sets the actor flags More...
 
virtual PxActorFlags getActorFlags () const =0
 Reads the PxActor flags. More...
 
virtual void setDominanceGroup (PxDominanceGroup dominanceGroup)=0
 Assigns dynamic actors a dominance group identifier. More...
 
virtual PxDominanceGroup getDominanceGroup () const =0
 Retrieves the value set with setDominanceGroup(). More...
 
virtual void setOwnerClient (PxClientID inClient)=0
 Sets the owner client of an actor. More...
 
virtual PxClientID getOwnerClient () const =0
 Returns the owner client that was specified with at creation time. More...
 
virtual void setClientBehaviorFlags (PxActorClientBehaviorFlags)=0
 Sets the behavior bits of the actor. More...
 
virtual PxActorClientBehaviorFlags getClientBehaviorFlags () const =0
 Retrieves the behavior bits of the actor. More...
 
virtual PxAggregategetAggregate () const =0
 Retrieves the aggregate the actor might be a part of. More...
 
- Public Member Functions inherited from PxBase
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type. More...
 
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

Constraints

virtual PxU32 getNbConstraints () const =0
 Returns the number of constraint shaders attached to the actor. More...
 
virtual PxU32 getConstraints (PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0
 Retrieve all the constraint shader pointers belonging to the actor. More...
 
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. More...
 

Additional Inherited Members

- Public Attributes inherited from PxActor
void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object. More...
 
- Protected Member Functions inherited from PxActor
PX_INLINE PxActor (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxActor (PxBaseFlags baseFlags)
 
virtual ~PxActor ()
 
- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SDK.

PxRigidActor objects specify the geometry of the object by defining a set of attached shapes (see PxShape, createShape()).

See Also
PxActor

Constructor & Destructor Documentation

PX_INLINE PxRigidActor::PxRigidActor ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected
PX_INLINE PxRigidActor::PxRigidActor ( PxBaseFlags  baseFlags)
inlineprotected
virtual PxRigidActor::~PxRigidActor ( )
inlineprotectedvirtual

Member Function Documentation

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.

Note
Mass properties of dynamic rigid actors will not automatically be recomputed to reflect the new mass distribution implied by the shape. Follow this call with a call to the PhysX extensions method PxRigidBodyExt::updateMassAndInertia() to do that.

Attaching a triangle mesh, heightfield or plane geometry shape configured as eSIMULATION_SHAPE is not supported for non-kinematic PxRigidDynamic instances.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]shapethe shape to attach.
virtual 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.

Note
The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). Triangle mesh, heightfield or plane geometry shapes configured as eSIMULATION_SHAPE are not supported for non-kinematic PxRigidDynamic instances.
Creating compounds with a very large number of shapes may adversely affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]geometrythe geometry of the shape
[in]materialsa pointer to an array of material pointers
[in]materialCountthe count of materials
[in]shapeFlagsoptional PxShapeFlags
Returns
The newly created shape.
See Also
PxShape PxShape::release()
PX_DEPRECATED PX_INLINE PxShape* PxRigidActor::createShape ( const PxGeometry geometry,
PxMaterial *const *  materials,
PxU32  materialCount,
const PxTransform localPose 
)
inline

Deprecated function to create shapes with an initial transform.

Deprecated:

Use this instead: PxShape* shape = actor->createShape(geometry, materials, materialCount); if (shape) shape->setLocalPose(transform);

See Also
PxShape, createShape(const PxGeometry& geometry, PxMaterial*const* materials, PxU16 materialCount, PxShapeFlags shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE)

References PxShape::setLocalPose().

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.

Note
The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). Triangle mesh, heightfield or plane geometry shapes configured as eSIMULATION_SHAPE are not supported for non-kinematic PxRigidDynamic instances.
Creating compounds with a very large number of shapes may adversely affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]geometrythe geometry of the shape
[in]materialthe material for the shape
[in]shapeFlagsoptional PxShapeFlags
Returns
The newly created shape.
See Also
PxShape PxShape::release() detachShape()
PX_DEPRECATED PX_INLINE PxShape* PxRigidActor::createShape ( const PxGeometry geometry,
const PxMaterial material,
const PxTransform localPose 
)
inline

Deprecated function to create shapes with an initial transform.

Deprecated:

Use this instead: PxShape* shape = actor->createShape(geometry, material); if (shape) shape->setLocalPose(transform);

See Also
PxShape, createShape(const PxGeometry& geometry, const PxMaterial& material, PxShapeFlags shapeFlags = PxShapeFlag::eVISUALIZATION | PxShapeFlag::eSCENE_QUERY_SHAPE | PxShapeFlag::eSIMULATION_SHAPE)

References PxShape::setLocalPose().

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.

For static rigid actors it is not possible to detach all shapes associated with the actor. An attempt to remove the last shape will be ignored.

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]shapethe shape to detach.
[in]wakeOnLostTouchSpecifies 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.

Parameters
[out]userBufferThe buffer to store the constraint shader pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first constraint pointer to be retrieved
Returns
Number of constraint shader pointers written to the buffer.
See Also
PxConstraint getNbConstraints() PxConstraint::release()
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.

Returns
Global pose of object.
See Also
PxRigidDynamic.setGlobalPose() PxRigidStatic.setGlobalPose()

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.

Returns
Number of constraint shaders attached to this actor.
See Also
PxConstraint getConstraints()
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.

Returns
Number of shapes associated with this actor.
See Also
PxShape getShapes()
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.

Parameters
[out]userBufferThe buffer to store the shape pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first shape pointer to be retrieved
Returns
Number of shape pointers written to the buffer.
See Also
PxShape getNbShapes() PxShape::release()
virtual bool PxRigidActor::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from PxActor.

Reimplemented in PxRigidBody, PxRigidDynamic, PxArticulationLink, 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.

See Also
PxActor::release()

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:

  • moving actors into other actors, thus causing overlap (an invalid physical state)
  • moving an actor that is connected by a joint to another away from the other (thus causing joint error)

Sleeping: This call wakes dynamic actors if they are sleeping and the autowake parameter is true (default).

Parameters
[in]poseTransformation from the actors local frame to the global frame. Range: rigid body transform.
[in]autowakewhether 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.
See Also
getGlobalPose()

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


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com