AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agx::MergedBody Class Referenceabstract

Structure holding several "normal" rigid bodies. More...

#include <MergedBody.h>

+ Inheritance diagram for agx::MergedBody:

Classes

struct  MergedBodyIndex
 Object with index of merged body and the original index of a merged object. More...
 
struct  Point
 Contact point data store in first rigid body local frame. More...
 

Public Types

typedef agx::observer_ptr< const BinaryConstraintEdgeInteractionBinaryConstraintEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const BinaryConstraintEdgeInteractionBinaryConstraintEdgeInteractionConstRef
 
typedef agx::observer_ptr< BinaryConstraintEdgeInteractionBinaryConstraintEdgeInteractionObserver
 
typedef agx::ref_ptr< BinaryConstraintEdgeInteractionBinaryConstraintEdgeInteractionRef
 
typedef agx::observer_ptr< const ContactGeneratorEdgeInteractionContactGeneratorEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const ContactGeneratorEdgeInteractionContactGeneratorEdgeInteractionConstRef
 
typedef agx::observer_ptr< ContactGeneratorEdgeInteractionContactGeneratorEdgeInteractionObserver
 
typedef agx::ref_ptr< ContactGeneratorEdgeInteractionContactGeneratorEdgeInteractionRef
 
typedef agx::observer_ptr< const EdgeInteractionEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const EdgeInteractionEdgeInteractionConstRef
 
typedef agx::observer_ptr< EdgeInteractionEdgeInteractionObserver
 
typedef agx::ref_ptr< EdgeInteractionEdgeInteractionRef
 
typedef agx::Vector< EdgeInteractionRefEdgeInteractionRefContainer
 
typedef std::function< void(EdgeInteraction *) > EdgeInteractionVisitor
 
typedef agx::observer_ptr< const EmptyEdgeInteractionEmptyEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const EmptyEdgeInteractionEmptyEdgeInteractionConstRef
 
typedef agx::observer_ptr< EmptyEdgeInteractionEmptyEdgeInteractionObserver
 
typedef agx::ref_ptr< EmptyEdgeInteractionEmptyEdgeInteractionRef
 
typedef agx::observer_ptr< const GeometryContactEdgeInteractionGeometryContactEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const GeometryContactEdgeInteractionGeometryContactEdgeInteractionConstRef
 
typedef agx::observer_ptr< GeometryContactEdgeInteractionGeometryContactEdgeInteractionObserver
 
typedef agx::ref_ptr< GeometryContactEdgeInteractionGeometryContactEdgeInteractionRef
 
enum  InteractionTag {
  NONE = 0 , CONTACT = 1 << 0 , CONTACT_GENERATOR = 1 << 1 , CONSTRAINT = 1 << 2 ,
  BINARY_CONSTRAINT = CONSTRAINT | (1 << 3) , PARTICLE_GENERATOR = 1 << 4
}
 
typedef agx::BitState< StateInternalState
 
typedef agx::observer_ptr< const Listener > ListenerConstObserver
 
typedef agx::ref_ptr< const Listener > ListenerConstRef
 
typedef agx::observer_ptr< Listener > ListenerObserver
 
typedef agx::ref_ptr< Listener > ListenerRef
 
typedef agx::observer_ptr< const ParticleParticleInteractionParticleParticleInteractionConstObserver
 
typedef agx::ref_ptr< const ParticleParticleInteractionParticleParticleInteractionConstRef
 
typedef agx::observer_ptr< ParticleParticleInteractionParticleParticleInteractionObserver
 
typedef agx::ref_ptr< ParticleParticleInteractionParticleParticleInteractionRef
 
typedef agx::VectorPOD< PointPointContainer
 
typedef std::function< void(agx::RigidBody *) > RigidBodyVisitor
 
enum  State { INTERACTION_GRAPH_DIRTY = 1 << 0 , RESTORED = 1 << 1 , READY_FOR_SOLVER = 1 << 2 , AUTO_CLEAN_WHEN_EMPTY = 1 << 3 }
 Internal state of this merged body. More...
 

Public Member Functions

 MergedBody ()
 Construct merged body, default containing a root rigid body.
 
agx::Bool add (EdgeInteraction *edge)
 Add an edge interaction defining a base interaction between one or two rigid bodies that will be considered merged if successful.
 
agx::Bool add (Listener *listener)
 Add listener to receive callbacks during certain events.
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (MergedBody::EdgeInteraction)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (MergedBody::BinaryConstraintEdgeInteraction)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (MergedBody::ContactGeneratorEdgeInteraction)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (MergedBody::EmptyEdgeInteraction)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (MergedBody::GeometryContactEdgeInteraction)
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (MergedBody::ParticleParticleInteraction)
 
 BinaryConstraintEdgeInteraction (agx::Constraint *constraint)
 Construct given a one or two body constraint.
 
 BinaryConstraintEdgeInteraction (agx::HighLevelConstraintImplementation *constraint)
 Construct given constraint implementation of a binary constraint.
 
virtual MergedBodyRef clone ()
 Creates an empty clone of this merged body where each object that supports cloning also are cloned.
 
