PxRigidBody

Defined in include/PxRigidBody.h

class PxRigidBody : public PxRigidActor

PxRigidBody is a base class shared between dynamic rigid body objects.

See also

PxRigidActor

Subclassed by PxArticulationLink, PxRigidDynamic

Mass Manipulation

virtual void setCMassLocalPose(const PxTransform &pose) = 0

Sets the pose of the center of mass relative to the actor.

Default: the identity transform

See also

getCMassLocalPose() getLinearVelocity()

Note

Changing this transform will not move the actor in the world!

Note

Setting an unrealistic center of mass which is a long way from the body can make it difficult for the SDK to solve constraints. Perhaps leading to instability and jittering bodies.

Note

Changing this transform will not update the linear velocity reported by getLinearVelocity() to account for the shift in center of mass. If the shift should be accounted for, the user should update the velocity using setLinearVelocity().

Parameters

pose[in] Mass frame offset transform relative to the actor frame. Range: rigid body transform.

virtual PxTransform getCMassLocalPose() const = 0

Retrieves the center of mass pose relative to the actor frame.

See also

setCMassLocalPose()

Returns

The center of mass pose relative to the actor frame.

virtual void setMass(PxReal mass) = 0

Sets the mass of a dynamic actor.

The mass must be non-negative.

setMass() does not update the inertial properties of the body, to change the inertia tensor use setMassSpaceInertiaTensor() or the PhysX extensions method PxRigidBodyExt::updateMassAndInertia().

Default: 1.0

Sleeping: Does NOT wake the actor up automatically.

See also

getMass() setMassSpaceInertiaTensor()

Note

A value of 0 is interpreted as infinite mass.

Note

Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.

Parameters

mass[in] New mass value for the actor. Range: [0, PX_MAX_F32)

virtual PxReal getMass() const = 0

Retrieves the mass of the actor.

See also

setMass() setMassSpaceInertiaTensor()

Note

A value of 0 is interpreted as infinite mass.

Returns

The mass of this actor.

virtual PxReal getInvMass() const = 0

Retrieves the inverse mass of the actor.

See also

setMass() setMassSpaceInertiaTensor()

Returns

The inverse mass of this actor.

virtual void setMassSpaceInertiaTensor(const PxVec3 &m) = 0

Sets the inertia tensor, using a parameter specified in mass space coordinates.

Note that such matrices are diagonal — the passed vector is the diagonal.

If you have a non diagonal world/actor space inertia tensor(3x3 matrix). Then you need to diagonalize it and set an appropriate mass space transform. See setCMassLocalPose().

The inertia tensor elements must be non-negative.

Default: (1.0, 1.0, 1.0)

Sleeping: Does NOT wake the actor up automatically.

See also

getMassSpaceInertia() setMass() setCMassLocalPose()

Note

A value of 0 in an element is interpreted as infinite inertia along that axis.

Note

Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.

Parameters

m[in] New mass space inertia tensor for the actor.

virtual PxVec3 getMassSpaceInertiaTensor() const = 0

Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame.

This method retrieves a mass frame inertia vector.

See also

setMassSpaceInertiaTensor() setMass() setCMassLocalPose()

Note

A value of 0 in an element is interpreted as infinite inertia along that axis.

Returns

The mass space inertia tensor of this actor.

virtual PxVec3 getMassSpaceInvInertiaTensor() const = 0

Retrieves the diagonal inverse inertia tensor of the actor relative to the mass coordinate frame.

This method retrieves a mass frame inverse inertia vector.

See also

setMassSpaceInertiaTensor() setMass() setCMassLocalPose()

Note

A value of 0 in an element is interpreted as infinite inertia along that axis.

Returns

The mass space inverse inertia tensor of this actor.

Damping

virtual void setLinearDamping(PxReal linDamp) = 0

Sets the linear damping coefficient.

Zero represents no damping. The damping coefficient must be nonnegative.

Default: 0.05 for PxArticulationLink, 0.0 for PxRigidDynamic

See also

getLinearDamping() setAngularDamping()

Parameters

linDamp[in] Linear damping coefficient. Range: [0, PX_MAX_F32)

virtual PxReal getLinearDamping() const = 0

Retrieves the linear damping coefficient.

See also

setLinearDamping() getAngularDamping()

Returns

The linear damping coefficient associated with this actor.

