|
Momentum Scripting v1
|
#include <Observer.h>
Public Member Functions | |
| Vec3 | getAcceleration () const |
| Vec3 | getAngularAcceleration () const |
| Vec3 | getAngularVelocity () const |
| bool | getEnabled () const |
| Vec3 | getLinearVelocity () const |
| std::string | getName () const |
| agx::ObserverFrame * | getObserver () const |
| Vec3 | getPosition () const |
| std::shared_ptr< MOMENTUM_NAMESPACE::RigidBody > | getRigidBody () const |
| Quat | getRotation () const |
| AffineMatrix4x4 | getTransformation () const |
| Vec3 | getVelocity () const |
| AffineMatrix4x4 | getWorldTransformation () const |
| void | setEnabled (bool enabled) |
| void | setPosition (const Vec3 &position) |
| void | setRotation (const Quat &rotation) |
| void | setTransformation (const AffineMatrix4x4 &transformation) |
| Vec3 | transformPointToLocal (const Vec3 &worldPoint) const |
| Vec3 | transformPointToLocal (double x, double y, double z) const |
| Vec3 | transformPointToWorld (const Vec3 &localPoint) const |
| Vec3 | transformPointToWorld (double x, double y, double z) const |
| Vec3 | transformVectorToLocal (const Vec3 &worldVector) const |
| Vec3 | transformVectorToLocal (double x, double y, double z) const |
| Vec3 | transformVectorToWorld (const Vec3 &localVector) const |
| Vec3 | transformVectorToWorld (double x, double y, double z) const |
The Observer is a coordinate system which can be used to measure positions,velocities, accelerations in absolute or relative coordinate systems.
I can be used to transform vectors and points between local and world coordinate systems.
| Vec3 MOMENTUM_NAMESPACE::Observer::getAcceleration | ( | ) | const |
Get the current acceleration of the observer frame, in meters per second^2.
| Vec3 MOMENTUM_NAMESPACE::Observer::getAngularAcceleration | ( | ) | const |
Get the current angular acceleration of the observer frame, in radians per second^2.
| Vec3 MOMENTUM_NAMESPACE::Observer::getAngularVelocity | ( | ) | const |
Get the current angular velocity of the observer frame, in radians per second.
| bool MOMENTUM_NAMESPACE::Observer::getEnabled | ( | ) | const |
Get if the observer frame is enabled and is interacting with the simulation.
| Vec3 MOMENTUM_NAMESPACE::Observer::getLinearVelocity | ( | ) | const |
Get the current velocity of the observer frame, in meters per second.
| std::string MOMENTUM_NAMESPACE::Observer::getName | ( | ) | const |
Get the name of the observer.
| agx::ObserverFrame * MOMENTUM_NAMESPACE::Observer::getObserver | ( | ) | const |
| Vec3 MOMENTUM_NAMESPACE::Observer::getPosition | ( | ) | const |
Get the position of the observer frame in the world coordinate system.
In meters from the origin
| std::shared_ptr< MOMENTUM_NAMESPACE::RigidBody > MOMENTUM_NAMESPACE::Observer::getRigidBody | ( | ) | const |
Get the rigid body that the observer frame is attached to.
If it is attached to the world, it will return nullptr
| Quat MOMENTUM_NAMESPACE::Observer::getRotation | ( | ) | const |
Get the rotation of the observer frame in the world coordinate system.
| AffineMatrix4x4 MOMENTUM_NAMESPACE::Observer::getTransformation | ( | ) | const |
Get the transformation of the observer frame relative to its attachment.
| Vec3 MOMENTUM_NAMESPACE::Observer::getVelocity | ( | ) | const |
Get the current velocity of the observer frame, in meters per second.
| AffineMatrix4x4 MOMENTUM_NAMESPACE::Observer::getWorldTransformation | ( | ) | const |
Get the transformation of the observer frame in the world.
| void MOMENTUM_NAMESPACE::Observer::setEnabled | ( | bool | enabled | ) |
Set if the observer frame is enabled and should interact with the simulation.
| enabled | if the joint should interact with the simulation |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::Observer::setPosition | ( | const Vec3 & | position | ) |
Set the position of the observer frame in the world coordinate system.
In meters from the origin
| position | the new position of the observer frame |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::Observer::setRotation | ( | const Quat & | rotation | ) |
Set the rotation of the observer frame in the world coordinate system.
| rotation | the new rotation of the observer frame |
Only available in simulation mode
| void MOMENTUM_NAMESPACE::Observer::setTransformation | ( | const AffineMatrix4x4 & | transformation | ) |
Set the transformation of the observer frame relative to its attachment.
| transformation | the new transformation of the observer frame |
Only available in simulation mode
Transform a point from the world coordinate system to this local coordinate system.
| worldPoint | - point to transform, given in the world coordinate system |
| Vec3 MOMENTUM_NAMESPACE::Observer::transformPointToLocal | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | const |
Transform a point from the world coordinate system to this local coordinate system.
| x | - x component of the point to transform, given in the world coordinate system |
| y | - y component of the point to transform, given in the world coordinate system |
| z | - z component of the point to transform, given in the world coordinate system |
Transform a point from the local coordinate system of this observer to the world coordinate system.
| localPoint | - point to transform, given in the local coordinate system of this observer |
| Vec3 MOMENTUM_NAMESPACE::Observer::transformPointToWorld | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | const |
Transform a point from the local coordinate system of this observer to the world coordinate system.
| x | - x component of the point to transform, given in the local coordinate system of this observer |
| y | - y component of the point to transform, given in the local coordinate system of this observer |
| z | - z component of the point to transform, given in the local coordinate system of this observer |
Transform a vector from the world coordinate system to the local coordinate system of this observer.
| worldVector | - vector to transform, given in the world coordinate system |
| Vec3 MOMENTUM_NAMESPACE::Observer::transformVectorToLocal | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | const |
Transform a vector from the world coordinate system to the local coordinate system of this observer.
| x | - x component of the vector to transform, given in the world coordinate system |
| y | - y component of the vector to transform, given in the world coordinate system |
| z | - z component of the vector to transform, given in the world coordinate system |
Transform a vector from the local observer coordinate system to the world coordinate system.
| localVector | - vector to transform, given in this local observer coordinate system |
vectorLocal in world coordinate system | Vec3 MOMENTUM_NAMESPACE::Observer::transformVectorToWorld | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | const |
Transform a vector from the observer coordinate system to the world coordinate system.
| x | - x component of the vector to transform, given in this local observer coordinate system |
| y | - y component of the vector to transform, given in this local observer coordinate system |
| z | - z component of the vector to transform, given in this local observer coordinate system |
vectorLocal in world coordinate system