|
AGX Dynamics 2.41.1.2
|
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries. More...
#include <Assembly.h>
Inheritance diagram for agxSDK::Assembly:Public Types | |
| enum | Type { ASSEMBLY , COLLECTION } |
| Specifies the type an assembly is. More... | |
Public Member Functions | |
| Assembly () | |
| Default constructor. | |
| bool | add (agx::Constraint *constraint) |
| Add a constraint to the assembly. | |
| bool | add (agx::ContactMaterial *contactMaterial) |
| Add a contact material to this assembly. | |
| bool | add (agx::Emitter *emitter) |
| Add an emitter to this assembly. | |
| bool | add (agx::Interaction *interaction) |
| Add an interaction to this assembly. | |
| bool | add (agx::MergedBody *mergedBody) |
| Add a MergedBody to this assembly. | |
| bool | add (agx::ObserverFrame *observerFrame) |
| Add an ObserverFrame to this assembly. | |
| bool | add (agx::RigidBody *body) |
| Add a rigid body to the assembly. | |
| bool | add (agxCollide::Geometry *geometry) |
| Add a geometry to the assembly. | |
| bool | add (agxSDK::EventListener *listener) |
| Add a listener to the assembly. | |
| bool | add (agxSDK::TerrainInstance *terrainInstance) |
| Add a TerrainInstance to this assembly. | |
| bool | add (agxSDK::TerrainToolInstance *toolInstance) |
| Add a TerrainToolInstance to this assembly. | |
| bool | add (agxStream::Serializable *object) |
| Add an object of type serialized. | |
| bool | add (Assembly *assembly) |
| Add another assembly as child to this assembly. | |
| virtual void | addNotification (agxSDK::Simulation *) |
| Called when this assembly is added to a simulation (given that it not already is in the simulation). | |
| virtual void | addNotification (Assembly *) |
| Called when this assembly is added to another assembly. | |
| AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxSDK::Assembly) | |
| size_t | collect (agx::ConstraintRefVector &result, bool recursive=true) |
| size_t | collect (agx::EmitterRefVector &result, bool recursive=true) |
| size_t | collect (agx::InteractionRefVector &result, bool recursive=true) |
| size_t | collect (agx::MergedBodyRefVector &result, bool recursive=true) |
| size_t | collect (agx::ObserverFrameRefVector &result, bool recursive=true) |
| size_t | collect (agx::ParticleSystemRefVector &result, bool recursive=true) |
| size_t | collect (agx::RigidBodyRefVector &result, bool recursive=true) |
| size_t | collect (agxCollide::GeometryRefVector &result, bool recursive=true) |
| size_t | collect (agxSDK::AssemblyRefVector &result, bool recursive=true) |
| size_t | collect (agxSDK::EventListenerRefVector &result, bool recursive=true) |
| size_t | collect (agxSDK::TerrainInstanceRefVector &result, bool recursive=true) |
| size_t | collect (agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true) |
| bool | empty () const |
| const AssemblyRefSetVector & | getAssemblies () const |
| agxSDK::Assembly * | getAssembly (const agx::Name &name, bool recursive=true) |
| Find (linear search) and return named Assembly. | |
| const agxSDK::Assembly * | getAssembly (const agx::Name &name, bool recursive=true) const |
| Find (linear search) and return named Assembly. | |
| agxSDK::Assembly * | getAssembly (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return an Assembly matching the given uuid. | |
| const agxSDK::Assembly * | getAssembly (const agx::Uuid &uuid, bool recursive=true) const |
| Find (linear search) and return an Assembly matching the given uuid. | |
| agx::Constraint * | getConstraint (const agx::Name &name, bool recursive=true) |
| Find (linear search) and return named Constraint. | |
| template<typename T > | |
| T * | getConstraint (const agx::Name &name, bool recursive=true) |
| Find and return named Constraint of a template type, for example Hinge: | |
| const agx::Constraint * | getConstraint (const agx::Name &name, bool recursive=true) const |
| Find (linear search) and return named Constraint. | |
| template<typename T > | |
| const T * | getConstraint (const agx::Name &name, bool recursive=true) const |
| Find and return named Constraint of a template type, for example Hinge: | |
| agx::Constraint * | getConstraint (const agx::Uuid &uuid, bool recursive=true) |
| Find and return a pointer to a Constraint with the given uuid. | |
| 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. | |
| agx::Constraint1DOF * | getConstraint1DOF (const agx::Name &name, bool recursive=true) |
| agx::Constraint2DOF * | getConstraint2DOF (const agx::Name &name, bool recursive=true) |
| const agx::ConstraintRefSetVector & | getConstraints () const |
| const agx::EmitterRefSetVector & | getEmitters () const |
| const EventListenerRefSetVector & | getEventListeners () const |
| virtual agx::Frame * | getFrame () |
| Return a reference to the frame containing transformation and velocity information for this assembly. | |
| virtual const agx::Frame * | getFrame () const |
| const agxCollide::GeometryRefSetVector & | getGeometries () const |
| agxCollide::Geometry * | getGeometry (const agx::Name &name, bool recursive=true) |
| Find (linear search) and return named collision Geometry. | |
| const agxCollide::Geometry * | getGeometry (const agx::Name &name, bool recursive=true) const |
| Find (linear search) and return named collision Geometry. | |
| agxCollide::Geometry * | getGeometry (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return a Geometry matching the given uuid. | |
| const agxCollide::Geometry * | getGeometry (const agx::Uuid &uuid, bool recursive=true) const |
| Find (linear search) and return a Geometry matching the given uuid. | |
| const agx::InteractionRefSetVector & | getInteractions () const |
| agx::Vec3 | getLocalPosition () const |
| agx::Quat | getLocalRotation () const |
| const agx::AffineMatrix4x4 & | getLocalTransform () const |
| const agx::MergedBodyRefSetVector & | getMergedBodies () const |
| agx::MergedBody * | getMergedBody (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return an MergedBody 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. | |
| agx::Name | getName () const |
| agx::ObserverFrame * | getObserverFrame (const agx::Name &name, bool recursive=true) |
| Find (linear search) and return an ObserverFrame matching the given uuid. | |
| const agx::ObserverFrame * | getObserverFrame (const agx::Name &name, bool recursive=true) const |
| Find (linear search) and return an ObserverFrame 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. | |
| const agx::ObserverFrame * | getObserverFrame (const agx::Uuid &uuid, bool recursive=true) const |
| Find (linear search) and return an ObserverFrame matching the given uuid. | |
| const agx::ObserverFrameRefSetVector & | getObserverFrames () const |
| Assembly * | getParent () |
| const Assembly * | getParent () const |
| agx::Frame * | getParentFrame () |
| const agx::Frame * | getParentFrame () const |
| const agx::ParticleSystemRefSetVector & | getParticleSystems () const |
| const agx::RigidBodyRefSetVector & | getRigidBodies () const |
| agx::RigidBody * | getRigidBody (const agx::Name &name, bool recursive=true) |
| Find (linear search) and return named RigidBody. | |
| const agx::RigidBody * | getRigidBody (const agx::Name &name, bool recursive=true) const |
| Find (linear search) and return named RigidBody. | |
| agx::RigidBody * | getRigidBody (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return a pointer to a RigidBody with the given uuid. | |
| 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. | |
| agxSDK::Simulation * | getSimulation () |
| const agxSDK::Simulation * | getSimulation () const |
| agxSDK::TerrainInstance * | getTerrainInstance (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return an TerrainInstance matching the given uuid. | |
| const agxSDK::TerrainInstance * | getTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const |
| Find (linear search) and return an TerrainInstance matching the given uuid. | |
| const agxSDK::TerrainInstanceRefSetVector & | getTerrainInstances () const |
| agxSDK::TerrainToolInstance * | getTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) |
| Find (linear search) and return an TerrainToolInstance matching the given uuid. | |
| 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::TerrainToolInstanceRefSetVector & | getTerrainToolInstances () const |
| Type | getType () const |
| bool | remove (agx::Constraint *constraint) |
| Remove a constraint from this assembly (does not recurse down in tree). | |
| bool | remove (agx::ContactMaterial *contactMaterial) |
| Remove a contact material from this assembly. | |
| bool | remove (agx::Emitter *emitter) |
| Remove an emitter from this assembly. | |
| bool | remove (agx::Interaction *interaction) |
| Remove an interaction from this assembly. | |
| bool | remove (agx::MergedBody *mergedBody) |
| Remove a MergedBody from this assembly. | |
| bool | remove (agx::ObserverFrame *observerFrame, bool resetParentFrame=true) |
| Remove an ObserverFrame from this assembly. | |
| bool | remove (agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true) |
| Remove a rigid body from this assembly (does not recurse down in tree). | |
| bool | remove (agxCollide::Geometry *geometry, bool resetParentFrame=true) |
| Remove a geometry from this assembly (does not recurse down in tree). | |
| bool | remove (agxSDK::TerrainInstance *terrainInstance) |
| Remove a TerrainInstance from this assembly. | |
| bool | remove (agxSDK::TerrainToolInstance *toolInstance) |
| Remove a TerrainToolInstance from this assembly. | |
| bool | remove (Assembly *assembly, bool resetParentFrame=true) |
| Remove a child assembly from a parent. | |
| bool | remove (EventListener *listener) |
| Remove an EventListener from the assembly. | |
| virtual void | removeNotification (agxSDK::Simulation *) |
| Called when this assembly is removed from a simulation. | |
| virtual void | removeNotification (Assembly *) |
| Called when this assembly is removed from another assembly. | |
| bool | reset (bool resetParentFrame=true) |
| If this assembly is not added to a simulation it will clear all added bodies etc. | |
| virtual void | setAngularVelocity (const agx::Vec3 &velocity) |
| Set the angular velocity (in world frame) recursively for all rigid bodies stored in 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. | |
| void | setLocalPosition (const agx::Vec3 &p) |
| Set the position of the assembly relative to its frame's parent frame. | |
| void | setLocalRotation (const agx::EulerAngles &e) |
| Set the rotation of the assembly relative to its frame's parent frame. | |
| void | setLocalRotation (const agx::Quat &q) |
| Set the rotation of the assembly relative to its frame's parent frame. | |
| void | setLocalTransform (const agx::AffineMatrix4x4 &matrix) |
| Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation. | |
| void | setName (const agx::Name &name) |
| Set the name of this Assembly. | |
| bool | setParentFrame (agx::Frame *frame) |
| Set the parent frame of this assembly's frame. | |
| void | setPosition (agx::Real x, agx::Real y, agx::Real z) |
| Set the position of the frame in world coordinates. | |
| void | setPosition (const agx::Vec3 &p) |
| Set the position of the frame in world coordinates. | |
| void | setRotation (const agx::EulerAngles &e) |
| Set the rotation of the assembly relative to world frame. | |
| void | setRotation (const agx::OrthoMatrix3x3 &m) |
| Set the rotation of the assembly relative to world frame. | |
| void | setRotation (const agx::Quat &q) |
| Set the rotation of the assembly relative to world frame. | |
| void | setTransform (const agx::AffineMatrix4x4 &matrix) |
| Set the transform of the assembly. | |
| virtual void | setVelocity (const agx::Vec3 &velocity) |
| Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly. | |
| bool | transfer (agxSDK::Assembly *target) |
Transfer all the content from this assembly to the target, including name and transformation. | |
| virtual void | traverse (AssemblyVisitor *visitor) |
| Traverse the assembly tree recursively using a visitor. | |
| virtual void | traverse (const AssemblyVisitor *visitor) const |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Member Functions inherited from agxStream::Serializable | |
| virtual | ~Serializable () |
| Destructor for normal C++ use but hidden from SWIG bindings. | |
| virtual const char * | getClassName () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. | |
| virtual StorageAgent * | getStorageAgent () const =0 |
| agx::Uuid | getUuid () const |
| bool | isFinished () const |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. | |
Static Public Member Functions | |
| static Assembly * | asAssembly (agxStream::Serializable *obj) |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Public Member Functions inherited from agxStream::Serializable | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. | |
Protected Member Functions | |
| Assembly (Type type) | |
| virtual | ~Assembly () |
| Destructor. | |
| bool | addParticleSystem (agx::ParticleSystem *particleSystem) |
| Add a particle system to this assembly. | |
| void | addToSimulation (Simulation *simulation) |
| void | removeFromSimulation (Simulation *simulation) |
| bool | removeParticleSystem (agx::ParticleSystem *particleSystem) |
| Remove a particle system from this assembly. | |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Protected Member Functions inherited from agxStream::Serializable | |
| Serializable () | |
| Default constructor. | |
| Serializable (const Serializable &other) | |
| Copy constructor. | |
| void | generateUuid () |
Additional Inherited Members | |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.
The assembly may also contain other assemblies, which enables a hierarchical structuring of the simulation, allowing manipulation at different conceptual levels.
The assembly has a local reference frame which is parent to the transformations of all contained bodies and sub-assemblies. When an object is added to an assembly, it is disconnected from any previous parent frames and is added as a child of the assembly.
The assembly tree can be traversed using an AssemblyVisitor.
Note that even though wires (agxWire::Wire) can be added to the assembly, it will not follow transformations or velocity operations such as:
assembly->add(wire); assembly->setPosition(pos); // Wire will not be affected assembly->getRigidBodies(); // Bodies in wires are not included assembly->getGeometries(); // Geometries in wires are not included.
To include wires you need to write an AssemblyVisitor that include the wires. One such example is the class agxUtil::CollectBodiesAndWiresVisitor
Definition at line 69 of file Assembly.h.
Specifies the type an assembly is.
| Enumerator | |
|---|---|
| ASSEMBLY | This is a full fledged Assembly which uses Frame for the hierarchy. |
| COLLECTION | This is only a collection of objects NOT using Frame for the hierarchy. |
Definition at line 809 of file Assembly.h.
| agxSDK::Assembly::Assembly | ( | ) |
Default constructor.
|
protected |
|
protectedvirtual |
Destructor.
| bool agxSDK::Assembly::add | ( | agx::Constraint * | constraint | ) |
Add a constraint to the assembly.
| bool agxSDK::Assembly::add | ( | agx::ContactMaterial * | contactMaterial | ) |
Add a contact material to this assembly.
| bool agxSDK::Assembly::add | ( | agx::Emitter * | emitter | ) |
Add an emitter to this assembly.
| bool agxSDK::Assembly::add | ( | agx::Interaction * | interaction | ) |
Add an interaction to this assembly.
| bool agxSDK::Assembly::add | ( | agx::MergedBody * | mergedBody | ) |
Add a MergedBody to this assembly.
| bool agxSDK::Assembly::add | ( | agx::ObserverFrame * | observerFrame | ) |
Add an ObserverFrame to this assembly.
| bool agxSDK::Assembly::add | ( | agx::RigidBody * | body | ) |
Add a rigid body to the assembly.
| bool agxSDK::Assembly::add | ( | agxCollide::Geometry * | geometry | ) |
Add a geometry to the assembly.
| bool agxSDK::Assembly::add | ( | agxSDK::EventListener * | listener | ) |
Add a listener to the assembly.
| bool agxSDK::Assembly::add | ( | agxSDK::TerrainInstance * | terrainInstance | ) |
Add a TerrainInstance to this assembly.
| bool agxSDK::Assembly::add | ( | agxSDK::TerrainToolInstance * | toolInstance | ) |
Add a TerrainToolInstance to this assembly.
| bool agxSDK::Assembly::add | ( | agxStream::Serializable * | object | ) |
| bool agxSDK::Assembly::add | ( | Assembly * | assembly | ) |
Add another assembly as child to this assembly.
|
inlinevirtual |
Called when this assembly is added to a simulation (given that it not already is in the simulation).
Reimplemented in agxSDK::LinkedStructure, agxOSG::Tree, agxSDK::LinkedStructure, agxModel::OneBodyTire, agxModel::SuctionGripper, agxModel::ThreeBodyTire, agxModel::Tree, agxModel::TwoBodyTire, and agxPowerLine::PowerLine.
Definition at line 773 of file Assembly.h.
|
inlinevirtual |
Called when this assembly is added to another assembly.
Reimplemented in agxPowerLine::PowerLine, and agxSDK::LinkedStructure.
Definition at line 783 of file Assembly.h.
|
protected |
Add a particle system to this assembly.
ParticleSystems should only be added to Collections.
|
protected |
| agxSDK::Assembly::AGXSTREAM_DECLARE_SERIALIZABLE_BASE | ( | agxSDK::Assembly | ) |
|
inlinestatic |
Definition at line 830 of file Assembly.h.
| size_t agxSDK::Assembly::collect | ( | agx::ConstraintRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the Constraints found in this and any sub-assemblies |
| recursive | - If true, Constraints in sub-assemblies will be included |
| size_t agxSDK::Assembly::collect | ( | agx::EmitterRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agx::InteractionRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the Interactions found in this and any sub-assemblies |
| recursive | - If true, Interactions in sub-assemblies will be included |
| size_t agxSDK::Assembly::collect | ( | agx::MergedBodyRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the MergedBodies found in this and any sub-assemblies |
| recursive | - If true, MergedBodies in sub-assemblies will be included |
| size_t agxSDK::Assembly::collect | ( | agx::ObserverFrameRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the ObserverFrames found in this and any sub-assemblies |
| recursive | - If true, ObserverFrames in sub-assemblies will be included |
| size_t agxSDK::Assembly::collect | ( | agx::ParticleSystemRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agx::RigidBodyRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agxCollide::GeometryRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agxSDK::AssemblyRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agxSDK::EventListenerRefVector & | result, |
| bool | recursive = true |
||
| ) |
| size_t agxSDK::Assembly::collect | ( | agxSDK::TerrainInstanceRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the TerrainInstances found in this and any sub-assemblies |
| recursive | - If true, terrains in sub-assemblies will be included |
| size_t agxSDK::Assembly::collect | ( | agxSDK::TerrainToolInstanceRefVector & | result, |
| bool | recursive = true |
||
| ) |
| result | - A Vector with all the TerrainToolInstances found in this and any sub-assemblies |
| recursive | - If true, terrain tools in sub-assemblies will be included |
|
inlinestatic |
Definition at line 857 of file Assembly.h.
| bool agxSDK::Assembly::empty | ( | ) | const |
| const AssemblyRefSetVector & agxSDK::Assembly::getAssemblies | ( | ) | const |
| agxSDK::Assembly * agxSDK::Assembly::getAssembly | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
| const agxSDK::Assembly * agxSDK::Assembly::getAssembly | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
| agxSDK::Assembly * agxSDK::Assembly::getAssembly | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
| const agxSDK::Assembly * agxSDK::Assembly::getAssembly | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
| agx::Constraint * agxSDK::Assembly::getConstraint | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return named Constraint.
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
| T * agxSDK::Assembly::getConstraint | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
Find and return named Constraint of a template type, for example Hinge:
agx::Hinge *hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
Definition at line 986 of file Assembly.h.
References getConstraint().
| const agx::Constraint * agxSDK::Assembly::getConstraint | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return named Constraint.
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const T * agxSDK::Assembly::getConstraint | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
Find and return named Constraint of a template type, for example Hinge:
const agx::Hinge* hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");
| name | - name of the Constraint to find |
| recursive | - if true (default) the search will include sub-assemblies |
Definition at line 992 of file Assembly.h.
References getConstraint().
| agx::Constraint * agxSDK::Assembly::getConstraint | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find and return a pointer to a Constraint with the given uuid.
| uuid | - uuid of the requested constraint |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::Constraint * agxSDK::Assembly::getConstraint | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return a pointer to a Constraint with the given uuid.
| uuid | - uuid of the requested constraint |
| recursive | - if true (default) the search will include sub-assemblies |
Referenced by getConstraint().
|
inline |
Definition at line 826 of file Assembly.h.
|
inline |
Definition at line 827 of file Assembly.h.
| const agx::ConstraintRefSetVector & agxSDK::Assembly::getConstraints | ( | ) | const |
| const agx::EmitterRefSetVector & agxSDK::Assembly::getEmitters | ( | ) | const |
| const EventListenerRefSetVector & agxSDK::Assembly::getEventListeners | ( | ) | const |
|
inlinevirtual |
Return a reference to the frame containing transformation and velocity information for this assembly.
Definition at line 913 of file Assembly.h.
References agx::ref_ptr< T >::get().
|
inlinevirtual |
Definition at line 918 of file Assembly.h.
References agx::ref_ptr< T >::get().
| const agxCollide::GeometryRefSetVector & agxSDK::Assembly::getGeometries | ( | ) | const |
Referenced by agxSDK::matchFilter().
| agxCollide::Geometry * agxSDK::Assembly::getGeometry | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return named collision Geometry.
| name | - name of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxCollide::Geometry * agxSDK::Assembly::getGeometry | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return named collision Geometry.
| name | - name of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
| agxCollide::Geometry * agxSDK::Assembly::getGeometry | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return a Geometry matching the given uuid.
| uuid | - uuid of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxCollide::Geometry * agxSDK::Assembly::getGeometry | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return a Geometry matching the given uuid.
| uuid | - uuid of the collision Geometry to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::InteractionRefSetVector & agxSDK::Assembly::getInteractions | ( | ) | const |
| agx::Vec3 agxSDK::Assembly::getLocalPosition | ( | ) | const |
| agx::Quat agxSDK::Assembly::getLocalRotation | ( | ) | const |
| const agx::AffineMatrix4x4 & agxSDK::Assembly::getLocalTransform | ( | ) | const |
| const agx::MergedBodyRefSetVector & agxSDK::Assembly::getMergedBodies | ( | ) | const |
| agx::MergedBody * agxSDK::Assembly::getMergedBody | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return an MergedBody matching the given uuid.
| uuid | - uuid of the MergedBody to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::MergedBody * agxSDK::Assembly::getMergedBody | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return an MergedBody matching the given uuid.
| uuid | - uuid of the MergedBody to find |
| recursive | - if true (default) the search will include sub-assemblies |
| agx::ObserverFrame * agxSDK::Assembly::getObserverFrame | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return an ObserverFrame matching the given uuid.
| name | - name of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::ObserverFrame * agxSDK::Assembly::getObserverFrame | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return an ObserverFrame matching the given uuid.
| name | - name of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
| agx::ObserverFrame * agxSDK::Assembly::getObserverFrame | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return an ObserverFrame matching the given uuid.
| uuid | - uuid of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::ObserverFrame * agxSDK::Assembly::getObserverFrame | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return an ObserverFrame matching the given uuid.
| uuid | - uuid of the ObserverFrame to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::ObserverFrameRefSetVector & agxSDK::Assembly::getObserverFrames | ( | ) | const |
| Assembly * agxSDK::Assembly::getParent | ( | ) |
| const Assembly * agxSDK::Assembly::getParent | ( | ) | const |
| agx::Frame * agxSDK::Assembly::getParentFrame | ( | ) |
| const agx::Frame * agxSDK::Assembly::getParentFrame | ( | ) | const |
| const agx::ParticleSystemRefSetVector & agxSDK::Assembly::getParticleSystems | ( | ) | const |
| const agx::RigidBodyRefSetVector & agxSDK::Assembly::getRigidBodies | ( | ) | const |
| agx::RigidBody * agxSDK::Assembly::getRigidBody | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return named RigidBody.
| name | - name of the body to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::RigidBody * agxSDK::Assembly::getRigidBody | ( | const agx::Name & | name, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return named RigidBody.
| name | - name of the body to find |
| recursive | - if true (default) the search will include sub-assemblies |
| agx::RigidBody * agxSDK::Assembly::getRigidBody | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return a pointer to a RigidBody with the given uuid.
| uuid | - uuid of the requested rigidbody |
| recursive | - if true (default) the search will include sub-assemblies |
| const agx::RigidBody * agxSDK::Assembly::getRigidBody | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return a pointer to a RigidBody with the given uuid.
| uuid | - uuid of the requested rigidbody |
| recursive | - if true (default) the search will include sub-assemblies |
| agxSDK::Simulation * agxSDK::Assembly::getSimulation | ( | ) |
| const agxSDK::Simulation * agxSDK::Assembly::getSimulation | ( | ) | const |
| agxSDK::TerrainInstance * agxSDK::Assembly::getTerrainInstance | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return an TerrainInstance matching the given uuid.
| uuid | - uuid of the TerrainInstance to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxSDK::TerrainInstance * agxSDK::Assembly::getTerrainInstance | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return an TerrainInstance matching the given uuid.
| uuid | - uuid of the TerrainInstance to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxSDK::TerrainInstanceRefSetVector & agxSDK::Assembly::getTerrainInstances | ( | ) | const |
| agxSDK::TerrainToolInstance * agxSDK::Assembly::getTerrainToolInstance | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) |
Find (linear search) and return an TerrainToolInstance matching the given uuid.
| uuid | - uuid of the TerrainToolInstance to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxSDK::TerrainToolInstance * agxSDK::Assembly::getTerrainToolInstance | ( | const agx::Uuid & | uuid, |
| bool | recursive = true |
||
| ) | const |
Find (linear search) and return an TerrainToolInstance matching the given uuid.
| uuid | - uuid of the TerrainToolInstance to find |
| recursive | - if true (default) the search will include sub-assemblies |
| const agxSDK::TerrainToolInstanceRefSetVector & agxSDK::Assembly::getTerrainToolInstances | ( | ) | const |
| Type agxSDK::Assembly::getType | ( | ) | const |
| bool agxSDK::Assembly::remove | ( | agx::Constraint * | constraint | ) |
Remove a constraint from this assembly (does not recurse down in tree).
| bool agxSDK::Assembly::remove | ( | agx::ContactMaterial * | contactMaterial | ) |
Remove a contact material from this assembly.
| bool agxSDK::Assembly::remove | ( | agx::Emitter * | emitter | ) |
Remove an emitter from this assembly.
| bool agxSDK::Assembly::remove | ( | agx::Interaction * | interaction | ) |
Remove an interaction from this assembly.
| bool agxSDK::Assembly::remove | ( | agx::MergedBody * | mergedBody | ) |
Remove a MergedBody from this assembly.
| bool agxSDK::Assembly::remove | ( | agx::ObserverFrame * | observerFrame, |
| bool | resetParentFrame = true |
||
| ) |
Remove an ObserverFrame from this assembly.
| resetParentFrame | - If true (default) and the parent frame belongs to this assembly the parent frame will be set to null for the removed observer |
| bool agxSDK::Assembly::remove | ( | agx::RigidBody * | body, |
| bool | removeAssociatedGeometries = false, |
||
| bool | resetParentFrame = true |
||
| ) |
Remove a rigid body from this assembly (does not recurse down in tree).
| body | - The body to be removed |
| resetParentFrame | - If true (default) and the parent frame belongs to this assembly it will be set to null for the removed rigid body. |
| removeAssociatedGeometries | - If true, the geometries associated to this body will also be removed |
| bool agxSDK::Assembly::remove | ( | agxCollide::Geometry * | geometry, |
| bool | resetParentFrame = true |
||
| ) |
Remove a geometry from this assembly (does not recurse down in tree).
| resetParentFrame | - If true (default) and the parent frame belongs to this assembly parent frame will be set to null for the removed geometry (unless it belongs to a rigidbody) |
| bool agxSDK::Assembly::remove | ( | agxSDK::TerrainInstance * | terrainInstance | ) |
Remove a TerrainInstance from this assembly.
| bool agxSDK::Assembly::remove | ( | agxSDK::TerrainToolInstance * | toolInstance | ) |
Remove a TerrainToolInstance from this assembly.
| bool agxSDK::Assembly::remove | ( | Assembly * | assembly, |
| bool | resetParentFrame = true |
||
| ) |
Remove a child assembly from a parent.
| resetParentFrame | - If true (default) and the parent frame belongs to this assembly the parent frame will be set to null for the removed assembly |
| bool agxSDK::Assembly::remove | ( | EventListener * | listener | ) |
Remove an EventListener from the assembly.
|
protected |
|
inlinevirtual |
Called when this assembly is removed from a simulation.
Reimplemented in agxSDK::LinkedStructure, agxSDK::LinkedStructure, agxModel::Deformable1D, agxModel::OneBodyTire, agxModel::SuctionGripper, agxModel::ThreeBodyTire, agxModel::Tree, agxModel::TwoBodyTire, and agxPowerLine::PowerLine.
Definition at line 778 of file Assembly.h.
|
inlinevirtual |
Called when this assembly is removed from another assembly.
Reimplemented in agxPowerLine::PowerLine, and agxSDK::LinkedStructure.
Definition at line 788 of file Assembly.h.
|
protected |
Remove a particle system from this assembly.
| bool agxSDK::Assembly::reset | ( | bool | resetParentFrame = true | ) |
If this assembly is not added to a simulation it will clear all added bodies etc.
and return true. If it is added to a simulation it will return false and do nothing.
| resetParentFrame | - If true a rigidbody (and other things that can have an assembly as a transformation parent) will get its parent pointer set to nullptr. Default is true, which is the same as if we would call assembly->remove(body); Remove all added objects recursively. |
|
virtual |
Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
| velocity | - The angular velocity in world frame that will be set for all rigid bodies. |
Set the position of the assembly relative to its frame's parent frame.
| x | - local x translate |
| y | - local y translate |
| z | - local z translate |
| void agxSDK::Assembly::setLocalPosition | ( | const agx::Vec3 & | p | ) |
Set the position of the assembly relative to its frame's parent frame.
| p | - local translate of assembly as a 3D vector |
| void agxSDK::Assembly::setLocalRotation | ( | const agx::EulerAngles & | e | ) |
Set the rotation of the assembly relative to its frame's parent frame.
| e | - rotation given as Euler angles |
| void agxSDK::Assembly::setLocalRotation | ( | const agx::Quat & | q | ) |
Set the rotation of the assembly relative to its frame's parent frame.
| q | - rotation given as a quaternion |
| void agxSDK::Assembly::setLocalTransform | ( | const agx::AffineMatrix4x4 & | matrix | ) |
Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.
| matrix | - transformation matrix relative to parent transform for the assembly's frame |
| void agxSDK::Assembly::setName | ( | const agx::Name & | name | ) |
| bool agxSDK::Assembly::setParentFrame | ( | agx::Frame * | frame | ) |
Set the parent frame of this assembly's frame.
This means that getLocalTranslate, getLocalRotate, getLocalTransform will be given in the parents coordinate frame. I.e., this frame's transformation will be concatenated with the parents.
| frame | - new parent frame, 0 to remove parent |
Set the position of the frame in world coordinates.
| x | - desired x-coordinate in world frame |
| y | - desired y-coordinate in world frame |
| z | - desired z-coordinate in world frame |
| void agxSDK::Assembly::setPosition | ( | const agx::Vec3 & | p | ) |
Set the position of the frame in world coordinates.
| p | - desired position in world coordinates. |
| void agxSDK::Assembly::setRotation | ( | const agx::EulerAngles & | e | ) |
Set the rotation of the assembly relative to world frame.
| e | - rotation given as Euler angles |
| void agxSDK::Assembly::setRotation | ( | const agx::OrthoMatrix3x3 & | m | ) |
Set the rotation of the assembly relative to world frame.
| m | - rotation given as an orthogonal transformation matrix |
| void agxSDK::Assembly::setRotation | ( | const agx::Quat & | q | ) |
Set the rotation of the assembly relative to world frame.
| q | - rotation given as a quaternion |
| void agxSDK::Assembly::setTransform | ( | const agx::AffineMatrix4x4 & | matrix | ) |
Set the transform of the assembly.
Its frame will move to the specified transform, which is given in world coordinates.
| matrix | - desired transform for the frame in world coordinates. |
|
virtual |
Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
| velocity | - The linear velocity in world frame that will be set for all rigid bodies. |
| bool agxSDK::Assembly::transfer | ( | agxSDK::Assembly * | target | ) |
Transfer all the content from this assembly to the target, including name and transformation.
Neither this or the target Assembly can have a parent frame (doing nothing and return false). Target Assembly must not be added to a simulation (doing nothing and return false). This assembly will be left empty, but still part of a Simulation until removed.
|
virtual |
Traverse the assembly tree recursively using a visitor.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
virtual |