122 T* createConstraintWithPrev( const agxSDK::
LinkedSegment& prev,
123 const agx::
Vec3& localConstraintAxis,
124 const agx::
Vec3& localConstraintY,
125 agx::
Bool disableCollisions );
133 LinkedSegment(agx::RigidBody* body, const agx::
Vec3& halfExtents, agx::Constraint* constraint);
138 virtual ~LinkedSegment();
140 void setHalfExtents(const agx::
Vec3& halfExtens);
141 void setRigidBody(agx::RigidBody* body);
142 void setConstraint(agx::Constraint* constraint);
156 void setIndex( agx::
UInt index );
162 agx::
Vec3 m_halfExtents;
166 inline agx::
UInt LinkedSegment::getIndex()
const
173 return LinkedStructureObjectData::get<LinkedStructureObjectData>( m_rb );
178 const auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( m_rb );
179 return data !=
nullptr ? data->linkedStructure :
nullptr;
183 T* LinkedSegment::createConstraintWithPrev(
const LinkedSegment& prev,
189 if ( m_constraint !=
nullptr )
192 const auto localConstraintX = localConstraintY ^ localConstraintAxis;
194 localConstraintY.
x(), localConstraintY.
y(), localConstraintY.
z(),
195 localConstraintAxis.x(), localConstraintAxis.y(), localConstraintAxis.z() );
204 m_constraint =
new T( prev.
getRigidBody(), prevFrame, getRigidBody(), thisFrame );
206 if ( disableCollisions )
209 return m_constraint->as<T>();
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
#define AGXPHYSICS_EXPORT
The base class for a constraint.
#define AGX_DECLARE_POINTER_TYPES(type)
void setLocalMatrix(const agx::AffineMatrix4x4 &matrix)
Assign the local transformation matrix for this frame ignoring any eventual parent transformation...
agx::RigidBody * getRigidBody() const
Base class providing referencing counted objects.
agx::ref_ptr< Constraint > ConstraintRef
agx::Real getLength() const
The rigid body class, combining a geometric model and a frame of reference.
AGXPHYSICS_EXPORT bool setEnableCollisions(agx::RigidBody *rb1, agx::RigidBody *rb2, bool enable)
Enable or disable the collision between all geometries in RigidBody rb1 and RigidBody rb2...
agx::ref_ptr< RigidBody > RigidBodyRef
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...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Segment object in a linked structure.
Connection back from bodies, constraints etc.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
agxSDK::LinkedStructure * getLinkedStructure() const
Specialized types of matrices for holding orthogonal transformation matrices.