PxRigidBody Class Referenceabstract

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

#include <PxRigidBody.h>

Inheritance diagram for PxRigidBody:
Collaboration diagram for PxRigidBody:

Public Member Functions

Mass Manipulation
virtual void setCMassLocalPose (const PxTransform &pose)=0
 Sets the pose of the center of mass relative to the actor. More...
 
virtual PxTransform getCMassLocalPose () const =0
 Retrieves the center of mass pose relative to the actor frame. More...
 
virtual void setMass (PxReal mass)=0
 Sets the mass of a dynamic actor. More...
 
virtual PxReal getMass () const =0
 Retrieves the mass of the actor. More...
 
virtual PxReal getInvMass () const =0
 Retrieves the inverse mass of the actor. More...
 
virtual void setMassSpaceInertiaTensor (const PxVec3 &m)=0
 Sets the inertia tensor, using a parameter specified in mass space coordinates. More...
 
virtual PxVec3 getMassSpaceInertiaTensor () const =0
 Retrieves the diagonal inertia tensor of the actor relative to the mass coordinate frame. More...
 
virtual PxVec3 getMassSpaceInvInertiaTensor () const =0
 Retrieves the diagonal inverse inertia tensor of the actor relative to the mass coordinate frame. More...
 
Damping
virtual void setLinearDamping (PxReal linDamp)=0
 Sets the linear damping coefficient. More...
 
virtual PxReal getLinearDamping () const =0
 Retrieves the linear damping coefficient. More...
 
virtual void setAngularDamping (PxReal angDamp)=0
 Sets the angular damping coefficient. More...
 
virtual PxReal getAngularDamping () const =0
 Retrieves the angular damping coefficient. More...
 
Velocity
virtual PxVec3 getLinearVelocity () const =0
 Retrieves the linear velocity of an actor. More...
 
virtual void setLinearVelocity (const PxVec3 &linVel, bool autowake=true)=0
 Sets the linear velocity of the actor. More...
 
virtual PxVec3 getAngularVelocity () const =0
 Retrieves the angular velocity of the actor. More...
 
virtual void setAngularVelocity (const PxVec3 &angVel, bool autowake=true)=0
 Sets the angular velocity of the actor. More...
 
virtual void setMaxAngularVelocity (PxReal maxAngVel)=0
 Lets you set the maximum angular velocity permitted for this actor. More...
 
virtual PxReal getMaxAngularVelocity () const =0
 Retrieves the maximum angular velocity permitted for this actor. More...
 
virtual void setMaxLinearVelocity (PxReal maxLinVel)=0
 Lets you set the maximum linear velocity permitted for this actor. More...
 
virtual PxReal getMaxLinearVelocity () const =0
 Retrieves the maximum angular velocity permitted for this actor. More...
 
- Public Member Functions inherited from PxRigidActor
virtual void release ()=0
 Deletes the rigid actor object. More...
 
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...
 
virtual bool 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...
 
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...
 
- Public Member Functions inherited from PxActor
virtual PxActorType::Enum getType () const =0
 Retrieves the type of actor. More...
 
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 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 =0
 Returns string name of dynamic type. More...
 
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

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. More...
 
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. More...
 
virtual void clearForce (PxForceMode::Enum mode=PxForceMode::eFORCE)=0
 Clears the accumulated forces (sets the accumulated force back to zero). More...
 
virtual void clearTorque (PxForceMode::Enum mode=PxForceMode::eFORCE)=0
 Clears the impulsive torque defined in the global coordinate frame to the actor. More...
 
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. More...
 
virtual void setRigidBodyFlag (PxRigidBodyFlag::Enum flag, bool value)=0
 Raises or clears a particular rigid body flag. More...
 
virtual void setRigidBodyFlags (PxRigidBodyFlags inFlags)=0
 
virtual PxRigidBodyFlags getRigidBodyFlags () const =0
 Reads the PxRigidBody flags. More...
 
virtual void setMinCCDAdvanceCoefficient (PxReal advanceCoefficient)=0
 Sets the CCD minimum advance coefficient. More...
 
virtual PxReal getMinCCDAdvanceCoefficient () const =0
 Gets the CCD minimum advance coefficient. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual PxReal getMaxContactImpulse () const =0
 Returns the maximum impulse that may be applied at a contact. More...
 
virtual PxU32 getInternalIslandNodeIndex () const =0
 Returns the island node index that only for internal use only. More...
 
