PhysX SDK 3.2 API Reference: PxRigidActor Class Reference

PhysX SDK 3.2 API

PxRigidActor Class Reference
[Physics]

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

#include <PxRigidActor.h>

Inheritance diagram for PxRigidActor:
Collaboration diagram for PxRigidActor:

List of all members.


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 wake=true)=0
 Method for setting an actor's pose in the world.
Shapes
virtual PxShapecreateShape (const PxGeometry &geometry, PxMaterial *const *materials, PxU32 materialCount, const PxTransform &localPose=PxTransform::createIdentity())=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_FORCE_INLINE PxShapecreateShape (const PxGeometry &geometry, const PxMaterial &material, const PxTransform &localPose=PxTransform::createIdentity())
 Creates a new shape with default properties and a single material adds it to the list of shapes of this actor.
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.
 PxRigidActor (PxRefResolver &v)
PX_INLINE PxRigidActor ()
virtual ~PxRigidActor ()
virtual bool isKindOf (const char *name) const

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 PxRigidActorDesc

Constructor & Destructor Documentation

PxRigidActor::PxRigidActor ( PxRefResolver v  )  [inline, protected]

PX_INLINE PxRigidActor::PxRigidActor (  )  [inline, protected]

virtual PxRigidActor::~PxRigidActor (  )  [inline, protected, virtual]


Member Function Documentation

PX_FORCE_INLINE PxShape* PxRigidActor::createShape ( const PxGeometry geometry,
const PxMaterial material,
const PxTransform localPose = PxTransform::createIdentity() 
) [inline]

Creates a new shape with default properties and a single material adds it to the list of shapes of this actor.

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.

The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). The only exception are triangle mesh, heightfield or plane geometry shapes if the actor is not a PxRigidStatic. In these cases the eSIMULATION_SHAPE flag is omitted.

Creating compounds with a very large number of shapes may adversly affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters:
[in] geometry the geometry of the shape.
[in] material the material for the shape
[in] localPose optional actor-relative pose of the shape
Returns:
The newly created shape.
See also:
PxShape PxShape::release()

virtual PxShape* PxRigidActor::createShape ( const PxGeometry geometry,
PxMaterial *const *  materials,
PxU32  materialCount,
const PxTransform localPose = PxTransform::createIdentity() 
) [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.

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.

The default shape flags to be set are: eVISUALIZATION, eSIMULATION_SHAPE, eSCENE_QUERY_SHAPE (see PxShapeFlag). The only exception are triangle mesh, heightfield or plane geometry shapes if the actor is not a PxRigidStatic. In these cases the eSIMULATION_SHAPE flag is omitted.

Creating compounds with a very large number of shapes may adversly affect performance and stability.

Sleeping: Does NOT wake the actor up automatically.

Parameters:
[in] geometry the geometry of the shape.
[in] materials a pointer to an array of material pointers.
[in] materialCount the count of materials
[in] localPose optional actor-relative pose of the shape
Returns:
The newly created shape.
See also:
PxShape PxShape::release()

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] 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
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] 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
Returns:
Number of shape pointers written to the buffer.
See also:
PxShape getNbShapes() PxShape::release()

virtual bool PxRigidActor::isKindOf ( const char *  name  )  const [inline, protected, virtual]

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.

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, and PxRigidStatic.

virtual void PxRigidActor::setGlobalPose ( const PxTransform pose,
bool  wake = 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 PxRigidDynamicFlag::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 interpenetration (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 wake parameter is true (default).

Parameters:
[in] pose Transformation from the actors local frame to the global frame. Range: rigid body transform.
[in] wake whether to wake the object if it is dynamic. This parameter has no effect for static actors
See also:
getGlobalPose()


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



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