virtual void setAngularDamping(PxReal angDamp) = 0

Sets the angular damping coefficient.

Zero represents no damping.

The angular damping coefficient must be nonnegative.

Default: 0.05

See also

getAngularDamping() setLinearDamping()

Parameters

angDamp[in] Angular damping coefficient. Range: [0, PX_MAX_F32)

virtual PxReal getAngularDamping() const = 0

Retrieves the angular damping coefficient.

See also

setAngularDamping() getLinearDamping()

Returns

The angular damping coefficient associated with this actor.

Velocity

virtual PxVec3 getLinearVelocity() const = 0

Retrieves the linear velocity of an actor.

See also

PxRigidDynamic.setLinearVelocity() getAngularVelocity()

Note

It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).

Note

The linear velocity is reported with respect to the rigid body’s center of mass and not the actor frame origin.

Returns

The linear velocity of the actor.

virtual PxVec3 getAngularVelocity() const = 0

Retrieves the angular velocity of the actor.

See also

PxRigidDynamic.setAngularVelocity() getLinearVelocity()

Note

It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).

Returns

The angular velocity of the actor.

virtual void setMaxLinearVelocity(PxReal maxLinVel) = 0

Lets you set the maximum linear velocity permitted for this actor.

With this function, you can set the maximum linear velocity permitted for this rigid body. Higher linear velocities are clamped to this value.

Note: The linear velocity is clamped to the set value before the solver, which means that the limit may still be momentarily exceeded.

Default: 100 * PxTolerancesScale::length /s for PxArticulationLink, 1e^16 lengthUnits/s for PxRigidDynamic

See also

getMaxAngularVelocity()

Note

Enforcing the limit introduces momentum into the simulation, causing potentially unphysical behavior. For articulation links, consider using joint damping and limits instead, which preserve momentum.

Parameters

maxLinVel[in] Max allowable linear velocity for actor. Range: [0, 1e^16) lengthUnits/s

virtual PxReal getMaxLinearVelocity() const = 0

Retrieves the maximum angular velocity permitted for this actor.

See also

setMaxLinearVelocity

Returns

The maximum allowed angular velocity for this actor.

virtual void setMaxAngularVelocity(PxReal maxAngVel) = 0

Lets you set the maximum angular velocity permitted for this actor.

For various internal computations, very quickly rotating actors introduce error into the simulation, which leads to undesired results.

With this function, you can set the maximum angular velocity permitted for this rigid body. Higher angular velocities are clamped to this value.

Note: The angular velocity is clamped to the set value before the solver, which means that the limit may still be momentarily exceeded.

Default: 50.0 rad/s for PxArticulationLink, 100.0 rad/s for PxRigidDynamic

Range: [0, 1e^16) rad/s

See also

getMaxAngularVelocity()

Note

Enforcing the limit introduces momentum into the simulation, causing potentially unphysical behavior. For articulation links, consider using joint damping and limits instead, which preserve momentum.

Parameters

maxAngVel[in] Max allowable angular velocity for actor.

virtual PxReal getMaxAngularVelocity() const = 0

Retrieves the maximum angular velocity permitted for this actor.

See also

setMaxAngularVelocity

Returns

The maximum allowed angular velocity for this actor.

Acceleration

virtual PxVec3 getLinearAcceleration() const = 0

Retrieves the linear acceleration of an actor.

For PxArticulationLink objects, this function is always available.

For PxRigidDynamic actors, this function only returns valid results if PxSceneFlag::eENABLE_BODY_ACCELERATIONS is enabled. If that flag is not enabled, the function returns zero for PxRigidDynamic actors.

See also

PxRigidBody.getAngularAcceleration() PxSceneFlag::eENABLE_BODY_ACCELERATIONS

Returns

The linear acceleration of the actor, or zero if PxSceneFlag::eENABLE_BODY_ACCELERATIONS is disabled and the object is a PxRigidDynamic.

virtual PxVec3 getAngularAcceleration() const = 0

Retrieves the angular acceleration of an actor.

For PxArticulationLink objects, this function is always available.

For PxRigidDynamic actors, this function only returns valid results if PxSceneFlag::eENABLE_BODY_ACCELERATIONS is enabled. If that flag is not enabled, the function returns zero for PxRigidDynamic actors.

See also

PxRigidBody.getLinearAcceleration() PxSceneFlag::eENABLE_BODY_ACCELERATIONS

