123 const
agx::
Vec3& localConstraintAxis,
124 const
agx::
Vec3& localConstraintY,
144 static T* getT(
agx::RigidBody* rb );
151 static const T* getT( const
agx::RigidBody* rb );
159 LinkedSegment(
agx::RigidBody* body, const
agx::
Vec3& halfExtents,
agx::Constraint* constraint);
164 virtual ~LinkedSegment();
166 void setHalfExtents(const
agx::
Vec3& halfExtens);
167 void setRigidBody(
agx::RigidBody* body);
168 void setConstraint(
agx::Constraint* constraint);
182 void setIndex(
agx::
UInt index );
192 inline
agx::
UInt LinkedSegment::getIndex()
const 199 return LinkedStructureObjectData::get<LinkedStructureObjectData>( m_rb );
204 const auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( m_rb );
205 return data !=
nullptr ? data->linkedStructure :
nullptr;
209 T* LinkedSegment::createConstraintWithPrev(
const LinkedSegment& prev,
215 if ( m_constraint !=
nullptr )
218 const auto localConstraintX = localConstraintY ^ localConstraintAxis;
220 localConstraintY.
x(), localConstraintY.
y(), localConstraintY.
z(),
221 localConstraintAxis.x(), localConstraintAxis.y(), localConstraintAxis.z() );
230 m_constraint =
new T( prev.
getRigidBody(), prevFrame, getRigidBody(), thisFrame );
232 if ( disableCollisions )
235 return m_constraint->as<T>();
240 auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
241 if ( data ==
nullptr )
243 return data->segment;
248 const auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
249 if ( data ==
nullptr )
251 return data->segment;
257 auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
258 if ( data ==
nullptr || data->segment ==
nullptr )
260 return data->segment->template asSafe<T>();
266 const auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
267 if ( data ==
nullptr || data->segment ==
nullptr )
269 return data->segment->template asSafe<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...
Base class providing referencing counted objects.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::ref_ptr< Constraint > ConstraintRef
agx::Real getLength() const
agx::RigidBody * getRigidBody() 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.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agxSDK::LinkedStructure * getLinkedStructure() const
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Specialized types of matrices for holding orthogonal transformation matrices.