AGX Dynamics  2.37.3.2
agx::RigidBody::AutoSleepProperties Class Reference

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)
 

Detailed Description

Data holder for auto-sleep properties.

Definition at line 1205 of file RigidBody.h.

Member Enumeration Documentation

◆ State

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.

Constructor & Destructor Documentation

◆ AutoSleepProperties()

agx::RigidBody::AutoSleepProperties::AutoSleepProperties ( RigidBody *  body = nullptr)
protected

Member Function Documentation

◆ getEnable()

bool agx::RigidBody::AutoSleepProperties::getEnable ( ) const
Returns
true if this body is enabled for auto sleep

Definition at line 1555 of file RigidBody.h.

◆ getRestTime()

float agx::RigidBody::AutoSleepProperties::getRestTime ( ) const
Returns
the time this body has been TIRED

Definition at line 1565 of file RigidBody.h.

References AGX_FORCE_INLINE.

◆ getState()

RigidBody::AutoSleepProperties::State agx::RigidBody::AutoSleepProperties::getState ( ) const
Returns
the current dynamic state of the RigidBody

Definition at line 1550 of file RigidBody.h.

◆ isSleeping()

bool agx::RigidBody::AutoSleepProperties::isSleeping ( ) const
Returns
true if body is sleeping

Definition at line 1560 of file RigidBody.h.

◆ setEnable()

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.

Parameters
flag- if true, auto sleep is enabled for this body

◆ setSleeping()

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

Parameters
flag- If true, the body will be put to sleep.

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