Momentum Scripting v1
Loading...
Searching...
No Matches
Observer.h
1/*
2Copyright 2007-2025. 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 without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14
15#ifndef MOMENTUM_OBSERVER_H
16#define MOMENTUM_OBSERVER_H
17
18#include "momentum_export.h"
19#include "momentum_namespace.h"
20
21#include "macros.h"
22#include "Vec3.h"
23#include "Quat.h"
24#include "RigidBody.h"
25
26#ifndef SWIG
28namespace agx
29{
30 class ObserverFrame;
31}
33#endif
34
35namespace MOMENTUM_NAMESPACE
36{
37#ifndef SWIG
38 class RigidBody;
39#endif
40
45 class MOMENTUM_EXPORT Observer
46 {
47 public:
48#ifndef SWIG
50
53 Observer(agx::ObserverFrame* Observer);
54
58 Observer();
60#endif
61
66 bool getEnabled() const;
67
68#ifndef AGX_MOMENTUM_ANALYSIS_API
75 void setEnabled(bool enabled);
76#endif
77
83
84#ifndef AGX_MOMENTUM_ANALYSIS_API
91 void setPosition(const Vec3& position);
92#endif
93
99
100#ifndef AGX_MOMENTUM_ANALYSIS_API
107 void setRotation(const Quat& rotation);
108#endif
109
115
121
122#ifndef AGX_MOMENTUM_ANALYSIS_API
129 void setTransformation(const AffineMatrix4x4& transformation);
130#endif
131
137
143
149
155
161
167 std::shared_ptr<MOMENTUM_NAMESPACE::RigidBody> getRigidBody() const;
168
174 Vec3 transformVectorToWorld(const Vec3& localVector) const;
175
183 Vec3 transformVectorToWorld(double x, double y, double z) const;
184
190 Vec3 transformVectorToLocal(const Vec3& worldVector) const;
191
199 Vec3 transformVectorToLocal(double x, double y, double z) const;
200
206 Vec3 transformPointToWorld(const Vec3& localPoint) const;
207
215 Vec3 transformPointToWorld(double x, double y, double z) const;
216
222 Vec3 transformPointToLocal(const Vec3& worldPoint) const;
223
231 Vec3 transformPointToLocal(double x, double y, double z) const;
232
237 std::string getName() const;
238
240 std::string __str__() const;
242
243#ifndef SWIG
244 agx::ObserverFrame* getObserver() const;
245#endif
246 private:
247#ifndef SWIG
248 agx::ObserverFrame* m_observer;
249#endif
250 };
251
252 V1_DECLARE_CONTAINER_TYPE(Observer);
253
254} // namespace momentum
255
256
257#endif
Matrix class for rigid transformations (translation, rotation).
Definition: AffineMatrix4x4.h:51
The Observer is a coordinate system which can be used to measure positions,velocities,...
Definition: Observer.h:46
Vec3 transformPointToWorld(const Vec3 &localPoint) const
Transform a point from the local coordinate system of this observer to the world coordinate system.
std::shared_ptr< MOMENTUM_NAMESPACE::RigidBody > getRigidBody() const
Get the rigid body that the observer frame is attached to.
bool getEnabled() const
Get if the observer frame is enabled and is interacting with the simulation.
AffineMatrix4x4 getTransformation() const
Get the transformation of the observer frame relative to its attachment.
std::string getName() const
Get the name of the observer.
Vec3 transformVectorToWorld(double x, double y, double z) const
Transform a vector from the observer coordinate system to the world coordinate system.
AffineMatrix4x4 getWorldTransformation() const
Get the transformation of the observer frame in the world.
void setEnabled(bool enabled)
Set if the observer frame is enabled and should interact with the simulation.
void setTransformation(const AffineMatrix4x4 &transformation)
Set the transformation of the observer frame relative to its attachment.
Vec3 transformPointToLocal(double x, double y, double z) const
Transform a point from the world coordinate system to this local coordinate system.
agx::ObserverFrame * getObserver() const
Vec3 getPosition() const
Get the position of the observer frame in the world coordinate system.
Vec3 getAcceleration() const
Get the current acceleration of the observer frame, in meters per second^2.
Vec3 getLinearVelocity() const
Get the current velocity of the observer frame, in meters per second.
Quat getRotation() const
Get the rotation of the observer frame in the world coordinate system.
Vec3 getAngularVelocity() const
Get the current angular velocity of the observer frame, in radians per second.
Vec3 transformPointToWorld(double x, double y, double z) const
Transform a point from the local coordinate system of this observer to the world coordinate system.
Vec3 transformVectorToLocal(double x, double y, double z) const
Transform a vector from the world coordinate system to the local coordinate system of this observer.
Vec3 transformVectorToWorld(const Vec3 &localVector) const
Transform a vector from the local observer coordinate system to the world coordinate system.
Vec3 transformVectorToLocal(const Vec3 &worldVector) const
Transform a vector from the world coordinate system to the local coordinate system of this observer.
Vec3 getAngularAcceleration() const
Get the current angular acceleration of the observer frame, in radians per second^2.
void setPosition(const Vec3 &position)
Set the position of the observer frame in the world coordinate system.
void setRotation(const Quat &rotation)
Set the rotation of the observer frame in the world coordinate system.
Vec3 getVelocity() const
Get the current velocity of the observer frame, in meters per second.
Vec3 transformPointToLocal(const Vec3 &worldPoint) const
Transform a point from the world coordinate system to this local coordinate system.
The object holding quaternions and providing operations on these.
Definition: Quat.h:55
A 3 dimensional vector which can be used to define a point or a vector and contains basic arithmetic.
Definition: Vec3.h:40
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29