Returns

The angular acceleration of the actor, or zero if PxSceneFlag::eENABLE_BODY_ACCELERATIONS is disabled and the object is a PxRigidDynamic.

Forces

virtual void addForce(const PxVec3 &force, PxForceMode::Enum mode = PxForceMode::eFORCE, bool autowake = true) = 0

Applies a force (or impulse) defined in the global coordinate frame to the actor at its center of mass.

This will not induce a torque.

PxForceMode determines if the force is to be conventional or impulsive.

Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse mass and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.

Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the force is non-zero.

See also

PxForceMode addTorque

Note

It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.

Note

The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.

Note

if this is called on an articulation link, only the link is updated, not the entire articulation.

Note

see PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in linear velocity that will arise from the application of an impulsive force, where an impulsive force is applied force multiplied by a timestep.

Note

Forces will be cleared automatically after they are applied during the next simulation step. If the forces should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.

Parameters
  • force[in] Force/Impulse to apply defined in the global frame.

  • mode[in] The mode to use when applying the force/impulse(see PxForceMode)

  • autowake[in] Specify if the call should wake up the actor if it is currently asleep. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.

virtual void addTorque(const PxVec3 &torque, PxForceMode::Enum mode = PxForceMode::eFORCE, bool autowake = true) = 0

Applies an impulsive torque defined in the global coordinate frame to the actor.

PxForceMode determines if the torque is to be conventional or impulsive.

Each actor has an angular acceleration and an angular velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators and are just short hand for multiplying the vector parameter by inverse inertia and then using PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively.

Sleeping: This call wakes the actor if it is sleeping, and the autowake parameter is true (default) or the torque is non-zero.

See also

PxForceMode addForce()

Note

It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.

Note

The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.

Note

if this called on an articulation link, only the link is updated, not the entire articulation.

Note

see PxRigidBodyExt::computeVelocityDeltaFromImpulse for details of how to compute the change in angular velocity that will arise from the application of an impulsive torque, where an impulsive torque is an applied torque multiplied by a timestep.

Note

Torques will be cleared after they are applied during the next simulation step. If the Torques should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.

Parameters
  • torque[in] Torque to apply defined in the global frame. Range: torque vector

  • mode[in] The mode to use when applying the force/impulse(see PxForceMode).

  • autowake[in] Specify if the call should wake up the actor if it is currently asleep. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.

virtual void clearForce(PxForceMode::Enum mode = PxForceMode::eFORCE) = 0

Clears the accumulated forces (sets the accumulated force back to zero).

Each actor has an acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators (see PxRigidBody::addForce() for details); therefore the effect of calling clearForce(PxForceMode::eFORCE) is equivalent to calling clearForce(PxForceMode::eACCELERATION), and the effect of calling clearForce(PxForceMode::eIMPULSE) is equivalent to calling clearForce(PxForceMode::eVELOCITY_CHANGE).

PxForceMode determines if the cleared force is to be conventional or impulsive.

See also

PxForceMode addForce

Note

The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.

Note

It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.

Parameters

mode[in] The mode to use when clearing the force/impulse(see PxForceMode)

virtual void clearTorque(PxForceMode::Enum mode = PxForceMode::eFORCE) = 0

Clears the impulsive torque defined in the global coordinate frame to the actor.

PxForceMode determines if the cleared torque is to be conventional or impulsive.

Each actor has an angular acceleration and a velocity change accumulator which are directly modified using the modes PxForceMode::eACCELERATION and PxForceMode::eVELOCITY_CHANGE respectively. The modes PxForceMode::eFORCE and PxForceMode::eIMPULSE also modify these same accumulators (see PxRigidBody::addTorque() for details); therefore the effect of calling clearTorque(PxForceMode::eFORCE) is equivalent to calling clearTorque(PxForceMode::eACCELERATION), and the effect of calling clearTorque(PxForceMode::eIMPULSE) is equivalent to calling clearTorque(PxForceMode::eVELOCITY_CHANGE).

See also

PxForceMode addTorque

Note

The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.

Note

It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.

Parameters

mode[in] The mode to use when clearing the force/impulse(see PxForceMode).

virtual void setForceAndTorque(const PxVec3 &force, const PxVec3 &torque, PxForceMode::Enum mode = PxForceMode::eFORCE) = 0