PX_INLINE PxRigidBody (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxRigidBody (PxBaseFlags baseFlags)
 
virtual ~PxRigidBody ()
 
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 PxRigidActor
PX_INLINE PxRigidActor (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxRigidActor (PxBaseFlags baseFlags)
 
virtual ~PxRigidActor ()
 
- Protected Member Functions inherited from PxActor
PX_INLINE PxActor (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxActor (PxBaseFlags baseFlags)
 
virtual ~PxActor ()
 
- Protected Member Functions inherited from PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags. More...
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags. More...
 
virtual ~PxBase ()
 Destructor. More...
 
template<class T >
bool typeMatch () const
 
- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

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

See also
PxRigidActor

Constructor & Destructor Documentation

◆ PxRigidBody() [1/2]

PX_INLINE PxRigidBody::PxRigidBody ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected

◆ PxRigidBody() [2/2]

PX_INLINE PxRigidBody::PxRigidBody ( PxBaseFlags  baseFlags)
inlineprotected

◆ ~PxRigidBody()

virtual PxRigidBody::~PxRigidBody ( )
inlineprotectedvirtual

Member Function Documentation

◆ addForce()

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

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.

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.
The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
if this is called on an articulation link, only the link is updated, not the entire articulation.
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.

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

Parameters
[in]forceForce/Impulse to apply defined in the global frame.
[in]modeThe mode to use when applying the force/impulse(see PxForceMode)
[in]autowakeSpecify 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.
See also
PxForceMode addTorque

◆ addTorque()

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

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.

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.
The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
if this called on an articulation link, only the link is updated, not the entire articulation.
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.

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

Parameters
[in]torqueTorque to apply defined in the global frame. Range: torque vector
[in]modeThe mode to use when applying the force/impulse(see PxForceMode).
[in]autowakewhether to wake up the object if it is asleep. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.
See also
PxForceMode addForce()

◆ clearForce()

virtual void PxRigidBody::clearForce ( PxForceMode::Enum  mode = PxForceMode::eFORCE)
pure virtual

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.

Note
The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
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
[in]modeThe mode to use when clearing the force/impulse(see PxForceMode)
See also
PxForceMode addForce

◆ clearTorque()

virtual void PxRigidBody::clearTorque ( PxForceMode::Enum  mode = PxForceMode::eFORCE)
pure virtual

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

Note
The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
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
[in]modeThe mode to use when clearing the force/impulse(see PxForceMode).
See also
PxForceMode addTorque

◆ getAngularDamping()

virtual PxReal PxRigidBody::getAngularDamping ( ) const
pure virtual

Retrieves the angular damping coefficient.

Returns
The angular damping coefficient associated with this actor.
See also
setAngularDamping() getLinearDamping()

◆ getAngularVelocity()

virtual PxVec3 PxRigidBody::getAngularVelocity ( ) const
pure virtual

Retrieves the angular velocity of the actor.

Returns
The angular velocity of the actor.
See also
PxRigidDynamic.setAngularVelocity() getLinearVelocity()

◆ getCMassLocalPose()

virtual PxTransform PxRigidBody::getCMassLocalPose ( ) const
pure virtual

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

Returns
The center of mass pose relative to the actor frame.
See also
setCMassLocalPose() PxRigidBodyDesc.massLocalPose

◆ getInternalIslandNodeIndex()

virtual PxU32 PxRigidBody::getInternalIslandNodeIndex ( ) const
pure virtual

Returns the island node index that only for internal use only.

Returns
The island node index that only for internal use only

◆ getInvMass()

virtual PxReal PxRigidBody::getInvMass ( ) const
pure virtual

Retrieves the inverse mass of the actor.

Returns
The inverse mass of this actor.
See also
setMass() PxRigidBodyDesc.mass setMassSpaceInertiaTensor()

◆ getLinearDamping()

virtual PxReal PxRigidBody::getLinearDamping ( ) const
pure virtual

Retrieves the linear damping coefficient.

Returns
The linear damping coefficient associated with this actor.
See also
setLinearDamping() getAngularDamping()

◆ getLinearVelocity()

virtual PxVec3 PxRigidBody::getLinearVelocity ( ) const
pure virtual

Retrieves the linear velocity of an actor.

Returns
The linear velocity of the actor.
See also
PxRigidDynamic.setLinearVelocity() getAngularVelocity()

◆ getMass()

virtual PxReal PxRigidBody::getMass ( ) const
pure virtual

Retrieves the mass of the actor.

Note
A value of 0 is interpreted as infinite mass.
Returns
The mass of this actor.
See also
setMass() PxRigidBodyDesc.mass setMassSpaceInertiaTensor()

◆ getMassSpaceInertiaTensor()

virtual PxVec3 PxRigidBody::getMassSpaceInertiaTensor ( ) const
pure virtual

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

This method retrieves a mass frame inertia vector.

Returns
The mass space inertia tensor of this actor.
Note
A value of 0 in an element is interpreted as infinite inertia along that axis.
See also
PxRigidBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() setMass() setCMassLocalPose()

◆ getMassSpaceInvInertiaTensor()

virtual PxVec3 PxRigidBody::getMassSpaceInvInertiaTensor ( ) const
pure virtual

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

This method retrieves a mass frame inverse inertia vector.

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.
See also
PxRigidBodyDesc.massSpaceInertia setMassSpaceInertiaTensor() setMass() setCMassLocalPose()

◆ getMaxAngularVelocity()

virtual PxReal PxRigidBody::getMaxAngularVelocity ( ) const
pure virtual

Retrieves the maximum angular velocity permitted for this actor.

Returns
The maximum allowed angular velocity for this actor.
See also
setMaxAngularVelocity

◆ getMaxContactImpulse()

virtual PxReal PxRigidBody::getMaxContactImpulse ( ) const
pure virtual

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

Returns
The maximum impulse that may be applied at a contact
See also
setMaxContactImpulse

◆ getMaxDepenetrationVelocity()

virtual PxReal PxRigidBody::getMaxDepenetrationVelocity ( ) const
pure virtual

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.

◆ getMaxLinearVelocity()

virtual PxReal PxRigidBody::getMaxLinearVelocity ( ) const
pure virtual

Retrieves the maximum angular velocity permitted for this actor.

Returns
The maximum allowed angular velocity for this actor.
See also
setMaxLinearVelocity

◆ getMinCCDAdvanceCoefficient()

virtual PxReal PxRigidBody::getMinCCDAdvanceCoefficient ( ) const
pure virtual

Gets the CCD minimum advance coefficient.

Returns
The value of the CCD min advance coefficient.
See also
setMinCCDAdvanceCoefficient

◆ getRigidBodyFlags()

virtual PxRigidBodyFlags PxRigidBody::getRigidBodyFlags ( ) const
pure virtual

Reads the PxRigidBody flags.

See the list of flags PxRigidBodyFlag

Returns
The values of the PxRigidBody flags.
See also
PxRigidBodyFlag setRigidBodyFlag()

◆ isKindOf()

virtual bool PxRigidBody::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

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

Reimplemented from PxRigidActor.

Reimplemented in PxRigidDynamic, and PxArticulationLink.

References PxRigidActor::isKindOf().

Referenced by PxArticulationLink::isKindOf(), and PxRigidDynamic::isKindOf().

◆ setAngularDamping()

virtual void PxRigidBody::setAngularDamping ( PxReal  angDamp)
pure virtual

Sets the angular damping coefficient.

Zero represents no damping.

The angular damping coefficient must be nonnegative.

Default: 0.05

Parameters
[in]angDampAngular damping coefficient. Range: [0, PX_MAX_F32)
See also
getAngularDamping() setLinearDamping()

◆ setAngularVelocity()

virtual void PxRigidBody::setAngularVelocity ( const PxVec3 angVel,
bool  autowake = true 
)
pure virtual

Sets the angular velocity of the actor.

Note that if you continuously set the angular velocity of an actor yourself, forces such as friction will not be able to rotate the actor, because forces directly influence only the velocity/momentum.

Default: (0.0, 0.0, 0.0)

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

Note
It is invalid to use this method if PxActorFlag::eDISABLE_SIMULATION is set.
Parameters
[in]angVelNew angular velocity of actor. Range: angular velocity vector
[in]autowakeWhether to wake the object up if it is asleep and the velocity is non-zero. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.
See also
getAngularVelocity() setLinearVelocity()

◆ setCMassLocalPose()

virtual void PxRigidBody::setCMassLocalPose ( const PxTransform pose)
pure virtual

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

Note
Changing this transform will not move the actor in the world!
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.

Default: the identity transform

Parameters
[in]poseMass frame offset transform relative to the actor frame. Range: rigid body transform.
See also
getCMassLocalPose() PxRigidBodyDesc.massLocalPose

◆ setForceAndTorque()

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

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.

Note
The force modes PxForceMode::eIMPULSE and PxForceMode::eVELOCITY_CHANGE can not be applied to articulation links.
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.
See also
PxForceMode addTorque

◆ setLinearDamping()

virtual void PxRigidBody::setLinearDamping ( PxReal  linDamp)
pure virtual

Sets the linear damping coefficient.

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

Default: 0.0

Parameters
[in]linDampLinear damping coefficient. Range: [0, PX_MAX_F32)
See also
getLinearDamping() setAngularDamping()

◆ setLinearVelocity()

virtual void PxRigidBody::setLinearVelocity ( const PxVec3 linVel,
bool  autowake = true 
)
pure virtual

Sets the linear velocity of the actor.

Note that if you continuously set the velocity of an actor yourself, forces such as gravity or friction will not be able to manifest themselves, because forces directly influence only the velocity/momentum of an actor.

Default: (0.0, 0.0, 0.0)

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

Note
It is invalid to use this method if PxActorFlag::eDISABLE_SIMULATION is set.
Parameters
[in]linVelNew linear velocity of actor. Range: velocity vector
[in]autowakeWhether to wake the object up if it is asleep and the velocity is non-zero. If true and the current wake counter value is smaller than PxSceneDesc::wakeCounterResetValue it will get increased to the reset value.
See also
getLinearVelocity() setAngularVelocity()

◆ setMass()

virtual void PxRigidBody::setMass ( PxReal  mass)
pure virtual

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

Note
A value of 0 is interpreted as infinite mass.
Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.

Default: 1.0

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]massNew mass value for the actor. Range: [0, PX_MAX_F32)
See also
getMass() PxRigidBodyDesc.mass setMassSpaceInertiaTensor()

◆ setMassSpaceInertiaTensor()

virtual void PxRigidBody::setMassSpaceInertiaTensor ( const PxVec3 m)
pure virtual

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.

Note
A value of 0 in an element is interpreted as infinite inertia along that axis.
Values of 0 are not permitted for instances of PxArticulationLink but are permitted for instances of PxRigidDynamic.

Default: (1.0, 1.0, 1.0)

Sleeping: Does NOT wake the actor up automatically.

Parameters
[in]mNew mass space inertia tensor for the actor.
See also
PxRigidBodyDesc.massSpaceInertia getMassSpaceInertia() setMass() setCMassLocalPose()

◆ setMaxAngularVelocity()

virtual void PxRigidBody::setMaxAngularVelocity ( PxReal  maxAngVel)
pure virtual

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: 100.0

Parameters
[in]maxAngVelMax allowable angular velocity for actor. Range: [0, PX_MAX_F32)
See also
getMaxAngularVelocity()

◆ setMaxContactImpulse()

virtual void PxRigidBody::setMaxContactImpulse ( PxReal  maxImpulse)
pure virtual

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.

Parameters
[in]maxImpulsethe maximum contact impulse. Range: [0, PX_MAX_F32] Default: PX_MAX_F32
See also
getMaxContactImpulse

◆ setMaxDepenetrationVelocity()

virtual void PxRigidBody::setMaxDepenetrationVelocity ( PxReal  biasClamp)
pure virtual

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
[in]biasClampThe maximum velocity to de-penetrate by Range: (0, PX_MAX_F32].

◆ setMaxLinearVelocity()

virtual void PxRigidBody::setMaxLinearVelocity ( PxReal  maxLinVel)
pure virtual

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 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: PX_MAX_F32

Parameters
[in]maxLinVelMax allowable linear velocity for actor. Range: [0, PX_MAX_F32)
See also
getMaxAngularVelocity()

◆ setMinCCDAdvanceCoefficient()

virtual void PxRigidBody::setMinCCDAdvanceCoefficient ( PxReal  advanceCoefficient)
pure virtual

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
[in]advanceCoefficientThe CCD min advance coefficient. Range: [0, 1] Default: 0.15

◆ setRigidBodyFlag()

virtual void PxRigidBody::setRigidBodyFlag ( PxRigidBodyFlag::Enum  flag,
bool  value 
)
pure virtual

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.

Parameters
[in]flagThe PxRigidBody flag to raise(set) or clear. See PxRigidBodyFlag.
[in]valueThe new boolean value for the flag.
See also
PxRigidBodyFlag getRigidBodyFlags()

◆ setRigidBodyFlags()

virtual void PxRigidBody::setRigidBodyFlags ( PxRigidBodyFlags  inFlags)
pure virtual

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