virtual ListenerRef clone ()=0
 This listener will be cloned when e.g., splitIslands is used.
 
 ContactGeneratorEdgeInteraction (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Construct given two rigid bodies.
 
agx::Bool containsDeletedBodies () const
 
void debugPrint (const agx::RigidBody *rb) const
 Debug prints (cout) interactions to rb.
 
 EmptyEdgeInteraction (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Construct given two rigid bodies.
 
virtual void generateInteraction (agxSDK::Simulation *simulation, agxCollide::LocalGeometryContactVector &newContacts)=0
 Generate interaction or do nothing.
 
 GeometryContactEdgeInteraction (agx::Physics::GeometryContactPtr gcPtr)
 Construct given a geometry contact data.
 
 GeometryContactEdgeInteraction (agxCollide::Geometry *geometry1, agx::RigidBody *rb1, agxCollide::Geometry *geometry2, agx::RigidBody *rb2)
 Construct given two geometries.
 
agx::HighLevelConstraintImplementationgetConstraint ()
 
const agx::HighLevelConstraintImplementationgetConstraint () const
 
void getDebugRenderColor (agx::Vec3 &color) const
 Color of this merged body used for debug rendering.
 
const EdgeInteractionRefContainergetEdges (const agx::RigidBody *rb1, const agx::RigidBody *rb2) const
 
agx::Bool getEnableAutomaticCleanupWhenEmpty () const
 
agxCollide::GeometrygetGeometry1 () const
 
agxCollide::GeometrygetGeometry2 () const
 
const agx::NamegetName () const
 
const agx::RigidBodyPtrVectorgetNeighbors (const agx::RigidBody *rb) const
 
agx::UInt getNumPairs () const
 
const PointContainergetPoints () const
 
agx::RigidBodygetRigidBody () const
 
agx::RigidBodygetRigidBody1 () const
 
agx::RigidBodygetRigidBody2 () const
 
const InternalStategetState () const
 
agx::Bool getValid () const
 
agx::Bool isActive () const
 
agx::Bool isEmpty () const
 
agx::Bool isTagged (InteractionTag tag) const
 
agx::Bool merge (agx::MergedBody *other, EdgeInteraction *edge)
 Merges this with other and clears other.
 
agx::Bool merged (const agx::RigidBody *rb1, const agx::RigidBody *rb2) const
 
virtual void onAdd (agx::RigidBody *, const agx::MergedBody *) const
 Called when a body is added to the merged body.
 
virtual void onAdded (EdgeInteraction *, const agx::MergedBody *) const
 Called when an edge is added to the merged body.
 
virtual void onMovedFromTo (const MergedBody::EdgeInteractionRefContainer &, const agx::MergedBody *, const agx::MergedBody *) const
 Called when the edges between two bodies are moved from one merged body to another.
 
virtual void onRemove (agx::RigidBody *, const agx::MergedBody *) const
 Called when a body is removed from the merged body.
 
virtual void onRemoved (const MergedBody::EdgeInteractionRefContainer &, const agx::MergedBody *) const
 Called when an edge is removed from the merged body.
 
 ParticleParticleInteraction (agx::RigidBody *substituteBody1, agx::RigidBody *substituteBody2)
 Construct given two rigid bodies.
 
agx::Bool remove (agx::RigidBody *rb)
 Split/Remove a rigid body from this merged body.
 
agx::Bool remove (EdgeInteraction *edge)
 Remove an edge interaction from this merged body.
 
agx::Bool remove (Listener *listener)
 Remove listener from this merged body.
 
virtual void restore (agxStream::InputArchive &in) override
 Restores the two bodies and the construction state.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream.
 
void setEnableAutomaticCleanupWhenEmpty (agx::Bool enable)
 If true, this merged body will remove itself from the simulation and clear all internal states when it becomes empty.
 
void setName (const agx::Name &name)
 Assign new name to this MergedBOdy Default: "".
 
agx::MergedBodyRefVector splitIslands ()
 Splits into islands.
 
virtual void store (agxStream::OutputArchive &out) const override
 Stores the two bodies and the construction state.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream.
 
void traverse (const agx::RigidBody *rb, EdgeInteractionVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse the internal interaction graph and receive callback for each edge interaction where rb is part of.
 
void traverse (const agx::RigidBody *rb, RigidBodyVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse neighboring bodies to rb.
 
void traverse (EdgeInteractionVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse the internal interaction graph and receive callback for each edge interaction.
 
void traverse (RigidBodyVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse the internal interaction graph and receive callback for all rigid bodies (unique).
 
agx::Bool updateProperties ()
 Updates mass, position, velocity etc of the root body given the current state.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static agx::RigidBodyfilter (agx::RigidBody *rb)
 
static const agx::RigidBodyfilter (const agx::RigidBody *rb)
 Filters rb and returns the merged rigid body if rb is part of one.
 
static MergedBodyIndex findMergedBodyIndex (agx::Physics::RigidBodyPtr rb)
 Similar to filter( const agx::RigidBody* rb ).
 
static agx::MergedBodyget (agx::Constraint *constraint)
 This method returns a merged body if the constraint has been involved in it, e.g., by having an edge created given it.
 
static agx::MergedBodyget (agx::RigidBody *rb)
 This method returns an agx::MergedBody if rb has been added to one.
 
static const agx::MergedBodyget (const agx::Constraint *constraint)
 This method returns a merged body if the constraint has been involved in it, e.g., by having an edge created given it.
 
static const agx::MergedBodyget (const agx::RigidBody *rb)
 This method returns an agx::MergedBody if rb has been added to one.
 
static agx::MergedBodygetActive (agx::RigidBody *rb)
 This method returns an agx::MergedBody that is active and in a simulation.
 
static const agx::MergedBodygetActive (const agx::RigidBody *rb)
 This method returns an agx::MergedBody that is active and in a simulation.
 
static BinaryConstraintEdgeInteractiongetEdge (const agx::Constraint *constraint)
 
static BinaryConstraintEdgeInteractiongetEdge (const agx::HighLevelConstraintImplementation *constraint)
 
static agx::Bool isRoot (const agx::RigidBody *rb)
 
static agx::Bool shouldIntegratePosition (const agx::RigidBody *rb)
 
static agx::Bool split (agx::Constraint *constraint)
 Removes the edge defined by the constraint from the merged body, if any.
 
static agx::Bool split (agx::HighLevelConstraintImplementation *constraint)
 Removes the edge defined by the constraint from the merged body, if any.
 
static agx::Bool split (agx::RigidBody *rb)
 Split rigid body if merged.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

virtual ~BinaryConstraintEdgeInteraction ()
 Reference counted object, protected destructor.
 
virtual ~ContactGeneratorEdgeInteraction ()
 Reference counted object, protected destructor.
 
virtual ~EdgeInteraction ()
 Reference counted object, protected destructor.
 
virtual ~EmptyEdgeInteraction ()
 Reference counted object, protected destructor.
 
virtual ~GeometryContactEdgeInteraction ()
 Reference counted object, protected destructor.
 
virtual ~Listener ()
 Reference counted object, protected destructor.
 
virtual ~MergedBody () throw ()
 Reference counted object, protected destructor.
 
virtual ~ParticleParticleInteraction ()
 Reference counted object, protected destructor.
 
 BinaryConstraintEdgeInteraction ()
 Default constructor used by serialization.
 
 ContactGeneratorEdgeInteraction ()
 Default constructor used by serialization.
 
 EdgeInteraction (agx::RigidBody *rb1, agx::RigidBody *rb2, InteractionTag tag, agx::Bool valid=true)
 Construct given two rigid bodies and a valid flag.
 
 EmptyEdgeInteraction ()
 Default constructor used by serialization.
 
virtual void generateInteraction (agxSDK::Simulation *, agxCollide::LocalGeometryContactVector &) override
 Does nothing.
 
virtual void generateInteraction (agxSDK::Simulation *, agxCollide::LocalGeometryContactVector &) override
 Checks for contacts between the bodies and adds them.
 
virtual void generateInteraction (agxSDK::Simulation *simulation, agxCollide::LocalGeometryContactVector &newContacts) override
 Checks for contacts between the bodies and adds them.
 
virtual void generateInteraction (agxSDK::Simulation *simulation, agxCollide::LocalGeometryContactVector &newContacts) override
 Transforms and adds the local contact data as a new geometry contact.
 
virtual void generateInteraction (agxSDK::Simulation *simulation, agxCollide::LocalGeometryContactVector &newContacts) override
 Activates the constraint.
 
 GeometryContactEdgeInteraction ()
 Default constructor used by serialization.
 
agxSDK::SimulationgetSimulation ()
 
const agxSDK::SimulationgetSimulation () const
 
virtual void onCleanup ()
 Called when the simulation is cleaned.
 
virtual void onRemove (agx::Constraint *constraint)
 Called when a constraint, present in this merged body, is removed from the simulation.
 
virtual void onRemove (agx::RigidBody *rb)
 Called when a rigid body, present in this merged body, is removed from the simulation.
 
virtual void onRemove (agxCollide::Geometry *geometry)
 Called when a geometry, probably present in this merged body, is removed from space or body.
 
 ParticleParticleInteraction ()
 Default constructor used by serialization.
 
virtual void postStep ()
 Called after solver (new velocities and POSSIBLY (or not) new transforms).
 
virtual void preCollide ()
 Called before collision detection.
 
virtual void preStep ()
 Called before solver executes.
 
void setBodies (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Assign bodies during restore.
 
virtual void setSimulation (agxSDK::Simulation *simulation)
 Called during agxSDK::Simulation::add and agxSDK::Simulation::remove.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Structure holding several "normal" rigid bodies.

Edge interaction that handles connection between rigid bodies that are converted from granular bodies.

Interaction data for a (one or) two body constraint.

Interaction data for two (previously contacting) merged objects.

Edge interaction that calls colliders for each pair of geometries in the bodies during split.

Empty edge interaction class containing only the two bodies.

Base type for general interaction with two rigid bodies.

Base class for merged body listener listener.

The "normal" rigid bodies will not be seen by the solver and they will not move relative each other. A rigid body added to this structure can still interact with other bodies in a simulation.

This object can be used when e.g., the two bodies have a constraint defined between them.

Functionality is the same as Empty Edge.

Definition at line 55 of file MergedBody.h.

Member Typedef Documentation

◆ BinaryConstraintEdgeInteractionConstObserver

◆ BinaryConstraintEdgeInteractionConstRef

◆ BinaryConstraintEdgeInteractionObserver

◆ BinaryConstraintEdgeInteractionRef

◆ ContactGeneratorEdgeInteractionConstObserver

◆ ContactGeneratorEdgeInteractionConstRef

◆ ContactGeneratorEdgeInteractionObserver

◆ ContactGeneratorEdgeInteractionRef

◆ EdgeInteractionConstObserver

◆ EdgeInteractionConstRef

◆ EdgeInteractionObserver

◆ EdgeInteractionRef

◆ EdgeInteractionRefContainer

◆ EdgeInteractionVisitor

typedef std::function< void( EdgeInteraction* ) > agx::MergedBody::EdgeInteractionVisitor

Definition at line 108 of file MergedBody.h.

◆ EmptyEdgeInteractionConstObserver

◆ EmptyEdgeInteractionConstRef

◆ EmptyEdgeInteractionObserver

◆ EmptyEdgeInteractionRef

◆ GeometryContactEdgeInteractionConstObserver

◆ GeometryContactEdgeInteractionConstRef

◆ GeometryContactEdgeInteractionObserver

◆ GeometryContactEdgeInteractionRef

◆ InternalState

typedef agx::BitState< State > agx::MergedBody::InternalState

Definition at line 109 of file MergedBody.h.

◆ ListenerConstObserver

Definition at line 106 of file MergedBody.h.

◆ ListenerConstRef

Definition at line 106 of file MergedBody.h.

◆ ListenerObserver

Definition at line 106 of file MergedBody.h.

◆ ListenerRef

Definition at line 106 of file MergedBody.h.

◆ ParticleParticleInteractionConstObserver

◆ ParticleParticleInteractionConstRef

◆ ParticleParticleInteractionObserver

◆ ParticleParticleInteractionRef

◆ PointContainer

Definition at line 975 of file MergedBody.h.

◆ RigidBodyVisitor

typedef std::function< void( agx::RigidBody* ) > agx::MergedBody::RigidBodyVisitor

Definition at line 107 of file MergedBody.h.

Member Enumeration Documentation

◆ InteractionTag

Enumerator
NONE 
CONTACT 
CONTACT_GENERATOR 
CONSTRAINT 
BINARY_CONSTRAINT 
PARTICLE_GENERATOR 

Definition at line 765 of file MergedBody.h.

◆ State

Internal state of this merged body.

Enumerator
INTERACTION_GRAPH_DIRTY 
RESTORED 
READY_FOR_SOLVER 
AUTO_CLEAN_WHEN_EMPTY 

Definition at line 69 of file MergedBody.h.

Constructor & Destructor Documentation

◆ MergedBody()

agx::MergedBody::MergedBody ( )

Construct merged body, default containing a root rigid body.

◆ ~MergedBody()

virtual agx::MergedBody::~MergedBody ( )
throw (
)
protectedvirtual

Reference counted object, protected destructor.

◆ ~Listener()

virtual agx::MergedBody::~Listener ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~EdgeInteraction()

virtual agx::MergedBody::~EdgeInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~EmptyEdgeInteraction()

virtual agx::MergedBody::~EmptyEdgeInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~ContactGeneratorEdgeInteraction()

virtual agx::MergedBody::~ContactGeneratorEdgeInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~GeometryContactEdgeInteraction()

virtual agx::MergedBody::~GeometryContactEdgeInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~BinaryConstraintEdgeInteraction()

virtual agx::MergedBody::~BinaryConstraintEdgeInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

◆ ~ParticleParticleInteraction()

virtual agx::MergedBody::~ParticleParticleInteraction ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ add() [1/2]

agx::Bool agx::MergedBody::add ( EdgeInteraction edge)

Add an edge interaction defining a base interaction between one or two rigid bodies that will be considered merged if successful.

Parameters
edge- edge interaction
Returns
true if merge was successful, otherwise false

◆ add() [2/2]

agx::Bool agx::MergedBody::add ( Listener *  listener)

Add listener to receive callbacks during certain events.

Parameters
listener- listener to add
Returns
true if the listener was added (or is already present), otherwise false

◆ AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE()

agx::MergedBody::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( MergedBody::EdgeInteraction  )

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE() [1/5]

agx::MergedBody::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( MergedBody::BinaryConstraintEdgeInteraction  )

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE() [2/5]

agx::MergedBody::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( MergedBody::ContactGeneratorEdgeInteraction  )

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE() [3/5]

agx::MergedBody::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( MergedBody::EmptyEdgeInteraction  )

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE() [4/5]

agx::MergedBody::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( MergedBody::GeometryContactEdgeInteraction  )

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE() [5/5]

agx::MergedBody::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( MergedBody::ParticleParticleInteraction  )

◆ BinaryConstraintEdgeInteraction() [1/3]

agx::MergedBody::BinaryConstraintEdgeInteraction ( )
protected

Default constructor used by serialization.

◆ BinaryConstraintEdgeInteraction() [2/3]

agx::MergedBody::BinaryConstraintEdgeInteraction ( agx::Constraint constraint)
explicit

Construct given a one or two body constraint.

Parameters
constraint- one or two body constraint

◆ BinaryConstraintEdgeInteraction() [3/3]

agx::MergedBody::BinaryConstraintEdgeInteraction ( agx::HighLevelConstraintImplementation constraint)
explicit

Construct given constraint implementation of a binary constraint.

Parameters
constraint- binary constraint

◆ clone() [1/2]

virtual MergedBodyRef agx::MergedBody::clone ( )
virtual

Creates an empty clone of this merged body where each object that supports cloning also are cloned.

Note
The returned clone will not contain any bodies
Returns
an empty clone of this merged body

◆ clone() [2/2]

virtual ListenerRef agx::MergedBody::clone ( )
pure virtual

This listener will be cloned when e.g., splitIslands is used.

Note
It's valid if the clone return itself.
Returns
a clone of this listener

◆ ContactGeneratorEdgeInteraction() [1/2]

agx::MergedBody::ContactGeneratorEdgeInteraction ( )
protected

Default constructor used by serialization.

◆ ContactGeneratorEdgeInteraction() [2/2]

agx::MergedBody::ContactGeneratorEdgeInteraction ( agx::RigidBody rb1,
agx::RigidBody rb2 
)

Construct given two rigid bodies.

Both rigid bodies have to be valid.

◆ containsDeletedBodies()

agx::Bool agx::MergedBody::containsDeletedBodies ( ) const
Returns
true if one or both objects has been deleted

◆ create() [1/5]

static agxStream::Serializable * agx::MergedBody::create ( agxStream::InputArchive )
inlinestatic

Definition at line 876 of file MergedBody.h.

◆ create() [2/5]

static agxStream::Serializable * agx::MergedBody::create ( agxStream::InputArchive )
inlinestatic

Definition at line 918 of file MergedBody.h.

◆ create() [3/5]

static agxStream::Serializable * agx::MergedBody::create ( agxStream::InputArchive )
inlinestatic

Definition at line 1010 of file MergedBody.h.

◆ create() [4/5]

static agxStream::Serializable * agx::MergedBody::create ( agxStream::InputArchive )
inlinestatic

Definition at line 1092 of file MergedBody.h.

◆ create() [5/5]

static agxStream::Serializable * agx::MergedBody::create ( agxStream::InputArchive )
inlinestatic

Definition at line 1136 of file MergedBody.h.

◆ debugPrint()

void agx::MergedBody::debugPrint ( const agx::RigidBody rb) const

Debug prints (cout) interactions to rb.

◆ EdgeInteraction()

agx::MergedBody::EdgeInteraction ( agx::RigidBody rb1,
agx::RigidBody rb2,
InteractionTag  tag,
agx::Bool  valid = true 
)
protected

Construct given two rigid bodies and a valid flag.

Parameters
rb1- first rigid body
rb2- second rigid body
tag- Tag type of the interaction
valid- true if valid, false if invalid

◆ EmptyEdgeInteraction() [1/2]

agx::MergedBody::EmptyEdgeInteraction ( )
protected

Default constructor used by serialization.

◆ EmptyEdgeInteraction() [2/2]

agx::MergedBody::EmptyEdgeInteraction ( agx::RigidBody rb1,
agx::RigidBody rb2 
)

Construct given two rigid bodies.

Both rigid bodies have to be valid.

◆ filter() [1/2]

RigidBody * agx::MergedBody::filter ( agx::RigidBody rb)
static

Definition at line 1222 of file MergedBody.h.

References agx::root().

◆ filter() [2/2]

const RigidBody * agx::MergedBody::filter ( const agx::RigidBody rb)
static

Filters rb and returns the merged rigid body if rb is part of one.

Otherwise rb is returned.

Parameters
rb- rb to filter
Returns
a merged rigid body if rb is present in one, otherwise rb

Definition at line 1216 of file MergedBody.h.

References agx::root().

◆ findMergedBodyIndex()

MergedBody::MergedBodyIndex agx::MergedBody::findMergedBodyIndex ( agx::Physics::RigidBodyPtr  rb)
static

Similar to filter( const agx::RigidBody* rb ).

Returns
index of either rb or a merged body that rb is part of

Definition at line 1208 of file MergedBody.h.

References agx::Physics::RigidBodyPtr::model(), and agx::root().

◆ generateInteraction() [1/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation ,
agxCollide::LocalGeometryContactVector  
)
inlineoverrideprotectedvirtual

Does nothing.

Definition at line 902 of file MergedBody.h.

◆ generateInteraction() [2/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation ,
agxCollide::LocalGeometryContactVector  
)
overrideprotectedvirtual

Checks for contacts between the bodies and adds them.

◆ generateInteraction() [3/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation simulation,
agxCollide::LocalGeometryContactVector newContacts 
)
overrideprotectedvirtual

Checks for contacts between the bodies and adds them.

◆ generateInteraction() [4/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation simulation,
agxCollide::LocalGeometryContactVector newContacts 
)
overrideprotectedvirtual

Transforms and adds the local contact data as a new geometry contact.

◆ generateInteraction() [5/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation simulation,
agxCollide::LocalGeometryContactVector newContacts 
)
overrideprotectedvirtual

Activates the constraint.

◆ generateInteraction() [6/6]

virtual void agx::MergedBody::generateInteraction ( agxSDK::Simulation simulation,
agxCollide::LocalGeometryContactVector newContacts 
)
pure virtual

Generate interaction or do nothing.

This method is called when this edge interaction is split, i.e., when removed from a merged body.

◆ GeometryContactEdgeInteraction() [1/3]

agx::MergedBody::GeometryContactEdgeInteraction ( )
protected

Default constructor used by serialization.

◆ GeometryContactEdgeInteraction() [2/3]

agx::MergedBody::GeometryContactEdgeInteraction ( agx::Physics::GeometryContactPtr  gcPtr)
explicit

Construct given a geometry contact data.

Parameters
gcPtr- geometry contact data

◆ GeometryContactEdgeInteraction() [3/3]

agx::MergedBody::GeometryContactEdgeInteraction ( agxCollide::Geometry geometry1,
agx::RigidBody rb1,
agxCollide::Geometry geometry2,
agx::RigidBody rb2 
)

Construct given two geometries.

Use this method when this edge is being restored using light data.

Parameters
geometry1- first geometry
rb1- First rigid body
geometry2- second geometry
rb2- Second rigid body

◆ get() [1/4]

static agx::MergedBody * agx::MergedBody::get ( agx::Constraint constraint)
static

This method returns a merged body if the constraint has been involved in it, e.g., by having an edge created given it.

Note
This method ignores the bodies involved.
Parameters
constraint- constraint to check if involved in a merged body
Returns
the merged body the constraint is part of, otherwise nullptr

◆ get() [2/4]

MergedBody * agx::MergedBody::get ( agx::RigidBody rb)
static

This method returns an agx::MergedBody if rb has been added to one.

This method returns an agx::MergedBody regardless of if the agx::MergedBody is in a simulation or not.

Parameters
rb- rb to find the agx::MergedBody for
Returns
merged body that rb is part of, null if rb isn't merged

Definition at line 1184 of file MergedBody.h.

◆ get() [3/4]

static const agx::MergedBody * agx::MergedBody::get ( const agx::Constraint constraint)
static

This method returns a merged body if the constraint has been involved in it, e.g., by having an edge created given it.

Note
This method ignores the bodies involved.
Parameters
constraint- constraint to check if involved in a merged body
Returns
the merged body the constraint is part of, otherwise nullptr

◆ get() [4/4]

const MergedBody * agx::MergedBody::get ( const agx::RigidBody rb)
static

This method returns an agx::MergedBody if rb has been added to one.

This method returns an agx::MergedBody regardless of if the agx::MergedBody is in a simulation or not.

Parameters
rb- rb to find the agx::MergedBody for
Returns
merged body that rb is part of, null if rb isn't merged

Definition at line 1178 of file MergedBody.h.

◆ getActive() [1/2]

MergedBody * agx::MergedBody::getActive ( agx::RigidBody rb)
static

This method returns an agx::MergedBody that is active and in a simulation.

rb - rb to find the active agx::MergedBody for

Returns
merged body that rb is part of, null if rb isn't merged or the merged body isn't active

Definition at line 1196 of file MergedBody.h.

References isActive().

◆ getActive() [2/2]

const MergedBody * agx::MergedBody::getActive ( const agx::RigidBody rb)
static

This method returns an agx::MergedBody that is active and in a simulation.

rb - rb to find the active agx::MergedBody for

Returns
merged body that rb is part of, null if rb isn't merged or the merged body isn't active

Definition at line 1190 of file MergedBody.h.

References isActive().

◆ getConstraint() [1/2]

agx::HighLevelConstraintImplementation * agx::MergedBody::getConstraint ( )
Returns
the constraint

◆ getConstraint() [2/2]

const agx::HighLevelConstraintImplementation * agx::MergedBody::getConstraint ( ) const
Returns
the constraint

◆ getDebugRenderColor()

void agx::MergedBody::getDebugRenderColor ( agx::Vec3 color) const

Color of this merged body used for debug rendering.

◆ getEdge() [1/2]

static BinaryConstraintEdgeInteraction * agx::MergedBody::getEdge ( const agx::Constraint constraint)
static
Returns
the edge interaction associated to the constraint, otherwise nullptr

◆ getEdge() [2/2]

static BinaryConstraintEdgeInteraction * agx::MergedBody::getEdge ( const agx::HighLevelConstraintImplementation constraint)
static
Returns
the edge interaction associated to the constraint, otherwise nullptr

◆ getEdges()

const EdgeInteractionRefContainer * agx::MergedBody::getEdges ( const agx::RigidBody rb1,
const agx::RigidBody rb2 
) const
Returns
the edges defined between rb1 and rb2, null if none (e.g., rb1 and rb2 isn't merged in this merged body, or aren't neighbors)

Referenced by agxSDK::MergeSplitUtils::collectConnectingEdges().

◆ getEnableAutomaticCleanupWhenEmpty()

agx::Bool agx::MergedBody::getEnableAutomaticCleanupWhenEmpty ( ) const
Returns
true if automatic cleanup when empty is enabled - otherwise false

◆ getGeometry1()

agxCollide::Geometry * agx::MergedBody::getGeometry1 ( ) const
Returns
first geometry

◆ getGeometry2()

agxCollide::Geometry * agx::MergedBody::getGeometry2 ( ) const
Returns
second geometry

◆ getName()

const agx::Name & agx::MergedBody::getName ( ) const
Returns
the name of this MergedBody

◆ getNeighbors()

const agx::RigidBodyPtrVector * agx::MergedBody::getNeighbors ( const agx::RigidBody rb) const
Returns
bodies rb is merged with, null if not merged

Referenced by agxSDK::MergeSplitUtils::collectConnectingEdges().

◆ getNumPairs()

agx::UInt agx::MergedBody::getNumPairs ( ) const
Returns
the number of pair interactions in this merged body

◆ getPoints()

const PointContainer & agx::MergedBody::getPoints ( ) const
Returns
vector with contact point data

◆ getRigidBody()

agx::RigidBody * agx::MergedBody::getRigidBody ( ) const
Returns
the root rigid body of this merged body

◆ getRigidBody1()

agx::RigidBody * agx::MergedBody::getRigidBody1 ( ) const
Returns
first rigid body

◆ getRigidBody2()

agx::RigidBody * agx::MergedBody::getRigidBody2 ( ) const
Returns
second rigid body

◆ getSimulation() [1/2]

agxSDK::Simulation * agx::MergedBody::getSimulation ( )
protected
Returns
the simulation this merged body is part of

◆ getSimulation() [2/2]

const agxSDK::Simulation * agx::MergedBody::getSimulation ( ) const
protected
Returns
the simulation this merged body is part of

◆ getState()

const InternalState & agx::MergedBody::getState ( ) const
Returns
current internal state

◆ getValid()

agx::Bool agx::MergedBody::getValid ( ) const
Returns
true if none of the objects has been deleted

◆ isActive()

Bool agx::MergedBody::isActive ( ) const
Returns
true if this merged body is in a simulation and assumed to be active

Definition at line 1233 of file MergedBody.h.

Referenced by getActive().

◆ isEmpty()

agx::Bool agx::MergedBody::isEmpty ( ) const
Returns
true if this merged body doesn't contain any bodies

◆ isRoot()

Bool agx::MergedBody::isRoot ( const agx::RigidBody rb)
inlinestatic
Parameters
rb- rigid body instance
Returns
true if rb is root body of a MergedBody instance, otherwise false

Definition at line 1202 of file MergedBody.h.

References agx::RigidBody::getEntity(), and agx::Physics::RigidBodyPtr::state().

◆ isTagged()

agx::Bool agx::MergedBody::isTagged ( InteractionTag  tag) const
Returns
true if this edge has the given tag

◆ merge()

agx::Bool agx::MergedBody::merge ( agx::MergedBody other,
EdgeInteraction edge 
)

Merges this with other and clears other.

Parameters
other- other root to merge with this
edge- new edge between this and other
Returns
true if successful, otherwise false

◆ merged()

agx::Bool agx::MergedBody::merged ( const agx::RigidBody rb1,
const agx::RigidBody rb2 
) const
Returns
true if rb1 is merged with rb2, i.e., there's an edge interaction present between them

◆ onAdd()

virtual void agx::MergedBody::onAdd ( agx::RigidBody ,
const agx::MergedBody  
) const
inlinevirtual

Called when a body is added to the merged body.

Definition at line 729 of file MergedBody.h.

◆ onAdded()

virtual void agx::MergedBody::onAdded ( EdgeInteraction ,
const agx::MergedBody  
) const
inlinevirtual

Called when an edge is added to the merged body.

Definition at line 739 of file MergedBody.h.

◆ onCleanup()

virtual void agx::MergedBody::onCleanup ( )
protectedvirtual

Called when the simulation is cleaned.

◆ onMovedFromTo()

virtual void agx::MergedBody::onMovedFromTo ( const MergedBody::EdgeInteractionRefContainer ,
const agx::MergedBody ,
const agx::MergedBody  
) const
inlinevirtual

Called when the edges between two bodies are moved from one merged body to another.

Definition at line 749 of file MergedBody.h.

◆ onRemove() [1/4]

virtual void agx::MergedBody::onRemove ( agx::Constraint constraint)
protectedvirtual

Called when a constraint, present in this merged body, is removed from the simulation.

◆ onRemove() [2/4]

virtual void agx::MergedBody::onRemove ( agx::RigidBody ,
const agx::MergedBody  
) const
inlinevirtual

Called when a body is removed from the merged body.

Definition at line 734 of file MergedBody.h.

◆ onRemove() [3/4]

virtual void agx::MergedBody::onRemove ( agx::RigidBody rb)
protectedvirtual

Called when a rigid body, present in this merged body, is removed from the simulation.

◆ onRemove() [4/4]

virtual void agx::MergedBody::onRemove ( agxCollide::Geometry geometry)
protectedvirtual

Called when a geometry, probably present in this merged body, is removed from space or body.

◆ onRemoved()

virtual void agx::MergedBody::onRemoved ( const MergedBody::EdgeInteractionRefContainer ,
const agx::MergedBody  
) const
inlinevirtual

Called when an edge is removed from the merged body.

Definition at line 744 of file MergedBody.h.

◆ ParticleParticleInteraction() [1/2]

agx::MergedBody::ParticleParticleInteraction ( )
protected

Default constructor used by serialization.

◆ ParticleParticleInteraction() [2/2]

agx::MergedBody::ParticleParticleInteraction ( agx::RigidBody substituteBody1,
agx::RigidBody substituteBody2 
)

Construct given two rigid bodies.

Both rigid bodies have to be valid.

◆ postStep()

virtual void agx::MergedBody::postStep ( )
protectedvirtual

Called after solver (new velocities and POSSIBLY (or not) new transforms).

See also
postIntegrate

◆ preCollide()

virtual void agx::MergedBody::preCollide ( )
protectedvirtual

Called before collision detection.

◆ preStep()

virtual void agx::MergedBody::preStep ( )
protectedvirtual

Called before solver executes.

◆ remove() [1/3]

agx::Bool agx::MergedBody::remove ( agx::RigidBody rb)

Split/Remove a rigid body from this merged body.

Note
If rb isn't part of this merged body this action will fail.
Parameters
rb- rigid body to split
Returns
true if successful, otherwise false

◆ remove() [2/3]

agx::Bool agx::MergedBody::remove ( EdgeInteraction edge)

Remove an edge interaction from this merged body.

Parameters
edge- edge interaction to remove
Returns
true if removed

◆ remove() [3/3]

agx::Bool agx::MergedBody::remove ( Listener *  listener)

Remove listener from this merged body.

Parameters
listener- listener to remove
Returns
true if removed, otherwise false

◆ restore()

virtual void agx::MergedBody::restore ( agxStream::InputArchive in)
overridevirtual

Restores the two bodies and the construction state.

◆ restoreLightData() [1/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ restoreLightData() [2/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ restoreLightData() [3/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ restoreLightData() [4/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ restoreLightData() [5/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ restoreLightData() [6/6]

virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream str)
overridevirtual

Restore non-structural data from stream.

◆ setBodies()

void agx::MergedBody::setBodies ( agx::RigidBody rb1,
agx::RigidBody rb2 
)
protected

Assign bodies during restore.

◆ setEnableAutomaticCleanupWhenEmpty()

void agx::MergedBody::setEnableAutomaticCleanupWhenEmpty ( agx::Bool  enable)

If true, this merged body will remove itself from the simulation and clear all internal states when it becomes empty.

This state is disabled by default and can be used when handling merged bodies implicitly by doing agx::MergedBody::get/getActive( rb ).

Note
This state is unnecessary as long as some other than agxSDK::Simulation is holding a reference to this object.
Parameters
enable- true to enable, false to disable

◆ setName()

void agx::MergedBody::setName ( const agx::Name name)

Assign new name to this MergedBOdy Default: "".

◆ setSimulation()

virtual void agx::MergedBody::setSimulation ( agxSDK::Simulation simulation)
protectedvirtual

Called during agxSDK::Simulation::add and agxSDK::Simulation::remove.

If removed, simulation == null.

◆ shouldIntegratePosition()

static agx::Bool agx::MergedBody::shouldIntegratePosition ( const agx::RigidBody rb)
static

◆ split() [1/3]

static agx::Bool agx::MergedBody::split ( agx::Constraint constraint)
static

Removes the edge defined by the constraint from the merged body, if any.

Returns
true if were merged and the edge was removed, otherwise false

◆ split() [2/3]

static agx::Bool agx::MergedBody::split ( agx::HighLevelConstraintImplementation constraint)
static

Removes the edge defined by the constraint from the merged body, if any.

Returns
true if were merged and the edge was removed, otherwise false

◆ split() [3/3]

static agx::Bool agx::MergedBody::split ( agx::RigidBody rb)
static

Split rigid body if merged.

Returns
true if the rigid body was merged and successfully removed from the merged body, otherwise false

◆ splitIslands()

agx::MergedBodyRefVector agx::MergedBody::splitIslands ( )

Splits into islands.

Returns
the other islands created and added to the simulation
Note
This merged body has to be in a simulation for this action to be performed.

◆ store()

virtual void agx::MergedBody::store ( agxStream::OutputArchive out) const
overridevirtual

Stores the two bodies and the construction state.

◆ storeLightData() [1/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ storeLightData() [2/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ storeLightData() [3/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ storeLightData() [4/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ storeLightData() [5/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ storeLightData() [6/6]

virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream str) const
overridevirtual

Store non-structural data to stream.

◆ traverse() [1/4]

void agx::MergedBody::traverse ( const agx::RigidBody rb,
EdgeInteractionVisitor  visitor,
agx::Bool  includeDisabled = false 
) const

Traverse the internal interaction graph and receive callback for each edge interaction where rb is part of.

Parameters
rb- rigid body to check whether part of an edge interaction
visitor- visitor function
includeDisabled- true to receive callback for all edge interactions, including ones with disabled and/or not simulating bodies. False to only receive callback for edge interactions containing enabled and simulated bodies.

◆ traverse() [2/4]

void agx::MergedBody::traverse ( const agx::RigidBody rb,
RigidBodyVisitor  visitor,
agx::Bool  includeDisabled = false 
) const

Traverse neighboring bodies to rb.

Neighboring bodies are the bodies with an edge interaction to rb.

Parameters
rb- rb with neighbors
visitor- visitor function
includeDisabled- true to receive callback for all bodies, false to only receive callback for enabled and simulated bodies

◆ traverse() [3/4]

void agx::MergedBody::traverse ( EdgeInteractionVisitor  visitor,
agx::Bool  includeDisabled = false 
) const

Traverse the internal interaction graph and receive callback for each edge interaction.

Parameters
visitor- visitor function
includeDisabled- true to receive callback for all edge interactions, including ones with disabled and/or not simulating bodies. False to only receive callback for edge interactions containing enabled and simulated bodies.

◆ traverse() [4/4]

void agx::MergedBody::traverse ( RigidBodyVisitor  visitor,
agx::Bool  includeDisabled = false 
) const

Traverse the internal interaction graph and receive callback for all rigid bodies (unique).

Parameters
visitor- visitor function
includeDisabled- true to receive callback for all bodies, false to only receive callback for enabled and simulated bodies

◆ updateProperties()

agx::Bool agx::MergedBody::updateProperties ( )

Updates mass, position, velocity etc of the root body given the current state.

Returns
true if all is valid and the root can be added to the solver

The documentation for this class was generated from the following file: