17 #ifndef AGX_SleepThreshold_H
18 #define AGX_SleepThreshold_H
39 float acceleration=
float(0.2),
40 float angularVelocity=
float(1E10),
41 float angularAcceleration=1E10
45 inline float getVelocity()
const;
48 inline float getAngularVelocity()
const;
51 inline float getAcceleration()
const;
54 inline float getAngularAcceleration()
const;
59 inline float getVelocity2()
const;
62 inline float getAngularVelocity2()
const;
65 inline float getAcceleration2()
const;
68 inline float getAngularAcceleration2()
const;
72 inline void setVelocity(
float vel );
75 inline void setAngularVelocity(
float vel );
78 inline void setAcceleration(
float acc );
81 inline void setAngularAcceleration(
float acc );
113 float acceleration=1E10,
114 float angularVelocity=
float(0.05),
115 float angularAcceleration=1E10,
116 float time=
float(0.8) );
122 inline void setTime(
float time );
128 inline float getTime()
const;
141 m_velocityThreshold(velocity), m_accelerationThreshold(acceleration), m_angularVelocityThreshold( angularVelocity ), m_angularAccelerationThreshold(angularAcceleration)
float getVelocity2() const
float getAcceleration() const
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
std::ostream & operator<<(std::ostream &stream, const AtomicValueT< T > &value)
float getAngularVelocity() const
agx::ref_ptr< SleepThreshold > SleepThresholdRef
float m_angularVelocityThreshold
#define AGXPHYSICS_EXPORT
agx::ref_ptr< MergeSplitThreshold > MergeSplitThresholdRef
float getAngularAcceleration2() const
Base class providing referencing counted objects.
float getAngularAcceleration() const
void setAngularVelocity(float vel)
Set the threshold of the angular velocity magnitude when a body should be put to sleep.
void setVelocity(float vel)
Set the threshold of the linear velocity magnitude when a body should be put to sleep.
void setAngularAcceleration(float acc)
Set the threshold of the angular acceleration magnitude when a body should be put to sleep...
Smart pointer for handling referenced counted objects.
agx::ref_ptr< AutoSleepThreshold > AutoSleepThresholdRef
float m_velocityThreshold
float getAcceleration2() const
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
float getVelocity() const
float getAngularVelocity2() const
float getTime() const
Get the time-window during which the body must be below velocity/acceleration threshold before it is ...
SleepThreshold MergeSplitThreshold
void setTime(float time)
Set the time-window during which the body must be below velocity/acceleration threshold before it is ...
float m_accelerationThreshold
SleepThreshold(float velocity=float(0.05), float acceleration=float(0.2), float angularVelocity=float(1E10), float angularAcceleration=1E10)
float m_angularAccelerationThreshold
void setAcceleration(float acc)
set the threshold of the linear acceleration magnitude when a body should be put to sleep ...