AGX Dynamics  2.37.3.2
KinematicPathListener.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 AGXSDK_KINEMATICPATHLISTENER_H
18 #define AGXSDK_KINEMATICPATHLISTENER_H
19 
20 #include <agxSDK/agxSDK.h>
22 #include <agx/RigidBody.h>
23 #include <string>
24 
25 
26 
27 namespace agxSDK
28 {
34  {
35  public:
36 
40  CYCLE
41  };
42 
45  {
46  PathConfiguration( agx::Real setTime, const agx::Vec3& setPosition, const agx::Quat& setRotation)
47  : position(setPosition), time(setTime), rotation(setRotation) {}
52  };
53 
55 
65  KinematicPathListener( const std::string& fileName,
66  agx::RigidBody* rigidBody, PathEndBehavior pathEndBehavior = STAND_STILL );
67 
68 
77  agx::RigidBody* rigidBody, PathEndBehavior pathEndBehavior = STAND_STILL );
78 
80  void setTimeOffset(agx::Real);
81 
83  agx::Real getTimeOffset() const;
84 
86  virtual void preCollide(const agx::TimeStamp& /*time*/);
87 
89  agx::UInt32 getCurrentIndex() const;
90 
92  const PathConfigurationVector& getPathConfigurations() const;
93 
94  private:
95  void validateBody();
96  void validatePath();
97  void validatePathEndBehavior();
98 
99  protected:
100  virtual ~KinematicPathListener();
101 
102  protected:
104  bool m_valid;
107  PathConfigurationVector m_configurations;
110  };
111 
112 
114 
115 
116 
117 
118 }
119 
120 #endif /* AGXSDK_KINEMATICPATHLISTENER_H */
Derive from this class to implement a listener for simulation step events.
PathConfigurationVector m_configurations
Help struct for storing transformation data per time step.
#define AGXPHYSICS_EXPORT
agx::Vector< PathConfiguration > PathConfigurationVector
agx::Real TimeStamp
Definition: TimeStamp.h:26
Class that will update a rigid body&#39;s transformation and velocities based on a given path of transfor...
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
PathConfiguration(agx::Real setTime, const agx::Vec3 &setPosition, const agx::Quat &setRotation)
agx::ref_ptr< KinematicPathListener > KinematicPathListenerRef
agx::observer_ptr< agx::RigidBody > m_body
double Real
Definition: Real.h:42
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
uint32_t UInt32
Definition: Integer.h:40