AGXDynamics  2.31.1.0
agx::ObserverFrame Class Reference

With this class you can attach an ObserverFrame object relative to a RigidBody. More...

#include <ObserverFrame.h>

+ Inheritance diagram for agx::ObserverFrame:

Public Member Functions

 ObserverFrame (const agx::Name &name="", agx::RigidBody *rb=nullptr, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Construct given name. More...
 
 ObserverFrame (agx::RigidBody *rb, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Construct without name. More...
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
void attach (agx::RigidBody *rb, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Attach the ObserverFrame to a rigid body. More...
 
void attachWithWorldTransform (agx::RigidBody *rb, const agx::AffineMatrix4x4 &transform=agx::AffineMatrix4x4())
 Attach the ObserverFrame to a rigid body. More...
 
void detach ()
 Detach the current rigid body, setting the current rigid body to the world and the frame to identity. More...
 
agx::Vec3 getAcceleration () const
 Get the acceleration of the ObserverFrame in the world. More...
 
agx::Vec3 getAngularAcceleration () const
 Get the angular acceleration of the ObserverFrame in the world. More...
 
agx::Vec3 getAngularVelocity () const
 Get the angular velocity of the ObserverFrame in the world. More...
 
agx::RigidBody * getAttachment () const
 
const char * getClassName () const override
 
bool getEnable () const
 Access the state enable flag. More...
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::Frame * getFrame ()
 Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc. More...
 
const agx::Frame * getFrame () const
 Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc. More...
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4 & getLocalTransform () const
 
agx::Name getName () const
 
agx::Frame * getParentFrame ()
 
const agx::Frame * getParentFrame () const
 
agx::Vec3 getPosition () const
 Current model frame position, given in world coordinate frame. More...
 
int getReferenceCount () const
 
agx::Vec3 getRelativeAcceleration (const agx::RigidBody *rb) const
 Get the relative acceleration of a rigid body and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeAcceleration (const agx::ObserverFrame *obs) const
 Get the relative acceleration of an observer frame and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeAngularAcceleration (const agx::RigidBody *rb) const
 Get the relative angular acceleration of a rigid body and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeAngularAcceleration (const agx::ObserverFrame *obs) const
 Get the relative angular acceleration of an observer frame and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeAngularVelocity (const agx::RigidBody *rb) const
 Get the relative angular velocity of a rigid body and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeAngularVelocity (const agx::ObserverFrame *obs) const
 Get the relative angular velocity of an observer frame and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativePosition (const agx::ObserverFrame *obs) const
 Get the relative position (distance) of an observer frame and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativePosition (const agx::RigidBody *body) const
 Get the relative position (distance) of an observer frame and the RigidBody in the world. More...
 
agx::Vec3 getRelativeVelocity (const agx::RigidBody *rb) const
 Get the relative velocity of a rigid body and the ObserverFrame in the world. More...
 
agx::Vec3 getRelativeVelocity (const agx::ObserverFrame *obs) const
 Get the relative velocity of an observer frame and the ObserverFrame in the world. More...
 
const agx::RigidBody * getRigidBody () const
 
agx::RigidBody * getRigidBody ()
 
agx::Quat getRotation () const
 Current model frame rotation, given in world coordinate frame. More...
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::DynamicsSystem * getSystem ()
 
const agx::DynamicsSystem * getSystem () const
 
agx::Uuid getUuid () const
 
agx::Vec3 getVelocity () const
 Get the velocity of the ObserverFrame in the world. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isEnabled () const
 Access the state enable flag. More...
 
bool isFinished () const
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
bool setCmAndInertiaInObserver (agx::RigidBody *rb, const agx::SPDMatrix3x3 &inertia)
 Set the specified inertia in the frame of the observer on the rigid body. More...
 
void setEnable (bool enable)
 Change state enable of this observer frame. More...
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setLocalPosition (const agx::Vec3 &p)
 Assign the parent relative translate of this frame. More...
 
void setLocalPosition (agx::Real x, agx::Real y, agx::Real z)
 Assign the parent relative translate of this frame. More...
 
void setLocalRotation (const agx::Quat &q)
 Assign the parent relative rotation of this frame. More...
 
void setLocalRotation (const agx::EulerAngles &e)
 Assign the parent relative rotation of this frame. More...
 
void setLocalTransform (const agx::AffineMatrix4x4 &matrix)
 Assign the local transformation matrix for this frame ignoring any eventual parent transformation. More...
 
void setName (const agx::Name &name)
 Assign new name to this observer frame. More...
 
bool setParentFrame (agx::Frame *frame)
 Set the parent Frame of this ObserverFrame. More...
 
void setPosition (const agx::Vec3 &p)
 Assign the final (world) translate of this frame. More...
 
void setPosition (agx::Real x, agx::Real y, agx::Real z)
 Assign the final (world) translate of this frame. More...
 
void setRotation (const agx::Quat &q)
 Set the rotation of the frame relative to world frame. More...
 
void setRotation (const agx::EulerAngles &e)
 Set the rotation of the frame relative to world frame. More...
 
void setRotation (const agx::OrthoMatrix3x3 &m)
 Set the rotation of the frame relative to world frame. More...
 
void setTransform (const agx::AffineMatrix4x4 &matrix)
 This method will set the local matrix of this frame to be the matrix m multiplied with the inverse of the parents matrix: M = m * inv(parent) I.e., assign the final (world) transform of this frame. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
agx::Vec3 transformPointToLocal (const agx::Vec3 &pointWorld) const
 
agx::Vec3 transformPointToWorld (const agx::Vec3 &pointLocal) const
 
agx::Vec3 transformVectorToLocal (const agx::Vec3 &vectorWorld) const
 
agx::Vec3 transformVectorToWorld (const agx::Vec3 &vectorLocal) const
 Wrapper functions for Frame. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

virtual ~ObserverFrame ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 
void setSystem (agx::DynamicsSystem *system)
 Assign dynamics system which this body belongs to. More...
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

With this class you can attach an ObserverFrame object relative to a RigidBody.

It allows for queering position/rotation/velocity in a coordinate system that is local to this ObserverFrame.

Definition at line 42 of file ObserverFrame.h.

Constructor & Destructor Documentation

◆ ObserverFrame() [1/2]

agx::ObserverFrame::ObserverFrame ( const agx::Name &  name = "",
agx::RigidBody *  rb = nullptr,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)

Construct given name.

Default: rigid body = nullptr/world, transform = identity

Parameters
name- name of this observer frame (default: "")
rb- the rigid body to attach to, by default world
transform- the frame of reference of the ObserverFrame

◆ ObserverFrame() [2/2]

agx::ObserverFrame::ObserverFrame ( agx::RigidBody *  rb,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)

Construct without name.

Default: transform = identity

Parameters
rb- the rigid body to attach to, null if world
transform- the frame of reference of the ObserverFrame

◆ ~ObserverFrame()

virtual agx::ObserverFrame::~ObserverFrame ( )
protectedvirtual

Member Function Documentation

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

◆ attach()

void agx::ObserverFrame::attach ( agx::RigidBody *  rb,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)

Attach the ObserverFrame to a rigid body.

This will remove previous attachments.

  • rb The rigid body to attach to, null if world
  • transform The transform relative to the body

◆ attachWithWorldTransform()

void agx::ObserverFrame::attachWithWorldTransform ( agx::RigidBody *  rb,
const agx::AffineMatrix4x4 &  transform = agx::AffineMatrix4x4() 
)

Attach the ObserverFrame to a rigid body.

This will remove previous attachments.

  • rb The rigid body to attach to, null if world
  • transform The transform in the world

◆ create() [1/2]

static agxStream::Serializable* agx::ObserverFrame::create ( )
inlinestatic

Definition at line 356 of file ObserverFrame.h.

◆ create() [2/2]

static agxStream::Serializable* agx::ObserverFrame::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 356 of file ObserverFrame.h.

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ detach()

void agx::ObserverFrame::detach ( )

Detach the current rigid body, setting the current rigid body to the world and the frame to identity.

◆ generateUuid()

void agxStream::Serializable::generateUuid ( )
protectedinherited

◆ getAcceleration()

agx::Vec3 agx::ObserverFrame::getAcceleration ( ) const

Get the acceleration of the ObserverFrame in the world.

◆ getAngularAcceleration()

agx::Vec3 agx::ObserverFrame::getAngularAcceleration ( ) const

Get the angular acceleration of the ObserverFrame in the world.

◆ getAngularVelocity()

agx::Vec3 agx::ObserverFrame::getAngularVelocity ( ) const

Get the angular velocity of the ObserverFrame in the world.

◆ getAttachment()

agx::RigidBody* agx::ObserverFrame::getAttachment ( ) const

◆ getClassName()

const char* agx::ObserverFrame::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 356 of file ObserverFrame.h.

◆ getConstructClassId()

static const char* agx::ObserverFrame::getConstructClassId ( )
inlinestatic

Definition at line 356 of file ObserverFrame.h.

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getEnable()

bool agx::ObserverFrame::getEnable ( ) const

Access the state enable flag.

Returns
true if the body is enabled (default) - otherwise false

Definition at line 381 of file ObserverFrame.h.

◆ getEnableSerialization()

bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

◆ getEnableUuidGeneration()

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object

◆ getFrame() [1/2]

Frame * agx::ObserverFrame::getFrame ( )

Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc.

Returns
model frame of this observer frame

Definition at line 391 of file ObserverFrame.h.

◆ getFrame() [2/2]

const Frame * agx::ObserverFrame::getFrame ( ) const

Returns the model frame containing model the transformation and utilities to manipulate position, rotation etc.

Returns
model frame of this observer frame

Definition at line 396 of file ObserverFrame.h.

◆ getIndex()

agx::UInt32 agxStream::Serializable::getIndex ( ) const
inherited

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

◆ getLocalPosition()

agx::Vec3 agx::ObserverFrame::getLocalPosition ( ) const
Returns
the relative translate to this frame's parent frame

◆ getLocalRotation()

agx::Quat agx::ObserverFrame::getLocalRotation ( ) const
Returns
the relative rotation to this frame's parent frame

◆ getLocalTransform()

const agx::AffineMatrix4x4& agx::ObserverFrame::getLocalTransform ( ) const
Returns
the local transformation matrix (i.e., the transformation relative to the parent)

◆ getName()

agx::Name agx::ObserverFrame::getName ( ) const
Returns
the name of this observer frame

◆ getParentFrame() [1/2]

agx::Frame* agx::ObserverFrame::getParentFrame ( )
Returns
a pointer to the parent frame, 0 if this frame has no parent

◆ getParentFrame() [2/2]

const agx::Frame* agx::ObserverFrame::getParentFrame ( ) const
Returns
a pointer to the parent frame, 0 if this frame has no parent

◆ getPosition()

agx::Vec3 agx::ObserverFrame::getPosition ( ) const

Current model frame position, given in world coordinate frame.

Returns
the current model frame position, given in world coordinate frame

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getRelativeAcceleration() [1/2]

agx::Vec3 agx::ObserverFrame::getRelativeAcceleration ( const agx::RigidBody *  rb) const

Get the relative acceleration of a rigid body and the ObserverFrame in the world.

◆ getRelativeAcceleration() [2/2]

agx::Vec3 agx::ObserverFrame::getRelativeAcceleration ( const agx::ObserverFrame *  obs) const

Get the relative acceleration of an observer frame and the ObserverFrame in the world.

◆ getRelativeAngularAcceleration() [1/2]

agx::Vec3 agx::ObserverFrame::getRelativeAngularAcceleration ( const agx::RigidBody *  rb) const

Get the relative angular acceleration of a rigid body and the ObserverFrame in the world.

◆ getRelativeAngularAcceleration() [2/2]

agx::Vec3 agx::ObserverFrame::getRelativeAngularAcceleration ( const agx::ObserverFrame *  obs) const

Get the relative angular acceleration of an observer frame and the ObserverFrame in the world.

◆ getRelativeAngularVelocity() [1/2]

agx::Vec3 agx::ObserverFrame::getRelativeAngularVelocity ( const agx::RigidBody *  rb) const

Get the relative angular velocity of a rigid body and the ObserverFrame in the world.

◆ getRelativeAngularVelocity() [2/2]

agx::Vec3 agx::ObserverFrame::getRelativeAngularVelocity ( const agx::ObserverFrame *  obs) const

Get the relative angular velocity of an observer frame and the ObserverFrame in the world.

◆ getRelativePosition() [1/2]

agx::Vec3 agx::ObserverFrame::getRelativePosition ( const agx::ObserverFrame *  obs) const

Get the relative position (distance) of an observer frame and the ObserverFrame in the world.

◆ getRelativePosition() [2/2]

agx::Vec3 agx::ObserverFrame::getRelativePosition ( const agx::RigidBody *  body) const

Get the relative position (distance) of an observer frame and the RigidBody in the world.

◆ getRelativeVelocity() [1/2]

agx::Vec3 agx::ObserverFrame::getRelativeVelocity ( const agx::RigidBody *  rb) const

Get the relative velocity of a rigid body and the ObserverFrame in the world.

◆ getRelativeVelocity() [2/2]

agx::Vec3 agx::ObserverFrame::getRelativeVelocity ( const agx::ObserverFrame *  obs) const

Get the relative velocity of an observer frame and the ObserverFrame in the world.

◆ getRigidBody() [1/2]

const agx::RigidBody * agx::ObserverFrame::getRigidBody ( ) const
inline
Returns
the rigid body this observer frame is attached to

Definition at line 401 of file ObserverFrame.h.

◆ getRigidBody() [2/2]

agx::RigidBody * agx::ObserverFrame::getRigidBody ( )
inline
Returns
the rigid body this observer frame is attached to

Definition at line 406 of file ObserverFrame.h.

◆ getRotation()

agx::Quat agx::ObserverFrame::getRotation ( ) const

Current model frame rotation, given in world coordinate frame.

Returns
the current model frame rotation, given in world coordinate frame

◆ getStorageAgent()

agxStream::StorageAgent* agx::ObserverFrame::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 356 of file ObserverFrame.h.

◆ getSystem() [1/2]

agx::DynamicsSystem* agx::ObserverFrame::getSystem ( )
Returns
a pointer to the DynamicsSystem this observer frame belongs to

◆ getSystem() [2/2]

const agx::DynamicsSystem* agx::ObserverFrame::getSystem ( ) const
Returns
a pointer to the DynamicsSystem this observer frame belongs to

◆ getUuid()

agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

Referenced by agxSDK::UuidHashCollisionFilter::match().

◆ getVelocity()

agx::Vec3 agx::ObserverFrame::getVelocity ( ) const

Get the velocity of the ObserverFrame in the world.

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ isEnabled()

bool agx::ObserverFrame::isEnabled ( ) const

Access the state enable flag.

Returns
true if the body is enabled (default) - otherwise false

Definition at line 386 of file ObserverFrame.h.

◆ isFinished()

bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

References AGX_FORCE_INLINE.

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

◆ restore()

virtual void agx::ObserverFrame::restore ( agxStream::InputArchive &  in)
overridevirtual

◆ setCmAndInertiaInObserver()

bool agx::ObserverFrame::setCmAndInertiaInObserver ( agx::RigidBody *  rb,
const agx::SPDMatrix3x3 &  inertia 
)

Set the specified inertia in the frame of the observer on the rigid body.

Also set the center of mass to the origin of the observer

Parameters
rbThe rigid body to change the inertia on
inertiaThe inertia in the frame of the observer
Returns
False if fails. This means that an invalid inertia is used. Otherwise True

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ setEnable()

void agx::ObserverFrame::setEnable ( bool  enable)

Change state enable of this observer frame.

Default: true.

Parameters
enable- true to enable, false to disable

◆ setEnableSerialization()

void agxStream::Serializable::setEnableSerialization ( bool  flag)
inherited

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

◆ setEnableUuidGeneration()

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

◆ setFinished()

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

◆ setLocalPosition() [1/2]

void agx::ObserverFrame::setLocalPosition ( const agx::Vec3 &  p)

Assign the parent relative translate of this frame.

Parameters
p- parent relative translate

◆ setLocalPosition() [2/2]

void agx::ObserverFrame::setLocalPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Assign the parent relative translate of this frame.

Parameters
x- parent relative x translate
y- parent relative y translate
z- parent relative z translate

◆ setLocalRotation() [1/2]

void agx::ObserverFrame::setLocalRotation ( const agx::Quat &  q)

Assign the parent relative rotation of this frame.

Parameters
q- rotation given as a quaternion

◆ setLocalRotation() [2/2]

void agx::ObserverFrame::setLocalRotation ( const agx::EulerAngles &  e)

Assign the parent relative rotation of this frame.

Parameters
e- rotation given as Euler angles

◆ setLocalTransform()

void agx::ObserverFrame::setLocalTransform ( const agx::AffineMatrix4x4 &  matrix)

Assign the local transformation matrix for this frame ignoring any eventual parent transformation.

Parameters
matrix- relative to parent transform for this frame

◆ setName()

void agx::ObserverFrame::setName ( const agx::Name &  name)

Assign new name to this observer frame.

Default: ""

◆ setParentFrame()

bool agx::ObserverFrame::setParentFrame ( agx::Frame *  frame)

Set the parent Frame of this ObserverFrame.

This means that getTranslate, getRotate, getTransform will be given in the parents coordinate frame. I.e., this frame's transformation will be concatenated with the parents.

Parameters
frame- new parent frame, 0 to remove parent
Returns
true if parent is changed (not the same as before) - otherwise false

◆ setPosition() [1/2]

void agx::ObserverFrame::setPosition ( const agx::Vec3 &  p)

Assign the final (world) translate of this frame.

Parameters
p- final (world) translate of this frame

◆ setPosition() [2/2]

void agx::ObserverFrame::setPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Assign the final (world) translate of this frame.

Parameters
x- final (world) x translate of this frame
y- final (world) y translate of this frame
z- final (world) z translate of this frame

◆ setRotation() [1/3]

void agx::ObserverFrame::setRotation ( const agx::Quat &  q)

Set the rotation of the frame relative to world frame.

Parameters
q- rotation given as a quaternion

◆ setRotation() [2/3]

void agx::ObserverFrame::setRotation ( const agx::EulerAngles &  e)

Set the rotation of the frame relative to world frame.

Parameters
e- rotation given as Euler angles

◆ setRotation() [3/3]

void agx::ObserverFrame::setRotation ( const agx::OrthoMatrix3x3 &  m)

Set the rotation of the frame relative to world frame.

Parameters
m- rotation given as an orthogonal transformation matrix

◆ setSystem()

void agx::ObserverFrame::setSystem ( agx::DynamicsSystem *  system)
protected

Assign dynamics system which this body belongs to.

Parameters
system- dynamics system which this body belongs to

◆ setTransform()

void agx::ObserverFrame::setTransform ( const agx::AffineMatrix4x4 &  matrix)

This method will set the local matrix of this frame to be the matrix m multiplied with the inverse of the parents matrix: M = m * inv(parent) I.e., assign the final (world) transform of this frame.

Parameters
matrix- final transform for this frame (leads to local transform = matrix * inv(parent))

◆ setUuid()

void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!

◆ store()

virtual void agx::ObserverFrame::store ( agxStream::OutputArchive &  out) const
overridevirtual

◆ transformPointToLocal()

agx::Vec3 agx::ObserverFrame::transformPointToLocal ( const agx::Vec3 &  pointWorld) const

◆ transformPointToWorld()

agx::Vec3 agx::ObserverFrame::transformPointToWorld ( const agx::Vec3 &  pointLocal) const

◆ transformVectorToLocal()

agx::Vec3 agx::ObserverFrame::transformVectorToLocal ( const agx::Vec3 &  vectorWorld) const

◆ transformVectorToWorld()

agx::Vec3 agx::ObserverFrame::transformVectorToWorld ( const agx::Vec3 &  vectorLocal) const

Wrapper functions for Frame.

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


The documentation for this class was generated from the following file: