360 template <
typename T >
361 T* getConstraint(
const agx::Name& name,
bool recursive =
true);
372 template <
typename T >
373 const T* getConstraint(
const agx::Name& name,
bool recursive =
true)
const;
849 bool reset(
bool resetParentFrame =
true);
915 return m_frame.
get();
920 return m_frame.
get();
985 template<
typename T >
988 return dynamic_cast< T*
>(this->
getConstraint(name, recursive));
991 template<
typename T >
994 return dynamic_cast< const T*
>(this->
getConstraint(name, recursive));
#define AGX_DECLARE_POINTER_TYPES(type)
#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
#define AGX_ADD_FRAME_TRANSFORM_INTERFACE()
#define AGX_DECLARE_VECTOR_TYPES(type)
The geometry representation used by the collision detection engine.
Class for visiting all elements in a tree of Assemblies.
virtual void visit(const agx::Constraint *) const
virtual void visit(const agx::ParticleSystem *) const
virtual void visit(agxCollide::Geometry *)
virtual void visit(agx::ContactMaterial *)
virtual void visit(const agx::MergedBody *) const
virtual void visit(agxSDK::TerrainToolInstance *)
virtual void visit(const agxCollide::Geometry *) const
virtual void visit(const agxSDK::TerrainToolInstance *) const
virtual void visit(const EventListener *) const
virtual void visit(agx::Emitter *)
virtual void visit(const agx::ContactMaterial *) const
virtual void visit(const agxSDK::TerrainInstance *) const
virtual void visit(agx::ParticleSystem *)
virtual void visit(const agx::Emitter *) const
virtual void visit(agxSDK::TerrainInstance *)
virtual void visit(const agx::Interaction *) const
virtual void visit(agx::ObserverFrame *)
virtual void visit(agx::Interaction *)
virtual void visit(const Assembly *) const
virtual void visit(const agx::ObserverFrame *) const
virtual void visit(agx::Constraint *)
virtual void visit(const agx::RigidBody *) const
virtual void visit(Assembly *)
void setSucceed(bool flag)
virtual void visit(agx::MergedBody *)
virtual void visit(agx::RigidBody *)
virtual ~AssemblyVisitor()
virtual void visit(EventListener *)
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
const agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
virtual agx::Frame * getFrame()
Return a reference to the frame containing transformation and velocity information for this assembly.
virtual void setVelocity(const agx::Vec3 &velocity)
Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
size_t collect(agx::ConstraintRefVector &result, bool recursive=true)
bool remove(EventListener *listener)
Remove an EventListener from the assembly.
bool removeParticleSystem(agx::ParticleSystem *particleSystem)
Remove a particle system from this assembly.
agx::Vec3 getLocalPosition() const
const agx::InteractionRefSetVector & getInteractions() const
bool add(agxSDK::EventListener *listener)
Add a listener to the assembly.
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
void setPosition(agx::Real x, agx::Real y, agx::Real z)
Set the position of the frame in world coordinates.
virtual void traverse(const AssemblyVisitor *visitor) const
bool add(agxCollide::Geometry *geometry)
Add a geometry to the assembly.
void removeFromSimulation(Simulation *simulation)
const agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an Assembly matching the given uuid.
agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a Geometry matching the given uuid.
agx::Constraint2DOF * getConstraint2DOF(const agx::Name &name, bool recursive=true)
const agx::ParticleSystemRefSetVector & getParticleSystems() const
agx::MergedBody * getMergedBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an MergedBody matching the given uuid.
const agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named collision Geometry.
bool add(agx::ObserverFrame *observerFrame)
Add an ObserverFrame to this assembly.
Assembly()
Default constructor.
void setRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to world frame.
const agx::ObserverFrameRefSetVector & getObserverFrames() const
void setPosition(const agx::Vec3 &p)
Set the position of the frame in world coordinates.
const EventListenerRefSetVector & getEventListeners() const
agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true)
Find (linear search) and return named collision Geometry.
const agx::ConstraintRefSetVector & getConstraints() const
bool remove(agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true)
Remove a rigid body from this assembly (does not recurse down in tree).
const agx::EmitterRefSetVector & getEmitters() const
bool remove(agx::MergedBody *mergedBody)
Remove a MergedBody from this assembly.
bool remove(agxCollide::Geometry *geometry, bool resetParentFrame=true)
Remove a geometry from this assembly (does not recurse down in tree).
agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an Assembly matching the given uuid.
agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
void setLocalPosition(agx::Real x, agx::Real y, agx::Real z)
Set the position of the assembly relative to its frame's parent frame.
bool remove(agxSDK::TerrainToolInstance *toolInstance)
Remove a TerrainToolInstance from this assembly.
size_t collect(agx::ParticleSystemRefVector &result, bool recursive=true)
bool add(agxStream::Serializable *object)
Add an object of type serialized.
agx::Name getName() const
static Assembly * asAssembly(agxStream::Serializable *obj)
virtual ~Assembly()
Destructor.
void setName(const agx::Name &name)
Set the name of this Assembly.
virtual void setAngularVelocity(const agx::Vec3 &velocity)
Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
bool addParticleSystem(agx::ParticleSystem *particleSystem)
Add a particle system to this assembly.
agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
bool add(agx::RigidBody *body)
Add a rigid body to the assembly.
bool add(agx::Constraint *constraint)
Add a constraint to the assembly.
const agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Constraint.
const agx::RigidBody * getRigidBody(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a pointer to a RigidBody with the given uuid.
size_t collect(agxCollide::GeometryRefVector &result, bool recursive=true)
virtual void traverse(AssemblyVisitor *visitor)
Traverse the assembly tree recursively using a visitor.
agx::Constraint * getConstraint(const agx::Uuid &uuid, bool recursive=true)
Find and return a pointer to a Constraint with the given uuid.
void setLocalTransform(const agx::AffineMatrix4x4 &matrix)
Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation...
bool remove(agx::Emitter *emitter)
Remove an emitter from this assembly.
size_t collect(agx::ObserverFrameRefVector &result, bool recursive=true)
bool add(agxSDK::TerrainInstance *terrainInstance)
Add a TerrainInstance to this assembly.
void setLocalRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to its frame's parent frame.
size_t collect(agx::RigidBodyRefVector &result, bool recursive=true)
bool reset(bool resetParentFrame=true)
If this assembly is not added to a simulation it will clear all added bodies etc.
bool add(agx::ContactMaterial *contactMaterial)
Add a contact material to this assembly.
bool transfer(agxSDK::Assembly *target)
Transfer all the content from this assembly to the target, including name and transformation.
agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Assembly.
const agxSDK::TerrainToolInstance * getTerrainToolInstance(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an TerrainToolInstance matching the given uuid.
const agxSDK::TerrainInstanceRefSetVector & getTerrainInstances() const
const agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named RigidBody.
bool remove(Assembly *assembly, bool resetParentFrame=true)
Remove a child assembly from a parent.
const agxSDK::TerrainToolInstanceRefSetVector & getTerrainToolInstances() const
const agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a Geometry matching the given uuid.
agx::Frame * getParentFrame()
size_t collect(agx::MergedBodyRefVector &result, bool recursive=true)
const Assembly * getParent() const
bool remove(agx::Interaction *interaction)
Remove an interaction from this assembly.
void setLocalPosition(const agx::Vec3 &p)
Set the position of the assembly relative to its frame's parent frame.
const agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
bool add(agxSDK::TerrainToolInstance *toolInstance)
Add a TerrainToolInstance to this assembly.
agx::Quat getLocalRotation() const
const agxCollide::GeometryRefSetVector & getGeometries() const
bool remove(agx::ObserverFrame *observerFrame, bool resetParentFrame=true)
Remove an ObserverFrame from this assembly.
virtual void addNotification(Assembly *)
Called when this assembly is added to another assembly.
virtual void removeNotification(Assembly *)
Called when this assembly is removed from another assembly.
const agx::Frame * getParentFrame() const
void addToSimulation(Simulation *simulation)
bool remove(agx::Constraint *constraint)
Remove a constraint from this assembly (does not recurse down in tree).
const agxSDK::TerrainInstance * getTerrainInstance(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an TerrainInstance matching the given uuid.
const agx::MergedBody * getMergedBody(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an MergedBody matching the given uuid.
bool add(agx::Interaction *interaction)
Add an interaction to this assembly.
const agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Assembly.
const agxSDK::Simulation * getSimulation() const
Type
Specifies the type an assembly is.
@ ASSEMBLY
This is a full fledged Assembly which uses Frame for the hierarchy.
agx::Constraint1DOF * getConstraint1DOF(const agx::Name &name, bool recursive=true)
size_t collect(agx::InteractionRefVector &result, bool recursive=true)
agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Constraint.
agxSDK::TerrainInstance * getTerrainInstance(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an TerrainInstance matching the given uuid.
size_t collect(agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true)
agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true)
Find (linear search) and return named RigidBody.
size_t collect(agx::EmitterRefVector &result, bool recursive=true)
size_t collect(agxSDK::AssemblyRefVector &result, bool recursive=true)
bool remove(agx::ContactMaterial *contactMaterial)
Remove a contact material from this assembly.
bool remove(agxSDK::TerrainInstance *terrainInstance)
Remove a TerrainInstance from this assembly.
agx::RigidBody * getRigidBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a pointer to a RigidBody with the given uuid.
size_t collect(agxSDK::TerrainInstanceRefVector &result, bool recursive=true)
bool add(Assembly *assembly)
Add another assembly as child to this assembly.
void setRotation(const agx::OrthoMatrix3x3 &m)
Set the rotation of the assembly relative to world frame.
agxSDK::TerrainToolInstance * getTerrainToolInstance(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an TerrainToolInstance matching the given uuid.
const agx::RigidBodyRefSetVector & getRigidBodies() const
bool add(agx::MergedBody *mergedBody)
Add a MergedBody to this assembly.
agxSDK::Simulation * getSimulation()
const agx::Constraint * getConstraint(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a pointer to a Constraint with the given uuid.
const agx::MergedBodyRefSetVector & getMergedBodies() const
const AssemblyRefSetVector & getAssemblies() const
void setTransform(const agx::AffineMatrix4x4 &matrix)
Set the transform of the assembly.
void setLocalRotation(const agx::Quat &q)
Set the rotation of the assembly relative to its frame's parent frame.
size_t collect(agxSDK::EventListenerRefVector &result, bool recursive=true)
bool add(agx::Emitter *emitter)
Add an emitter to this assembly.
void setRotation(const agx::Quat &q)
Set the rotation of the assembly relative to world frame.
const agx::AffineMatrix4x4 & getLocalTransform() const
bool setParentFrame(agx::Frame *frame)
Set the parent frame of this assembly's frame.
An EventListener can be associated to a Simulation and triggered upon various events.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic.
Specialization for constraints that have two degree of freedom such as Cylindrical.
The base class for a constraint.
Spawns new bodys inside a given volume.
This class provides conversion services between Euler angles in any of the 24 conventions and corresp...
The object defining a frame of reference and providing transformations operations.
The base class for interactions.
Structure holding several "normal" rigid bodies.
Representation of a name string.
With this class you can attach an ObserverFrame object relative to a RigidBody.
Specialized types of matrices for holding orthogonal transformation matrices.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Base class providing referencing counted objects.
The rigid body class, combining a geometric model and a frame of reference.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::SetVector< agx::ref_ptr< agxSDK::Assembly > > AssemblyRefSetVector