AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
KinematicPathListener.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx 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
27namespace agxSDK
28{
34 {
35 public:
36
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
81
84
86 virtual void preCollide(const agx::TimeStamp& /*time*/);
87
90
93
94 private:
95 void validateBody();
96 void validatePath();
97 void validatePathEndBehavior();
98
99 protected:
101
102 protected:
110 };
111
112
114
115
116
117
118}
119
120#endif /* AGXSDK_KINEMATICPATHLISTENER_H */
#define AGXPHYSICS_EXPORT
Class that will update a rigid body's transformation and velocities based on a given path of transfor...
virtual void preCollide(const agx::TimeStamp &)
Inherited from StepEventListener. Manages the velocity updates here.
KinematicPathListener(const std::string &fileName, agx::RigidBody *rigidBody, PathEndBehavior pathEndBehavior=STAND_STILL)
Constructs a KinematicPathListener from a file defining the path.
agx::observer_ptr< agx::RigidBody > m_body
KinematicPathListener(const agx::Vector< PathConfiguration > &configurations, agx::RigidBody *rigidBody, PathEndBehavior pathEndBehavior=STAND_STILL)
Constructs a KinematicPathListener from a file defining the path.
PathConfigurationVector m_configurations
void setTimeOffset(agx::Real)
Sets a time offset to the path.
const PathConfigurationVector & getPathConfigurations() const
Returns the path configurations.
agx::Vector< PathConfiguration > PathConfigurationVector
agx::UInt32 getCurrentIndex() const
Returns the index of the current path configuration (0 at beginning).
agx::Real getTimeOffset() const
Sets a time offset to the path.
Derive from this class to implement a listener for simulation step events.
The rigid body class, combining a geometric model and a frame of reference.
Definition RigidBody.h:52
Templated vector class.
Definition agx/Vector.h:53
Smart pointer for observed objects, that automatically set pointers to them to null when they deleted...
Smart pointer for handling referenced counted objects.
Definition ref_ptr.h:30
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition Constraint.h:31
agx::ref_ptr< KinematicPathListener > KinematicPathListenerRef
uint32_t UInt32
Definition Integer.h:32
double Real
Definition Real.h:42
agx::Real TimeStamp
Definition TimeStamp.h:26
Help struct for storing transformation data per time step.
PathConfiguration(agx::Real setTime, const agx::Vec3 &setPosition, const agx::Quat &setRotation)