AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
BinaryConstraintEdgeInteraction > 
BinaryConstraintEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const
BinaryConstraintEdgeInteraction > 
BinaryConstraintEdgeInteractionConstRef
 
typedef agx::observer_ptr
< BinaryConstraintEdgeInteraction > 
BinaryConstraintEdgeInteractionObserver
 
typedef agx::ref_ptr
< BinaryConstraintEdgeInteraction > 
BinaryConstraintEdgeInteractionRef
 
typedef agx::observer_ptr
< const
ContactGeneratorEdgeInteraction > 
ContactGeneratorEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const
ContactGeneratorEdgeInteraction > 
ContactGeneratorEdgeInteractionConstRef
 
typedef agx::observer_ptr
< ContactGeneratorEdgeInteraction > 
ContactGeneratorEdgeInteractionObserver
 
typedef agx::ref_ptr
< ContactGeneratorEdgeInteraction > 
ContactGeneratorEdgeInteractionRef
 
typedef agx::observer_ptr
< const EdgeInteraction > 
EdgeInteractionConstObserver
 
typedef agx::ref_ptr< const
EdgeInteraction > 
EdgeInteractionConstRef
 
typedef agx::observer_ptr
< EdgeInteraction > 
EdgeInteractionObserver
 
typedef agx::ref_ptr
< EdgeInteraction > 
EdgeInteractionRef
 
typedef agx::Vector
< EdgeInteractionRef > 
EdgeInteractionRefContainer
 
typedef std::function< void(EdgeInteraction *) > EdgeInteractionVisitor
 
typedef agx::observer_ptr
< const EmptyEdgeInteraction > 
EmptyEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const
EmptyEdgeInteraction > 
EmptyEdgeInteractionConstRef
 
typedef agx::observer_ptr
< EmptyEdgeInteraction > 
EmptyEdgeInteractionObserver
 
typedef agx::ref_ptr
< EmptyEdgeInteraction > 
EmptyEdgeInteractionRef
 
typedef agx::observer_ptr
< const
GeometryContactEdgeInteraction > 
GeometryContactEdgeInteractionConstObserver
 
typedef agx::ref_ptr< const
GeometryContactEdgeInteraction > 
GeometryContactEdgeInteractionConstRef
 
typedef agx::observer_ptr
< GeometryContactEdgeInteraction > 
GeometryContactEdgeInteractionObserver
 
typedef agx::ref_ptr
< GeometryContactEdgeInteraction > 
GeometryContactEdgeInteractionRef
 
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< State > InternalState
 
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
ParticleParticleInteraction > 
ParticleParticleInteractionConstObserver
 
typedef agx::ref_ptr< const
ParticleParticleInteraction > 
ParticleParticleInteractionConstRef
 
typedef agx::observer_ptr
< ParticleParticleInteraction > 
ParticleParticleInteractionObserver
 
typedef agx::ref_ptr
< ParticleParticleInteraction > 
ParticleParticleInteractionRef
 
typedef agx::VectorPOD< Point > PointContainer
 
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. More...
 
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. More...
 
agx::Bool add (Listener *listener)
 Add listener to receive callbacks during certain events. More...
 
 AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (MergedBody::EdgeInteraction)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
 BinaryConstraintEdgeInteraction (agx::Constraint *constraint)
 Construct given a one or two body constraint. More...
 
 BinaryConstraintEdgeInteraction (agx::HighLevelConstraintImplementation *constraint)
 Construct given constraint implementation of a binary constraint. More...
 
virtual MergedBodyRef clone ()
 Creates an empty clone of this merged body where each object that supports cloning also are cloned. More...
 
