17 #ifndef AGX_MERGESPLITBODYSTORAGE_H
18 #define AGX_MERGESPLITBODYSTORAGE_H
90 bool hasChildren()
const;
95 size_t getNumChildren()
const;
121 bool isMerged()
const;
164 inline void incrementNumUpdates();
166 inline void resetNumUpdates();
168 inline size_t getNumUpdates();
196 static size_t m_rebuildNumChildren;
197 static size_t m_rebuildNumUpdates;
219 return m_children.
size();
234 return m_motionControl;
239 return m_children.
size() > 0;
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
The geometry representation used by the collision detection engine.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
The object defining a frame of reference and providing transformations operations.
Book keeping of a body which can be merged with other bodies.
void addGeometry(agxCollide::Geometry *geom)
bool hasChild(MergeSplitBodyStorage *child) const
const MergeSplitBodyStorage * getChild(size_t nth) const
AffineMatrix4x4 getTransformRelativeParent() const
static void setRebuildThreshold(size_t numChildren, size_t numUpdates)
Set the threshold when the inertiatensor of a parent should be completely rebuilt.
bool removeChild(MergeSplitBodyStorage *child)
Remove a storage so its no longer a child of this storage.
MergeSplitBodyStorage * getChild(size_t nth)
agx::Vector< agx::observer_ptr< agxCollide::Geometry > > GeometryObserverVector
virtual ~MergeSplitBodyStorage()
void clear()
Reset this storage so its not associated to any body.
static void addMassProperties(MergeSplitBodyStorage *targetStorage, const MergeSplitBodyStorage *sourceStorage, Real sign)
size_t getNumChildren() const
void followGeometry()
Make the body follow the first geometry in the list of geometries.
void setMotionControl(agx::RigidBody::MotionControl m)
agx::RigidBody::MotionControl getMotionControl() const
void restoreMassProperties()
static void removeMassProperties(MergeSplitBodyStorage *targetStorage, const MergeSplitBodyStorage *sourceStorage, Real sign)
void setRigidBody(agx::RigidBody *body)
Associate this storage with the specified body.
MergeSplitBodyStorage(agx::RigidBody *body)
Constructor which associates a body to this body storage.
const agxCollide::GeometryRefVector & getGeometries() const
void incrementNumUpdates()
void addChild(MergeSplitBodyStorage *child)
Add a storage as a child to this storage.
agx::RigidBody * getRigidBody()
void restore(bool beingErased=false)
Restore the associated body in that it will get back all its original geometries, motioncontrol etc.
MergeSplitBodyStorage()
Default constructor.
void calculateRelativeTransform(const MergeSplitBodyStorage *parentStorage)
Calculate and store the transform relative the parent body.
MergeSplitBodyStorage * getParent()
void setParent(MergeSplitBodyStorage *parent)
Set the pointer to the parent body of this body.
Class which will go through contacting/separating bodies and determine if the bodies can be merged (g...
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
MotionControl
The MotionControl enumeration indicates what makes a RigidBody move.
Specialized type of matrices for holding symmetric positive definite matrices.
size_t size() const
Return the number of inserted elements.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.