 |
AGXDynamics
2.35.0.3
|
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)
56 class ParticleEmitter;
57 class RigidBodyEmitter;
62 class StabilityReport;
70 class AngularLockJoint;
71 class CylindricalJoint;
73 class PrismaticUniversalJoint;
83 class RemoteDebugClient;
98 class SurfaceVelocityConveyorBelt;
109 class SimulationFrameReader;
110 class SimulationFrameWriter;
112 class SimulationFrameWriter;
113 class GuiEventAdapterImplementation;
115 class MergeSplitHandler;
116 class TerrainInstance;
252 bool remove(
agx::RigidBody* body,
bool removeGeometries =
true );
353 bool add( agxControl::Action* action );
360 bool remove( agxControl::Action* action );
367 bool add( agxControl::Operation* operation );
374 bool remove( agxControl::Operation* operation );
397 bool add(
agx::Emitter* emitter,
bool addGeometries=
true);
406 bool remove(
agx::Emitter* emitter,
bool removeGeometries=
true);
468 bool setUniformGravity(
const agx::Vec3& g );
643 template <
typename T >
654 template <
typename T >
655 const T* getConstraint(
const agx::Uuid& uuid)
const;
665 template <
typename T >
666 T* getConstraint(
const agx::Name& name );
676 template <
typename T >
677 const T* getConstraint(
const agx::Name& name )
const;
679 #define GETCONSTRAINT_TYPE(CLASS_NAME, TYPENAME) \
680 CLASS_NAME *get ## TYPENAME(const agx::Name& name); \
681 CLASS_NAME *get ##TYPENAME(const agx::Uuid& uuid);
693 #undef GETCONSTRAINT_TYPE
846 #if AGX_USE_WEBSOCKETS()
850 agx::RemoteSolver* getRemoteSolver();
855 const agx::RemoteSolver* getRemoteSolver()
const;
941 bool addEventListener(
agxSDK::EventListener* listener,
int priority = EventManager::DEFAULT_PRIORITY );
966 bool triggerEvent(
const GuiEvent& e );
974 enum CleanupSelectionMask {
975 STEP_LISTENERS = 0x1,
976 CONTACT_LISTENERS = 0x2,
978 LISTENERS = STEP_LISTENERS | CONTACT_LISTENERS | GUI_LISTENERS,
983 PARTICLE_SYSTEMS = 0x2000,
984 CONTACT_DATA = 0x4000,
985 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA
993 STEP_LISTENERS = EventManager::STEP_LISTENERS,
994 CONTACT_LISTENERS = EventManager::CONTACT_LISTENERS,
995 GUI_LISTENERS = EventManager::GUI_LISTENERS,
996 LISTENERS = EventManager::LISTENERS,
1000 ASSEMBLIES = 0x1000,
1001 PARTICLE_SYSTEMS = 0x2000,
1002 CONTACT_DATA = 0x4000,
1003 PLOTSYSTEM = 0x8000,
1004 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA | PLOTSYSTEM
1014 READ_TIMESTEP = 0x1,
1015 READ_TIMESTAMP = 0x2,
1018 READ_ALL = READ_TIMESTEP + READ_TIMESTAMP + READ_GRAVITY + READ_SOLVER,
1019 READ_DEFAULT = READ_TIMESTEP + READ_GRAVITY + READ_SOLVER
1029 void cleanup(
agx::UInt selection = CLEANUP_ALL,
bool fast=
false );
1041 agxControl::ActionManager* getActionManager();
1046 void clearContactData();
1051 agx::Solver* getSolver();
1056 const agx::Solver* getSolver()
const;
1061 void setPreIntegratePositions(
bool flag );
1066 bool getPreIntegratePositions()
const;
1105 void setStatisticsPath(
const agx::String& path );
1110 void setStatisticsInterval(
agx::Real interval );
1117 void setEnableStatistics(
bool enable );
1120 bool getEnableStatistics()
const;
1123 void setEnableStatisticsRendering(
bool enable );
1126 bool getEnableStatisticsRendering()
const;
1131 void setProfilingFrequency(
agx::Real frequency);
1136 agx::Real getProfilingFrequency()
const;
1235 size_t write( std::ostream& stream,
bool binary )
const;
1261 bool restore(std::istream& stream,
bool isBinary,
agx::UInt selection = READ_DEFAULT);
1302 void setEnableRemoteDebugging(
bool flag,
agx::Int16 port = -1,
bool useCompression =
false,
bool waitForSynchronization =
true );
1307 bool getEnableRemoteDebugging()
const;
1313 void setRemoteDebuggingTimeStep(
agx::Real timeStep );
1318 agx::Real getRemoteDebuggingTimeStep()
const;
1328 void setContactReductionBinResolution(
agx::UInt8 binResolution );
1333 agx::UInt8 getContactReductionBinResolution()
const;
1340 void setContactReductionThreshold(
agx::UInt threshold);
1345 agx::UInt getContactReductionThreshold()
const;
1377 void updateRenderManager();
1382 void updateStatisticsRenderData();
1393 void garbageCollect();
1424 void sendSimulation();
1449 void updateActionManager();
1476 void renderComponents();
1477 void createRenderTask();
1478 agx::SolveModel* getSolveModel(
const agx::Name& name);
1480 const agx::SolveModelRefVector& getSolveModels()
const;
1482 #if AGX_USE_WEBSOCKETS()
1483 void setRemoteSolver(agx::RemoteSolver* remoteSolver);
1499 void setEnableSimulationStatisticsListener(
bool flag );
1504 void addSolveModel(agx::SolveModel* model);
1505 void removeSolveModel(agx::SolveModel* model);
1508 bool getUseComplexImpactStage()
const;
1509 void setUseComplexImpactStage(
bool flag);
1538 void resetTaskTimers();
1543 void dumpTaskTimers(
const agx::String& filePath =
"BufferAllocations.xml");
1548 void dumpMemoryUsage(
const agx::String& filePath =
"TaskTimers.xml");
1552 bool allowCreateParticles()
const;
1564 friend class GuiEventAdapterImplementation;
1582 void initConfiguration();
1585 void updateStatisticsEnable();
1587 void setEnableComputeAllConstraintForces(
bool flag);
1588 bool getEnableComputeAllConstraintForces()
const;
1591 void resetGraphStatistics();
1597 void setupStatisticsLogging();
1599 void updateConstraintForceData();
1601 void createUpdateTask();
1603 void generateContactMaterials();
1605 void prepareContacts();
1606 void triggerParticleContactSensors();
1607 void triggerPreStepEvents();
1608 void triggerPostStepEvents();
1609 void triggerLastStepEvents();
1610 void terrainPostUpdate();
1612 void resetDirtyMaterials();
1613 void updateRemoteDebugger();
1614 void recordStatistics();
1615 void recordPlaybackStatistics();
1616 void recordParticleCount();
1617 void recordWarmStartingData();
1618 void printStatistics();
1622 void pruneContacts();
1623 void contactPointReduction();
1624 void updateSleepState();
1625 void triggerPreCollideStepEvent();
1626 void triggerSeparationContactEventListeners();
1627 void triggerContactEventListeners();
1628 void assignContactMaterials();
1631 void applyPreIntegrationSettings();
1634 friend class agx::Solver;
1635 void registerParticleSystemPointers();
1636 void unregisterParticleSystemPointers();
1641 class StatisticsWriter;
1645 #if AGX_USE_WEBSOCKETS()
1646 friend class agx::RemoteSolver;
1650 void setHasJournal(
bool flag);
1651 void preStoreSynchronization();
1654 StatisticsWriter* m_statWriter;
1667 bool m_stepToStarted;
1669 EventManagerRef m_eventManager;
1672 agxControl::ActionManagerRef m_actionManager;
1692 bool m_preIntegrate;
1694 bool m_allowCreateParticles;
1702 agx::SolveModelTable m_solveModelTable;
1703 agx::SolveModelRefVector m_solveModels;
1712 void* m_remoteSolver;
1715 bool m_enableComputeAllConstraintForces;
1716 bool m_inDestructor;
1747 bool m_disableGeometryAutoAdd;
1765 return m_space.
get();
1770 return m_space.
get();
1775 return m_system.
get();
1780 return m_system.
get();
1785 if (m_system)
return m_system->getTimeGovernor()->getTimeStep();
1801 return m_allowCreateParticles;
1806 return m_solveModels;
1809 template<
typename T >
1815 template<
typename T >
1818 return dynamic_cast< const T*
>( this->
getConstraint( uuid ) );
1821 template<
typename T >
1827 template<
typename T >
1830 return dynamic_cast< const T*
>( this->
getConstraint( name ) );
1835 # 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 only one degree of freedom such as Hinge and Prismatic.
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
Class which will go through contacting/separating bodies and determine if the bodies can be merged (g...
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.
#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.
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....