78 virtual agx::UInt32 getDisabledCollisionGroupId()
const;
150 virtual void setLinearVelocityDamping(
const agx::Vec3& linearVelocityDamping );
155 virtual agx::Vec3 getLinearVelocityDamping()
const;
164 virtual void setAngularVelocityDamping(
const agx::Vec3& angularVelocityDamping );
169 virtual agx::Vec3 getAngularVelocityDamping()
const;
181 virtual agx::Real getCurrentLength()
const;
262 T* getComponent()
const;
358 virtual void onMaterialNew();
363 virtual void onGroupAdd(
const IdData& group );
368 virtual void onGroupRemove(
const IdData& group );
378 virtual void onPreCollideStep();
383 virtual void onPreStep();
388 virtual void onPostStep();
393 virtual void onLastStep();
457 T* getSegment(
agx::Real restLengthFromStart )
const;
462 template<
typename ObjT>
474 template<
typename T,
typename ObjT>
497 void trigger( SimulationEvent simulationEvent );
516 auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
517 return data !=
nullptr && data->linkedStructure !=
nullptr ? data->linkedStructure->template asSafe<T>() :
nullptr;
523 return LinkedStructure::getT<T>(
const_cast<agx::RigidBody*
>( rb ) );
529 for (
auto component : m_components ) {
530 auto typed = component->template asSafe<T>();
531 if ( typed !=
nullptr )
545 return m_segments.size();
559 getSegmentIterator<T>( endIndex ) );
565 return m_segments[ index ];
571 if ( m_segments.empty() )
574 if ( restLengthFromStart <= 0.0 )
575 return m_segments.front()->template as<T>();
577 agx::Real restLengthAlongStructure = 0.0;
578 for (
auto segment : this->
template getSegments<T>() ) {
579 if ( restLengthAlongStructure + segment->getLength() < restLengthFromStart )
580 restLengthAlongStructure += segment->
getLength();
582 return segment->template as<T>();
585 return m_segments.back()->template as<T>();
591 auto index = getSegmentIndex( rb );
593 m_segments[ index ] :
599 auto data = getData( rb );
600 return data !=
nullptr && data->segment !=
nullptr && data->linkedStructure ==
this ?
601 data->segment->getIndex() :
611 template<
typename T,
typename ObjT>
614 auto segment = this->getSegment( rb );
615 if ( segment ==
nullptr )
617 return getSegmentIterator<T>( segment->getIndex(), boundaryless );
622 auto data = LinkedStructureObjectData::get<LinkedStructureObjectData>( rb );
625 return data !=
nullptr && ( data->linkedStructure ==
this || data->linkedStructure == nullptr ) ?
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
IdData(const agx::Name &name)
Construct group given name where id == agx::InvalidIndex.
agx::UInt getNumSegments() const
Segment range object for linked structure.
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
bool operator==(T val, InvalidIndexStruct)
#define AGXPHYSICS_EXPORT
agx::UInt getSegmentIndex(const agx::RigidBody *rb) const
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
IdData()
Default constructor, group id is invalid with id == agx::InvalidIndex and name == ""...
#define AGX_DECLARE_POINTER_TYPES(type)
Representation of a name string.
LinkedSegment * getSegment(agx::UInt index) const
const agxSDK::LinkedSegmentContainer & getSegmentsContainer() const
static LinkedSegmentIterator begin(const agxSDK::LinkedSegmentContainer &segments)
The geometry representation used by the collision detection engine.
AGXPHYSICS_EXPORT void addGroup(const agx::RigidBody *body, unsigned id)
For the specified body, add the collision group ID to its geometries.
IdData(agx::UInt32 id)
Construct group given int id where name == "".
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Group id 'union' of int id and name id.
agx::Real getLength() const
Collection of geometry group names and id's.
LinkedSegmentRange< T > getSegments() const
Constructs a segment range over all segments.
LinkedSegmentIterator< T > getSegmentIterator(agx::UInt index, agx::Bool boundaryless=false) const
The rigid body class, combining a geometric model and a frame of reference.
Main material class which acts as a holder of a Surface Material and a Bulk material.
Optionally unbounded linked structure segment iterator object to iterate segments in a SegmentStructu...
static LinkedSegmentIterator end(const agxSDK::LinkedSegmentContainer &segments)
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...
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
AGXPHYSICS_EXPORT void removeGroup(const agx::RigidBody *body, unsigned id)
For the specified body, remove the collision group ID to its geometries.
LinkedStructureObjectData * getData(const agx::RigidBody *rb) const
virtual void addNotification(agxSDK::Simulation *)
Called when this assembly is added to a simulation (given that it not already is in the simulation)...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Segment object in a linked structure.
bool operator!=(T val, InvalidIndexStruct)
Connection back from bodies, constraints etc.
static T * getT(agx::RigidBody *rb)
Base implementation of a component (e.g., specific functionality) in linked structures.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.