AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::SwingData Class Reference

Data holder class for elementary swing constraint. More...

#include <ElementaryConstraintData.h>

+ Inheritance diagram for agx::SwingData:

Public Member Functions

 SwingData ()
 Default constructor used during restore of this object. More...
 
 SwingData (const agx::AttachmentPair *ap, agx::Attachment::Transformed dir1U, agx::Attachment::Transformed dir1V, agx::Attachment::Transformed dir1N, agx::Attachment::Transformed dir2N)
 Construct given attachment pair and the two directions that should be orthogonal. More...
 
virtual ~SwingData ()
 Destructor. More...
 
const agx::Attachment * getAttachment (agx::UInt index) const
 
const agx::AttachmentPair * getAttachmentPair () const
 
const agx::Vec3 & getCmToAnchorPosition (agx::UInt index) const
 
const agx::Vec3 & getDir1N () const
 
const agx::Vec3 & getDir1U () const
 
const agx::Vec3 & getDir1V () const
 
const agx::Vec3 & getDir2N () const
 
const agx::Vec3 & getSeparation () const
 
agx::Real getSwingAngle () const
 
agx::Vec3 getSwingAxis () const
 
const agx::Vec3 & getWorldToAnchorPosition (agx::UInt index) const
 
virtual void restore (agxStream::InputArchive &in) override
 Restore data from stream. More...
 
virtual void set (const agx::AttachmentPair *ap)
 Assign new attachment pair. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 Store data to stream. More...
 

Protected Attributes

const agx::AttachmentPair * m_ap
 
agx::Attachment::Transformed m_dir1N
 
agx::Attachment::Transformed m_dir1U
 
agx::Attachment::Transformed m_dir1V
 
agx::Attachment::Transformed m_dir2N
 

Detailed Description

Data holder class for elementary swing constraint.

Definition at line 484 of file ElementaryConstraintData.h.

Constructor & Destructor Documentation

agx::SwingData::SwingData ( )

Default constructor used during restore of this object.

Construct given attachment pair and the two directions that should be orthogonal.

Parameters
ap- constraint attachment pair
dir1U- direction reference attachment 1
dir1V- direction reference attachment 1
dir1N- direction reference attachment 1
dir2N- direction reference attachment 2
virtual agx::SwingData::~SwingData ( )
virtual

Destructor.

Member Function Documentation

const agx::Attachment* agx::ElementaryConstraintData::getAttachment ( agx::UInt  index) const
inlineinherited
Parameters
index- index of the attachment (0 or 1)
Returns
the constraint attachment for attachment with index index

Definition at line 67 of file ElementaryConstraintData.h.

References agxAssert.

const agx::AttachmentPair* agx::ElementaryConstraintData::getAttachmentPair ( ) const
inlineinherited
Returns
the attachment pair

Definition at line 61 of file ElementaryConstraintData.h.

References agxAssert.

const agx::Vec3& agx::ElementaryConstraintData::getCmToAnchorPosition ( agx::UInt  index) const
inlineinherited
Returns
the vector going from center of mass to the constraint anchor point given index (0 or 1)

Definition at line 77 of file ElementaryConstraintData.h.

References agxAssert, and agx::Attachment::CM_TO_ANCHOR_POS.

const agx::Vec3& agx::SwingData::getDir1N ( ) const
inline
Returns
direction reference attachment N of frame 1.

Definition at line 526 of file ElementaryConstraintData.h.

const agx::Vec3& agx::SwingData::getDir1U ( ) const
inline
Returns
direction reference attachment U of frame 1.

Definition at line 510 of file ElementaryConstraintData.h.

const agx::Vec3& agx::SwingData::getDir1V ( ) const
inline
Returns
direction reference attachment V of frame 1.

Definition at line 518 of file ElementaryConstraintData.h.

const agx::Vec3& agx::SwingData::getDir2N ( ) const
inline
Returns
direction reference attachment N of frame 2.

Definition at line 534 of file ElementaryConstraintData.h.

const agx::Vec3& agx::ElementaryConstraintData::getSeparation ( ) const
inlineinherited
Returns
the separation vector between the two attachments (att1->pos - att2->pos)

Definition at line 72 of file ElementaryConstraintData.h.

References agxAssert, and agx::AttachmentPair::SEPARATION.

agx::Real agx::SwingData::getSwingAngle ( ) const
inline
Returns
swing angle theta

Definition at line 550 of file ElementaryConstraintData.h.

References agx::clamp().

agx::Vec3 agx::SwingData::getSwingAxis ( ) const
inline
Returns
swing axis

Definition at line 542 of file ElementaryConstraintData.h.

References agx::Vec3T< T >::getPerpendicularUnitVector().

const agx::Vec3& agx::ElementaryConstraintData::getWorldToAnchorPosition ( agx::UInt  index) const
inlineinherited
Returns
the constraint anchor point in world coordinates given index (0 or 1)

Definition at line 82 of file ElementaryConstraintData.h.

References agxAssert, and agx::Attachment::ANCHOR_POS.

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

Restore data from stream.

Reimplemented from agx::ElementaryConstraintData.

virtual void agx::ElementaryConstraintData::set ( const agx::AttachmentPair *  ap)
virtualinherited

Assign new attachment pair.

Parameters
ap- attachment pair

Reimplemented in agx::QuatLockData.

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

Store data to stream.

Reimplemented from agx::ElementaryConstraintData.

Member Data Documentation

const agx::AttachmentPair* agx::ElementaryConstraintData::m_ap
protectedinherited
agx::Attachment::Transformed agx::SwingData::m_dir1N
protected

Definition at line 568 of file ElementaryConstraintData.h.

agx::Attachment::Transformed agx::SwingData::m_dir1U
protected

Definition at line 566 of file ElementaryConstraintData.h.

agx::Attachment::Transformed agx::SwingData::m_dir1V
protected

Definition at line 567 of file ElementaryConstraintData.h.

agx::Attachment::Transformed agx::SwingData::m_dir2N
protected

Definition at line 569 of file ElementaryConstraintData.h.


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