virtual ListenerRef clone ()=0
 This listener will be cloned when e.g., splitIslands is used. More...
 
 ContactGeneratorEdgeInteraction (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Construct given two rigid bodies. More...
 
agx::Bool containsDeletedBodies () const
 
void debugPrint (const agx::RigidBody *rb) const
 Debug prints (cout) interactions to rb. More...
 
 EmptyEdgeInteraction (agx::RigidBody *rb1, agx::RigidBody *rb2)
 Construct given two rigid bodies. More...
 
virtual void generateInteraction (agxSDK::Simulation *simulation, agxCollide::LocalGeometryContactVector &newContacts)=0
 Generate interaction or do nothing. More...
 
 GeometryContactEdgeInteraction (agx::Physics::GeometryContactPtr gcPtr)
 Construct given a geometry contact data. More...
 
 GeometryContactEdgeInteraction (agxCollide::Geometry *geometry1, agx::RigidBody *rb1, agxCollide::Geometry *geometry2, agx::RigidBody *rb2)
 Construct given two geometries. More...
 
const char * getClassName () const override
 
const char * getClassName () const override
 
const char * getClassName () const override
 
const char * getClassName () const override
 
const char * getClassName () const override
 
agx::HighLevelConstraintImplementation * getConstraint ()
 
const
agx::HighLevelConstraintImplementation * 
getConstraint () const
 
void getDebugRenderColor (agx::Vec3 &color) const
 Color of this merged body used for debug rendering. More...
 
const EdgeInteractionRefContainer * getEdges (const agx::RigidBody *rb1, const agx::RigidBody *rb2) const
 
agx::Bool getEnableAutomaticCleanupWhenEmpty () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agxCollide::Geometry * getGeometry1 () const
 
agxCollide::Geometry * getGeometry2 () const
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
const agx::RigidBodyPtrVector * getNeighbors (const agx::RigidBody *rb) const
 
agx::UInt getNumPairs () const
 
const PointContainer & getPoints () const
 
int getReferenceCount () const
 
agx::RigidBody * getRigidBody () const
 
agx::RigidBody * getRigidBody1 () const
 
agx::RigidBody * getRigidBody2 () const
 
const InternalState & getState () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
agxStream::StorageAgent * getStorageAgent () const override
 
agxStream::StorageAgent * getStorageAgent () const override
 
agxStream::StorageAgent * getStorageAgent () const override
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::Uuid getUuid () const
 
agx::Bool getValid () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
agx::Bool isActive () const
 
agx::Bool isEmpty () const
 
bool isFinished () const
 
agx::Bool isTagged (InteractionTag tag) const
 
agx::Bool merge (agx::MergedBody *other, EdgeInteraction *edge)
 Merges this with other and clears other. More...
 
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. More...
 
virtual void onAdded (EdgeInteraction *, const agx::MergedBody *) const
 Called when an edge is added to the merged body. More...
 
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. More...
 
virtual void onRemove (agx::RigidBody *, const agx::MergedBody *) const
 Called when a body is removed from the merged body. More...
 
virtual void onRemoved (const MergedBody::EdgeInteractionRefContainer &, const agx::MergedBody *) const
 Called when an edge is removed from the merged body. More...
 
 ParticleParticleInteraction (agx::RigidBody *substituteBody1, agx::RigidBody *substituteBody2)
 Construct given two rigid bodies. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
agx::Bool remove (EdgeInteraction *edge)
 Remove an edge interaction from this merged body. More...
 
agx::Bool remove (agx::RigidBody *rb)
 Split/Remove a rigid body from this merged body. More...
 
agx::Bool remove (Listener *listener)
 Remove listener from this merged body. More...
 
virtual void restore (agxStream::InputArchive &in) override
 Restores the two bodies and the construction state. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
virtual void restoreLightData (agxStream::StorageStream &str) override
 Restore non-structural data from stream. More...
 
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. More...
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
agx::MergedBodyRefVector splitIslands ()
 Splits into islands. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 Stores the two bodies and the construction state. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void store (agxStream::OutputArchive &out) const override
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
virtual void storeLightData (agxStream::StorageStream &str) const override
 Store non-structural data to stream. More...
 
void traverse (RigidBodyVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse the internal interaction graph and receive callback for all rigid bodies (unique). More...
 
void traverse (EdgeInteractionVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse the internal interaction graph and receive callback for each edge interaction. More...
 
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. More...
 
void traverse (const agx::RigidBody *rb, RigidBodyVisitor visitor, agx::Bool includeDisabled=false) const
 Traverse neighboring bodies to rb. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static agxStream::Serializable * create ()
 
static const agx::RigidBody * filter (const agx::RigidBody *rb)
 Filters rb and returns the merged rigid body if rb is part of one. More...
 
static agx::RigidBody * filter (agx::RigidBody *rb)
 
static MergedBodyIndex findMergedBodyIndex (agx::Physics::RigidBodyPtr rb)
 Similar to filter( const agx::RigidBody* rb ). More...
 
static const agx::MergedBody * get (const agx::RigidBody *rb)
 This method returns an agx::MergedBody if rb has been added to one. More...
 
static agx::MergedBody * get (agx::RigidBody *rb)
 This method returns an agx::MergedBody if rb has been added to one. More...
 
static agx::MergedBody * get (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. More...
 
static const agx::MergedBody * get (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. More...
 
static const agx::MergedBody * getActive (const agx::RigidBody *rb)
 This method returns an agx::MergedBody that is active and in a simulation. More...
 
static agx::MergedBody * getActive (agx::RigidBody *rb)
 This method returns an agx::MergedBody that is active and in a simulation. More...
 
static const char * getConstructClassId ()
 
static const char * getConstructClassId ()
 
static const char * getConstructClassId ()
 
static const char * getConstructClassId ()
 
static const char * getConstructClassId ()
 
static
BinaryConstraintEdgeInteraction * 
getEdge (const agx::Constraint *constraint)
 
static
BinaryConstraintEdgeInteraction * 
getEdge (const agx::HighLevelConstraintImplementation *constraint)
 
static agx::Bool isRoot (const agx::RigidBody *rb)
 
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 
static agx::Bool shouldIntegratePosition (const agx::RigidBody *rb)
 
static agx::Bool split (agx::RigidBody *rb)
 Split rigid body if merged. More...
 
static agx::Bool split (agx::Constraint *constraint)
 Removes the edge defined by the constraint from the merged body, if any. More...
 
static agx::Bool split (agx::HighLevelConstraintImplementation *constraint)
 Removes the edge defined by the constraint from the merged body, if any. More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

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

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

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 54 of file MergedBody.h.

Member Typedef Documentation

Definition at line 107 of file MergedBody.h.

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

Definition at line 108 of file MergedBody.h.

Definition at line 105 of file MergedBody.h.

Definition at line 105 of file MergedBody.h.

Definition at line 105 of file MergedBody.h.

Definition at line 105 of file MergedBody.h.

Definition at line 962 of file MergedBody.h.

Definition at line 106 of file MergedBody.h.

Member Enumeration Documentation

Enumerator
NONE 
CONTACT 
CONTACT_GENERATOR 
CONSTRAINT 
BINARY_CONSTRAINT 
PARTICLE_GENERATOR 

Definition at line 752 of file MergedBody.h.

Internal state of this merged body.

Enumerator
INTERACTION_GRAPH_DIRTY 
RESTORED 
READY_FOR_SOLVER 
AUTO_CLEAN_WHEN_EMPTY 

Definition at line 68 of file MergedBody.h.

Constructor & Destructor Documentation

agx::MergedBody::MergedBody ( )

Construct merged body, default containing a root rigid body.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

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

Reference counted object, protected destructor.

Member Function Documentation

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
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
agx::MergedBody::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( MergedBody::EdgeInteraction  )
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
agx::MergedBody::BinaryConstraintEdgeInteraction ( agx::Constraint *  constraint)
explicit

Construct given a one or two body constraint.

Parameters
constraint- one or two body constraint
agx::MergedBody::BinaryConstraintEdgeInteraction ( agx::HighLevelConstraintImplementation *  constraint)
explicit

Construct given constraint implementation of a binary constraint.

Parameters
constraint- binary constraint
agx::MergedBody::BinaryConstraintEdgeInteraction ( )
protected

Default constructor used by serialization.

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
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
agx::MergedBody::ContactGeneratorEdgeInteraction ( agx::RigidBody *  rb1,
agx::RigidBody *  rb2 
)

Construct given two rigid bodies.

Both rigid bodies have to be valid.

agx::MergedBody::ContactGeneratorEdgeInteraction ( )
protected

Default constructor used by serialization.

agx::Bool agx::MergedBody::containsDeletedBodies ( ) const
Returns
true if one or both objects has been deleted
static agxStream::Serializable* agx::MergedBody::create ( )
inlinestatic

Definition at line 863 of file MergedBody.h.

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

Definition at line 863 of file MergedBody.h.

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

Definition at line 905 of file MergedBody.h.

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

Definition at line 905 of file MergedBody.h.

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

Definition at line 997 of file MergedBody.h.

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

Definition at line 997 of file MergedBody.h.

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

Definition at line 1079 of file MergedBody.h.

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

Definition at line 1079 of file MergedBody.h.

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

Definition at line 1123 of file MergedBody.h.

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

Definition at line 1123 of file MergedBody.h.

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

Debug prints (cout) interactions to rb.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
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
agx::MergedBody::EmptyEdgeInteraction ( agx::RigidBody *  rb1,
agx::RigidBody *  rb2 
)

Construct given two rigid bodies.

Both rigid bodies have to be valid.

agx::MergedBody::EmptyEdgeInteraction ( )
protected

Default constructor used by serialization.

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 1203 of file MergedBody.h.

References getRigidBody(), and agx::root().

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

Definition at line 1209 of file MergedBody.h.

References getRigidBody(), and agx::root().

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 1195 of file MergedBody.h.

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

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.

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

Does nothing.

Definition at line 889 of file MergedBody.h.

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

Checks for contacts between the bodies and adds them.

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

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

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

Activates the constraint.

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

Checks for contacts between the bodies and adds them.

void agxStream::Serializable::generateUuid ( )
protectedinherited
agx::MergedBody::GeometryContactEdgeInteraction ( agx::Physics::GeometryContactPtr  gcPtr)
explicit

Construct given a geometry contact data.

Parameters
gcPtr- geometry contact data
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
agx::MergedBody::GeometryContactEdgeInteraction ( )
protected

Default constructor used by serialization.

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 1165 of file MergedBody.h.

Referenced by getActive().

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 1171 of file MergedBody.h.

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
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
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 1177 of file MergedBody.h.

References get(), and isActive().

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 1183 of file MergedBody.h.

References get(), and isActive().

const char* agx::MergedBody::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 863 of file MergedBody.h.

const char* agx::MergedBody::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 905 of file MergedBody.h.

const char* agx::MergedBody::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 997 of file MergedBody.h.

const char* agx::MergedBody::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 1079 of file MergedBody.h.

const char* agx::MergedBody::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 1123 of file MergedBody.h.

agx::HighLevelConstraintImplementation* agx::MergedBody::getConstraint ( )
Returns
the constraint
const agx::HighLevelConstraintImplementation* agx::MergedBody::getConstraint ( ) const
Returns
the constraint
static const char* agx::MergedBody::getConstructClassId ( )
inlinestatic

Definition at line 863 of file MergedBody.h.

static const char* agx::MergedBody::getConstructClassId ( )
inlinestatic

Definition at line 905 of file MergedBody.h.

static const char* agx::MergedBody::getConstructClassId ( )
inlinestatic

Definition at line 997 of file MergedBody.h.

static const char* agx::MergedBody::getConstructClassId ( )
inlinestatic

Definition at line 1079 of file MergedBody.h.

static const char* agx::MergedBody::getConstructClassId ( )
inlinestatic

Definition at line 1123 of file MergedBody.h.

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

Color of this merged body used for debug rendering.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
static BinaryConstraintEdgeInteraction* agx::MergedBody::getEdge ( const agx::Constraint *  constraint)
static
Returns
the edge interaction associated to the constraint, otherwise nullptr
static BinaryConstraintEdgeInteraction* agx::MergedBody::getEdge ( const agx::HighLevelConstraintImplementation *  constraint)
static
Returns
the edge interaction associated to the constraint, otherwise nullptr
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().

agx::Bool agx::MergedBody::getEnableAutomaticCleanupWhenEmpty ( ) const
Returns
true if automatic cleanup when empty is enabled - otherwise false
bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object
agxCollide::Geometry* agx::MergedBody::getGeometry1 ( ) const
Returns
first geometry
agxCollide::Geometry* agx::MergedBody::getGeometry2 ( ) const
Returns
second geometry
agx::UInt32 agxStream::Serializable::getIndex ( ) const
inherited

This index is given at creation of this object.

It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

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().

agx::UInt agx::MergedBody::getNumPairs ( ) const
Returns
the number of pair interactions in this merged body
const PointContainer& agx::MergedBody::getPoints ( ) const
Returns
vector with contact point data
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::RigidBody* agx::MergedBody::getRigidBody ( ) const
Returns
the root rigid body of this merged body

Referenced by filter(), and findMergedBodyIndex().

agx::RigidBody* agx::MergedBody::getRigidBody1 ( ) const
Returns
first rigid body
agx::RigidBody* agx::MergedBody::getRigidBody2 ( ) const
Returns
second rigid body
agxSDK::Simulation* agx::MergedBody::getSimulation ( )
protected
Returns
the simulation this merged body is part of
const agxSDK::Simulation* agx::MergedBody::getSimulation ( ) const
protected
Returns
the simulation this merged body is part of
const InternalState& agx::MergedBody::getState ( ) const
Returns
current internal state
agxStream::StorageAgent* agx::MergedBody::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 863 of file MergedBody.h.

agxStream::StorageAgent* agx::MergedBody::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 905 of file MergedBody.h.

agxStream::StorageAgent* agx::MergedBody::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 997 of file MergedBody.h.

agxStream::StorageAgent* agx::MergedBody::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 1079 of file MergedBody.h.

agxStream::StorageAgent* agx::MergedBody::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 1123 of file MergedBody.h.

agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

agx::Bool agx::MergedBody::getValid ( ) const
Returns
true if none of the objects has been deleted
template<typename T >
bool agx::Referenced::is ( ) const
inherited
Bool agx::MergedBody::isActive ( ) const
Returns
true if this merged body is in a simulation and assumed to be active

Definition at line 1220 of file MergedBody.h.

Referenced by getActive().

agx::Bool agx::MergedBody::isEmpty ( ) const
Returns
true if this merged body doesn't contain any bodies
bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

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 1189 of file MergedBody.h.

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

agx::Bool agx::MergedBody::isTagged ( InteractionTag  tag) const
Returns
true if this edge has the given tag
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
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
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 716 of file MergedBody.h.

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

Called when an edge is added to the merged body.

Definition at line 726 of file MergedBody.h.

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

Called when the simulation is cleaned.

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 736 of file MergedBody.h.

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

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

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

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

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.

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 721 of file MergedBody.h.

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 731 of file MergedBody.h.

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

Construct given two rigid bodies.

Both rigid bodies have to be valid.

agx::MergedBody::ParticleParticleInteraction ( )
protected

Default constructor used by serialization.

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

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

See Also
postIntegrate
virtual void agx::MergedBody::preCollide ( )
protectedvirtual

Called before collision detection.

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

Called before solver executes.

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

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
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
agx::Bool agx::MergedBody::remove ( Listener *  listener)

Remove listener from this merged body.

Parameters
listener- listener to remove
Returns
true if removed, otherwise false
virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual

Restores the two bodies and the construction state.

virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual
virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual
virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual
virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual
virtual void agx::MergedBody::restore ( agxStream::InputArchive &  in)
overridevirtual
virtual void agx::MergedBody::restoreLightData ( agxStream::StorageStream &  str)
overridevirtual

Restore non-structural data from stream.

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

Restore non-structural data from stream.

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

Restore non-structural data from stream.

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

Restore non-structural data from stream.

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

Restore non-structural data from stream.

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

Restore non-structural data from stream.

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

Assign bodies during restore.

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

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
void agxStream::Serializable::setEnableSerialization ( bool  flag)
inherited

Set to false to disable serialization of this object.

It will just be ignored during serialization (writing). It is still possible to restore TO this object.

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

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

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

If removed, simulation == null.

void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

Explicitly set a Uuid on a serializable object.

Use this method with great care, as it can result in non-unique identifiers in the system!

static agx::Bool agx::MergedBody::shouldIntegratePosition ( const agx::RigidBody *  rb)
static
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
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
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
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.
virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual

Stores the two bodies and the construction state.

virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual
virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual
virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual
virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual
virtual void agx::MergedBody::store ( agxStream::OutputArchive &  out) const
overridevirtual
virtual void agx::MergedBody::storeLightData ( agxStream::StorageStream &  str) const
overridevirtual

Store non-structural data to stream.

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

Store non-structural data to stream.

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

Store non-structural data to stream.

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

Store non-structural data to stream.

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

Store non-structural data to stream.

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

Store non-structural data to stream.

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
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.
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.
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
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

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

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
template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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