#include <PxRigidDynamic.h>
Public Member Functions | |
Kinematic Actors | |
virtual void | setKinematicTarget (const PxTransform &destination)=0 |
Moves kinematically controlled dynamic actors through the game world. | |
virtual bool | getKinematicTarget (PxTransform &target) const =0 |
Get target pose of a kinematically controlled dynamic actor. | |
Damping | |
virtual void | setLinearDamping (PxReal linDamp)=0 |
Sets the linear damping coefficient. | |
virtual PxReal | getLinearDamping () const =0 |
Retrieves the linear damping coefficient. | |
virtual void | setAngularDamping (PxReal angDamp)=0 |
Sets the angular damping coefficient. | |
virtual PxReal | getAngularDamping () const =0 |
Retrieves the angular damping coefficient. | |
Velocity | |
virtual void | setMaxAngularVelocity (PxReal maxAngVel)=0 |
Lets you set the maximum angular velocity permitted for this actor. | |
virtual PxReal | getMaxAngularVelocity () const =0 |
Retrieves the maximum angular velocity permitted for this actor. | |
Sleeping | |
virtual bool | isSleeping () const =0 |
Returns true if this body is sleeping. | |
virtual void | setSleepThreshold (PxReal threshold)=0 |
Sets the mass-normalized kinetic energy threshold below which an actor may go to sleep. | |
virtual PxReal | getSleepThreshold () const =0 |
Returns the mass-normalized kinetic energy below which an actor may go to sleep. | |
virtual void | setStabilizationThreshold (PxReal threshold)=0 |
Sets the mass-normalized kinetic energy threshold below which an actor may participate in stabilization. | |
virtual PxReal | getStabilizationThreshold () const =0 |
Returns the mass-normalized kinetic energy below which an actor may participate in stabilization. | |
virtual PxRigidDynamicLockFlags | getRigidDynamicLockFlags () const =0 |
Reads the PxRigidDynamic lock flags. | |
virtual void | setRigidDynamicLockFlag (PxRigidDynamicLockFlag::Enum flag, bool value)=0 |
Raises or clears a particular rigid dynamic lock flag. | |
virtual void | setRigidDynamicLockFlags (PxRigidDynamicLockFlags flags)=0 |
virtual void | setWakeCounter (PxReal wakeCounterValue)=0 |
Sets the wake counter for the actor. | |
virtual PxReal | getWakeCounter () const =0 |
Returns the wake counter of the actor. | |
virtual void | wakeUp ()=0 |
Wakes up the actor if it is sleeping. | |
virtual void | putToSleep ()=0 |
Forces the actor to sleep. | |
virtual void | setSolverIterationCounts (PxU32 minPositionIters, PxU32 minVelocityIters=1)=0 |
Sets the solver iteration counts for the body. | |
virtual void | getSolverIterationCounts (PxU32 &minPositionIters, PxU32 &minVelocityIters) const =0 |
Retrieves the solver iteration counts. | |
virtual PxReal | getContactReportThreshold () const =0 |
Retrieves the force threshold for contact reports. | |
virtual void | setContactReportThreshold (PxReal threshold)=0 |
Sets the force threshold for contact reports. | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. | |
PX_INLINE | PxRigidDynamic (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxRigidDynamic (PxBaseFlags baseFlags) |
virtual | ~PxRigidDynamic () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. |
Instances of this class are created by calling PxPhysics::createRigidDynamic() and deleted with release().
PX_INLINE PxRigidDynamic::PxRigidDynamic | ( | PxType | concreteType, | |
PxBaseFlags | baseFlags | |||
) | [inline, protected] |
PX_INLINE PxRigidDynamic::PxRigidDynamic | ( | PxBaseFlags | baseFlags | ) | [inline, protected] |
virtual PxRigidDynamic::~PxRigidDynamic | ( | ) | [inline, protected, virtual] |
virtual PxReal PxRigidDynamic::getAngularDamping | ( | ) | const [pure virtual] |
Retrieves the angular damping coefficient.
virtual const char* PxRigidDynamic::getConcreteTypeName | ( | ) | const [inline, virtual] |
Returns string name of dynamic type.
Implements PxBase.
virtual PxReal PxRigidDynamic::getContactReportThreshold | ( | ) | const [pure virtual] |
Retrieves the force threshold for contact reports.
The contact report threshold is a force threshold. If the force between two actors exceeds this threshold for either of the two actors, a contact report will be generated according to the contact report threshold flags provided by the filter shader/callback. See PxPairFlag.
The threshold used for a collision between a dynamic actor and the static environment is the threshold of the dynamic actor, and all contacts with static actors are summed to find the total normal force.
Default: PX_MAX_F32
virtual bool PxRigidDynamic::getKinematicTarget | ( | PxTransform & | target | ) | const [pure virtual] |
Get target pose of a kinematically controlled dynamic actor.
[out] | target | Transform to write the target pose to. Only valid if the method returns true. |
virtual PxReal PxRigidDynamic::getLinearDamping | ( | ) | const [pure virtual] |
Retrieves the linear damping coefficient.
virtual PxReal PxRigidDynamic::getMaxAngularVelocity | ( | ) | const [pure virtual] |
Retrieves the maximum angular velocity permitted for this actor.
virtual PxRigidDynamicLockFlags PxRigidDynamic::getRigidDynamicLockFlags | ( | ) | const [pure virtual] |
Reads the PxRigidDynamic lock flags.
See the list of flags PxRigidDynamicLockFlag
virtual PxReal PxRigidDynamic::getSleepThreshold | ( | ) | const [pure virtual] |
Returns the mass-normalized kinetic energy below which an actor may go to sleep.
virtual PxReal PxRigidDynamic::getStabilizationThreshold | ( | ) | const [pure virtual] |
Returns the mass-normalized kinetic energy below which an actor may participate in stabilization.
Actors whose kinetic energy divided by their mass is above this threshold will not participate in stabilization.
virtual PxReal PxRigidDynamic::getWakeCounter | ( | ) | const [pure virtual] |
Returns the wake counter of the actor.
virtual bool PxRigidDynamic::isKindOf | ( | const char * | superClass | ) | const [inline, protected, virtual] |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxRigidBody.
References PxRigidBody::isKindOf().
virtual bool PxRigidDynamic::isSleeping | ( | ) | const [pure virtual] |
Returns true if this body is sleeping.
When an actor does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or one of its properties is changed by the user, the entire sleep mechanism should be transparent to the user.
In general, a dynamic rigid actor is guaranteed to be awake if at least one of the following holds:
If an actor is asleep after the call to PxScene::fetchResults() returns, it is guaranteed that the pose of the actor was not changed. You can use this information to avoid updating the transforms of associated objects.
It is invalid to use this method if the actor has not been added to a scene already.
virtual void PxRigidDynamic::putToSleep | ( | ) | [pure virtual] |
Forces the actor to sleep.
The actor will stay asleep during the next simulation step if not touched by another non-sleeping actor.
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.
It is invalid to use this method for kinematic actors since the sleep state for kinematics is defined based on whether a target pose has been set (see the comment in isSleeping()).
virtual void PxRigidDynamic::setAngularDamping | ( | PxReal | angDamp | ) | [pure virtual] |
Sets the angular damping coefficient.
Zero represents no damping.
The angular damping coefficient must be nonnegative.
Default: 0.05
[in] | angDamp | Angular damping coefficient. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::setContactReportThreshold | ( | PxReal | threshold | ) | [pure virtual] |
Sets the force threshold for contact reports.
See getContactReportThreshold().
[in] | threshold | Force threshold for contact reports. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::setKinematicTarget | ( | const PxTransform & | destination | ) | [pure virtual] |
Moves kinematically controlled dynamic actors through the game world.
You set a dynamic actor to be kinematic using the PxRigidBodyFlag::eKINEMATIC flag with setRigidBodyFlag().
The move command will result in a velocity that will move the body into the desired pose. After the move is carried out during a single time step, the velocity is returned to zero. Thus, you must continuously call this in every time step for kinematic actors so that they move along a path.
This function simply stores the move destination until the next simulation step is processed, so consecutive calls will simply overwrite the stored target variable.
The motion is always fully carried out.
[in] | destination | The desired pose for the kinematic actor, in the global frame. Range: rigid body transform. |
virtual void PxRigidDynamic::setLinearDamping | ( | PxReal | linDamp | ) | [pure virtual] |
Sets the linear damping coefficient.
Zero represents no damping. The damping coefficient must be nonnegative.
Default: 0.0
[in] | linDamp | Linear damping coefficient. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::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: 7.0
[in] | maxAngVel | Max allowable angular velocity for actor. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::setRigidDynamicLockFlag | ( | PxRigidDynamicLockFlag::Enum | flag, | |
bool | value | |||
) | [pure virtual] |
Raises or clears a particular rigid dynamic lock flag.
See the list of flags PxRigidDynamicLockFlag
Default: no flags are set
[in] | flag | The PxRigidDynamicLockBody flag to raise(set) or clear. See PxRigidBodyFlag. |
[in] | value | The new boolean value for the flag. |
virtual void PxRigidDynamic::setRigidDynamicLockFlags | ( | PxRigidDynamicLockFlags | flags | ) | [pure virtual] |
virtual void PxRigidDynamic::setSleepThreshold | ( | PxReal | threshold | ) | [pure virtual] |
Sets the mass-normalized kinetic energy threshold below which an actor may go to sleep.
Actors whose kinetic energy divided by their mass is below this threshold will be candidates for sleeping.
Default: 5e-5f * PxTolerancesScale::speed * PxTolerancesScale::speed
[in] | threshold | Energy below which an actor may go to sleep. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::setSolverIterationCounts | ( | PxU32 | minPositionIters, | |
PxU32 | minVelocityIters = 1 | |||
) | [pure virtual] |
Sets the solver iteration counts for the body.
The solver iteration count determines how accurately joints and contacts are resolved. If you are having trouble with jointed bodies oscillating and behaving erratically, then setting a higher position iteration count may improve their stability.
If intersecting bodies are being depenetrated too violently, increase the number of velocity iterations. More velocity iterations will drive the relative exit velocity of the intersecting objects closer to the correct value given the restitution.
Default: 4 position iterations, 1 velocity iteration
[in] | minPositionIters | Number of position iterations the solver should perform for this body. Range: [1,255] |
[in] | minVelocityIters | Number of velocity iterations the solver should perform for this body. Range: [1,255] |
virtual void PxRigidDynamic::setStabilizationThreshold | ( | PxReal | threshold | ) | [pure virtual] |
Sets the mass-normalized kinetic energy threshold below which an actor may participate in stabilization.
Actors whose kinetic energy divided by their mass is above this threshold will not participate in stabilization.
This value has no effect if PxSceneFlag::eENABLE_STABILIZATION was not enabled on the PxSceneDesc.
Default: 1e-5f * PxTolerancesScale::speed * PxTolerancesScale::speed
[in] | threshold | Energy below which an actor may participate in stabilization. Range: [0,inf) |
virtual void PxRigidDynamic::setWakeCounter | ( | PxReal | wakeCounterValue | ) | [pure virtual] |
Sets the wake counter for the actor.
The wake counter value determines the minimum amount of time until the body can be put to sleep. Please note that a body will not be put to sleep if the energy is above the specified threshold (see setSleepThreshold()) or if other awake bodies are touching it.
It is invalid to use this method for kinematic actors since the wake counter for kinematics is defined based on whether a target pose has been set (see the comment in isSleeping()).
It is invalid to use this method if PxActorFlag::eDISABLE_SIMULATION is set.
[in] | wakeCounterValue | Wake counter value. Range: [0, PX_MAX_F32) |
virtual void PxRigidDynamic::wakeUp | ( | ) | [pure virtual] |
Wakes up the actor if it is sleeping.
The actor will get woken up and might cause other touching actors to wake up as well during the next simulation step.
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.
It is invalid to use this method for kinematic actors since the sleep state for kinematics is defined based on whether a target pose has been set (see the comment in isSleeping()).