 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
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 );
498 void addGroup(
const IdData& group );
500 agx::Bool hasGroup(
const IdData& group )
const;
507 IdDataContainer m_externallyAddedGroups;
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>();
593 m_segments[ index ] :
600 return data !=
nullptr && data->segment !=
nullptr && data->linkedStructure ==
this ?
601 data->segment->getIndex() :
611 template<
typename T,
typename ObjT>
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 ) ?
The rigid body class, combining a geometric model and a frame of reference.
static LinkedSegmentIterator end(const agxSDK::LinkedSegmentContainer &segments)
Connection back from bodies, constraints etc.
AGXPHYSICS_EXPORT void addGroup(const agx::RigidBody *body, unsigned id)
For the specified body, add the collision group ID to its geometries.
agx::UInt getSegmentIndex(const agx::RigidBody *rb) const
Group id 'union' of int id and name id.
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
const agxSDK::LinkedSegmentContainer & getSegmentsContainer() const
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXPHYSICS_EXPORT
LinkedSegmentIterator< T > getSegmentIterator(agx::UInt index, agx::Bool boundaryless=false) const
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Basic implementation of any structure where bodies are linked/constrained together in a well defined ...
LinkedStructureObjectData * getData(const agx::RigidBody *rb) const
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 geometry representation used by the collision detection engine.
LinkedSegment * getSegment(agx::UInt index) const
static T * getT(agx::RigidBody *rb)
bool operator!=(T val, InvalidIndexStruct)
Representation of a name string.
IdData()
Default constructor, group id is invalid with id == agx::InvalidIndex and name == "".
#define AGX_DECLARE_POINTER_TYPES(type)
AGXPHYSICS_EXPORT void removeGroup(const agx::RigidBody *body, unsigned id)
For the specified body, remove the collision group ID to its geometries.
IdData(agx::UInt32 id)
Construct group given int id where name == "".
Segment object in a linked structure.
bool operator==(T val, InvalidIndexStruct)
Collection of geometry group names and id's.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
IdData(const agx::Name &name)
Construct group given name where id == agx::InvalidIndex.
Base implementation of a component (e.g., specific functionality) in linked structures.
Main material class which acts as a holder of a Surface Material and a Bulk material.
const AGXCORE_EXPORT InvalidIndexStruct InvalidIndex
Segment range object for linked structure.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Optionally unbounded linked structure segment iterator object to iterate segments in a SegmentStructu...
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
LinkedSegmentRange< T > getSegments() const
Constructs a segment range over all segments.
agx::UInt getNumSegments() const
virtual void addNotification(agxSDK::Simulation *)
Called when this assembly is added to a simulation (given that it not already is in the simulation).