|
AGXDynamics
2.31.1.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. More... | |
| template<typename T > | |
| T * | as () |
Unsafe version, static cast of this to T. More... | |
| template<typename T > | |
| const T * | as () const |
Unsafe version, static cast of this to T. More... | |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| 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 |
| const char * | getClassName () const override |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::Frame * | getFrame () const |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| virtual agx::Vec3 | getLinearVelocity () const |
| agx::Vec3 | getLocal (agx::Attachment::Transformed entry) const |
| int | getReferenceCount () const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| agx::Uuid | getUuid () const |
| template<typename T > | |
| agx::Bool | is () const |
| template<typename T > | |
| Bool | is () const |
| template<> | |
| Bool | is () const |
| bool | isFinished () const |
| virtual agx::Bool | objectDeleted () 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 |
| template<typename T > | |
| T * | safeAs () |
Dynamic cast of this to T. More... | |
| template<typename T > | |
| const T * | safeAs () const |
Dynamic cast of this to T. 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 | setFrame (agx::Frame *frame) |
| Assign a new frame - transformed data will be updated. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| virtual void | store (agxStream::OutputArchive &out) const override |
| virtual void | transform () |
| Subclass - implement this method! 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... | |
| virtual agx::Bool | valid () const |
Static Public Member Functions | |
| static agxStream::Serializable * | create () |
| 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. More... | |
| static void | createAttachmentBase (const agx::Vec3f &N, agx::Vec3f &U, agx::Vec3f &V) |
| 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 | |
| Attachment () | |
| Constructor to use during restore. More... | |
| virtual | ~Attachment () |
| Reference counted object, protected destructor. More... | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| void | generateUuid () |
| 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). 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 |
| agx::FrameRef | m_relFrame |
| agx::Vec3 | m_transformed [NUM_ELEMENTS] |
Constraint attachment base class for any type of frame.
Subclass for moving frames (e.g., rigid bodies).
Definition at line 36 of file 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 42 of file 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.
|
protectedinherited |
| T * agx::Attachment::as | ( | ) |
Unsafe version, static cast of this to T.
Definition at line 486 of file Attachment.h.
References agxAssert.
| const T * agx::Attachment::as | ( | ) | const |
Unsafe version, static cast of this to T.
Definition at line 505 of file Attachment.h.
References agxAssert.
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
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 175 of file Attachment.h.
|
inlinestatic |
Definition at line 175 of file 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< agx::ScaleBoxFrictionModel >::calculateTangentPlane().
|
static |
|
protectedinherited |
|
protectedinherited |
| const Vec3 & agx::Attachment::get | ( | agx::Attachment::Transformed | entry | ) | const |
Definition at line 463 of file Attachment.h.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
inlineoverridevirtual |
Reimplemented from agxStream::Serializable.
Reimplemented in agx::RigidBodyAttachment.
Definition at line 175 of file Attachment.h.
|
inlinestatic |
Definition at line 175 of file Attachment.h.
|
staticprotectedinherited |
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
| Frame * agx::Attachment::getFrame | ( | ) | const |
Definition at line 468 of file Attachment.h.
|
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.
Definition at line 247 of file Serializable.h.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
| agx::Vec3 agx::Attachment::getLocal | ( | agx::Attachment::Transformed | entry | ) | const |
|
inherited |
|
inlineoverridevirtual |
Implements agxStream::Serializable.
Reimplemented in agx::RigidBodyAttachment.
Definition at line 175 of file Attachment.h.
|
inherited |
Definition at line 268 of file Serializable.h.
Referenced by agxSDK::UuidHashCollisionFilter::match().
| agx::Bool agx::Attachment::is | ( | ) | const |
T | Bool agx::Attachment::is | ( | ) | const |
Definition at line 474 of file Attachment.h.
| Bool agx::Attachment::is | ( | ) | const |
Definition at line 480 of file Attachment.h.
|
inherited |
Definition at line 252 of file Serializable.h.
References AGX_FORCE_INLINE.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
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.
|
overridevirtual |
Reimplemented in agx::RigidBodyAttachment.
| T * agx::Attachment::safeAs | ( | ) |
Dynamic cast of this to T.
Definition at line 499 of file Attachment.h.
| const T * agx::Attachment::safeAs | ( | ) | const |
Dynamic cast of this to T.
Definition at line 517 of file Attachment.h.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
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.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
| void agx::Attachment::setFrame | ( | agx::Frame * | frame | ) |
Assign a new frame - transformed data will be updated.
| frame | - new frame |
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!
|
overridevirtual |
Reimplemented in agx::RigidBodyAttachment.
|
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 |
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().
|
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.
|
virtual |
Reimplemented in agx::RigidBodyAttachment.
|
staticinherited |
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 199 of file Attachment.h.
|
protected |
Definition at line 198 of file Attachment.h.