AGX Dynamics  2.38.0.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;
110  };
111 
112 
114 
115 
116 
117 
118 }
119 
120 #endif /* AGXSDK_KINEMATICPATHLISTENER_H */
agx::Real
double Real
Definition: Real.h:42
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agx::Vector< PathConfiguration >
agxSDK::KinematicPathListener::m_index
agx::UInt32 m_index
Definition: KinematicPathListener.h:108
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxSDK::KinematicPathListener::STAND_STILL
@ STAND_STILL
Definition: KinematicPathListener.h:38
StepEventListener.h
agxSDK::KinematicPathListener::m_pathEndBehavior
PathEndBehavior m_pathEndBehavior
Definition: KinematicPathListener.h:105
agxSDK::KinematicPathListener::PathConfiguration::position
agx::Vec3 position
Definition: KinematicPathListener.h:49
agx::observer_ptr< agx::RigidBody >
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxSDK::KinematicPathListener::m_timeOffset
agx::Real m_timeOffset
Definition: KinematicPathListener.h:109
agxSDK::KinematicPathListener
Class that will update a rigid body's transformation and velocities based on a given path of transfor...
Definition: KinematicPathListener.h:33
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxSDK::KinematicPathListener::m_cycleAccTime
agx::Real m_cycleAccTime
Definition: KinematicPathListener.h:106
agxSDK::KinematicPathListener::PathConfiguration::PathConfiguration
PathConfiguration()
Definition: KinematicPathListener.h:48
agxSDK::KinematicPathListener::PathEndBehavior
PathEndBehavior
Definition: KinematicPathListener.h:37
agxSDK::KinematicPathListener::m_valid
bool m_valid
Definition: KinematicPathListener.h:104
agxSDK::KinematicPathListener::m_configurations
PathConfigurationVector m_configurations
Definition: KinematicPathListener.h:107
agxSDK::KinematicPathListener::PathConfigurationVector
agx::Vector< PathConfiguration > PathConfigurationVector
Definition: KinematicPathListener.h:54
agx::QuatT< Real >
RigidBody.h
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxSDK::KinematicPathListener::m_body
agx::observer_ptr< agx::RigidBody > m_body
Definition: KinematicPathListener.h:103
agxSDK::KinematicPathListener::PathConfiguration::rotation
agx::Quat rotation
Definition: KinematicPathListener.h:51
agxSDK::KinematicPathListenerRef
agx::ref_ptr< KinematicPathListener > KinematicPathListenerRef
Definition: KinematicPathListener.h:113
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agxSDK::KinematicPathListener::PathConfiguration::time
agx::Real time
Definition: KinematicPathListener.h:50
agxSDK::KinematicPathListener::PathConfiguration::PathConfiguration
PathConfiguration(agx::Real setTime, const agx::Vec3 &setPosition, const agx::Quat &setRotation)
Definition: KinematicPathListener.h:46
agx::Vec3T< Real >
agxSDK::KinematicPathListener::CONTINUE_LAST
@ CONTINUE_LAST
Definition: KinematicPathListener.h:39
agx::UInt32
uint32_t UInt32
Definition: Integer.h:32
agxSDK.h
agxSDK::KinematicPathListener::PathConfiguration
Help struct for storing transformation data per time step.
Definition: KinematicPathListener.h:44