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 );
380 #endif // AGXMODEL_DEFORMABLE1DATTACHMENT_H 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...
Node attachment using ball joint, i.e., the node will rotate about this attachment.
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...
agx::Frame * getFrame()
Returns the model frame containing model the transformation and utilities to manipulate position...
agx::ConstraintRef m_constraint
InitializationMode m_initMode
virtual agx::ConstraintRef createConstraint(agx::RigidBodyRef rb1, agx::FrameRef f1, agx::RigidBodyRef rb2, agx::FrameRef f2) const override
The base class for a constraint.
agx::FrameRef m_rbAttachmentFrame
#define AGX_DECLARE_POINTER_TYPES(type)
const agx::AffineMatrix4x4 & getTransform() const
Current model frame transform, given in world coordinate frame.
Base class providing referencing counted objects.
Base class for attachments to Deformable1D nodes.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Node attachment using lock joint, i.e., the node cannot move relative to this attachment.
Node attachment using prismatic joint, i.e., the node can slide along this attachment.
Node attachment using hinge joint, i.e., the node can rotate about this attachment.
static agxModel::NodeAttachmentRef createFromWorld(agx::Vec3 worldPoint, agx::RigidBody *rb)
Creates an node attachment given a point in world frame.
NodeAttachmentT()
Default constructor for serialization.
Helper class to create give type of constraint for the different attachments.
Smart pointer for handling referenced counted objects.
NodeAttachmentT(agx::RigidBody *rb, agx::Frame *rbAttachmentFrame, agxModel::NodeAttachment::InitializationMode initMode)
Construct given rigid body and a relative frame.
agx::Vec3 transformPointToLocal(const agx::Vec3 &pointWorld) const
Transform point from the world coordinate frame to this frame.
static agxModel::NodeAttachmentRef createFromBody(agx::Vec3 bodyPoint, agx::RigidBody *rb)
Creates an node attachment given a point in rb local frame.
The rigid body class, combining a geometric model and a frame of reference.
Abstract base class for storing/restoring a line/drums with version control.
The object defining a frame of reference and providing transformations operations.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
AffineMatrix4x4T< T > inverse() const
Quick inverse, transpose rotation part, and change sign of translation part.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
virtual ~NodeAttachmentT()
Reference counted object, protected destructor.
InitializationMode
Each attachment implementation controls the initialization mode.