AGX Dynamics 2.41.1.2
Loading...
Searching...
No Matches
agxSDK::Assembly Class Reference

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 AssemblyRefSetVectorgetAssemblies () const
 
agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named Assembly.
 
const agxSDK::AssemblygetAssembly (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named Assembly.
 
agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::AssemblygetAssembly (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an Assembly matching the given uuid.
 
agx::ConstraintgetConstraint (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::ConstraintgetConstraint (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::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true)
 Find and return a pointer to a Constraint with the given uuid.
 
const agx::ConstraintgetConstraint (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a Constraint with the given uuid.
 
agx::Constraint1DOFgetConstraint1DOF (const agx::Name &name, bool recursive=true)
 
agx::Constraint2DOFgetConstraint2DOF (const agx::Name &name, bool recursive=true)
 
const agx::ConstraintRefSetVectorgetConstraints () const
 
const agx::EmitterRefSetVectorgetEmitters () const
 
const EventListenerRefSetVectorgetEventListeners () const
 
virtual agx::FramegetFrame ()
 Return a reference to the frame containing transformation and velocity information for this assembly.
 
virtual const agx::FramegetFrame () const
 
const agxCollide::GeometryRefSetVectorgetGeometries () const
 
agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::GeometrygetGeometry (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a Geometry matching the given uuid.
 
const agxCollide::GeometrygetGeometry (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a Geometry matching the given uuid.
 
const agx::InteractionRefSetVectorgetInteractions () const
 
agx::Vec3 getLocalPosition () const
 
agx::Quat getLocalRotation () const
 
const agx::AffineMatrix4x4getLocalTransform () const
 
const agx::MergedBodyRefSetVectorgetMergedBodies () const
 
agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an MergedBody matching the given uuid.
 
const agx::MergedBodygetMergedBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an MergedBody matching the given uuid.
 
agx::Name getName () const
 
agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an ObserverFrame matching the given uuid.
 
const agx::ObserverFrameRefSetVectorgetObserverFrames () const
 
AssemblygetParent ()
 
const AssemblygetParent () const
 
agx::FramegetParentFrame ()
 
const agx::FramegetParentFrame () const
 
const agx::ParticleSystemRefSetVectorgetParticleSystems () const
 
const agx::RigidBodyRefSetVectorgetRigidBodies () const
 
agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBodygetRigidBody (const agx::Name &name, bool recursive=true) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
const agx::RigidBodygetRigidBody (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
agxSDK::SimulationgetSimulation ()
 
const agxSDK::SimulationgetSimulation () const
 
agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstancegetTerrainInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainInstance matching the given uuid.
 
const agxSDK::TerrainInstanceRefSetVectorgetTerrainInstances () const
 
agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true)
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstancegetTerrainToolInstance (const agx::Uuid &uuid, bool recursive=true) const
 Find (linear search) and return an TerrainToolInstance matching the given uuid.
 
const agxSDK::TerrainToolInstanceRefSetVectorgetTerrainToolInstances () 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.
 
Referencedoperator= (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 AssemblyasAssembly (agxStream::Serializable *obj)
 
static agxStream::Serializablecreate (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 DeleteHandlergetDeleteHandler ()
 
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
 

Detailed Description

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.

Member Enumeration Documentation

◆ Type

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.

Constructor & Destructor Documentation

◆ Assembly() [1/2]

agxSDK::Assembly::Assembly ( )

Default constructor.

◆ Assembly() [2/2]

agxSDK::Assembly::Assembly ( Type  type)
protected

◆ ~Assembly()

virtual agxSDK::Assembly::~Assembly ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ add() [1/13]

bool agxSDK::Assembly::add ( agx::Constraint constraint)

Add a constraint to the assembly.

Returns
true when the constraint has been successfully added - otherwise false (constraint is nullptr or already present in this assembly)

◆ add() [2/13]

bool agxSDK::Assembly::add ( agx::ContactMaterial contactMaterial)

Add a contact material to this assembly.

Returns
true when the contact material has been successfully added - otherwise false (the contact material is nullptr or already present in this assembly)

◆ add() [3/13]

bool agxSDK::Assembly::add ( agx::Emitter emitter)

Add an emitter to this assembly.

Returns
true when the emitter has been successfully added - otherwise false (the emitter is nullptr or already present in this assembly)

◆ add() [4/13]

bool agxSDK::Assembly::add ( agx::Interaction interaction)

Add an interaction to this assembly.

Returns
true when the interaction has been successfully added - otherwise false (interaction is nullptr or already present in this assembly)

◆ add() [5/13]

bool agxSDK::Assembly::add ( agx::MergedBody mergedBody)

Add a MergedBody to this assembly.

Returns
true when the MergedBody has been successfully added - otherwise false (the MergedBody is nullptr or already present in this assembly)

◆ add() [6/13]

bool agxSDK::Assembly::add ( agx::ObserverFrame observerFrame)

Add an ObserverFrame to this assembly.

Returns
true when the observer frame has been successfully added - otherwise false (the observer frame is nullptr or already present in this assembly)

◆ add() [7/13]

bool agxSDK::Assembly::add ( agx::RigidBody body)

Add a rigid body to the assembly.

Returns
true when the rigid body has been successfully added - otherwise false (the rigid body is nullptr or already present in this assembly)

◆ add() [8/13]

bool agxSDK::Assembly::add ( agxCollide::Geometry geometry)

Add a geometry to the assembly.

Returns
true when the geometry has been successfully added - otherwise false (the geometry is nullptr or already present in this assembly)

◆ add() [9/13]

bool agxSDK::Assembly::add ( agxSDK::EventListener listener)

Add a listener to the assembly.

Returns
true when the listener has been successfully added - otherwise false (listener is nullptr or already present in this assembly)

◆ add() [10/13]

bool agxSDK::Assembly::add ( agxSDK::TerrainInstance terrainInstance)

Add a TerrainInstance to this assembly.

Returns
true when the TerrainInstance has been successfully added - otherwise false (the TerrainInstance is nullptr or already present in this assembly)

◆ add() [11/13]

bool agxSDK::Assembly::add ( agxSDK::TerrainToolInstance toolInstance)

Add a TerrainToolInstance to this assembly.

Returns
true when the TerrainToolInstance has been successfully added - otherwise false (the TerrainToolInstance is nullptr or already present in this assembly)

◆ add() [12/13]

bool agxSDK::Assembly::add ( agxStream::Serializable object)

Add an object of type serialized.

The object will be dynamically cast to the types supported by add() methods an appropriately added to this Assembly.

Returns
true when the object has been successfully added - otherwise false (the object is nullptr or already present in this assembly)

◆ add() [13/13]

bool agxSDK::Assembly::add ( Assembly assembly)

Add another assembly as child to this assembly.

Returns
true when the assembly has been successfully added - otherwise false (the assembly is nullptr or already present in this assembly)

◆ addNotification() [1/2]

virtual void agxSDK::Assembly::addNotification ( agxSDK::Simulation )
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.

◆ addNotification() [2/2]

virtual void agxSDK::Assembly::addNotification ( Assembly )
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.

◆ addParticleSystem()

bool agxSDK::Assembly::addParticleSystem ( agx::ParticleSystem particleSystem)
protected

Add a particle system to this assembly.

ParticleSystems should only be added to Collections.

◆ addToSimulation()

void agxSDK::Assembly::addToSimulation ( Simulation simulation)
protected

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxSDK::Assembly::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxSDK::Assembly  )

◆ asAssembly()

static Assembly * agxSDK::Assembly::asAssembly ( agxStream::Serializable obj)
inlinestatic
Returns
a pointer to an Assembly if obj is infact an Assembly

Definition at line 830 of file Assembly.h.

◆ collect() [1/12]

size_t agxSDK::Assembly::collect ( agx::ConstraintRefVector result,
bool  recursive = true 
)
Parameters
result- A Vector with all the Constraints found in this and any sub-assemblies
recursive- If true, Constraints in sub-assemblies will be included
Returns
Number of elements in the collected results.

◆ collect() [2/12]

size_t agxSDK::Assembly::collect ( agx::EmitterRefVector result,
bool  recursive = true 
)

◆ collect() [3/12]

size_t agxSDK::Assembly::collect ( agx::InteractionRefVector result,
bool  recursive = true 
)
Parameters
result- A Vector with all the Interactions found in this and any sub-assemblies
recursive- If true, Interactions in sub-assemblies will be included
Returns
Number of elements in the collected results.

◆ collect() [4/12]

size_t agxSDK::Assembly::collect ( agx::MergedBodyRefVector result,
bool  recursive = true 
)
Parameters
result- A Vector with all the MergedBodies found in this and any sub-assemblies
recursive- If true, MergedBodies in sub-assemblies will be included
Returns
Number of elements in the collected results.

◆ collect() [5/12]

size_t agxSDK::Assembly::collect ( agx::ObserverFrameRefVector result,
bool  recursive = true 
)
Parameters
result- A Vector with all the ObserverFrames found in this and any sub-assemblies
recursive- If true, ObserverFrames in sub-assemblies will be included
Returns
Number of elements in the collected results.

◆ collect() [6/12]

size_t agxSDK::Assembly::collect ( agx::ParticleSystemRefVector result,
bool  recursive = true 
)

◆ collect() [7/12]

size_t agxSDK::Assembly::collect ( agx::RigidBodyRefVector result,
bool  recursive = true 
)

◆ collect() [8/12]

size_t agxSDK::Assembly::collect ( agxCollide::GeometryRefVector result,
bool  recursive = true 
)

◆ collect() [9/12]

size_t agxSDK::Assembly::collect ( agxSDK::AssemblyRefVector result,
bool  recursive = true 
)

◆ collect() [10/12]

size_t agxSDK::Assembly::collect ( agxSDK::EventListenerRefVector result,
bool  recursive = true 
)

◆ collect() [11/12]

size_t agxSDK::Assembly::collect ( agxSDK::TerrainInstanceRefVector result,
bool  recursive = true 
)
Parameters
result- A Vector with all the TerrainInstances found in this and any sub-assemblies
recursive- If true, terrains in sub-assemblies will be included
Returns
Number of elements in the collected results.

◆ collect() [12/12]

size_t agxSDK::Assembly::collect ( agxSDK::TerrainToolInstanceRefVector result,
bool  recursive = true 
)
Parameters
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
Returns
Number of elements in the collected results.

◆ create()

static agxStream::Serializable * agxSDK::Assembly::create ( agxStream::InputArchive )
inlinestatic

Definition at line 857 of file Assembly.h.

◆ empty()

bool agxSDK::Assembly::empty ( ) const
Returns
true if the Assembly is empty

◆ getAssemblies()

const AssemblyRefSetVector & agxSDK::Assembly::getAssemblies ( ) const
Returns
a const reference to the Assemblies in this Assembly (not tracing recursively into sub-assemblies)

◆ getAssembly() [1/4]

agxSDK::Assembly * agxSDK::Assembly::getAssembly ( const agx::Name name,
bool  recursive = true 
)

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [2/4]

const agxSDK::Assembly * agxSDK::Assembly::getAssembly ( const agx::Name name,
bool  recursive = true 
) const

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [3/4]

agxSDK::Assembly * agxSDK::Assembly::getAssembly ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return an Assembly matching the given uuid.

Parameters
uuid- uuid of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [4/4]

const agxSDK::Assembly * agxSDK::Assembly::getAssembly ( const agx::Uuid uuid,
bool  recursive = true 
) const

Find (linear search) and return an Assembly matching the given uuid.

Parameters
uuid- uuid of the Assembly to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Assembly, null if not found

◆ getConstraint() [1/6]

agx::Constraint * agxSDK::Assembly::getConstraint ( const agx::Name name,
bool  recursive = true 
)

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [2/6]

template<typename T >
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");

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
typed pointer to the found Constraint, null if not found

Definition at line 986 of file Assembly.h.

References getConstraint().

◆ getConstraint() [3/6]

const agx::Constraint * agxSDK::Assembly::getConstraint ( const agx::Name name,
bool  recursive = true 
) const

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [4/6]

template<typename T >
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");

Parameters
name- name of the Constraint to find
recursive- if true (default) the search will include sub-assemblies
Returns
typed pointer to the found Constraint, null if not found

Definition at line 992 of file Assembly.h.

References getConstraint().

◆ getConstraint() [5/6]

agx::Constraint * agxSDK::Assembly::getConstraint ( const agx::Uuid uuid,
bool  recursive = true 
)

Find and return a pointer to a Constraint with the given uuid.

Parameters
uuid- uuid of the requested constraint
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [6/6]

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.

Parameters
uuid- uuid of the requested constraint
recursive- if true (default) the search will include sub-assemblies
Returns
const pointer to the found constraint, null if not found

Referenced by getConstraint().

◆ getConstraint1DOF()

agx::Constraint1DOF * agxSDK::Assembly::getConstraint1DOF ( const agx::Name name,
bool  recursive = true 
)
inline

Definition at line 826 of file Assembly.h.

◆ getConstraint2DOF()

agx::Constraint2DOF * agxSDK::Assembly::getConstraint2DOF ( const agx::Name name,
bool  recursive = true 
)
inline

Definition at line 827 of file Assembly.h.

◆ getConstraints()

const agx::ConstraintRefSetVector & agxSDK::Assembly::getConstraints ( ) const
Returns
a const reference to the Constraints in this Assembly (not tracing recursively into sub-assemblies)

◆ getEmitters()

const agx::EmitterRefSetVector & agxSDK::Assembly::getEmitters ( ) const
Returns
a const reference to the Emitters in this Assembly (not tracing recursively into sub-assemblies)

◆ getEventListeners()

const EventListenerRefSetVector & agxSDK::Assembly::getEventListeners ( ) const
Returns
a const reference to the EventListeners in this Assembly (not tracing recursively into sub-assemblies)

◆ getFrame() [1/2]

agx::Frame * agxSDK::Assembly::getFrame ( )
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().

◆ getFrame() [2/2]

const agx::Frame * agxSDK::Assembly::getFrame ( ) const
inlinevirtual

Definition at line 918 of file Assembly.h.

References agx::ref_ptr< T >::get().

◆ getGeometries()

const agxCollide::GeometryRefSetVector & agxSDK::Assembly::getGeometries ( ) const
Returns
a const reference to the Geometries in this Assembly (not tracing recursively into sub-assemblies)

Referenced by agxSDK::matchFilter().

◆ getGeometry() [1/4]

agxCollide::Geometry * agxSDK::Assembly::getGeometry ( const agx::Name name,
bool  recursive = true 
)

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [2/4]

const agxCollide::Geometry * agxSDK::Assembly::getGeometry ( const agx::Name name,
bool  recursive = true 
) const

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [3/4]

agxCollide::Geometry * agxSDK::Assembly::getGeometry ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return a Geometry matching the given uuid.

Parameters
uuid- uuid of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [4/4]

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.

Parameters
uuid- uuid of the collision Geometry to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found collision Geometry, null if not found

◆ getInteractions()

const agx::InteractionRefSetVector & agxSDK::Assembly::getInteractions ( ) const
Returns
interactions in this assembly (not tracing recursively into sub-assemblies)

◆ getLocalPosition()

agx::Vec3 agxSDK::Assembly::getLocalPosition ( ) const
Returns
- the relative translate to the parent frame of the assembly's frame.

◆ getLocalRotation()

agx::Quat agxSDK::Assembly::getLocalRotation ( ) const
Returns
- the assembly's rotation relative to its frame's parent frame.

◆ getLocalTransform()

const agx::AffineMatrix4x4 & agxSDK::Assembly::getLocalTransform ( ) const
Returns
- the local transformation matrix of the assembly's frame, relative to the parent's frame.

◆ getMergedBodies()

const agx::MergedBodyRefSetVector & agxSDK::Assembly::getMergedBodies ( ) const
Returns
MergedBodies in this assembly (not tracing recursively into sub-assemblies)

◆ getMergedBody() [1/2]

agx::MergedBody * agxSDK::Assembly::getMergedBody ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return an MergedBody matching the given uuid.

Parameters
uuid- uuid of the MergedBody to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found MergedBody, null if not found

◆ getMergedBody() [2/2]

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.

Parameters
uuid- uuid of the MergedBody to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found MergedBody, null if not found

◆ getName()

agx::Name agxSDK::Assembly::getName ( ) const
Returns
the name of this Assembly

◆ getObserverFrame() [1/4]

agx::ObserverFrame * agxSDK::Assembly::getObserverFrame ( const agx::Name name,
bool  recursive = true 
)

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
name- name of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserverFrame() [2/4]

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.

Parameters
name- name of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserverFrame() [3/4]

agx::ObserverFrame * agxSDK::Assembly::getObserverFrame ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return an ObserverFrame matching the given uuid.

Parameters
uuid- uuid of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserverFrame() [4/4]

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.

Parameters
uuid- uuid of the ObserverFrame to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserverFrames()

const agx::ObserverFrameRefSetVector & agxSDK::Assembly::getObserverFrames ( ) const
Returns
observers in this assembly (not tracing recursively into sub-assemblies)

◆ getParent() [1/2]

Assembly * agxSDK::Assembly::getParent ( )
Returns
the parent assembly if this assembly is part of another assembly.

◆ getParent() [2/2]

const Assembly * agxSDK::Assembly::getParent ( ) const
Returns
the parent assembly if this assembly is part of another assembly.

◆ getParentFrame() [1/2]

agx::Frame * agxSDK::Assembly::getParentFrame ( )
Returns
- the parent frame of the assembly's frame, or 0 if this frame has no parent

◆ getParentFrame() [2/2]

const agx::Frame * agxSDK::Assembly::getParentFrame ( ) const
Returns
- the parent frame of the assembly's frame, or 0 if this frame has no parent

◆ getParticleSystems()

const agx::ParticleSystemRefSetVector & agxSDK::Assembly::getParticleSystems ( ) const
Returns
a const reference to the ParticleSystems in this Assembly (not tracing recursively into sub-assemblies)

◆ getRigidBodies()

const agx::RigidBodyRefSetVector & agxSDK::Assembly::getRigidBodies ( ) const
Returns
a const reference to the RigidBodies in this Assembly (not tracing recursively into sub-assemblies)

◆ getRigidBody() [1/4]

agx::RigidBody * agxSDK::Assembly::getRigidBody ( const agx::Name name,
bool  recursive = true 
)

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody body, null if not found

◆ getRigidBody() [2/4]

const agx::RigidBody * agxSDK::Assembly::getRigidBody ( const agx::Name name,
bool  recursive = true 
) const

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody body, null if not found

◆ getRigidBody() [3/4]

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.

Parameters
uuid- uuid of the requested rigidbody
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody, null if not found

◆ getRigidBody() [4/4]

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.

Parameters
uuid- uuid of the requested rigidbody
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found RigidBody, null if not found

◆ getSimulation() [1/2]

agxSDK::Simulation * agxSDK::Assembly::getSimulation ( )
Returns
the simulation this assembly is added to. nullptr if none.

◆ getSimulation() [2/2]

const agxSDK::Simulation * agxSDK::Assembly::getSimulation ( ) const
Returns
the simulation this assembly is added to. nullptr if none.

◆ getTerrainInstance() [1/2]

agxSDK::TerrainInstance * agxSDK::Assembly::getTerrainInstance ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return an TerrainInstance matching the given uuid.

Parameters
uuid- uuid of the TerrainInstance to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found TerrainInstance, null if not found

◆ getTerrainInstance() [2/2]

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.

Parameters
uuid- uuid of the TerrainInstance to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found TerrainInstance, null if not found

◆ getTerrainInstances()

const agxSDK::TerrainInstanceRefSetVector & agxSDK::Assembly::getTerrainInstances ( ) const
Returns
TerrainInstances in this assembly (not tracing recursively into sub-assemblies)

◆ getTerrainToolInstance() [1/2]

agxSDK::TerrainToolInstance * agxSDK::Assembly::getTerrainToolInstance ( const agx::Uuid uuid,
bool  recursive = true 
)

Find (linear search) and return an TerrainToolInstance matching the given uuid.

Parameters
uuid- uuid of the TerrainToolInstance to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found TerrainToolInstance, null if not found

◆ getTerrainToolInstance() [2/2]

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.

Parameters
uuid- uuid of the TerrainToolInstance to find
recursive- if true (default) the search will include sub-assemblies
Returns
pointer to the found TerrainToolInstance, null if not found

◆ getTerrainToolInstances()

const agxSDK::TerrainToolInstanceRefSetVector & agxSDK::Assembly::getTerrainToolInstances ( ) const
Returns
TerrainToolInstances in this assembly (not tracing recursively into sub-assemblies)

◆ getType()

Type agxSDK::Assembly::getType ( ) const
Returns
the type of this Assembly/Collection

◆ remove() [1/12]

bool agxSDK::Assembly::remove ( agx::Constraint constraint)

Remove a constraint from this assembly (does not recurse down in tree).

Returns
true when the constraint has been successfully removed - otherwise false (constraint is nullptr or not in this assembly)

◆ remove() [2/12]

bool agxSDK::Assembly::remove ( agx::ContactMaterial contactMaterial)

Remove a contact material from this assembly.

Returns
true when the contact material has been successfully removed - otherwise false (contact material is nullptr or not in this assembly)

◆ remove() [3/12]

bool agxSDK::Assembly::remove ( agx::Emitter emitter)

Remove an emitter from this assembly.

Returns
true when the emitter has been successfully removed - otherwise false (emitter is nullptr or not in this assembly)

◆ remove() [4/12]

bool agxSDK::Assembly::remove ( agx::Interaction interaction)

Remove an interaction from this assembly.

Returns
true when the interaction has been successfully removed - otherwise false (interaction is nullptr or not in this assembly)

◆ remove() [5/12]

bool agxSDK::Assembly::remove ( agx::MergedBody mergedBody)

Remove a MergedBody from this assembly.

Returns
true when the MergedBody has been successfully removed - otherwise false (MergedBody is nullptr or not in this assembly)

◆ remove() [6/12]

bool agxSDK::Assembly::remove ( agx::ObserverFrame observerFrame,
bool  resetParentFrame = true 
)

Remove an ObserverFrame from this assembly.

Parameters
resetParentFrame- If true (default) and the parent frame belongs to this assembly the parent frame will be set to null for the removed observer
Returns
true when the observer frame has been successfully removed - otherwise false (observer frame is nullptr or not in this assembly)

◆ remove() [7/12]

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).

Parameters
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
Returns
true if the body been successfully removed

◆ remove() [8/12]

bool agxSDK::Assembly::remove ( agxCollide::Geometry geometry,
bool  resetParentFrame = true 
)

Remove a geometry from this assembly (does not recurse down in tree).

Parameters
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)
Returns
true when the geometry has been successfully removed - otherwise false (geometry is nullptr or not in this assembly)

◆ remove() [9/12]

bool agxSDK::Assembly::remove ( agxSDK::TerrainInstance terrainInstance)

Remove a TerrainInstance from this assembly.

Returns
true when the TerrainInstance has been successfully removed - otherwise false (TerrainInstance is nullptr or not in this assembly)

◆ remove() [10/12]

bool agxSDK::Assembly::remove ( agxSDK::TerrainToolInstance toolInstance)

Remove a TerrainToolInstance from this assembly.

Returns
true when the TerrainToolInstance has been successfully removed - otherwise false (TerrainToolInstance is nullptr or not in this assembly)

◆ remove() [11/12]

bool agxSDK::Assembly::remove ( Assembly assembly,
bool  resetParentFrame = true 
)

Remove a child assembly from a parent.

Parameters
resetParentFrame- If true (default) and the parent frame belongs to this assembly the parent frame will be set to null for the removed assembly
Returns
true when the assembly has been successfully removed - otherwise false (assembly is nullptr or not in this assembly)

◆ remove() [12/12]

bool agxSDK::Assembly::remove ( EventListener listener)

Remove an EventListener from the assembly.

Returns
true when the listener has been successfully removed - otherwise false (listener is nullptr or not in this assembly)

◆ removeFromSimulation()

void agxSDK::Assembly::removeFromSimulation ( Simulation simulation)
protected

◆ removeNotification() [1/2]

virtual void agxSDK::Assembly::removeNotification ( agxSDK::Simulation )
inlinevirtual

◆ removeNotification() [2/2]

virtual void agxSDK::Assembly::removeNotification ( Assembly )
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.

◆ removeParticleSystem()

bool agxSDK::Assembly::removeParticleSystem ( agx::ParticleSystem particleSystem)
protected

Remove a particle system from this assembly.

◆ reset()

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.

Parameters
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.
Returns
true if the assembly could be cleared.

◆ setAngularVelocity()

virtual void agxSDK::Assembly::setAngularVelocity ( const agx::Vec3 velocity)
virtual

Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.

Parameters
velocity- The angular velocity in world frame that will be set for all rigid bodies.

◆ setLocalPosition() [1/2]

void agxSDK::Assembly::setLocalPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Set the position of the assembly relative to its frame's parent frame.

Parameters
x- local x translate
y- local y translate
z- local z translate

◆ setLocalPosition() [2/2]

void agxSDK::Assembly::setLocalPosition ( const agx::Vec3 p)

Set the position of the assembly relative to its frame's parent frame.

Parameters
p- local translate of assembly as a 3D vector

◆ setLocalRotation() [1/2]

void agxSDK::Assembly::setLocalRotation ( const agx::EulerAngles e)

Set the rotation of the assembly relative to its frame's parent frame.

Parameters
e- rotation given as Euler angles

◆ setLocalRotation() [2/2]

void agxSDK::Assembly::setLocalRotation ( const agx::Quat q)

Set the rotation of the assembly relative to its frame's parent frame.

Parameters
q- rotation given as a quaternion

◆ setLocalTransform()

void agxSDK::Assembly::setLocalTransform ( const agx::AffineMatrix4x4 matrix)

Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation.

Parameters
matrix- transformation matrix relative to parent transform for the assembly's frame

◆ setName()

void agxSDK::Assembly::setName ( const agx::Name name)

Set the name of this Assembly.

Parameters
name- new name of this Assembly.

◆ setParentFrame()

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.

Parameters
frame- new parent frame, 0 to remove parent
Returns
true if parent is changed (not the same as before) - otherwise false

◆ setPosition() [1/2]

void agxSDK::Assembly::setPosition ( agx::Real  x,
agx::Real  y,
agx::Real  z 
)

Set the position of the frame in world coordinates.

Parameters
x- desired x-coordinate in world frame
y- desired y-coordinate in world frame
z- desired z-coordinate in world frame

◆ setPosition() [2/2]

void agxSDK::Assembly::setPosition ( const agx::Vec3 p)

Set the position of the frame in world coordinates.

Parameters
p- desired position in world coordinates.

◆ setRotation() [1/3]

void agxSDK::Assembly::setRotation ( const agx::EulerAngles e)

Set the rotation of the assembly relative to world frame.

Parameters
e- rotation given as Euler angles

◆ setRotation() [2/3]

void agxSDK::Assembly::setRotation ( const agx::OrthoMatrix3x3 m)

Set the rotation of the assembly relative to world frame.

Parameters
m- rotation given as an orthogonal transformation matrix

◆ setRotation() [3/3]

void agxSDK::Assembly::setRotation ( const agx::Quat q)

Set the rotation of the assembly relative to world frame.

Parameters
q- rotation given as a quaternion

◆ setTransform()

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.

Parameters
matrix- desired transform for the frame in world coordinates.

◆ setVelocity()

virtual void agxSDK::Assembly::setVelocity ( const agx::Vec3 velocity)
virtual

Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.

Parameters
velocity- The linear velocity in world frame that will be set for all rigid bodies.

◆ transfer()

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.

Returns
true if transfer was successfully done.

◆ traverse() [1/2]

virtual void agxSDK::Assembly::traverse ( AssemblyVisitor visitor)
virtual

Traverse the assembly tree recursively using a visitor.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ traverse() [2/2]

virtual void agxSDK::Assembly::traverse ( const AssemblyVisitor visitor) const
virtual

The documentation for this class was generated from the following file: