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

Constraint attachment pair class. More...

#include <Attachment.h>

Classes

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

Public Types

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

Public Member Functions

 AttachmentPair ()
 Default constructor, attachment frame 1 = attachment frame 2 = 0.
 
virtual ~AttachmentPair ()
 Destructor.
 
void add (agx::Angle *angle)
 Add constraint angle.
 
agx::Real calculateAngularSpeed () const
 Calculates the rotational/angular speed between the two attachments, about the constraint axis.
 
agx::Real calculateLinearSpeed () const
 Calculates the linear speed between the two attachments, along the constraint axis.
 
const agx::Vec3get (agx::AttachmentPair::Transformed entry) const
 
agx::AnglegetAngle (agx::UInt index) const
 Access constraint angle given index.
 
const agx::AngleContainergetAngles () const
 
agx::AttachmentgetAttachment1 () const
 
agx::AttachmentgetAttachment2 () const
 
agx::AttachmentPair::CustomDatagetCustomData () const
 
agx::Bool hasAngle (const agx::Angle *angle) const
 
virtual void onPostSolve (agx::Real dt, const agx::ConstraintImplementation &context)
 Post solvers, velocity dependent variables should be updated.
 
virtual void onPreSolve (agx::Real dt, const agx::ConstraintImplementation &context)
 Pre solvers, position/orientation dependent variables (used in Jacobians) should be updated.
 
agx::Attachmentoperator[] (agx::UInt i) const
 
virtual agx::Bool rebind ()
 Rebind given first frame.
 
virtual void restore (agxStream::InputArchive &in)
 Restore given stream.
 
virtual void restoreLightData (agxStream::StorageStream &str)
 Restore structural independent data from stream.
 
void set (agx::Attachment *a1, agx::Attachment *a2)
 Assign constraint attachment frames.
 
void setCustomData (agx::AttachmentPair::CustomData *customData)
 Assign custom data to receive transform calls.
 
virtual void store (agxStream::OutputArchive &out) const
 Store given stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const
 Store structural independent data to stream.
 
virtual void transform ()
 Transform attachment frames and updates data.
 
agx::Bool valid () const
 

Protected Attributes

AngleContainer m_angles
 
AttachmentRef m_attachments [2]
 
CustomDataRef m_customData
 
InternalState m_state
 
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 301 of file agx/Attachment.h.

Member Typedef Documentation

◆ CustomDataRef

Member Enumeration Documentation

◆ Transformed

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 307 of file agx/Attachment.h.

Constructor & Destructor Documentation

◆ AttachmentPair()

agx::AttachmentPair::AttachmentPair ( )

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

◆ ~AttachmentPair()

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

Destructor.

Member Function Documentation

◆ add()

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

Add constraint angle.

Parameters
angle- constraint angle to add

◆ calculateAngularSpeed()

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

◆ calculateLinearSpeed()

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

◆ get()

const Vec3 & agx::AttachmentPair::get ( agx::AttachmentPair::Transformed  entry) const
Returns
transformed data

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

References m_transformed.

◆ getAngle()

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)

◆ getAngles()

const agx::AngleContainer & agx::AttachmentPair::getAngles ( ) const
Returns
constraint angle container

◆ getAttachment1()

Attachment * agx::AttachmentPair::getAttachment1 ( ) const
inline
Returns
first attachment in this attachment pair

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

◆ getAttachment2()

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

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

◆ getCustomData()

agx::AttachmentPair::CustomData * agx::AttachmentPair::getCustomData ( ) const
Returns
custom data if assigned

◆ hasAngle()

agx::Bool agx::AttachmentPair::hasAngle ( const agx::Angle angle) const
Returns
true if angle exist in this attachment pair

◆ onPostSolve()

virtual void agx::AttachmentPair::onPostSolve ( agx::Real  dt,
const agx::ConstraintImplementation context 
)
virtual

Post solvers, velocity dependent variables should be updated.

Parameters
dt- time step size
context- constraint this attachment pair belongs to

◆ onPreSolve()

virtual void agx::AttachmentPair::onPreSolve ( agx::Real  dt,
const agx::ConstraintImplementation context 
)
virtual

Pre solvers, position/orientation dependent variables (used in Jacobians) should be updated.

Parameters
dt- time step size
context- constraint this attachment pair belongs to

◆ operator[]()

Attachment * agx::AttachmentPair::operator[] ( agx::UInt  i) const
Returns
the attachment of index i (0 or 1!)

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

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

◆ rebind()

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

Rebind given first frame.

◆ restore()

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

Restore given stream.

◆ restoreLightData()

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

Restore structural independent data from stream.

◆ set()

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

Assign constraint attachment frames.

Parameters
a1- first attachment frame
a2- second attachment frame

◆ setCustomData()

void agx::AttachmentPair::setCustomData ( agx::AttachmentPair::CustomData customData)

Assign custom data to receive transform calls.

Parameters
customData- user defined custom data

◆ store()

virtual void agx::AttachmentPair::store ( agxStream::OutputArchive out) const
virtual

Store given stream.

◆ storeLightData()

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

Store structural independent data to stream.

◆ transform()

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

Transform attachment frames and updates data.

◆ valid()

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

Member Data Documentation

◆ m_angles

AngleContainer agx::AttachmentPair::m_angles
protected

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

◆ m_attachments

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

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

Referenced by operator[]().

◆ m_customData

CustomDataRef agx::AttachmentPair::m_customData
protected

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

◆ m_state

InternalState agx::AttachmentPair::m_state
protected

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

◆ m_transformed

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

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

Referenced by get().


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