46 # pragma warning(push)
47 # pragma warning( disable : 4290 ) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
57 class ParticleEmitter;
58 class RigidBodyEmitter;
63 class StabilityReport;
71 class AngularLockJoint;
72 class CylindricalJoint;
74 class PrismaticUniversalJoint;
84 class RemoteDebugClient;
99 class SurfaceVelocityConveyorBelt;
104 class SimulationFrameReader;
105 class SimulationFrameWriter;
107 class SimulationFrameWriter;
108 class GuiEventAdapterImplementation;
110 class MergeSplitHandler;
111 class TerrainInstance;
247 bool remove(
agx::RigidBody* body,
bool removeGeometries = true );
348 bool add( agxControl::Action* action );
355 bool remove( agxControl::Action* action );
362 bool add( agxControl::Operation* operation );
369 bool remove( agxControl::Operation* operation );
416 agx::ParticleEmitterRefVector getParticleEmitters();
421 agx::EmitterRefVector getEmitters();
426 agx::ParticleSystemRefVector& getParticleSystems();
431 const agx::ParticleSystemRefVector& getParticleSystems()
const;
459 bool setUniformGravity(
const agx::Vec3& g );
606 template <
typename T >
617 template <
typename T >
618 const T* getConstraint(
const agx::Uuid& uuid)
const;
628 template <
typename T >
629 T* getConstraint(
const agx::Name& name );
639 template <
typename T >
640 const T* getConstraint(
const agx::Name& name )
const;
642 #define GETCONSTRAINT_TYPE(CLASS_NAME, TYPENAME) \
643 CLASS_NAME *get ## TYPENAME(const agx::Name& name); \
644 CLASS_NAME *get ##TYPENAME(const agx::Uuid& uuid);
656 #undef GETCONSTRAINT_TYPE
809 #if AGX_USE_WEBSOCKETS()
813 agx::RemoteSolver* getRemoteSolver();
818 const agx::RemoteSolver* getRemoteSolver()
const;
909 bool addEventListener(
agxSDK::EventListener* listener,
int priority = EventManager::DEFAULT_PRIORITY );
934 bool triggerEvent(
const GuiEvent& e );
947 enum CleanupSelectionMask {
948 STEP_LISTENERS = 0x1,
949 CONTACT_LISTENERS = 0x2,
951 LISTENERS = STEP_LISTENERS | CONTACT_LISTENERS | GUI_LISTENERS,
956 PARTICLE_SYSTEMS = 0x2000,
957 CONTACT_DATA = 0x4000,
958 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA
966 STEP_LISTENERS = EventManager::STEP_LISTENERS,
967 CONTACT_LISTENERS = EventManager::CONTACT_LISTENERS,
968 GUI_LISTENERS = EventManager::GUI_LISTENERS,
969 LISTENERS = EventManager::LISTENERS,
974 PARTICLE_SYSTEMS = 0x2000,
975 CONTACT_DATA = 0x4000,
977 CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA | PLOTSYSTEM
988 READ_TIMESTAMP = 0x2,
991 READ_ALL = READ_TIMESTEP + READ_TIMESTAMP + READ_GRAVITY + READ_SOLVER,
992 READ_DEFAULT = READ_TIMESTEP + READ_GRAVITY + READ_SOLVER
1002 void cleanup(
agx::UInt selection = CLEANUP_ALL,
bool fast=
false );
1014 agxControl::ActionManager* getActionManager();
1019 void clearContactData();
1024 agx::Solver* getSolver();
1029 const agx::Solver* getSolver()
const;
1034 void setPreIntegratePositions(
bool flag );
1039 bool getPreIntegratePositions()
const;
1078 void setStatisticsPath(
const agx::String& path );
1083 void setStatisticsInterval(
agx::Real interval );
1090 void setEnableStatistics(
bool enable );
1093 bool getEnableStatistics()
const;
1096 void setEnableStatisticsRendering(
bool enable );
1099 bool getEnableStatisticsRendering()
const;
1104 void setProfilingFrequency(
agx::Real frequency);
1109 agx::Real getProfilingFrequency()
const;
1130 const agx::RigidBodyRefVector& getRigidBodies()
const;
1135 agx::RigidBodyRefVector& getRigidBodies();
1208 size_t write( std::ostream& stream,
bool binary )
const;
1234 bool restore(std::istream& stream,
bool isBinary,
agx::UInt selection = READ_DEFAULT);
1275 void setEnableRemoteDebugging(
bool flag,
agx::Int16 port = -1,
bool useCompression =
false,
bool waitForSynchronization =
true );
1280 bool getEnableRemoteDebugging()
const;
1286 void setRemoteDebuggingTimeStep(
agx::Real timeStep );
1291 agx::Real getRemoteDebuggingTimeStep()
const;
1301 void setContactReductionBinResolution(
agx::UInt8 binResolution );
1306 agx::UInt8 getContactReductionBinResolution()
const;
1338 void updateRenderManager();
1343 void updateStatisticsRenderData();
1354 void garbageCollect();
1361 void setContactReductionThreshold(
agx::UInt threshold );
1366 agx::UInt getContactReductionThreshold()
const;
1382 const agxSDK::SimulationParameterRefVector& getParameters()
const;
1398 void sendSimulation();
1423 void updateActionManager();
1450 void renderComponents();
1451 void createRenderTask();
1452 agx::SolveModel* getSolveModel(
const agx::Name& name);
1454 const agx::SolveModelRefVector& getSolveModels()
const;
1456 #if AGX_USE_WEBSOCKETS()
1457 void setRemoteSolver(agx::RemoteSolver* remoteSolver);
1473 void setEnableSimulationStatisticsListener(
bool flag );
1478 void addSolveModel(agx::SolveModel* model);
1479 void removeSolveModel(agx::SolveModel* model);
1482 bool getUseComplexImpactStage()
const;
1483 void setUseComplexImpactStage(
bool flag);
1512 void resetTaskTimers();
1517 void dumpTaskTimers(
const agx::String& filePath =
"BufferAllocations.xml");
1522 void dumpMemoryUsage(
const agx::String& filePath =
"TaskTimers.xml");
1526 bool allowCreateParticles()
const;
1536 friend class GuiEventAdapterImplementation;
1554 void initConfiguration();
1557 void updateStatisticsEnable();
1559 void setEnableComputeAllConstraintForces(
bool flag);
1560 bool getEnableComputeAllConstraintForces()
const;
1563 void resetGraphStatistics();
1569 void setupStatisticsLogging();
1571 void updateConstraintForceData();
1573 void createUpdateTask();
1575 void generateContactMaterials();
1577 void prepareContacts();
1578 void triggerParticleContactSensors();
1579 void triggerPreStepEvents();
1580 void triggerPostStepEvents();
1581 void triggerLastStepEvents();
1582 void terrainPostUpdate();
1584 void resetDirtyMaterials();
1585 void updateRemoteDebugger();
1586 void recordStatistics();
1587 void recordPlaybackStatistics();
1588 void recordParticleCount();
1589 void recordWarmStartingData();
1590 void printStatistics();
1594 void pruneContacts();
1595 void contactPointReduction();
1596 void updateSleepState();
1597 void triggerPreCollideStepEvent();
1598 void triggerSeparationContactEventListeners();
1599 void triggerContactEventListeners();
1600 void assignContactMaterials();
1603 void applyPreIntegrationSettings();
1606 friend class agx::Solver;
1607 void registerParticleSystemPointers();
1608 void unregisterParticleSystemPointers();
1613 class StatisticsWriter;
1617 #if AGX_USE_WEBSOCKETS()
1618 friend class agx::RemoteSolver;
1622 void setHasJournal(
bool flag);
1623 void preStoreSynchronization();
1626 StatisticsWriter* m_statWriter;
1639 bool m_stepToStarted;
1641 EventManagerRef m_eventManager;
1644 agxControl::ActionManagerRef m_actionManager;
1651 agx::ParticleSystemRefVector m_particleSystems;
1659 agx::ComponentRefVector m_subComponents;
1663 agx::TaskRefVector m_preIntegrateTasks;
1664 bool m_preIntegrate;
1666 bool m_allowCreateParticles;
1674 agx::SolveModelTable m_solveModelTable;
1675 agx::SolveModelRefVector m_solveModels;
1682 void* m_remoteSolver;
1685 bool m_enableComputeAllConstraintForces;
1686 bool m_inDestructor;
1688 agx::ParticleContactSensorRefVector m_particleContactSensors;
1717 bool m_disableGeometryAutoAdd;
1718 agxSDK::SimulationParameterRefVector m_simulationParameters;
1735 return m_space.
get();
1740 return m_space.
get();
1745 return m_system.
get();
1750 return m_system.
get();
1757 return m_plotSystem.
get();
1762 return m_plotSystem.
get();
1767 return m_timeDataSeries.
get();
1772 return m_timeDataSeries.
get();
1780 if (m_system)
return m_system->getTimeGovernor()->getTimeStep();
1796 return m_allowCreateParticles;
1801 return m_solveModels;
1804 template<
typename T >
1810 template<
typename T >
1813 return dynamic_cast< const T*
>( this->
getConstraint( uuid ) );
1816 template<
typename T >
1822 template<
typename T >
1825 return dynamic_cast< const T*
>( this->
getConstraint( name ) );
1830 # pragma warning(pop) // C++ exception specification ignored except to indicate a function is not __declspec(nothrow). Restored.
agxTerrain::Terrain instance in a simulation, receiving step and contact callbacks in a controllable ...
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...
This class is for detecting and handling particle collisions with geometries in the simulation...
agx::Event2< Simulation *, agx::RigidBody * > RigidBodyEvent
MaterialEvent removeMaterialEvent
AGXTERRAIN_EXPORT void clear()
void AGXPHYSICS_EXPORT init()
Initialize agx.
const agx::SolveModelRefVector & getSolveModels() const
agx::Event2< Simulation *, agx::Constraint * > ConstraintEvent
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.
agx::Thread is a representation of an OS specific implementation of a computational thread...
agx::Constraint2DOF * getConstraint2DOF(const agx::Name &name)
RigidBodyEvent removeRigidBodyEvent
agx::Event2< Simulation *, agxCollide::Geometry * > GeometryEvent
Base class for a merge split algorithm handling a set of merged bodies.
A component is an object containing other objects, enabling hierarchical structuring.
A model is an abstract representation of the class of an agx::Object.
A class holding 4 dimensional vectors and providing basic arithmetic.
MaterialEvent addMaterialEvent
agx::Event2< Simulation *, agx::Material * > MaterialEvent
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic...
Keeps track of the energy flow in the system.
#define AGXPHYSICS_EXPORT
The base class for a constraint.
Class for receiving serialized agxSDK::Simulation:s from remote host.
#define AGX_DECLARE_POINTER_TYPES(type)
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic...
A representation of a generic task.
Representation of a name string.
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
agxPlot::System * getPlotSystem()
Spawns new bodys inside a given volume.
This class will collect statistics and sizes of a simulation.
class for serializing a simulation into a series for files on disk <filename>_0001.agx etc.
RigidBodyEvent addRigidBodyEvent
const agx::Constraint * getConstraint(const agx::Uuid &uuid) const
Find (linear search) and return a pointer to a Constraint with the given uuid.
The geometry representation used by the collision detection engine.
agxCollide::Space * getSpace()
The base class for interactions.
Structure holding several "normal" rigid bodies.
agx::HashVector< agxSDK::Assembly *, agxSDK::AssemblyRef > AssemblyHash
A basic particle system that contains all the storages and buffers required for basic operation and a...
Class which will go through contacting/separating bodies and determine if the bodies can be merged (g...
Interface and placeholder of controllers/helpers for wires.
This class contains all Geometries and performs Broad Phase and Narrow Phase collision detection to c...
GeometryEvent removeGeometryEvent
bool AGXPHYSICS_EXPORT write(const std::string &filename, const agxStream::Serializable *data)
Write a Serializable object to a file.
JournalAttachEvent journalAttachedEvent
ReadSelectionMask
Enum for specifying some additional, part of a simulation that can be restored from a serialization...
agx::Event2< Simulation *, agx::ContactMaterial * > ContactMaterialEvent
CleanupSelectionMask
Specification of what should be cleaned up from a simulation during a call to the cleanup() method...
ContactMaterialEvent removeContactMaterialEvent
Constraint that removes 3 DOF (rotational degrees of freedom) between two bodies, or one body and the...
The rigid body class, combining a geometric model and a frame of reference.
Main material class which acts as a holder of a Surface Material and a Bulk material.
ContactMaterialEvent addContactMaterialEvent
agx::Constraint1DOF * getConstraint1DOF(const agx::Name &name)
The complete physical system with bodies, interactions, data layout, time stepper, and solver.
GeometryEvent addGeometryEvent
agx::HashTable< agxCollide::Geometry *, agx::ref_ptr< Geometry > > GeometryTable
A UUID, or Universally unique identifier, is intended to uniquely identify information in a distribut...
Class for listening to the restore of Serializable objects.
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Class for writing serialized data in binary format to a stream.
An EventListener can be associated to a Simulation and triggered upon various events.
Simulation unique manager that handles logics around and parameters in contact materials given two ag...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
The class GravityField is responsible for calculating and applying a gravity force on a set of bodies...
Clock class keeps representation of virtual/simulated time.
ConstraintEvent removeConstraintEvent
ConstraintEvent addConstraintEvent
bool allowCreateParticles() const
agx::Real getTimeStep() const
Interface class used by internal objects running in parallel.
const agxPlot::DataSeries * getTimeDataSeries() const
A data series that contains all time stamps of the simulation.
agx::Real getTimeStamp() const
agx::Real getTime() const
agx::DynamicsSystem * getDynamicsSystem()
Inheritance with partial specialization due to bug with ref_ptr containers.
An agx::Device is an abstract representation of a device on which data can be stored and processed...
#define GETCONSTRAINT_TYPE(CLASS_NAME, TYPENAME)
agx::Event2< Simulation *, agx::Journal * > JournalAttachEvent
An assembly is a collection of basic simulation objects, such as rigid bodies, constraints, geometries.
With this class you can attach an ObserverFrame object relative to a RigidBody.