23# pragma warning( push )
24# pragma warning( disable : 4251 )
25# pragma warning(disable: 6385)
31 class ConstraintImplementation;
174 const T* safeAs()
const;
487 void setEnableAttachmentProjections(
bool enable );
492 bool getEnableAttachmentProjections() const;
502 ATTACHMENT_PROJECTIONS_ENABLAD = 1 << 0,
504 using Flags = BitState<Flag, std::underlying_type_t<Flag>>;
530 return dynamic_cast<const T*
>( this ) !=
nullptr;
547 agxAssert( (
void *)
this ==
nullptr || this->is<T>() );
548 return static_cast<T*
>( this );
555 return dynamic_cast<T*
>( this );
566 agxAssert( (
void *)
this ==
nullptr || this->is<T>() );
return static_cast<const T*
>( this );
573 return dynamic_cast<const T*
>( this );
604#pragma warning( pop )
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Abstract base class for storing/restoring a line/drums with version control.
Custom data for separation pair.
virtual void transform(const agx::AttachmentPair &attachmentPair)=0
Called after the other attachments have been transformed.
virtual ~CustomData()
Reference counted object, protected destructor.
Constraint attachment pair class.
AttachmentPair()
Default constructor, attachment frame 1 = attachment frame 2 = 0.
virtual void transform()
Transform attachment frames and updates data.
void setCustomData(agx::AttachmentPair::CustomData *customData)
Assign custom data to receive transform calls.
virtual void restoreLightData(agxStream::StorageStream &str)
Restore structural independent data from stream.
virtual void onPreSolve(agx::Real dt, const agx::ConstraintImplementation &context)
Pre solvers, position/orientation dependent variables (used in Jacobians) should be updated.
agx::Attachment * getAttachment2() const
virtual void store(agxStream::OutputArchive &out) const
Store given stream.
void add(agx::Angle *angle)
Add constraint angle.
agx::Attachment * operator[](agx::UInt i) const
agx::Attachment * getAttachment1() const
virtual agx::Bool rebind()
Rebind given first frame.
agx::AttachmentPair::CustomData * getCustomData() const
virtual void storeLightData(agxStream::StorageStream &str) const
Store structural independent data to stream.
Transformed
Data access enum.
@ SEPARATION
Separation vector, i.e., the vector from frame 2 to frame 1.
const agx::Vec3 & get(agx::AttachmentPair::Transformed entry) const
agx::Real calculateLinearSpeed() const
Calculates the linear speed between the two attachments, along the constraint axis.
agx::ref_ptr< CustomData > CustomDataRef
agx::Angle * getAngle(agx::UInt index) const
Access constraint angle given index.
virtual void restore(agxStream::InputArchive &in)
Restore given stream.
const agx::AngleContainer & getAngles() const
agx::Real calculateAngularSpeed() const
Calculates the rotational/angular speed between the two attachments, about the constraint axis.
virtual ~AttachmentPair()
Destructor.
virtual void onPostSolve(agx::Real dt, const agx::ConstraintImplementation &context)
Post solvers, velocity dependent variables should be updated.
agx::Bool hasAngle(const agx::Angle *angle) const
AttachmentRef m_attachments[2]
CustomDataRef m_customData
void set(agx::Attachment *a1, agx::Attachment *a2)
Assign constraint attachment frames.
agx::Vec3 m_transformed[NUM_ELEMENTS]
Constraint attachment base class for any type of frame.
static void createAttachmentBase(const agx::Vec3d &N, agx::Vec3d &U, agx::Vec3d &V)
Given vector N, create orthonormal base.
virtual agx::Bool valid() const
Transformed
Data access enum.
@ ANCHOR_POS
Constraint attachment world position.
@ V
Constraint attachment y-axis.
@ U
Constraint attachment x-axis.
@ N
Constraint attachment z-axis.
@ CM_TO_ANCHOR_POS
Vector from center of mass (if moving) to anchor point given in world frame.
agx::Frame * getFrame() const
virtual ~Attachment()
Reference counted object, protected destructor.
const agx::Vec3 & get(agx::Attachment::Transformed entry) const
T * safeAs()
Dynamic cast of this to T.
virtual agx::Vec3 getLinearVelocity() const
agx::Vec3 m_transformed[NUM_ELEMENTS]
static void createAttachmentBase(const agx::Vec3f &N, agx::Vec3f &U, agx::Vec3f &V)
virtual agx::Vec3 getAngularVelocity() const
virtual agx::Real calculateLinearDistance(const agx::Attachment *other) const
Attachment(agx::Frame *relFrame)
Construct given frame.
T * as()
Unsafe version, static cast of this to T.
Attachment()
Constructor to use during restore.
agx::Vec3 getLocal(agx::Attachment::Transformed entry) const
virtual agx::Real calculateLinearSpeed(const agx::Attachment *other) const
virtual agx::Real calculateDistance(const agx::Attachment *other) const
void setFrame(agx::Frame *frame)
Assign a new frame - transformed data will be updated.
virtual void transform()
Subclass - implement this method!
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 fr...
virtual agx::Bool objectDeleted() const
virtual agx::Real calculateAngularSpeed(const agx::Attachment *other) const
The object defining a frame of reference and providing transformations operations.
Base class providing referencing counted objects.
Constraint attachment class for agx::RigidBody.
RigidBodyAttachment()
Protected default constructor used by restore.
virtual agx::Bool objectDeleted() const override
virtual agx::Vec3 getAngularVelocity() const override
agx::RigidBodyObserver m_rb
virtual agx::Real calculateDistance(const agx::Attachment *other) const override
virtual agx::Vec3 getLinearVelocity() const override
virtual agx::Real calculateAngularSpeed(const agx::Attachment *other) const override
virtual ~RigidBodyAttachment()
Reference counted object, protected destructor.
virtual agx::Bool valid() const override
virtual agx::Real calculateLinearSpeed(const agx::Attachment *other) const override
agx::RigidBody * getRigidBody() const
virtual agx::Real calculateLinearDistance(const agx::Attachment *other) const override
virtual void transform() override
Transform given rigid body and frame.
void setRigidBody(agx::RigidBody *rb)
Assign rigid body to this constraint frame.
RigidBodyAttachment(agx::RigidBody *rb, agx::Frame *relFrame)
Construct given rigid body and relative frame.
The rigid body class, combining a geometric model and a frame of reference.
A class holding 3 dimensional vectors and providing basic arithmetic.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< Attachment > AttachmentRef
agx::ref_ptr< RigidBodyAttachment > RigidBodyAttachmentRef
BitState< Flag, std::underlying_type_t< Flag > > Flags