AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
agx::RigidBodyAttachment Class Reference

Constraint attachment class for agx::RigidBody. More...

#include <Attachment.h>

+ Inheritance diagram for agx::RigidBodyAttachment:

Public Member Functions

 RigidBodyAttachment (agx::RigidBody *rb, agx::Frame *relFrame)
 Construct given rigid body and relative frame.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agx::RigidBodyAttachment)
 
virtual agx::Real calculateAngularSpeed (const agx::Attachment *other) const override
 
virtual agx::Real calculateDistance (const agx::Attachment *other) const override
 
virtual agx::Real calculateLinearDistance (const agx::Attachment *other) const override
 
virtual agx::Real calculateLinearSpeed (const agx::Attachment *other) const override
 
virtual agx::Vec3 getAngularVelocity () const override
 
virtual agx::Vec3 getLinearVelocity () const override
 
agx::RigidBodygetRigidBody () const
 
virtual agx::Bool objectDeleted () const override
 
void setRigidBody (agx::RigidBody *rb)
 Assign rigid body to this constraint frame.
 
virtual void transform () override
 Transform given rigid body and frame.
 
virtual agx::Bool valid () const override
 
- Public Member Functions inherited from agx::Attachment
 Attachment (agx::Frame *relFrame)
 Construct given frame.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agx::Attachment)
 
template<typename T >
T * as ()
 Unsafe version, static cast of this to T.
 
template<typename T >
const T * as () const
 Unsafe version, static cast of this to T.
 
virtual agx::Real calculateAngularSpeed (const agx::Attachment *other) const
 
virtual agx::Real calculateDistance (const agx::Attachment *other) const
 
virtual agx::Real calculateLinearDistance (const agx::Attachment *other) const
 
virtual agx::Real calculateLinearSpeed (const agx::Attachment *other) const
 
const agx::Vec3get (agx::Attachment::Transformed entry) const
 
virtual agx::Vec3 getAngularVelocity () const
 
agx::FramegetFrame () const
 
virtual agx::Vec3 getLinearVelocity () const
 
agx::Vec3 getLocal (agx::Attachment::Transformed entry) const
 
template<typename T >
agx::Bool is () const
 
template<typename T >
Bool is () const
 
template<>
Bool is () const
 
virtual agx::Bool objectDeleted () const
 
template<typename T >
T * safeAs ()
 Dynamic cast of this to T.
 
template<typename T >
const T * safeAs () const
 Dynamic cast of this to T.
 
void setFrame (agx::Frame *frame)
 Assign a new frame - transformed data will be updated.
 
virtual void transform ()
 Subclass - implement this method!
 
virtual agx::Bool valid () const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializablecreate (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agx::Attachment
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static void createAttachmentBase (const agx::Vec3d &N, agx::Vec3d &U, agx::Vec3d &V)
 Given vector N, create orthonormal base.
 
static void createAttachmentBase (const agx::Vec3f &N, agx::Vec3f &U, agx::Vec3f &V)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 RigidBodyAttachment ()
 Protected default constructor used by restore.
 
virtual ~RigidBodyAttachment ()
 Reference counted object, protected destructor.
 
- Protected Member Functions inherited from agx::Attachment
 Attachment ()
 Constructor to use during restore.
 
virtual ~Attachment ()
 Reference counted object, protected destructor.
 
void transform (const agx::AffineMatrix4x4 &cmTransform, const agx::Vec3 &cmToModel, const agx::AffineMatrix4x4 &localConstraintTransform)
 Fill Transformed data given center of mass transform and offset from model frame to center of mass frame (assumes not rotated relative each other).
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

agx::Bool m_hadValidRb
 
agx::RigidBodyObserver m_rb
 
- Protected Attributes inherited from agx::Attachment
agx::FrameRef m_relFrame
 
agx::Vec3 m_transformed [NUM_ELEMENTS]
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agx::Attachment
enum  Transformed {
  U , V , N , ANCHOR_POS ,
  CM_TO_ANCHOR_POS , NUM_ELEMENTS
}
 Data access enum. More...
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Constraint attachment class for agx::RigidBody.

Definition at line 208 of file agx/Attachment.h.

Constructor & Destructor Documentation

◆ RigidBodyAttachment() [1/2]

agx::RigidBodyAttachment::RigidBodyAttachment ( agx::RigidBody rb,
agx::Frame relFrame 
)

Construct given rigid body and relative frame.

Parameters
rb- rigid body (0 if e.g., world frame or other type of static frame)
relFrame- constraint attachment frame relative rb model frame

◆ RigidBodyAttachment() [2/2]

agx::RigidBodyAttachment::RigidBodyAttachment ( )
protected

Protected default constructor used by restore.

◆ ~RigidBodyAttachment()

virtual agx::RigidBodyAttachment::~RigidBodyAttachment ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agx::RigidBodyAttachment::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agx::RigidBodyAttachment  )

