17#ifndef AGXMODEL_DEFORMABLE1DATTACHMENT_H
18#define AGXMODEL_DEFORMABLE1DATTACHMENT_H
29 class Deformable1DNode;
45 ROTATE_TO_NODE_DIRECTION
56 template<
typename T >
66 template<
typename T >
76 template<
typename T >
86 template<
typename T >
183 template<
typename T >
211 return new T( rb1, f1, rb2, f2 );
355 template<
typename T >
361 template<
typename T >
364 return new T( rb, bodyPoint );
367 template<
typename T >
370 return createFromBody< T >( (rb !=
nullptr ? worldTransform * rb->
getTransform().
inverse() : worldTransform), rb );
373 template<
typename T >
376 return new T( rb, bodyTransform );
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Helper class to create give type of constraint for the different attachments.
virtual agx::ConstraintRef createConstraint(agx::RigidBodyRef rb1, agx::FrameRef f1, agx::RigidBodyRef rb2, agx::FrameRef f2) const override
NodeAttachmentT(agx::RigidBody *rb, agx::Frame *rbAttachmentFrame, agxModel::NodeAttachment::InitializationMode initMode)
Construct given rigid body and a relative frame.
NodeAttachmentT()
Default constructor for serialization.
virtual ~NodeAttachmentT()
Reference counted object, protected destructor.
Base class for attachments to Deformable1D nodes.
agx::AffineMatrix4x4 getWorldMatrix() const
InitializationMode
Each attachment implementation controls the initialization mode.
@ ROTATE_TO_NODE_DIRECTION
virtual agx::Bool initialize(agxModel::Deformable1DNode *node)
Initializes constraint.
InitializationMode m_initMode
agx::ConstraintRef m_constraint
agx::FrameRef m_rbAttachmentFrame
virtual ~NodeAttachment()
Reference counted object, protected destructor.
agx::RigidBody * getRigidBody() const
void setName(const agx::String &name)
Name this attachment, e.g., to find this attachment using agxModel::Node::getAttachment( const agx::S...
void store(agxStream::OutputArchive &out) const override
Serialization store.
static agxModel::NodeAttachmentRef createFromWorld(agx::Vec3 worldPoint, agx::RigidBody *rb)
Creates an node attachment given a point in world frame.
agx::Constraint * getConstraint() const
virtual agx::ConstraintRef createConstraint(agx::RigidBodyRef rb1, agx::FrameRef f1, agx::RigidBodyRef rb2, agx::FrameRef f2) const =0
Create the attachment constraint.
InitializationMode getInitMode() const
virtual void storeLightData(agxStream::StorageStream &str) const override
Store structural independent data to stream.
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxModel::NodeAttachment)
static agxModel::NodeAttachmentRef createFromBody(agx::Vec3 bodyPoint, agx::RigidBody *rb)
Creates an node attachment given a point in rb local frame.
virtual void restoreLightData(agxStream::StorageStream &str) override
Restore structural independent data from stream.
NodeAttachment(agx::RigidBody *rb, agx::Frame *rbAttachmentFrame, agxModel::NodeAttachment::InitializationMode initMode)
Construct given rigid body and a relative frame.
void restore(agxStream::InputArchive &in) override
Serialization restore.
agx::Frame * getFrame() const
const agx::String & getName() const
Node attachment using ball joint, i.e., the node will rotate about this attachment.
virtual ~PointNodeAttachment()
Reference counted object, protected destructor.
PointNodeAttachment()
Default constructor for serialization.
PointNodeAttachment(agx::RigidBody *rb, const agx::Vec3 &relPosition)
Construct given rigid body and relative (to rigid body) position.
Node attachment using lock joint, i.e., the node cannot move relative to this attachment.
RigidNodeAttachment(agx::RigidBody *rb, const agx::AffineMatrix4x4 &relTransform)
Construct given rigid body and relative (to rigid body) transform.
virtual ~RigidNodeAttachment()
Reference counted object, protected destructor.
RigidNodeAttachment()
Default constructor for serialization.
RigidNodeAttachment(agx::RigidBody *rb, const agx::Vec3 &relPosition)
Construct given rigid body and relative (to rigid body) position.
Node attachment using hinge joint, i.e., the node can rotate about this attachment.
RotatingNodeAttachment()
Default constructor for serialization.
virtual ~RotatingNodeAttachment()
Reference counted object, protected destructor.
RotatingNodeAttachment(agx::RigidBody *rb, const agx::AffineMatrix4x4 &relTransform)
Construct given rigid body and relative transform.
RotatingNodeAttachment(agx::RigidBody *rb, const agx::Vec3 &relPosition)
Construct given rigid body and relative position.
Node attachment using prismatic joint, i.e., the node can slide along this attachment.
SlidingNodeAttachment(agx::RigidBody *rb, const agx::AffineMatrix4x4 &relTransform)
Construct given rigid body and relative transform.
SlidingNodeAttachment(agx::RigidBody *rb, const agx::Vec3 &relPosition)
Construct given rigid body and relative position.
SlidingNodeAttachment()
Default constructor for serialization.
virtual ~SlidingNodeAttachment()
Reference counted object, protected destructor.
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.
AffineMatrix4x4T< T > inverse() const
Quick inverse, transpose rotation part, and change sign of translation part.
The base class for a constraint.
The object defining a frame of reference and providing transformations operations.
agx::Vec3 transformPointToLocal(const agx::Vec3 &pointWorld) const
Transform point from the world coordinate frame to this frame.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
const agx::AffineMatrix4x4 & getTransform() const
Current model frame transform, given in world coordinate frame.
agx::Frame * getFrame()
Returns the model frame containing model the transformation and utilities to manipulate position,...
Smart pointer for handling referenced counted objects.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.