 |
AGX Dynamics
2.38.0.2
|
Go to the documentation of this file.
19 #include <agx/config/AGX_USE_WEBSOCKETS.h>
45 # pragma warning(push)
46 # pragma warning( disable : 4290 ) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
55 class ParticleEmitter;
56 class RigidBodyEmitter;
61 class StabilityReport;
69 class AngularLockJoint;
70 class CylindricalJoint;
72 class PrismaticUniversalJoint;
82 class RemoteDebugClient;
97 class SurfaceVelocityConveyorBelt;
108 class SimulationFrameReader;
109 class SimulationFrameWriter;
111 class SimulationFrameWriter;
112 class GuiEventAdapterImplementation;
114 class MergeSplitHandler;
115 class TerrainInstance;
251 bool remove(
agx::RigidBody* body,
bool removeGeometries =
true );
352 bool add( agxControl::Action* action );
359 bool remove( agxControl::Action* action );
366 bool add( agxControl::Operation* operation );
373 bool remove( agxControl::Operation* operation );
396 bool add(
agx::Emitter* emitter,
bool addGeometries=
true);
405 bool remove(
agx::Emitter* emitter,
bool removeGeometries=
true);
467 bool setUniformGravity(
const agx::Vec3& g );
642 template <
typename T >
653 template <
typename T >
654 const T* getConstraint(
const agx::Uuid& uuid)
const;
664 template <
typename T >
665 T* getConstraint(
const agx::Name& name );
675 template <
typename T >
676 const T* getConstraint(
const agx::Name& name )
const;
678 #define GETCONSTRAINT_TYPE(CLASS_NAME, TYPENAME) \
679 CLASS_NAME *get ## TYPENAME(const agx::Name& name); \
680 CLASS_NAME *get ##TYPENAME(const agx::Uuid& uuid);
692 #undef GETCONSTRAINT_TYPE
845 #if AGX_USE_WEBSOCKETS()
849 agx::RemoteSolver* getRemoteSolver();
854 const agx::RemoteSolver* getRemoteSolver()
const;
940 bool addEventListener(
agxSDK::EventListener* listener,
int priority = EventManager::DEFAULT_PRIORITY );
965 bool triggerEvent(
const GuiEvent& e );
973 enum CleanupSelectionMask {
974 STEP_LISTENERS = 0x1,
975 CONTACT_LISTENERS = 0x2,
977 LISTENERS = STEP_LISTENERS | CONTACT_LISTENERS | GUI_LISTENERS,
982 PARTICLE_SYSTEMS = 0x2000,
983 CONTACT_DATA = 0x4000,
984 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA
992 STEP_LISTENERS = EventManager::STEP_LISTENERS,
993 CONTACT_LISTENERS = EventManager::CONTACT_LISTENERS,
994 GUI_LISTENERS = EventManager::GUI_LISTENERS,
995 LISTENERS = EventManager::LISTENERS,
1000 PARTICLE_SYSTEMS = 0x2000,
1001 CONTACT_DATA = 0x4000,
1002 PLOTSYSTEM = 0x8000,
1003 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA | PLOTSYSTEM
1013 READ_TIMESTEP = 0x1,
1014 READ_TIMESTAMP = 0x2,
1017 READ_ALL = READ_TIMESTEP + READ_TIMESTAMP + READ_GRAVITY + READ_SOLVER,
1018 READ_DEFAULT = READ_TIMESTEP + READ_GRAVITY + READ_SOLVER
1028 void cleanup(
agx::UInt selection = CLEANUP_ALL,
bool fast=
false );
1040 agxControl::ActionManager* getActionManager();
1045 void clearContactData();
1050 agx::Solver* getSolver();
1055 const agx::Solver* getSolver()
const;
1060 void setPreIntegratePositions(
bool flag );
1065 bool getPreIntegratePositions()
const;
1104 void setStatisticsPath(
const agx::String& path );
1109 void setStatisticsInterval(
agx::Real interval );
1116 void setEnableStatistics(
bool enable );
1119 bool getEnableStatistics()
const;
1122 void setEnableStatisticsRendering(
bool enable );
1125 bool getEnableStatisticsRendering()
const;
1130 void setProfilingFrequency(
agx::Real frequency);
1135 agx::Real getProfilingFrequency()
const;
1234 size_t write( std::ostream& stream,
bool binary )
const;
1260 bool restore(std::istream& stream,
bool isBinary,
agx::UInt selection = READ_DEFAULT);
1301 void setEnableRemoteDebugging(
bool flag,
agx::Int16 port = -1,
bool useCompression =
false,
bool waitForSynchronization =
true );
1306 bool getEnableRemoteDebugging()
const;
1312 void setRemoteDebuggingTimeStep(
agx::Real timeStep );
1317 agx::Real getRemoteDebuggingTimeStep()
const;
1327 void setContactReductionBinResolution(
agx::UInt8 binResolution );
1332 agx::UInt8 getContactReductionBinResolution()
const;
1339 void setContactReductionThreshold(
agx::UInt threshold);
1344 agx::UInt getContactReductionThreshold()
const;
1366 void updateRenderManager();
1371 void updateStatisticsRenderData();
1382 void garbageCollect();
1413 void sendSimulation();
1438 void updateActionManager();
1465 void renderComponents();
1466 void createRenderTask();
1467 agx::SolveModel* getSolveModel(
const agx::Name& name);
1469 const agx::SolveModelRefVector& getSolveModels()
const;
1471 #if AGX_USE_WEBSOCKETS()
1472 void setRemoteSolver(agx::RemoteSolver* remoteSolver);
1488 void setEnableSimulationStatisticsListener(
bool flag );
1493 void addSolveModel(agx::SolveModel* model);
1494 void removeSolveModel(agx::SolveModel* model);
1524 void resetTaskTimers();
1529 void dumpTaskTimers(
const agx::String& filePath =
"BufferAllocations.xml");
1534 void dumpMemoryUsage(
const agx::String& filePath =
"TaskTimers.xml");
1538 bool allowCreateParticles()
const;
1550 friend class GuiEventAdapterImplementation;
1568 void initConfiguration();
1571 void updateStatisticsEnable();
1573 void setEnableComputeAllConstraintForces(
bool flag);
1574 bool getEnableComputeAllConstraintForces()
const;
1577 void resetGraphStatistics();
1583 void setupStatisticsLogging();
1585 void updateConstraintForceData();
1587 void createUpdateTask();
1589 void generateContactMaterials();
1591 void prepareContacts();
1592 void triggerParticleContactSensors();
1593 void triggerPreStepEvents();
1594 void triggerPostStepEvents();
1595 void triggerLastStepEvents();
1596 void terrainPostUpdate();
1598 void resetDirtyMaterials();
1599 void updateRemoteDebugger();
1600 void recordStatistics();
1601 void recordPlaybackStatistics();
1602 void recordParticleCount();
1603 void recordWarmStartingData();
1604 void printStatistics();
1608 void pruneContacts();
1609 void contactPointReduction();
1610 void updateSleepState();
1611 void triggerPreCollideStepEvent();
1612 void triggerSeparationContactEventListeners();
1613 void triggerContactEventListeners();
1614 void assignContactMaterials();
1617 void applyPreIntegrationSettings();
1620 friend class agx::Solver;
1621 void registerParticleSystemPointers();
1622 void unregisterParticleSystemPointers();
1627 class StatisticsWriter;
1631 #if AGX_USE_WEBSOCKETS()
1632 friend class agx::RemoteSolver;
1636 void setHasJournal(
bool flag);
1637 void preStoreSynchronization();
1640 StatisticsWriter* m_statWriter;
1653 bool m_stepToStarted;
1655 EventManagerRef m_eventManager;
1658 agxControl::ActionManagerRef m_actionManager;
1678 bool m_preIntegrate;
1680 bool m_allowCreateParticles;
1688 agx::SolveModelTable m_solveModelTable;
1689 agx::SolveModelRefVector m_solveModels;
1698 void* m_remoteSolver;
1701 bool m_enableComputeAllConstraintForces;
1702 bool m_inDestructor;
1732 bool m_disableGeometryAutoAdd;
1750 return m_space.
get();
1755 return m_space.
get();
1760 return m_system.
get();
1765 return m_system.
get();
1770 if (m_system)
return m_system->getTimeGovernor()->getTimeStep();
1786 return m_allowCreateParticles;
1791 return m_solveModels;
1794 template<
typename T >
1800 template<
typename T >
1803 return dynamic_cast< const T*
>( this->
getConstraint( uuid ) );
1806 template<
typename T >
1812 template<
typename T >
1815 return dynamic_cast< const T*
>( this->
getConstraint( name ) );
1820 # pragma warning(pop) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow). Restored.
ReadSelectionMask
Enum for specifying some additional, part of a simulation that can be restored from a serialization.
ConstraintEvent removeConstraintEvent
agx::Event2< Simulation *, agx::ContactMaterial * > ContactMaterialEvent
RigidBodyEvent addRigidBodyEvent
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Namespace containing classes for handling debug rendering of collision geometries,...
Namespace contains functionality related to plotting.
RigidBodyEvent removeRigidBodyEvent
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic.
The rigid body class, combining a geometric model and a frame of reference.
JournalAttachEvent journalAttachedEvent
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
MaterialEvent addMaterialEvent
Specialization for constraints that have two degree of freedom such as Cylindrical.
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
agx::Constraint2DOF * getConstraint2DOF(const agx::Name &name)
A prismatic joint keeps a fixed relative orientation between the attached bodies but allows them to s...
agx::Real getTimeStamp() const
An EventListener can be associated to a Simulation and triggered upon various events.
Class for receiving serialized agxSDK::Simulation:s from remote host.
const agx::SolveModelRefVector & getSolveModels() const
agx::Real getTimeStep() const
A cylindrical joint is similar to a prismatic joint but with an extra degree of freedom free (rotatio...
agx::Event2< Simulation *, agxCollide::Geometry * > GeometryEvent
agx::ref_ptr< Frame > FrameRef
A class holding 4 dimensional vectors and providing basic arithmetic.
Data storage for a collection of entity instances of a specified EntityModel.
Interface and placeholder of controllers/helpers for wires.
Class for listening to the restore of Serializable objects.
A Prismatic Universal Joint has two translational dof's constrained.
Constraint that removes 3 DOF (rotational degrees of freedom) between two bodies, or one body and the...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
This class is for detecting and handling particle collisions with geometries in the simulation.
bool allowCreateParticles() const
#define AGXPHYSICS_EXPORT
A model is an abstract representation of the class of an agx::Object.
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Base class for a merge split algorithm handling a set of merged bodies.
GeometryEvent removeGeometryEvent
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints,...
A representation of a generic task.
agx::Event2< Simulation *, agx::Material * > MaterialEvent
With this class you can attach an ObserverFrame object relative to a RigidBody.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Implements a Wire model with adaptive resolution.
agx::DynamicsSystem * getDynamicsSystem()
Simulation unique manager that handles logics around and parameters in contact materials given two ag...
ConstraintEvent addConstraintEvent
agx::Event2< Simulation *, agx::Constraint * > ConstraintEvent
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::Real getTime() const
The geometry representation used by the collision detection engine.
agx::HashVector< agxSDK::Assembly *, agxSDK::AssemblyRef > AssemblyHash
System that manages the plotting system.
Constraint that removes all 6 DOF between two bodies, or one body and the world.
Representation of a name string.
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
Class for writing serialized data in binary format to a stream.
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
A component is an object containing other objects, enabling hierarchical structuring.
Constraint that removes the three translation DOF between two bodies (or one and the world).
A Universal Joint has one fixed relative point, the 3 translational dof's, and one constrained axis (...
agx::Event2< Simulation *, agx::Journal * > JournalAttachEvent
MaterialEvent removeMaterialEvent
The base class for interactions.
Class that encapsulates data to be plotted, including methods for accessing the data,...
#define AGX_DECLARE_POINTER_TYPES(type)
agxCollide::Space * getSpace()
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Keeps track of the energy flow in the system.
The base class for a constraint.
agx::Thread is a representation of an OS specific implementation of a computational thread.
agx::Constraint1DOF * getConstraint1DOF(const agx::Name &name)
bool AGXPHYSICS_EXPORT read(const std::string &filename, agxStream::SerializablePtrVector &readObjects)
Open and read serializable objects from a file on disk with previously stored objects.
An agx::Device is an abstract representation of a device on which data can be stored and processed.
The hinge constraint between two rigid bodies or one rigid body and the world.
#define GETCONSTRAINT_TYPE(CLASS_NAME, TYPENAME)
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Clock class keeps representation of virtual/simulated time.
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API.
This joint will preserve the initial distance between a body and a point in world coordinate or betwe...
ContactMaterialEvent removeContactMaterialEvent
Main material class which acts as a holder of a Surface Material and a Bulk material.
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
ContactMaterialEvent addContactMaterialEvent
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
AGXTERRAIN_EXPORT void clear()
The complete physical system with bodies, interactions, data layout, time stepper,...
agx::HashTable< agxCollide::Geometry *, agx::ref_ptr< Geometry > > GeometryTable
Structure holding several "normal" rigid bodies.
Spawns new bodys inside a given volume.
CleanupSelectionMask
Specification of what should be cleaned up from a simulation during a call to the cleanup() method.
This class will collect statistics and sizes of a simulation.
agx::Event2< Simulation *, agx::RigidBody * > RigidBodyEvent
Containins classes for sending/reading data over sockets as well as compression functionality.
const agx::Constraint * getConstraint(const agx::Uuid &uuid) const
Find (linear search) and return a pointer to a Constraint with the given uuid.
Interface class used by internal objects running in parallel.
GeometryEvent addGeometryEvent
class for serializing a simulation into a series for files on disk <filename>_0001....