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

Constraint attachment pair class. More...

#include <Attachment.h>

Classes

class  CustomData
 Custom data for separation pair. More...
 

Public Types

typedef agx::ref_ptr< CustomData > CustomDataRef
 
enum  Transformed { SEPARATION, NUM_ELEMENTS }
 Data access enum. More...
 

Public Member Functions

 AttachmentPair ()
 Default constructor, attachment frame 1 = attachment frame 2 = 0. More...
 
virtual ~AttachmentPair ()
 Destructor. More...
 
void add (agx::Angle *angle)
 Add constraint angle. More...
 
agx::Real calculateAngularSpeed () const
 Calculates the rotational/angular speed between the two attachments, about the constraint axis. More...
 
agx::Real calculateLinearSpeed () const
 Calculates the linear speed between the two attachments, along the constraint axis. More...
 
const agx::Vec3 & get (agx::AttachmentPair::Transformed entry) const
 
agx::Angle * getAngle (agx::UInt index) const
 Access constraint angle given index. More...
 
const agx::AngleContainer & getAngles () const
 
agx::Attachment * getAttachment1 () const
 
agx::Attachment * getAttachment2 () const
 
agx::AttachmentPair::CustomData * getCustomData () const
 
agx::Bool hasAngle (const agx::Angle *angle) const
 
agx::Attachment * operator[] (agx::UInt i) const
 
virtual agx::Bool rebind ()
 Rebind given first frame. More...
 
virtual void restore (agxStream::InputArchive &in)
 Restore given stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str)
 Restore structural independent data from stream. More...
 
void set (agx::Attachment *a1, agx::Attachment *a2)
 Assign constraint attachment frames. More...
 
void setCustomData (agx::AttachmentPair::CustomData *customData)
 Assign custom data to receive transform calls. More...
 
virtual void store (agxStream::OutputArchive &out) const
 Store given stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const
 Store structural independent data to stream. More...
 
virtual void transform ()
 Transform attachment frames and updates data. More...
 
agx::Bool valid () const
 

Protected Attributes

AngleContainer m_angles
 
AttachmentRef m_attachments [2]
 
CustomDataRef m_customData
 
agx::Vec3 m_transformed [NUM_ELEMENTS]
 

Detailed Description

Constraint attachment pair class.

Data holder for a pair of constraint attachments (i.e., what defines the difference between the frames that is used in constraints).

Definition at line 300 of file Attachment.h.

Member Typedef Documentation

Member Enumeration Documentation

Data access enum.

Enumerator
SEPARATION 

Separation vector, i.e., the vector from frame 2 to frame 1.

NUM_ELEMENTS 

Number of data elements.

Definition at line 306 of file Attachment.h.

Constructor & Destructor Documentation

agx::AttachmentPair::AttachmentPair ( )

Default constructor, attachment frame 1 = attachment frame 2 = 0.

virtual agx::AttachmentPair::~AttachmentPair ( )
virtual

Destructor.

Member Function Documentation

void agx::AttachmentPair::add ( agx::Angle *  angle)

Add constraint angle.

Parameters
angle- constraint angle to add
agx::Real agx::AttachmentPair::calculateAngularSpeed ( ) const

Calculates the rotational/angular speed between the two attachments, about the constraint axis.

Returns
rotational speed about the constraint axis
agx::Real agx::AttachmentPair::calculateLinearSpeed ( ) const

Calculates the linear speed between the two attachments, along the constraint axis.

Returns
linear speed along the constraint axis
const Vec3 & agx::AttachmentPair::get ( agx::AttachmentPair::Transformed  entry) const
Returns
transformed data

Definition at line 543 of file Attachment.h.

References m_transformed.

agx::Angle* agx::AttachmentPair::getAngle ( agx::UInt  index) const

Access constraint angle given index.

Parameters
index- index of angle
Returns
constraint angle at index (0 if index is out of bounds)
const agx::AngleContainer& agx::AttachmentPair::getAngles ( ) const
Returns
constraint angle container
Attachment * agx::AttachmentPair::getAttachment1 ( ) const
inline
Returns
first attachment in this attachment pair

Definition at line 533 of file Attachment.h.

Attachment * agx::AttachmentPair::getAttachment2 ( ) const
inline
Returns
second attachment in this attachment pair

Definition at line 538 of file Attachment.h.

agx::AttachmentPair::CustomData* agx::AttachmentPair::getCustomData ( ) const
Returns
custom data if assigned
agx::Bool agx::AttachmentPair::hasAngle ( const agx::Angle *  angle) const
Returns
true if angle exist in this attachment pair
Attachment * agx::AttachmentPair::operator[] ( agx::UInt  i) const
Returns
the attachment of index i (0 or 1!)

Definition at line 527 of file Attachment.h.

References agxAssert, agx::ref_ptr< T >::get(), and m_attachments.

virtual agx::Bool agx::AttachmentPair::rebind ( )
virtual

Rebind given first frame.

virtual void agx::AttachmentPair::restore ( agxStream::InputArchive &  in)
virtual

Restore given stream.

virtual void agx::AttachmentPair::restoreLightData ( agxStream::StorageStream &  str)
virtual

Restore structural independent data from stream.

void agx::AttachmentPair::set ( agx::Attachment *  a1,
agx::Attachment *  a2 
)

Assign constraint attachment frames.

Parameters
a1- first attachment frame
a2- second attachment frame
void agx::AttachmentPair::setCustomData ( agx::AttachmentPair::CustomData *  customData)

Assign custom data to receive transform calls.

Parameters
customData- user defined custom data
virtual void agx::AttachmentPair::store ( agxStream::OutputArchive &  out) const
virtual

Store given stream.

virtual void agx::AttachmentPair::storeLightData ( agxStream::StorageStream &  str) const
virtual

Store structural independent data to stream.

virtual void agx::AttachmentPair::transform ( )
virtual

Transform attachment frames and updates data.

agx::Bool agx::AttachmentPair::valid ( ) const
Returns
true if the current state is valid

Member Data Documentation

AngleContainer agx::AttachmentPair::m_angles
protected

Definition at line 460 of file Attachment.h.

AttachmentRef agx::AttachmentPair::m_attachments[2]
protected

Definition at line 457 of file Attachment.h.

Referenced by operator[]().

CustomDataRef agx::AttachmentPair::m_customData
protected

Definition at line 459 of file Attachment.h.

agx::Vec3 agx::AttachmentPair::m_transformed[NUM_ELEMENTS]
protected

Definition at line 458 of file Attachment.h.

Referenced by get().


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