Sets the impulsive force and torque defined in the global coordinate frame to the actor.

PxForceMode determines if the cleared torque is to be conventional or impulsive.

See also

PxForceMode addTorque

Note

The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.

Note

It is invalid to use this method if the actor has not been added to a scene already or if PxActorFlag::eDISABLE_SIMULATION is set.

Note

Forces and torques will be cleared after they are applied during the next simulation step. If they should be retained for the following steps, PxRigidBodyFlag::eRETAIN_ACCELERATIONS should be raised.

virtual void setRigidBodyFlag(PxRigidBodyFlag::Enum flag, bool value) = 0

Raises or clears a particular rigid body flag.

See the list of flags PxRigidBodyFlag

Default: no flags are set

Sleeping: Does NOT wake the actor up automatically.

See also

PxRigidBodyFlag getRigidBodyFlags()

Parameters
  • flag[in] The PxRigidBody flag to raise(set) or clear. See PxRigidBodyFlag.

  • value[in] The new boolean value for the flag.

virtual void setRigidBodyFlags(PxRigidBodyFlags inFlags) = 0
virtual PxRigidBodyFlags getRigidBodyFlags() const = 0

Reads the PxRigidBody flags.

See the list of flags PxRigidBodyFlag

See also

PxRigidBodyFlag setRigidBodyFlag()

Returns

The values of the PxRigidBody flags.

virtual void setMinCCDAdvanceCoefficient(PxReal advanceCoefficient) = 0

Sets the CCD minimum advance coefficient.

The CCD minimum advance coefficient is a value in the range [0, 1] that is used to control the minimum amount of time a body is integrated when it has a CCD contact. The actual minimum amount of time that is integrated depends on various properties, including the relative speed and collision shapes of the bodies involved in the contact. From these properties, a numeric value is calculated that determines the maximum distance (and therefore maximum time) which these bodies could be integrated forwards that would ensure that these bodies did not pass through each-other. This value is then scaled by CCD minimum advance coefficient to determine the amount of time that will be consumed in the CCD pass.

Things to consider: A large value (approaching 1) ensures that the objects will always advance some time. However, larger values increase the chances of objects gently drifting through each-other in scenes which the constraint solver can’t converge, e.g. scenes where an object is being dragged through a wall with a constraint. A value of 0 ensures that the pair of objects stop at the exact time-of-impact and will not gently drift through each-other. However, with very small/thin objects initially in contact, this can lead to a large amount of time being dropped and increases the chances of jamming. Jamming occurs when the an object is persistently in contact with an object such that the time-of-impact is 0, which results in no time being advanced for those objects in that CCD pass.

The chances of jamming can be reduced by increasing the number of CCD mass

See also

PxSceneDesc.ccdMaxPasses. However, increasing this number increases the CCD overhead.

Parameters

advanceCoefficient[in] The CCD min advance coefficient. Range: [0, 1] Default: 0.15

virtual PxReal getMinCCDAdvanceCoefficient() const = 0

Gets the CCD minimum advance coefficient.

See also

setMinCCDAdvanceCoefficient

Returns

The value of the CCD min advance coefficient.

virtual void setMaxDepenetrationVelocity(PxReal biasClamp) = 0

Sets the maximum depenetration velocity permitted to be introduced by the solver.

This value controls how much velocity the solver can introduce to correct for penetrations in contacts.

Parameters

biasClamp[in] The maximum velocity to de-penetrate by Range: (0, PX_MAX_F32].

virtual PxReal getMaxDepenetrationVelocity() const = 0

Returns the maximum depenetration velocity the solver is permitted to introduced.

This value controls how much velocity the solver can introduce to correct for penetrations in contacts.

Returns

The maximum penetration bias applied by the solver.

virtual void setMaxContactImpulse(PxReal maxImpulse) = 0

Sets a limit on the impulse that may be applied at a contact.

The maximum impulse at a contact between two dynamic or kinematic bodies will be the minimum of the two limit values. For a collision between a static and a dynamic body, the impulse is limited by the value for the dynamic body.

See also

getMaxContactImpulse

Parameters

maxImpulse[in] the maximum contact impulse. Range: [0, PX_MAX_F32] Default: PX_MAX_F32

virtual PxReal getMaxContactImpulse() const = 0

Returns the maximum impulse that may be applied at a contact.

See also

setMaxContactImpulse

