pub unsafe extern "C" fn PxRigidDynamic_isSleeping(
    self_: *const PxRigidDynamic
) -> bool
Expand description

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:

The wake counter is positive (see setWakeCounter).

The linear or angular velocity is non-zero.

A non-zero force or torque has been applied.

If a dynamic rigid actor is sleeping, the following state is guaranteed:

The wake counter is zero.

The linear and angular velocity is zero.

There is no force update pending.

When an actor gets inserted into a scene, it will be considered asleep if all the points above hold, else it will be treated as awake.

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.

A kinematic actor is asleep unless a target pose has been set (in which case it will stay awake until two consecutive simulation steps without a target pose being set have passed). The wake counter will get set to zero or to the reset value PxSceneDesc::wakeCounterResetValue in the case where a target pose has been set to be consistent with the definitions above.

It is invalid to use this method if the actor has not been added to a scene already.

It is not allowed to use this method while the simulation is running.

True if the actor is sleeping.