330 template <
typename T >
331 T* getConstraint(
const agx::Name& name,
bool recursive =
true);
342 template <
typename T >
343 const T* getConstraint(
const agx::Name& name,
bool recursive =
true)
const;
727 return m_frame.
get();
732 return m_frame.
get();
793 template<
typename T >
796 return dynamic_cast< T*
>(this->
getConstraint(name, recursive));
799 template<
typename T >
802 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()
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(const agxCollide::Geometry *) const
virtual void visit(const EventListener *) const
virtual void visit(agx::Emitter *)
virtual void visit(const agx::ContactMaterial *) const
virtual void visit(agx::ParticleSystem *)
virtual void visit(const agx::Emitter *) const
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,...
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.
agx::Constraint1DOF * getConstraint1DOF(const agx::Name &name, bool recursive=true)
static Assembly * asAssembly(agxStream::Serializable *obj)
const agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a Geometry matching the given uuid.
agx::Constraint2DOF * getConstraint2DOF(const agx::Name &name, bool recursive=true)
const agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
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
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.
const agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named collision Geometry.
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.
const agx::ParticleSystemRefSetVector & getParticleSystems() const
const agxCollide::GeometryRefSetVector & getGeometries() const
void removeFromSimulation(Simulation *simulation)
agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true)
Find (linear search) and return named RigidBody.
agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true)
Find (linear search) and return named collision Geometry.
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::ObserverFrame *observerFrame)
Add an ObserverFrame to this assembly.
Assembly()
Default constructor.
agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Assembly.
void setRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to world frame.
const AssemblyRefSetVector & getAssemblies() const
agx::MergedBody * getMergedBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an MergedBody matching the given uuid.
void setPosition(const agx::Vec3 &p)
Set the position of the frame in world coordinates.
const agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
bool remove(agx::MergedBody *mergedBody)
Remove a MergedBody from this assembly.
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(agxCollide::Geometry *geometry)
Remove a geometry from this assembly (does not recurse down in tree).
const agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an Assembly matching the given uuid.
bool add(agxStream::Serializable *object)
Add an object of type serialized.
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.
agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a Geometry matching the given uuid.
agx::Name getName() const
const Assembly * getParent() const
virtual ~Assembly()
Destructor.
void setName(const agx::Name &name)
Set the name of this Assembly.
agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
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.
bool add(agx::RigidBody *body)
Add a rigid body to the assembly.
bool add(agx::Constraint *constraint)
Add a constraint to the assembly.
bool remove(agx::RigidBody *body, bool removeAssociatedGeometries=false)
Remove a rigid body from this assembly (does not recurse down in tree).
agx::Frame * getParentFrame()
virtual void traverse(AssemblyVisitor *visitor)
Traverse the assembly tree recursively using a visitor.
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.
const agx::AffineMatrix4x4 & getLocalTransform() const
void setLocalRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to its frame's parent frame.
bool add(agx::ContactMaterial *contactMaterial)
Add a contact material to this assembly.
agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an Assembly matching the given uuid.
const agx::Frame * getParentFrame() const
const agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Constraint.
const agx::ObserverFrameRefSetVector & getObserverFrames() const
const agxSDK::Simulation * getSimulation() const
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.
agx::RigidBody * getRigidBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a pointer to a RigidBody with the given uuid.
agx::Constraint * getConstraint(const agx::Uuid &uuid, bool recursive=true)
Find and return a pointer to a Constraint with the given uuid.
const agx::ConstraintRefSetVector & getConstraints() const
const agx::InteractionRefSetVector & getInteractions() 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.
agx::Quat getLocalRotation() const
bool remove(Assembly *assembly)
Remove a child assembly from a parent.
const agx::RigidBodyRefSetVector & getRigidBodies() const
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.
void addToSimulation(Simulation *simulation)
bool remove(agx::Constraint *constraint)
Remove a constraint from this assembly (does not recurse down in tree).
bool add(agx::Interaction *interaction)
Add an interaction to this assembly.
bool remove(agx::ObserverFrame *observerFrame)
Remove an ObserverFrame from this assembly.
Type
Specifies the type an assembly is.
@ ASSEMBLY
This is a full fledged Assembly which uses Frame for the hierarchy.
agxSDK::Simulation * getSimulation()
agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Constraint.
bool remove(agx::ContactMaterial *contactMaterial)
Remove a contact material from this assembly.
const agx::MergedBodyRefSetVector & getMergedBodies() const
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.
agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
const EventListenerRefSetVector & getEventListeners() const
bool add(agx::MergedBody *mergedBody)
Add a MergedBody to this assembly.
const agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Assembly.
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.
const agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named RigidBody.
const agx::EmitterRefSetVector & getEmitters() const
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.
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...
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 only one degree of freedom such as Hinge and Prismatic.
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