17 #ifndef AGX_ELEMENTARYCONSTRAINTDATA_H
18 #define AGX_ELEMENTARYCONSTRAINTDATA_H
23 # pragma warning(push)
24 # pragma warning(disable: 6011)
512 return getAttachment( 0 )->get( m_dir1U );
520 return getAttachment( 0 )->get( m_dir1V );
528 return getAttachment( 0 )->get( m_dir1N );
536 return getAttachment( 1 )->get( m_dir2N );
629 return getAttachment( 0 )->get( m_dir1 );
637 return getAttachment( 1 )->get( m_dir2 );
649 # pragma warning(pop)
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
virtual const agx::Vec3 & getDir(const agx::AttachmentPair &ap, agx::UInt index) const
Custom data for separation pair.
Constraint attachment pair class.
@ SEPARATION
Separation vector, i.e., the vector from frame 2 to frame 1.
Constraint attachment base class for any type of frame.
Transformed
Data access enum.
@ ANCHOR_POS
Constraint attachment world position.
@ CM_TO_ANCHOR_POS
Vector from center of mass (if moving) to anchor point given in world frame.
Basic data holder class for "angle based" (secondary) constraints.
const agx::Vec3 & getDir1() const
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
virtual ~ConstraintAngleBasedData()
Destructor.
const agx::Angle * getAngle() const
agx::ref_ptr< const agx::Angle > AngleRefType
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
const agx::Vec3 & getDir2() const
ConstraintAngleBasedData(const agx::AttachmentPair *ap, const agx::Angle *angle)
Construct given constraint attachment pair and the input angle for the elementary constraint to work ...
ConstraintAngleBasedData()
Default constructor used during restore of this object.
Data holder class for elementary constraint Dot1.
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
const agx::Vec3 & getDir2() const
agx::Attachment::Transformed m_dir2
virtual ~Dot1Data()
Destructor.
const agx::Vec3 & getDir1() const
agx::Attachment::Transformed m_dir1
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
Dot1Data(const agx::AttachmentPair *ap, agx::Attachment::Transformed dir1, agx::Attachment::Transformed dir2)
Construct given attachment pair and the two directions that should be orthogonal.
Dot1Data()
Default constructor used during restore of this object.
Extended Dot1Data with additional slack parameter.
void setSlack(agx::Real slack)
Set amount of slack in constraint.
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
Dot1SlackData(const agx::AttachmentPair *ap, agx::Attachment::Transformed dir1, agx::Attachment::Transformed dir2)
agx::Real getSlack() const
Dot1SlackData()
Default constructor.
Data holder class for elementary constraint Dot2.
Dot2Data()
Default constructor used during restore of this object.
virtual ~Dot2Data()
Destructor.
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
virtual agx::Int getReferenceBody() const
Dot2Data(const agx::AttachmentPair *ap, agx::Attachment::Transformed dir, agx::Int body=0)
Construct given constraint attachment pair and direction to be orthogonal to the separation vector.
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
const agx::Vec3 & getDir() const
agx::Attachment::Transformed m_dir
Data holder class for elementary constraint Dot2Slack.
void setSlack(agx::Real slack)
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
Dot2SlackData()
Default constructor used during restore of this object.
agx::Real getSlack() const
Dot2SlackData(const agx::AttachmentPair *ap, agx::Attachment::Transformed dir)
Construct given constraint attachment pair and direction to be orthogonal to the separation vector.
virtual ~Dot2SlackData()
Destructor.
Class to hold data for elementary constraints.
ElementaryConstraintData()
Used during serialization restore.
virtual ~ElementaryConstraintData()
Destructor.
const agx::AttachmentPair * getAttachmentPair() const
virtual void restore(agxStream::InputArchive &in)
Restore from stream.
const agx::Vec3 & getSeparation() const
const agx::AttachmentPair * m_ap
ElementaryConstraintData(const agx::AttachmentPair *ap)
Construct given attachment pair.
const agx::Vec3 & getWorldToAnchorPosition(agx::UInt index) const
const agx::Attachment * getAttachment(agx::UInt index) const
virtual void store(agxStream::OutputArchive &out) const
Store to stream.
virtual void set(const agx::AttachmentPair *ap)
Assign new attachment pair.
const agx::Vec3 & getCmToAnchorPosition(agx::UInt index) const
Data holder class for elementary constraint QuatLock.
virtual ~QuatLockData()
Destructor.
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
void set(const agx::AttachmentPair *ap) override
Associate attachment pair to this object, for this object to register QuatTransformer as attachment p...
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
QuatTransformerRef m_qTransformer
agx::ref_ptr< QuatTransformer > QuatTransformerRef
QuatLockData()
Default constructor used during restore of this object.
QuatLockData(const agx::AttachmentPair *ap)
Construct given attachment pair.
Generic class for holding constraint data including 3 slack parameters.
void setSlack(agx::Vec3 slack)
const agx::Vec3 getSlack() const
virtual ~Slack3ConstraintData()
virtual void restore(agxStream::InputArchive &in) override
Restore from stream.
Slack3ConstraintData(const agx::AttachmentPair *ap)
virtual void store(agxStream::OutputArchive &out) const override
Store to stream.
Data holder class for elementary swing constraint.
agx::Vec3 getSwingAxis() const
virtual ~SwingData()
Destructor.
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
agx::Attachment::Transformed m_dir1U
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
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.
SwingData()
Default constructor used during restore of this object.
agx::Real getSwingAngle() const
agx::Attachment::Transformed m_dir2N
const agx::Vec3 & getDir2N() const
agx::Attachment::Transformed m_dir1N
const agx::Vec3 & getDir1U() const
agx::Attachment::Transformed m_dir1V
const agx::Vec3 & getDir1V() const
const agx::Vec3 & getDir1N() const
Data holder class for elementary constraint Twist.
TwistData()
Default constructor used during restore of this object.
virtual void restore(agxStream::InputArchive &in) override
Restore data from stream.
virtual void store(agxStream::OutputArchive &out) const override
Store data to stream.
agx::Attachment::Transformed m_dir2
agx::Attachment::Transformed m_dir1
TwistData(const agx::AttachmentPair *ap, agx::Attachment::Transformed dir1, agx::Attachment::Transformed dir2)
Construct given attachment pair.
const agx::Vec3 & getDir1() const
const agx::Vec3 & getDir2() const
virtual ~TwistData()
Destructor.
Vec3T getPerpendicularUnitVector() const
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal
T1 clamp(T1 v, T2 minimum, T3 maximum)