Returns

The maximum impulse that may be applied at a contact

virtual void setContactSlopCoefficient(PxReal slopCoefficient) = 0

Sets a distance scale whereby the angular influence of a contact on the normal constraint in a contact is zeroed if normal.cross(offset) falls below this tolerance.

Rather than acting as an absolute value, this tolerance is scaled by the ratio rXn.dot(angVel)/normal.dot(linVel) such that contacts that have relatively larger angular velocity than linear normal velocity (e.g. rolling wheels) achieve larger slop values as the angular velocity increases.

See also

getContactSlopCoefficient

Parameters

slopCoefficient[in] the Slop coefficient. Range: [0, PX_MAX_F32] Default: 0

virtual PxReal getContactSlopCoefficient() const = 0

Returns the contact slop coefficient.

See also

setContactSlopCoefficient

Returns

The contact slop coefficient.

virtual PxNodeIndex getInternalIslandNodeIndex() const = 0

Returns the island node index.

Returns

The island node index.

inline PxRigidBody(PxType concreteType, PxBaseFlags baseFlags)
inline PxRigidBody(PxBaseFlags baseFlags)
inline virtual ~PxRigidBody()
inline virtual bool isKindOf(const char *name) const

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

Global Pose Manipulation

virtual PxTransform getGlobalPose() const = 0

Retrieves the actors world space transform.

The getGlobalPose() method retrieves the actor’s current actor space to world space transformation.

See also

PxRigidDynamic.setGlobalPose() PxRigidStatic.setGlobalPose()

Note

It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).

Returns

Global pose of object.

virtual void setGlobalPose(const PxTransform &pose, bool autowake = true) = 0

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).

See also

getGlobalPose()

Note

It is not allowed to use this method if the actor is part of a PxPruningStructure that has not been added to a scene yet.

Parameters
  • pose[in] Transformation from the actors local frame to the global frame. Range: rigid body transform.

  • autowake[in] 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.

Shapes

virtual bool attachShape(PxShape &shape) = 0

Attach a shape to an actor.

This call will increment the reference count of the shape.

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.

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.

Parameters

shape[in] the shape to attach.

Returns

True if success.

virtual void detachShape(PxShape &shape, bool wakeOnLostTouch = true) = 0

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.

Parameters
  • shape[in] the shape to detach.

  • wakeOnLostTouch[in] Specifies whether touching objects from the previous frame should get woken up in the next frame. Only applies to PxArticulationReducedCoordinate and PxRigidActor types.

virtual PxU32 getNbShapes() const = 0

Returns the number of shapes assigned to the actor.

You can use getShapes() to retrieve the shape pointers.

See also

PxShape getShapes()

Returns

Number of shapes associated with this actor.

virtual PxU32 getShapes(PxShape **userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0

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.

See also

PxShape getNbShapes() PxShape::release()

Parameters
  • userBuffer[out] The buffer to store the shape pointers.

  • bufferSize[in] Size of provided user buffer.

  • startIndex[in] Index of first shape pointer to be retrieved

Returns

Number of shape pointers written to the buffer.

Constraints

virtual PxU32 getNbConstraints() const = 0

Returns the number of constraint shaders attached to the actor.

You can use getConstraints() to retrieve the constraint shader pointers.

See also

PxConstraint getConstraints()

Returns

Number of constraint shaders attached to this actor.

virtual PxU32 getConstraints(PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex = 0) const = 0

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.

See also

PxConstraint getNbConstraints() PxConstraint::release()

Parameters
  • userBuffer[out] The buffer to store the constraint shader pointers.

  • bufferSize[in] Size of provided user buffer.

  • startIndex[in] Index of first constraint pointer to be retrieved

Returns

Number of constraint shader pointers written to the buffer.

Public Functions

virtual void release() = 0

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()

virtual PxU32 getInternalActorIndex() const = 0

Returns the internal actor index.

Warning

This is only defined for actors that have been added to a scene.

Returns

The internal actor index, or 0xffffffff if the actor is not part of a scene.

virtual PxActorType::Enum getType() const = 0

Retrieves the type of actor.

See also

PxActorType

Returns

The actor type of the actor.

virtual PxScene *getScene() const = 0

Retrieves the scene which this actor belongs to.

See also

PxScene

Returns

Owner Scene. NULL if not part of a scene.

virtual void setName(const char *name) = 0

Sets a name string for the object that can be retrieved with getName().

This is for debugging and is not used by the SDK. The string is not copied by the SDK, only the pointer is stored.

Default: NULL

See also

getName()

Parameters

name[in] String to set the objects name to.

virtual const char *getName() const = 0

Retrieves the name string set with setName().

See also

setName()

Returns

Name string associated with object.

virtual PxBounds3 getWorldBounds(float inflation = 1.01f) const = 0

Retrieves the axis aligned bounding box enclosing the actor.

See also

PxBounds3

Note

It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).