◆ calculateAngularSpeed()

virtual agx::Real agx::RigidBodyAttachment::calculateAngularSpeed ( const agx::Attachment other) const
overridevirtual
Returns
relative speed about world z-axis of this attachment

Reimplemented from agx::Attachment.

◆ calculateDistance()

virtual agx::Real agx::RigidBodyAttachment::calculateDistance ( const agx::Attachment other) const
overridevirtual
Returns
the distance between this and the other attachment
See also
calculateLinearDistance

Reimplemented from agx::Attachment.

◆ calculateLinearDistance()

virtual agx::Real agx::RigidBodyAttachment::calculateLinearDistance ( const agx::Attachment other) const
overridevirtual
Returns
the projected (along this attachments world z-axis) distance between this and the other attachment

Reimplemented from agx::Attachment.

◆ calculateLinearSpeed()

virtual agx::Real agx::RigidBodyAttachment::calculateLinearSpeed ( const agx::Attachment other) const
overridevirtual
Returns
relative speed along world z-axis of this attachment

Reimplemented from agx::Attachment.

◆ create()

static agxStream::Serializable * agx::RigidBodyAttachment::create ( agxStream::InputArchive )
inlinestatic

Definition at line 276 of file agx/Attachment.h.

◆ getAngularVelocity()

virtual agx::Vec3 agx::RigidBodyAttachment::getAngularVelocity ( ) const
overridevirtual
Returns
linear velocity of this attachment given in world frame

Reimplemented from agx::Attachment.

◆ getLinearVelocity()

virtual agx::Vec3 agx::RigidBodyAttachment::getLinearVelocity ( ) const
overridevirtual
Returns
linear velocity of this attachment given in world frame

Reimplemented from agx::Attachment.

◆ getRigidBody()

RigidBody * agx::RigidBodyAttachment::getRigidBody ( ) const
Returns
the rigid body

Definition at line 576 of file agx/Attachment.h.

References m_rb.

◆ objectDeleted()

virtual agx::Bool agx::RigidBodyAttachment::objectDeleted ( ) const
overridevirtual
Returns
true if the rigid body or the frame has been deleted

Reimplemented from agx::Attachment.

◆ setRigidBody()

void agx::RigidBodyAttachment::setRigidBody ( agx::RigidBody rb)

Assign rigid body to this constraint frame.

Note
The actual constraint will not know about this change unless it's handled explicitly.
Parameters
rb- new rigid body

◆ transform()

virtual void agx::RigidBodyAttachment::transform ( )
overridevirtual

Transform given rigid body and frame.

Reimplemented from agx::Attachment.

◆ valid()

virtual agx::Bool agx::RigidBodyAttachment::valid ( ) const
overridevirtual
Returns
true if the current configuration is valid

Reimplemented from agx::Attachment.

Member Data Documentation

◆ m_hadValidRb

agx::Bool agx::RigidBodyAttachment::m_hadValidRb
protected

Definition at line 291 of file agx/Attachment.h.

◆ m_rb

agx::RigidBodyObserver agx::RigidBodyAttachment::m_rb
protected

Definition at line 290 of file agx/Attachment.h.

Referenced by getRigidBody().


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