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 );
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 );
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;
246 inline const LinkedSegment* LinkedSegment::get(
const agx::RigidBody* rb )
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>();
#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...
#define AGXPHYSICS_EXPORT
Segment object in a linked structure.
const agx::Vec3 & getHalfExtents() const
agxSDK::LinkedStructure * getLinkedStructure() const
agx::Vec3 getEndPosition() const
LinkedSegment(const agx::AffineMatrix4x4 &transform, const agx::Vec3 &halfExtents)
Construct given transform and half extents of the shape.
agx::Vec3 getDirection() const
agx::Real getLength() const
agx::Real getCurrentLength() const
agx::Vec3 getCenterPosition() const
agx::Constraint * getConstraint() const
Returns the constraint created between this segment and the previous one in the linked structure.
agx::Vec3 getBeginPosition() const
agx::RigidBody * getRigidBody() const
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
The base class for a constraint.
The object defining a frame of reference and providing transformations operations.
void setLocalMatrix(const agx::AffineMatrix4x4 &matrix)
Assign the local transformation matrix for this frame ignoring any eventual parent transformation.
Specialized types of matrices for holding orthogonal transformation matrices.
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Vec3T< Real > Vec3
The object holding 3 dimensional vectors and providing basic arithmetic.
agx::ref_ptr< RigidBody > RigidBodyRef
agx::ref_ptr< Constraint > ConstraintRef
Connection back from bodies, constraints etc.