Parameters

inflation[in] Scale factor for computed world bounds. Box extents are multiplied by this value.

Returns

The actor’s bounding box.

virtual void setActorFlag(PxActorFlag::Enum flag, bool value) = 0

Raises or clears a particular actor flag.

See the list of flags PxActorFlag

Sleeping: Does NOT wake the actor up automatically.

See also

PxActorFlag getActorFlags()

Parameters
  • flag[in] The PxActor flag to raise(set) or clear. See PxActorFlag.

  • value[in] The boolean value to assign to the flag.

virtual void setActorFlags(PxActorFlags inFlags) = 0

Sets the actor flags.

See the list of flags PxActorFlag

See also

PxActorFlag setActorFlag()

virtual PxActorFlags getActorFlags() const = 0

Reads the PxActor flags.

See the list of flags PxActorFlag

See also

PxActorFlag setActorFlag()

Returns

The values of the PxActor flags.

virtual void setDominanceGroup(PxDominanceGroup dominanceGroup) = 0

Assigns dynamic actors a dominance group identifier.

PxDominanceGroup is a 5 bit group identifier (legal range from 0 to 31).

The PxScene::setDominanceGroupPair() lets you set certain behaviors for pairs of dominance groups. By default every dynamic actor is created in group 0.

Default: 0

Sleeping: Changing the dominance group does NOT wake the actor up automatically.

See also

getDominanceGroup() PxDominanceGroup PxScene::setDominanceGroupPair()

Parameters

dominanceGroup[in] The dominance group identifier. Range: [0..31]

virtual PxDominanceGroup getDominanceGroup() const = 0

Retrieves the value set with setDominanceGroup().

See also

setDominanceGroup() PxDominanceGroup PxScene::setDominanceGroupPair()

Returns

The dominance group of this actor.

virtual void setOwnerClient(PxClientID inClient) = 0

Sets the owner client of an actor.

This cannot be done once the actor has been placed into a scene.

Default: PX_DEFAULT_CLIENT

See also

PxClientID PxScene::createClient()

virtual PxClientID getOwnerClient() const = 0

Returns the owner client that was specified at creation time.

This value cannot be changed once the object is placed into the scene.

See also

PxClientID PxScene::createClient()

virtual PxAggregate *getAggregate() const = 0

Retrieves the aggregate the actor might be a part of.

See also

PxAggregate

Returns

The aggregate the actor is a part of, or NULL if the actor does not belong to an aggregate.

virtual const char *getConcreteTypeName() const = 0

Returns string name of dynamic type.

Returns

Class name of most derived type of this object.

template<class T>
inline T *is()
template<class T>
inline const T *is() const
inline PxType getConcreteType() const

Returns concrete type of object.

See also

PxConcreteType

Returns

PxConcreteType::Enum of serialized object

inline void setBaseFlag(PxBaseFlag::Enum flag, bool value)

Set PxBaseFlag

Parameters
  • flag[in] The flag to be set

  • value[in] The flags new value

inline void setBaseFlags(PxBaseFlags inFlags)

Set PxBaseFlags

See also

PxBaseFlags

Parameters

inFlags[in] The flags to be set

inline PxBaseFlags getBaseFlags() const

Returns PxBaseFlags.

See also

PxBaseFlags

Returns

PxBaseFlags

inline virtual bool isReleasable() const

Whether the object is subordinate.

A class is subordinate, if it can only be instantiated in the context of another class.

See also

PxSerialization::isSerializable

Returns

Whether the class is subordinate

Public Members

void *userData

user can assign this to whatever, usually to create a 1:1 relationship with a user object.

Protected Functions

template<class T>
inline bool typeMatch() const

Protected Attributes

PxType mConcreteType
PxBaseFlags mBaseFlags
PxU32 mBuiltInRefCount