|
AGX Dynamics 2.41.3.0
|
Constraint attachment base class for any type of frame. More...
#include <Attachment.h>
Inheritance diagram for agx::Attachment:Public Types | |
| enum | Transformed { U , V , N , ANCHOR_POS , CM_TO_ANCHOR_POS , NUM_ELEMENTS } |
| Data access enum. More... | |
Public Member Functions | |
| 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::Vec3 & | get (agx::Attachment::Transformed entry) const |
| virtual agx::Vec3 | getAngularVelocity () const |
| agx::Frame * | getFrame () 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. | |
| Referenced & | operator= (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::Serializable * | create (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 | |
| 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::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 | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Constraint attachment base class for any type of frame.
Subclass for moving frames (e.g., rigid bodies).
Definition at line 37 of file agx/Attachment.h.
Data access enum.
| Enumerator | |
|---|---|
| U | Constraint attachment x-axis. |
| V | Constraint attachment y-axis. |
| N | Constraint attachment z-axis. |
| ANCHOR_POS | Constraint attachment world position. |
| CM_TO_ANCHOR_POS | Vector from center of mass (if moving) to anchor point given in world frame. |
| NUM_ELEMENTS | Number of data elements. |
Definition at line 43 of file agx/Attachment.h.
| agx::Attachment::Attachment | ( | agx::Frame * | relFrame | ) |
Construct given frame.
| relFrame | - that transforms from center to anchor point. |
|
protected |
Constructor to use during restore.
|
protectedvirtual |
Reference counted object, protected destructor.
| agx::Attachment::AGXSTREAM_DECLARE_SERIALIZABLE_BASE | ( | agx::Attachment | ) |
| T * agx::Attachment::as |
Unsafe version, static cast of this to T.
Definition at line 540 of file agx/Attachment.h.
References agxAssert.
| const T * agx::Attachment::as |
Unsafe version, static cast of this to T.
Definition at line 559 of file agx/Attachment.h.
References agxAssert.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
virtual |
| other | - The other attachment |
Reimplemented in agx::RigidBodyAttachment.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
inlinestatic |
Definition at line 176 of file agx/Attachment.h.
|
static |
Given vector N, create orthonormal base.
| N | - in vector (a.k.a. z axis) |
| U | - out vector (a.k.a. x axis) |
| V | - out vector (a.k.a. y axis) |
Referenced by agx::OrientedFrictionModelImpl< T >::calculateTangentPlane().
|
static |
| const Vec3 & agx::Attachment::get | ( | agx::Attachment::Transformed | entry | ) | const |
Definition at line 517 of file agx/Attachment.h.
References m_transformed.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
| Frame * agx::Attachment::getFrame | ( | ) | const |
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
| agx::Vec3 agx::Attachment::getLocal | ( | agx::Attachment::Transformed | entry | ) | const |
| agx::Bool agx::Attachment::is | ( | ) | const |
T | Bool agx::Attachment::is | ( | ) | const |
Definition at line 528 of file agx/Attachment.h.
| Bool agx::Attachment::is | ( | ) | const |
Definition at line 534 of file agx/Attachment.h.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
| T * agx::Attachment::safeAs |
Dynamic cast of this to T.
Definition at line 553 of file agx/Attachment.h.
| const T * agx::Attachment::safeAs |
Dynamic cast of this to T.
Definition at line 571 of file agx/Attachment.h.
| void agx::Attachment::setFrame | ( | agx::Frame * | frame | ) |
Assign a new frame - transformed data will be updated.
| frame | - new frame |
|
virtual |
Subclass - implement this method!
Default this method will copy data from relative frame to transformed data.
Reimplemented in agx::RigidBodyAttachment.
|
protected |
Fill Transformed data given center of mass transform and offset from model frame to center of mass frame (assumes not rotated relative each other).
| cmTransform | - world transform of the center of mass frame |
| cmToModel | - in local coordinates, vector from center of mass frame to model frame |
| localConstraintTransform | - transform of the local constraint frame |
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
protected |
Definition at line 200 of file agx/Attachment.h.
Referenced by getFrame().
|
protected |
Definition at line 199 of file agx/Attachment.h.
Referenced by get().