Momentum Scripting v1
Loading...
Searching...
No Matches
MOMENTUM_NAMESPACE::Observer Class Reference

#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::RigidBodygetRigidBody () 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
 

Detailed Description

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.

Member Function Documentation

◆ getAcceleration()

Vec3 MOMENTUM_NAMESPACE::Observer::getAcceleration ( ) const

Get the current acceleration of the observer frame, in meters per second^2.

Returns
the current acceleration of the observer frame

◆ getAngularAcceleration()

Vec3 MOMENTUM_NAMESPACE::Observer::getAngularAcceleration ( ) const

Get the current angular acceleration of the observer frame, in radians per second^2.

Returns
the current angular acceleration of the observer frame

◆ getAngularVelocity()

Vec3 MOMENTUM_NAMESPACE::Observer::getAngularVelocity ( ) const

Get the current angular velocity of the observer frame, in radians per second.

Returns
the current angular velocity of the observer frame

◆ getEnabled()

bool MOMENTUM_NAMESPACE::Observer::getEnabled ( ) const

Get if the observer frame is enabled and is interacting with the simulation.

Returns
if the joint is enabled for simulation

◆ getLinearVelocity()

Vec3 MOMENTUM_NAMESPACE::Observer::getLinearVelocity ( ) const

Get the current velocity of the observer frame, in meters per second.

Returns
the current velocity of the observer frame

◆ getName()

std::string MOMENTUM_NAMESPACE::Observer::getName ( ) const

Get the name of the observer.

Returns
the name of the observer

◆ getObserver()

agx::ObserverFrame * MOMENTUM_NAMESPACE::Observer::getObserver ( ) const

◆ getPosition()

Vec3 MOMENTUM_NAMESPACE::Observer::getPosition ( ) const

Get the position of the observer frame in the world coordinate system.

In meters from the origin

Returns
the position of the observer frame

◆ getRigidBody()

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

Returns
the rigid body that the observer frame is attached to. nullptr if world

◆ getRotation()

Quat MOMENTUM_NAMESPACE::Observer::getRotation ( ) const

Get the rotation of the observer frame in the world coordinate system.

Returns
the rotation of the observer frame

◆ getTransformation()

AffineMatrix4x4 MOMENTUM_NAMESPACE::Observer::getTransformation ( ) const

Get the transformation of the observer frame relative to its attachment.

Returns
the transformation of the observer frame relative to its attachment

◆ getVelocity()

Vec3 MOMENTUM_NAMESPACE::Observer::getVelocity ( ) const

Get the current velocity of the observer frame, in meters per second.

Returns
the current velocity of the observer frame

◆ getWorldTransformation()

AffineMatrix4x4 MOMENTUM_NAMESPACE::Observer::getWorldTransformation ( ) const

Get the transformation of the observer frame in the world.

Returns
the transformation of the observer frame in world

◆ setEnabled()

void MOMENTUM_NAMESPACE::Observer::setEnabled ( bool  enabled)

Set if the observer frame is enabled and should interact with the simulation.

Parameters
enabledif the joint should interact with the simulation

Only available in simulation mode

◆ setPosition()

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

Parameters
positionthe new position of the observer frame

Only available in simulation mode

◆ setRotation()

void MOMENTUM_NAMESPACE::Observer::setRotation ( const Quat rotation)

Set the rotation of the observer frame in the world coordinate system.

Parameters
rotationthe new rotation of the observer frame

Only available in simulation mode

◆ setTransformation()

void MOMENTUM_NAMESPACE::Observer::setTransformation ( const AffineMatrix4x4 transformation)

Set the transformation of the observer frame relative to its attachment.

Parameters
transformationthe new transformation of the observer frame

Only available in simulation mode

◆ transformPointToLocal() [1/2]

Vec3 MOMENTUM_NAMESPACE::Observer::transformPointToLocal ( const Vec3 worldPoint) const

Transform a point from the world coordinate system to this local coordinate system.

Parameters
worldPoint- point to transform, given in the world coordinate system
Returns
the given point transformed to this local coordinate system of the observer

◆ transformPointToLocal() [2/2]

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.

Parameters
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
Returns
the given point transformed to this local coordinate system of the observer

◆ transformPointToWorld() [1/2]

Vec3 MOMENTUM_NAMESPACE::Observer::transformPointToWorld ( const Vec3 localPoint) const

Transform a point from the local coordinate system of this observer to the world coordinate system.

Parameters
localPoint- point to transform, given in the local coordinate system of this observer
Returns
the given point transformed to the world coordinate system

◆ transformPointToWorld() [2/2]

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.

Parameters
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
Returns
the given point transformed to the world coordinate system

◆ transformVectorToLocal() [1/2]

Vec3 MOMENTUM_NAMESPACE::Observer::transformVectorToLocal ( const Vec3 worldVector) const

Transform a vector from the world coordinate system to the local coordinate system of this observer.

Parameters
worldVector- vector to transform, given in the world coordinate system
Returns
the transformed vector transformed to the local coordinate system of this observer

◆ transformVectorToLocal() [2/2]

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.

Parameters
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
Returns
the transformed vector transformed to the local coordinate system of this observer

◆ transformVectorToWorld() [1/2]

Vec3 MOMENTUM_NAMESPACE::Observer::transformVectorToWorld ( const Vec3 localVector) const

Transform a vector from the local observer coordinate system to the world coordinate system.

Parameters
localVector- vector to transform, given in this local observer coordinate system
Returns
the transformed vectorLocal in world coordinate system

◆ transformVectorToWorld() [2/2]

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.

Parameters
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
Returns
the transformed vectorLocal in world coordinate system