AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
Assembly.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/agx.h>
20#include <agx/RigidBody.h>
21#include <agx/MergedBody.h>
23#include <agxSDK/agxSDK.h>
24
25#include <agx/Frame.h>
27#include <agx/Constraint.h>
28#include <agxCollide/Geometry.h>
29#include <agx/ObserverFrame.h>
30#include <agx/ParticleSystem.h>
32#include <agx/SetVector.h>
33#include <agx/DynamicsSystem.h>
36
37namespace agxSDK
38{
40
41 class AssemblyVisitor;
42
70 {
71 public:
74
80 bool add(agx::Constraint* constraint);
81
87 bool remove(agx::Constraint* constraint);
88
94 bool add(agx::Interaction* interaction);
95
101 bool remove(agx::Interaction* interaction);
102
108 bool add(agxSDK::EventListener* listener);
109
115 bool remove(EventListener* listener);
116
122 bool add(agx::RigidBody* body);
123
131 bool remove(agx::RigidBody* body, bool removeAssociatedGeometries = false, bool resetParentFrame=true);
132
138 bool add(agxCollide::Geometry* geometry);
139
146 bool remove(agxCollide::Geometry* geometry, bool resetParentFrame = true);
147
153 bool add(Assembly* assembly);
154
161 bool remove(Assembly* assembly, bool resetParentFrame=true);
162
168 bool add(agx::ContactMaterial* contactMaterial);
169
175 bool remove(agx::ContactMaterial* contactMaterial);
176
182 bool add(agx::Emitter* emitter);
183
189 bool remove(agx::Emitter* emitter);
190
196 bool add(agx::ObserverFrame* observerFrame);
197
204 bool remove(agx::ObserverFrame* observerFrame, bool resetParentFrame=true);
205
211 bool add(agx::MergedBody* mergedBody);
212
218 bool remove(agx::MergedBody *mergedBody);
219
224 bool add(agxSDK::TerrainInstance* terrainInstance);
225
230 bool remove(agxSDK::TerrainInstance* terrainInstance);
231
236 bool add(agxSDK::TerrainToolInstance* toolInstance);
237
243
251
252
254
261 agx::RigidBody* getRigidBody(const agx::Name& name, bool recursive = true);
262
269 const agx::RigidBody* getRigidBody(const agx::Name& name, bool recursive = true) const;
270
277 agx::RigidBody* getRigidBody(const agx::Uuid& uuid, bool recursive = true);
278
285 const agx::RigidBody* getRigidBody(const agx::Uuid& uuid, bool recursive = true) const;
286
293 const agx::Constraint* getConstraint(const agx::Uuid& uuid, bool recursive = true) const;
294
301 agx::Constraint* getConstraint(const agx::Uuid& uuid, bool recursive = true);
302
309 const agx::Constraint* getConstraint(const agx::Name& name, bool recursive = true) const;
310
317 agx::Constraint* getConstraint(const agx::Name& name, bool recursive = true);
318
325 const agxSDK::Assembly* getAssembly(const agx::Name& name, bool recursive = true) const;
326
333 agxSDK::Assembly* getAssembly(const agx::Name& name, bool recursive = true);
334
341 const agxSDK::Assembly* getAssembly(const agx::Uuid& uuid, bool recursive = true) const;
342
349 agxSDK::Assembly* getAssembly(const agx::Uuid& uuid, bool recursive = true);
350
360 template < typename T >
361 T* getConstraint(const agx::Name& name, bool recursive = true);
362
372 template < typename T >
373 const T* getConstraint(const agx::Name& name, bool recursive = true) const;
374
381 const agxCollide::Geometry* getGeometry(const agx::Name& name, bool recursive = true) const;
382
389 agxCollide::Geometry* getGeometry(const agx::Name& name, bool recursive = true);
390
397 const agxCollide::Geometry* getGeometry(const agx::Uuid& uuid, bool recursive = true) const;
398
405 agxCollide::Geometry* getGeometry(const agx::Uuid& uuid, bool recursive = true);
406
407
414 const agx::ObserverFrame* getObserverFrame(const agx::Name& name, bool recursive = true) const;
415
422 agx::ObserverFrame* getObserverFrame(const agx::Name& name, bool recursive = true);
423
430 const agx::ObserverFrame* getObserverFrame(const agx::Uuid& uuid, bool recursive = true) const;
431
438 agx::ObserverFrame* getObserverFrame(const agx::Uuid& uuid, bool recursive = true);
439
446 const agx::MergedBody* getMergedBody (const agx::Uuid& uuid, bool recursive = true) const;
447
454 agx::MergedBody* getMergedBody(const agx::Uuid& uuid, bool recursive = true);
455
456
463 const agxSDK::TerrainInstance* getTerrainInstance(const agx::Uuid& uuid, bool recursive = true) const;
464
471 agxSDK::TerrainInstance* getTerrainInstance(const agx::Uuid& uuid, bool recursive = true);
472
479 const agxSDK::TerrainToolInstance* getTerrainToolInstance(const agx::Uuid& uuid, bool recursive = true) const;
480
488
489
491
495 virtual void traverse(AssemblyVisitor* visitor);
496 virtual void traverse(const AssemblyVisitor* visitor) const;
497
502
503 /*
504 \param result - A Vector with all the RigidBodies found in this and any sub-assemblies
505 \param recursive - If true, RigidBodies in sub-assemblies will be included
506 \return Number of elements in the collected results.
507 */
508 size_t collect(agx::RigidBodyRefVector& result, bool recursive = true);
509
514
515 /*
516 \param result - A Vector with all the Geometries found in this and any sub-assemblies
517 \param recursive - If true, Geometries in sub-assemblies will be included
518 \return Number of elements in the collected results.
519 */
520 size_t collect(agxCollide::GeometryRefVector& result, bool recursive = true);
521
526
527 /*
528 \param result - A Vector with all the EventListeners found in this and any sub-assemblies
529 \param recursive - If true, EventListeners in sub-assemblies will be included
530 \return Number of elements in the collected results.
531 */
532 size_t collect(agxSDK::EventListenerRefVector& result, bool recursive = true);
533
538
539 /*
540 \param result - A Vector with all the Assemblies found in this and any sub-assemblies
541 \param recursive - If true, Assemblies in sub-assemblies will be included
542 \return Number of elements in the collected results.
543 */
544 size_t collect(agxSDK::AssemblyRefVector& result, bool recursive = true);
545
550
551 /*
552 \param result - A Vector with all the Particle systems found in this and any sub-assemblies
553 \param recursive - If true, Particle systems in sub-assemblies will be included
554 \return Number of elements in the collected results.
555 */
556 size_t collect(agx::ParticleSystemRefVector& result, bool recursive = true);
557
562
563 /*
564 \param result - A Vector with all the Emitters found in this and any sub-assemblies
565 \param recursive - If true, Emitters in sub-assemblies will be included
566 \return Number of elements in the collected results.
567 */
568 size_t collect(agx::EmitterRefVector & result, bool recursive = true);
569
570
575
581 size_t collect(agx::ConstraintRefVector& result, bool recursive = true);
582
587
593 size_t collect(agx::InteractionRefVector& result, bool recursive = true);
594
599
605 size_t collect(agx::ObserverFrameRefVector& result, bool recursive = true);
606
611
617 size_t collect(agx::MergedBodyRefVector& result, bool recursive = true);
618
623
629 size_t collect(agxSDK::TerrainInstanceRefVector& result, bool recursive = true);
630
635
641 size_t collect(agxSDK::TerrainToolInstanceRefVector& result, bool recursive=true);
642
647 virtual agx::Frame* getFrame();
648 virtual const agx::Frame* getFrame() const;
649
654
658 const Assembly* getParent() const;
659
665 void setTransform( const agx::AffineMatrix4x4& matrix );
666
671
677
682
687 void setLocalPosition( const agx::Vec3& p );
688
696
701 void setRotation( const agx::Quat& q );
702
708
714
719
724 void setLocalRotation( const agx::Quat& q );
725
731
736
741
752
757 void setPosition( const agx::Vec3& p );
758
766
768
769
773 virtual void addNotification(agxSDK::Simulation*) {}
774
779
783 virtual void addNotification(Assembly*) {}
784
788 virtual void removeNotification(Assembly*) { }
789
792
795
800 virtual void setVelocity(const agx::Vec3& velocity);
801
806 virtual void setAngularVelocity(const agx::Vec3& velocity);
807
809 enum Type {
811 COLLECTION
812 };
813
815 Type getType() const;
816
821 void setName(const agx::Name& name);
822
825
826 agx::Constraint1DOF* getConstraint1DOF(const agx::Name& name, bool recursive=true) { return this->getConstraint<agx::Constraint1DOF>(name, recursive); }
827 agx::Constraint2DOF* getConstraint2DOF(const agx::Name& name, bool recursive=true) { return this->getConstraint<agx::Constraint2DOF>(name, recursive); }
828
830 static Assembly* asAssembly(agxStream::Serializable *obj) { return dynamic_cast<Assembly *>(obj); }
831
840
849 bool reset(bool resetParentFrame = true);
850
854 bool empty() const;
855
856 public:
858
859 protected:
860
861
867
872
873
874#if !defined(SWIG)
876#endif
877
879 virtual ~Assembly();
880 friend class Simulation;
881
882 void addToSimulation(Simulation* simulation);
884
885 private:
886
887 agx::FrameRef m_frame;
888
891 agx::ConstraintRefSetVector m_constraints;
892 agx::EmitterRefSetVector m_emitters;
893 EventListenerRefSetVector m_listeners;
894 agxSDK::Simulation* m_simulation;
895 agx::InteractionRefSetVector m_interactions;
896
897 agx::ContactMaterialRefSetVector m_contactMaterials;
898 agx::ParticleSystemRefSetVector m_particleSystems;
899
900 AssemblyRefSetVector m_assemblies;
901 AssemblyObserver m_parent;
902
904 agx::MergedBodyRefSetVector m_mergedBodies;
907
908 Type m_type;
909 agx::Name m_name;
910 };
911
912
914 {
915 return m_frame.get();
916 }
917
918 inline const agx::Frame* Assembly::getFrame() const
919 {
920 return m_frame.get();
921 }
922
932 {
933 public:
934
936 bool succeed() const;
937
938 // Constructor
941
942 protected:
943
944 friend class Assembly;
945 virtual void visit(agx::Constraint*) {}
946 virtual void visit(agx::Interaction*) {}
947 virtual void visit(agx::RigidBody*) {}
948 virtual void visit(agxCollide::Geometry*) {}
949 virtual void visit(Assembly*);
950 virtual void visit(EventListener*) {}
951 virtual void visit(agx::ContactMaterial*) {}
952 virtual void visit(agx::ParticleSystem*) {}
953 virtual void visit(agx::Emitter*) {}
954 virtual void visit(agx::ObserverFrame*) {}
955 virtual void visit(agx::MergedBody*) {}
958
959 virtual void visit(const agx::Constraint*) const {}
960 virtual void visit(const agx::Interaction*) const {}
961 virtual void visit(const agx::RigidBody*) const {}
962 virtual void visit(const agxCollide::Geometry*) const {}
963 virtual void visit(const Assembly*)const;
964 virtual void visit(const EventListener*) const {}
965 virtual void visit(const agx::ContactMaterial*) const {}
966 virtual void visit(const agx::ParticleSystem*) const {}
967 virtual void visit(const agx::Emitter*) const {}
968 virtual void visit(const agx::ObserverFrame*) const {}
969 virtual void visit(const agx::MergedBody*) const {}
970 virtual void visit(const agxSDK::TerrainInstance*) const {}
971 virtual void visit(const agxSDK::TerrainToolInstance*) const {}
972
973 void setSucceed(bool flag) {
974 m_succeed = flag;
975 }
976
978 };
979
980
981
982 /* Implementation */
983
984
985 template< typename T >
986 T* Assembly::getConstraint(const agx::Name& name, bool recursive)
987 {
988 return dynamic_cast< T* >(this->getConstraint(name, recursive));
989 }
990
991 template< typename T >
992 const T* Assembly::getConstraint(const agx::Name& name, bool recursive) const
993 {
994 return dynamic_cast< const T* >(this->getConstraint(name, recursive));
995 }
996
997
998}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:208
#define AGXPHYSICS_EXPORT
#define AGX_ADD_FRAME_TRANSFORM_INTERFACE()
Definition: agx/Frame.h:660
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Class for visiting all elements in a tree of Assemblies.
Definition: Assembly.h:932
virtual void visit(const agx::Constraint *) const
Definition: Assembly.h:959
virtual void visit(const agx::ParticleSystem *) const
Definition: Assembly.h:966
virtual void visit(agxCollide::Geometry *)
Definition: Assembly.h:948
virtual void visit(agx::ContactMaterial *)
Definition: Assembly.h:951
virtual void visit(const agx::MergedBody *) const
Definition: Assembly.h:969
virtual void visit(agxSDK::TerrainToolInstance *)
Definition: Assembly.h:957
virtual void visit(const agxCollide::Geometry *) const
Definition: Assembly.h:962
virtual void visit(const agxSDK::TerrainToolInstance *) const
Definition: Assembly.h:971
virtual void visit(const EventListener *) const
Definition: Assembly.h:964
virtual void visit(agx::Emitter *)
Definition: Assembly.h:953
virtual void visit(const agx::ContactMaterial *) const
Definition: Assembly.h:965
virtual void visit(const agxSDK::TerrainInstance *) const
Definition: Assembly.h:970
virtual void visit(agx::ParticleSystem *)
Definition: Assembly.h:952
virtual void visit(const agx::Emitter *) const
Definition: Assembly.h:967
virtual void visit(agxSDK::TerrainInstance *)
Definition: Assembly.h:956
virtual void visit(const agx::Interaction *) const
Definition: Assembly.h:960
virtual void visit(agx::ObserverFrame *)
Definition: Assembly.h:954
virtual void visit(agx::Interaction *)
Definition: Assembly.h:946
virtual void visit(const Assembly *) const
virtual void visit(const agx::ObserverFrame *) const
Definition: Assembly.h:968
virtual void visit(agx::Constraint *)
Definition: Assembly.h:945
virtual void visit(const agx::RigidBody *) const
Definition: Assembly.h:961
virtual void visit(Assembly *)
void setSucceed(bool flag)
Definition: Assembly.h:973
virtual void visit(agx::MergedBody *)
Definition: Assembly.h:955
virtual void visit(agx::RigidBody *)
Definition: Assembly.h:947
virtual void visit(EventListener *)
Definition: Assembly.h:950
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
Definition: Assembly.h:70
const agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
virtual agx::Frame * getFrame()
Return a reference to the frame containing transformation and velocity information for this assembly.
Definition: Assembly.h:913
virtual void setVelocity(const agx::Vec3 &velocity)
Set the linear velocity (in world frame) recursively for all rigid bodies stored in assembly.
size_t collect(agx::ConstraintRefVector &result, bool recursive=true)
bool remove(EventListener *listener)
Remove an EventListener from the assembly.
bool removeParticleSystem(agx::ParticleSystem *particleSystem)
Remove a particle system from this assembly.
agx::Vec3 getLocalPosition() const
const agx::InteractionRefSetVector & getInteractions() const
bool add(agxSDK::EventListener *listener)
Add a listener to the assembly.
virtual void removeNotification(agxSDK::Simulation *)
Called when this assembly is removed from a simulation.
Definition: Assembly.h:778
void setPosition(agx::Real x, agx::Real y, agx::Real z)
Set the position of the frame in world coordinates.
virtual void traverse(const AssemblyVisitor *visitor) const
bool add(agxCollide::Geometry *geometry)
Add a geometry to the assembly.
Assembly * getParent()
void removeFromSimulation(Simulation *simulation)
const agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an Assembly matching the given uuid.
agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a Geometry matching the given uuid.
agx::Constraint2DOF * getConstraint2DOF(const agx::Name &name, bool recursive=true)
Definition: Assembly.h:827
const agx::ParticleSystemRefSetVector & getParticleSystems() const
agx::MergedBody * getMergedBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an MergedBody matching the given uuid.
const agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named collision Geometry.
bool add(agx::ObserverFrame *observerFrame)
Add an ObserverFrame to this assembly.
Assembly()
Default constructor.
void setRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to world frame.
const agx::ObserverFrameRefSetVector & getObserverFrames() const
void setPosition(const agx::Vec3 &p)
Set the position of the frame in world coordinates.
const EventListenerRefSetVector & getEventListeners() const
agxCollide::Geometry * getGeometry(const agx::Name &name, bool recursive=true)
Find (linear search) and return named collision Geometry.
const agx::ConstraintRefSetVector & getConstraints() const
bool remove(agx::RigidBody *body, bool removeAssociatedGeometries=false, bool resetParentFrame=true)
Remove a rigid body from this assembly (does not recurse down in tree).
const agx::EmitterRefSetVector & getEmitters() const
bool remove(agx::MergedBody *mergedBody)
Remove a MergedBody from this assembly.
bool remove(agxCollide::Geometry *geometry, bool resetParentFrame=true)
Remove a geometry from this assembly (does not recurse down in tree).
agxSDK::Assembly * getAssembly(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an Assembly matching the given uuid.
agx::ObserverFrame * getObserverFrame(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
void setLocalPosition(agx::Real x, agx::Real y, agx::Real z)
Set the position of the assembly relative to its frame's parent frame.
bool remove(agxSDK::TerrainToolInstance *toolInstance)
Remove a TerrainToolInstance from this assembly.
size_t collect(agx::ParticleSystemRefVector &result, bool recursive=true)
bool add(agxStream::Serializable *object)
Add an object of type serialized.
agx::Name getName() const
static Assembly * asAssembly(agxStream::Serializable *obj)
Definition: Assembly.h:830
virtual ~Assembly()
Destructor.
void setName(const agx::Name &name)
Set the name of this Assembly.
virtual void setAngularVelocity(const agx::Vec3 &velocity)
Set the angular velocity (in world frame) recursively for all rigid bodies stored in assembly.
bool addParticleSystem(agx::ParticleSystem *particleSystem)
Add a particle system to this assembly.
agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true)
Find (linear search) and return an ObserverFrame matching the given uuid.
bool add(agx::RigidBody *body)
Add a rigid body to the assembly.
bool add(agx::Constraint *constraint)
Add a constraint to the assembly.
const agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Constraint.
const agx::RigidBody * getRigidBody(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a pointer to a RigidBody with the given uuid.
size_t collect(agxCollide::GeometryRefVector &result, bool recursive=true)
virtual void traverse(AssemblyVisitor *visitor)
Traverse the assembly tree recursively using a visitor.
agx::Constraint * getConstraint(const agx::Uuid &uuid, bool recursive=true)
Find and return a pointer to a Constraint with the given uuid.
void setLocalTransform(const agx::AffineMatrix4x4 &matrix)
Assign the local transformation matrix for this assembly, ignoring any eventual parent transformation...
bool remove(agx::Emitter *emitter)
Remove an emitter from this assembly.
size_t collect(agx::ObserverFrameRefVector &result, bool recursive=true)
bool add(agxSDK::TerrainInstance *terrainInstance)
Add a TerrainInstance to this assembly.
void setLocalRotation(const agx::EulerAngles &e)
Set the rotation of the assembly relative to its frame's parent frame.
size_t collect(agx::RigidBodyRefVector &result, bool recursive=true)
bool reset(bool resetParentFrame=true)
If this assembly is not added to a simulation it will clear all added bodies etc.
bool add(agx::ContactMaterial *contactMaterial)
Add a contact material to this assembly.
bool transfer(agxSDK::Assembly *target)
Transfer all the content from this assembly to the target, including name and transformation.
agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Assembly.
const agxSDK::TerrainToolInstance * getTerrainToolInstance(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an TerrainToolInstance matching the given uuid.
const agxSDK::TerrainInstanceRefSetVector & getTerrainInstances() const
const agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named RigidBody.
bool remove(Assembly *assembly, bool resetParentFrame=true)
Remove a child assembly from a parent.
Type getType() const
const agxSDK::TerrainToolInstanceRefSetVector & getTerrainToolInstances() const
const agxCollide::Geometry * getGeometry(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a Geometry matching the given uuid.
agx::Frame * getParentFrame()
size_t collect(agx::MergedBodyRefVector &result, bool recursive=true)
const Assembly * getParent() const
bool remove(agx::Interaction *interaction)
Remove an interaction from this assembly.
void setLocalPosition(const agx::Vec3 &p)
Set the position of the assembly relative to its frame's parent frame.
const agx::ObserverFrame * getObserverFrame(const agx::Name &name, bool recursive=true) const
Find (linear search) and return an ObserverFrame matching the given uuid.
bool add(agxSDK::TerrainToolInstance *toolInstance)
Add a TerrainToolInstance to this assembly.
agx::Quat getLocalRotation() const
const agxCollide::GeometryRefSetVector & getGeometries() const
bool remove(agx::ObserverFrame *observerFrame, bool resetParentFrame=true)
Remove an ObserverFrame from this assembly.
virtual void addNotification(Assembly *)
Called when this assembly is added to another assembly.
Definition: Assembly.h:783
virtual void removeNotification(Assembly *)
Called when this assembly is removed from another assembly.
Definition: Assembly.h:788
const agx::Frame * getParentFrame() const
void addToSimulation(Simulation *simulation)
bool remove(agx::Constraint *constraint)
Remove a constraint from this assembly (does not recurse down in tree).
const agxSDK::TerrainInstance * getTerrainInstance(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an TerrainInstance matching the given uuid.
const agx::MergedBody * getMergedBody(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return an MergedBody matching the given uuid.
bool add(agx::Interaction *interaction)
Add an interaction to this assembly.
const agxSDK::Assembly * getAssembly(const agx::Name &name, bool recursive=true) const
Find (linear search) and return named Assembly.
const agxSDK::Simulation * getSimulation() const
Type
Specifies the type an assembly is.
Definition: Assembly.h:809
@ ASSEMBLY
This is a full fledged Assembly which uses Frame for the hierarchy.
Definition: Assembly.h:810
agx::Constraint1DOF * getConstraint1DOF(const agx::Name &name, bool recursive=true)
Definition: Assembly.h:826
Assembly(Type type)
size_t collect(agx::InteractionRefVector &result, bool recursive=true)
agx::Constraint * getConstraint(const agx::Name &name, bool recursive=true)
Find (linear search) and return named Constraint.
agxSDK::TerrainInstance * getTerrainInstance(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an TerrainInstance matching the given uuid.
bool empty() const
size_t collect(agxSDK::TerrainToolInstanceRefVector &result, bool recursive=true)
agx::RigidBody * getRigidBody(const agx::Name &name, bool recursive=true)
Find (linear search) and return named RigidBody.
size_t collect(agx::EmitterRefVector &result, bool recursive=true)
size_t collect(agxSDK::AssemblyRefVector &result, bool recursive=true)
bool remove(agx::ContactMaterial *contactMaterial)
Remove a contact material from this assembly.
bool remove(agxSDK::TerrainInstance *terrainInstance)
Remove a TerrainInstance from this assembly.
agx::RigidBody * getRigidBody(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return a pointer to a RigidBody with the given uuid.
size_t collect(agxSDK::TerrainInstanceRefVector &result, bool recursive=true)
bool add(Assembly *assembly)
Add another assembly as child to this assembly.
void setRotation(const agx::OrthoMatrix3x3 &m)
Set the rotation of the assembly relative to world frame.
agxSDK::TerrainToolInstance * getTerrainToolInstance(const agx::Uuid &uuid, bool recursive=true)
Find (linear search) and return an TerrainToolInstance matching the given uuid.
const agx::RigidBodyRefSetVector & getRigidBodies() const
bool add(agx::MergedBody *mergedBody)
Add a MergedBody to this assembly.
agxSDK::Simulation * getSimulation()
const agx::Constraint * getConstraint(const agx::Uuid &uuid, bool recursive=true) const
Find (linear search) and return a pointer to a Constraint with the given uuid.
const agx::MergedBodyRefSetVector & getMergedBodies() const
const AssemblyRefSetVector & getAssemblies() const
void setTransform(const agx::AffineMatrix4x4 &matrix)
Set the transform of the assembly.
void setLocalRotation(const agx::Quat &q)
Set the rotation of the assembly relative to its frame's parent frame.
size_t collect(agxSDK::EventListenerRefVector &result, bool recursive=true)
bool add(agx::Emitter *emitter)
Add an emitter to this assembly.
void setRotation(const agx::Quat &q)
Set the rotation of the assembly relative to world frame.
const agx::AffineMatrix4x4 & getLocalTransform() const
bool setParentFrame(agx::Frame *frame)
Set the parent frame of this assembly's frame.
An EventListener can be associated to a Simulation and triggered upon various events.
Definition: EventListener.h:40
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:130
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
An agxTerrain::TerrainToolInstance in a simulation, receiving step and contact callbacks in a control...
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic.
Definition: Constraint.h:710
Specialization for constraints that have two degree of freedom such as Cylindrical.
Definition: Constraint.h:798
The base class for a constraint.
Definition: Constraint.h:89
This class store the combine material properties between two agx::Material's.
Definition: Material.h:516
Spawns new bodys inside a given volume.
Definition: Emitter.h:45
This class provides conversion services between Euler angles in any of the 24 conventions and corresp...
Definition: EulerAngles.h:70
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
The base class for interactions.
Definition: Interaction.h:33
Structure holding several "normal" rigid bodies.
Definition: MergedBody.h:56
Representation of a name string.
Definition: Name.h:33
With this class you can attach an ObserverFrame object relative to a RigidBody.
Definition: ObserverFrame.h:42
Specialized types of matrices for holding orthogonal transformation matrices.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Base class providing referencing counted objects.
Definition: Referenced.h:120
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:52
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: SetVector.h:38
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Definition: Uuid.h:42
T * get() const
Definition: ref_ptr.h:256
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:31
agx::SetVector< agx::ref_ptr< agxSDK::Assembly > > AssemblyRefSetVector
Definition: Assembly.h:39
double Real
Definition: Real.h:42