AGX Dynamics  2.35.0.1
AutoSleep.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGX_AUTOSLEEP_H
18 #define AGX_AUTOSLEEP_H
19 
20 #include <agx/agxPhysics_export.h>
21 #include <agx/Referenced.h>
22 #include <agx/SleepThreshold.h>
23 #include <agxCollide/Space.h>
25 #include <agxData/Buffer.h>
26 
27 namespace agx
28 {
29 
30  class DynamicsSystem;
31 
41  {
42  public:
43 
44 
47 
51  bool getEnable() const;
52 
56  bool isEnabled() const;
57 
64  void setEnable( bool enable );
65 
69  AutoSleepThreshold *getThreshold() { return m_threshold; }
70 
74  const AutoSleepThreshold *getThreshold() const { return m_threshold; }
75 
76  protected:
77  virtual ~AutoSleep();
78  friend class DynamicsSystem;
79 
82  const agxCollide::GeometryContactPtrVector& contacts );
83 
84 
88 
89  bool m_enabled;
93  };
94 
96 }
97 
98 #endif /* _AGX_AutoSleep_H_ */
#define AGXPHYSICS_EXPORT
Class that will investigate bodies to see if they are resting, that is if linear/angular velocity and...
Definition: AutoSleep.h:41
const AutoSleepThreshold * getThreshold() const
Definition: AutoSleep.h:74
AutoSleep(agx::DynamicsSystem *system)
Default constructor.
RigidBodyPtrVector & getBodyConnections(RigidBody *body)
bool m_enabled
Definition: AutoSleep.h:89
void setEnable(bool enable)
Specify if auto-disable of dynamic Bodies should be enabled or not.
AutoSleepThreshold * getThreshold()
Definition: AutoSleep.h:69
virtual ~AutoSleep()
void updateSleepState(const agxCollide::SeparationPairVector &separations, const agxCollide::GeometryContactPtrVector &contacts)
Investigate if bodies should be awaken based on separations and contacts.
void updateSleepState()
Investigate if bodies should be put to sleep/awaken.
agx::ref_ptr< AutoSleepThreshold > m_threshold
Definition: AutoSleep.h:91
RigidBodyPtrVector m_bodyConnections
Definition: AutoSleep.h:92
bool isEnabled() const
bool getEnable() const
DynamicsSystem * m_system
Definition: AutoSleep.h:90
The complete physical system with bodies, interactions, data layout, time stepper,...
Base class providing referencing counted objects.
Definition: Referenced.h:114
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< AutoSleep > AutoSleepRef
Definition: AutoSleep.h:95