17 #ifndef AGXMODEL_TREE_H
18 #define AGXMODEL_TREE_H
95 bool removeBranch(
size_t index );
100 size_t getNumBranches()
const;
157 void setMaxTranslationalLoad(
agx::Real maxLoad );
163 void setMaxRotationalLoad(
agx::Real maxLoad );
174 agx::Real getMaxTranslationalLoad()
const;
190 agx::Real getCurrentTranslationalLoad()
const;
195 agx::Real getCurrentRotationalLoad()
const;
297 Tree* getTree()
const;
301 void setTree(
Tree* tree );
347 enum State { INITIALIZED = (1<<0), STATIC = (1<<1), WAKE_ON_CONTACT = (1<<2) };
358 virtual Tree* clone();
368 bool initialized()
const;
375 virtual bool initialize();
380 bool isStatic()
const;
385 bool wakeOnContact()
const;
573 virtual void clear();
609 virtual void preCollide();
625 void configure(
Branch* branch );
652 virtual void checkLoad(
Branch* branch );
657 void split(
Branch* source,
Branch* destination )
const;
665 void remove(
Branch* branch );
671 void add(
Branch* branch );
690 void copyParameters(
const Branch* source,
Branch* destination )
const;
708 : m_tree( tree ) { setMask( IMPACT ); }
725 : m_tree( tree ) { setMask( PRE_COLLIDE | PRE_STEP | POST_STEP ); }
756 template<
typename T >
759 agx::Real oldLength = shape->getHeight();
760 newBelowLength =
agx::Real( 0.5 ) * oldLength + position;
761 newAboveLength = oldLength - newBelowLength;
762 if ( newBelowLength < 0 || newAboveLength < 0 )
764 shape->setHeight( newBelowLength );
765 return new T( shape->getRadius(), newAboveLength );
773 #endif // AGXMODEL_TREE_H
agx::observer_ptr< Tree > m_tree
BranchContainer::iterator BranchIterator
bool add(agx::Constraint *constraint)
Add a constraint to the assembly.
AGXTERRAIN_EXPORT void clear()
agx::ref_ptr< BranchEventListener > BranchEventListenerRef
AGXMODEL_EXPORT agx::Real getShapeLength(const agxCollide::Shape *shape)
agx::ref_ptr< Branch > BranchRef
Derive from this class to implement a listener for simulation Step events.
GroupIdContainer m_geometryIDs
agx::MaterialRef m_material
TreeStepEventListenerRef m_stepListener
agx::SymmetricPair< agx::Physics::GeometryPtr > GeometryPair
Branch is a part of the Tree, with a body and a constraint to its parent.
Abstract base class that implements a filter that selects which events should trigger a Listener...
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
agx::observer_ptr< Branch > BranchObs
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
The base class for a constraint.
const BranchRef * const_iterator
virtual ~TreeStepEventListener()
TreeExecuteFilter allows to catch contacts with the Tree.
agx::Vector< BranchRef > BranchContainer
agx::HashVector< agxCollide::Geometry *, agx::observer_ptr< agxCollide::Geometry > > DisabledCollisionsGeometryContainer
Base class providing referencing counted objects.
TreeStepEventListener(Tree *tree)
The geometry representation used by the collision detection engine.
bool remove(agx::Constraint *constraint)
Remove a constraint from this assembly (does not recurse down in tree).
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
agx::ref_ptr< agx::Referenced > m_customData
AGXMODEL_EXPORT agx::Real getShapeRadius(const agxCollide::Shape *shape)
DisabledCollisionsGeometryContainer m_externalDisabledGeometries
T * cutShape(T *shape, agx::Real position, agx::Real &newBelowLength, agx::Real &newAboveLength)
agx::ConstraintRef m_constraint
agx::ref_ptr< agx::Referenced > m_customData
virtual bool match(const agxCollide::GeometryContact &gc) const
Called when narrow phase tests have determined overlap (when we have detailed intersection between th...
agx::UInt32 m_geometriesID
Tree is a structure of Branch objects in a mathematical Tree structure where a Branch can have severa...
agx::ref_ptr< TreeContactEventListener > TreeContactEventListenerRef
The rigid body class, combining a geometric model and a frame of reference.
Main material class which acts as a holder of a Surface Material and a Bulk material.
BranchEventListenerRef m_branchListener
AGXPHYSICS_EXPORT bool setEnableCollisions(agx::RigidBody *rb1, agx::RigidBody *rb2, bool enable)
Enable or disable the collision between all geometries in RigidBody rb1 and RigidBody rb2...
SolveType
Specifies in what solvers the constraint will be solved.
The object defining a frame of reference and providing transformations operations.
virtual void addNotification(agxSDK::Simulation *)
Called when this assembly is added to a simulation (given that it not already is in the simulation)...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
agx::ref_ptr< TreeStepEventListener > TreeStepEventListenerRef
agx::ref_ptr< Tree > TreeRef
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
agx::UInt32 m_disabledCollisionsID
AGXCORE_EXPORT Component * root()
TreeContactEventListenerRef m_wakeOnContactListener
agx::ref_ptr< TreeExecuteFilter > TreeExecuteFilterRef
agx::SetVector< agx::UInt32 > GroupIdContainer
BranchContainer::const_iterator BranchConstIterator
BranchContainer m_branches
BranchEventListener handles certain events happening to a Tree.
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.