|
AGX Dynamics
2.37.3.2
|
Data holder for auto-sleep properties. More...
#include <RigidBody.h>
Public Types | |
| enum | State { AWAKE = 0, TIRED = 1, ASLEEP = 2 } |
| Specifies the state of auto sleep for this body. More... | |
Public Member Functions | |
| bool | getEnable () const |
| float | getRestTime () const |
| State | getState () const |
| bool | isSleeping () const |
| void | setEnable (bool flag) |
| Enable/Disable auto sleep functionality for this body. More... | |
| void | setSleeping (bool flag) |
| Put the body into sleep or wake it up. More... | |
Protected Member Functions | |
| AutoSleepProperties (RigidBody *body=nullptr) | |
Data holder for auto-sleep properties.
Definition at line 1205 of file RigidBody.h.
Specifies the state of auto sleep for this body.
| Enumerator | |
|---|---|
| AWAKE | Body is active. |
| TIRED | Body is not moving and is about to be put to sleep by the system. |
| ASLEEP | Body has been put to sleep. |
Definition at line 1211 of file RigidBody.h.
|
protected |
| bool agx::RigidBody::AutoSleepProperties::getEnable | ( | ) | const |
Definition at line 1555 of file RigidBody.h.
| float agx::RigidBody::AutoSleepProperties::getRestTime | ( | ) | const |
Definition at line 1565 of file RigidBody.h.
References AGX_FORCE_INLINE.
| RigidBody::AutoSleepProperties::State agx::RigidBody::AutoSleepProperties::getState | ( | ) | const |
Definition at line 1550 of file RigidBody.h.
| bool agx::RigidBody::AutoSleepProperties::isSleeping | ( | ) | const |
Definition at line 1560 of file RigidBody.h.
| void agx::RigidBody::AutoSleepProperties::setEnable | ( | bool | flag | ) |
Enable/Disable auto sleep functionality for this body.
Only a body with auto sleep enabled can be put to sleep and awaken by the system.
| flag | - if true, auto sleep is enabled for this body |
| void agx::RigidBody::AutoSleepProperties::setSleeping | ( | bool | flag | ) |
Put the body into sleep or wake it up.
A body in sleep does not occupy time in the solver. It can be awaken by contact/separation or a velocity/acceleration > given threshold.
If a body is put to sleep, it will get its velocities set to zero. It will be removed from the DynamicsSystem's simulated bodies
| flag | - If true, the body will be put to sleep. |