AGX Dynamics  2.37.2.0
AutoSleep.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
46  AutoSleep( agx::DynamicsSystem *system );
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 
81  void updateSleepState( const agxCollide::SeparationPairVector& separations,
82  const agxCollide::GeometryContactPtrVector& contacts );
83 
84 
86  void updateSleepState();
87  RigidBodyPtrVector& getBodyConnections(RigidBody *body);
88 
89  bool m_enabled;
93  };
94 
96 }
97 
98 #endif /* _AGX_AutoSleep_H_ */
agx::ref_ptr< AutoSleepThreshold > m_threshold
Definition: AutoSleep.h:91
const AutoSleepThreshold * getThreshold() const
Definition: AutoSleep.h:74
AutoSleepThreshold * getThreshold()
Definition: AutoSleep.h:69
#define AGXPHYSICS_EXPORT
RigidBodyPtrVector m_bodyConnections
Definition: AutoSleep.h:92
bool m_enabled
Definition: AutoSleep.h:89
Base class providing referencing counted objects.
Definition: Referenced.h:119
Vector containing &#39;raw&#39; data.
Definition: Vector.h:245
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< AutoSleep > AutoSleepRef
Definition: AutoSleep.h:95
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
The complete physical system with bodies, interactions, data layout, time stepper, and solver.
Class that will investigate bodies to see if they are resting, that is if linear/angular velocity and...
Definition: AutoSleep.h:40
DynamicsSystem * m_system
Definition: AutoSleep.h:90