AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agxSDK::Simulation Class Reference

Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation system agx::DynamicsSystem. More...

#include <Simulation.h>

+ Inheritance diagram for agxSDK::Simulation:

Public Types

enum  CleanupSelectionMask {
  STEP_LISTENERS = EventManager::STEP_LISTENERS , CONTACT_LISTENERS = EventManager::CONTACT_LISTENERS , GUI_LISTENERS = EventManager::GUI_LISTENERS , LISTENERS = EventManager::LISTENERS ,
  SYSTEM = 0x200 , SPACE = 0x400 , MATERIALS = 0x800 , ASSEMBLIES = 0x1000 ,
  PARTICLE_SYSTEMS = 0x2000 , CONTACT_DATA = 0x4000 , PLOTSYSTEM = 0x8000 , CLEANUP_ALL = LISTENERS | SYSTEM | SPACE | MATERIALS | ASSEMBLIES | PARTICLE_SYSTEMS | CONTACT_DATA | PLOTSYSTEM
}
 Specification of what should be cleaned up from a simulation during a call to the cleanup() method. More...
 
typedef agx::Event2< Simulation *, agx::Constraint * > ConstraintEvent
 
typedef agx::Event2< Simulation *, agx::ContactMaterial * > ContactMaterialEvent
 
typedef agx::Event2< Simulation *, agxCollide::Geometry * > GeometryEvent
 
typedef agx::Event2< Simulation *, agx::Journal * > JournalAttachEvent
 
typedef agx::Event2< Simulation *, agx::Material * > MaterialEvent
 
enum  ReadSelectionMask {
  READ_NONE = 0x0 , READ_TIMESTEP = 0x1 , READ_TIMESTAMP = 0x2 , READ_GRAVITY = 0x4 ,
  READ_SOLVER = 0x8 , READ_ALL = READ_TIMESTEP + READ_TIMESTAMP + READ_GRAVITY + READ_SOLVER , READ_DEFAULT = READ_TIMESTEP + READ_GRAVITY + READ_SOLVER
}
 Enum for specifying some additional, part of a simulation that can be restored from a serialization. More...
 
typedef agx::Event2< Simulation *, agx::RigidBody * > RigidBodyEvent
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const EventEventConstObserver
 
typedef agx::ref_ptr< const EventEventConstRef
 
typedef agx::observer_ptr< EventEventObserver
 
typedef agx::Vector< EventObserverEventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< EventEventRef
 
typedef agx::Vector< EventRefEventRefVector
 

Public Member Functions

 Simulation ()
 Default constructor This constructor CAN Throw a std::runtime_exception if configuration file is broken/invalid.
 
 Simulation (agx::Device *device)
 Special constructor which will associate the Simulation to a specified device.
 
bool add (agx::Component *subComponent)
 Add a sub component to the Simulation.
 
bool add (agx::Constraint *constraint)
 Add a constraint to the simulation.
 
bool add (agx::ContactMaterial *material)
 Add an explicit contact material to the simulation.
 
bool add (agx::Emitter *emitter, bool addGeometries=true)
 Add an emitter to the Simulation.
 
bool add (agx::Interaction *interaction)
 Add an Interaction to the Simulation.
 
bool add (agx::Material *material)
 Add a material to the simulation.
 
bool add (agx::MergedBody *mergedBody)
 Add a merged body to this simulation.
 
bool add (agx::ObserverFrame *observerFrame)
 Add a ObserverFrame to the Simulation.
 
bool add (agx::ParticleContactSensor *sensor)
 Add a particle contact sensor to the Simulation.
 
bool add (agx::ParticleSystem *particleSystem)
 Add a particle system to the simulation.
 
bool add (agx::RigidBody *body, bool addGeometries=true)
 
bool add (agxCollide::Geometry *geometry)
 
bool add (agxControl::Action *action)
 Register an action to this simulation.
 
bool add (agxControl::Operation *operation)
 Register an operation to this simulation.
 
bool add (agxSDK::Assembly *assembly, bool addAllEntries=true)
 Add an assembly to the simulation including all its parts.
 
bool add (agxSDK::EventListener *listener, int priority=EventManager::DEFAULT_PRIORITY)
 Add an event listener The listener will get a call to its addNotification method if adding was successful.
 
bool add (agxSDK::SimulationParameter *parameter)
 Add a parameter to the simulation configuration interface.
 
bool add (agxSDK::TerrainInstance *terrain)
 Add terrain (agxTerrain::Terrain) instance to this simulation.
 
bool add (agxSDK::TerrainToolInstance *toolInstance)
 Add a terrain tool instance to this simulation.
 
bool add (agxStream::Serializable *object)
 Add an object as a serializable object.
 
bool addEventListener (agxSDK::EventListener *listener, int priority=EventManager::DEFAULT_PRIORITY)
 Add an event listener The listener will get a call to its addNotification method if adding was successful.
 
bool addRestoreListener (agxStream::RestoreListener *listener)
 Add a restore listener to the Simulation.
 
void addSolveModel (agx::SolveModel *model)
 
bool allowCreateParticles () const
 
bool breakStepTo ()
 Break an initiated stepTo() after the current simulation step.
 
void cleanup (agx::UInt selection=CLEANUP_ALL, bool fast=false)
 This method will remove/cleanup selected parts of the simulation.
 
void clearContactData ()
 Clears contact data in the simulation.
 
void commit (agxSDK::SimulationProxy *simulationProxy)
 Internal method.
 
bool contains (const agx::Component *object) const
 Is the object contained in the simulation?
 
bool contains (const agxSDK::TerrainInstance *terrain) const
 Is the terrain contained in the simulation?
 
bool contains (const agxSDK::TerrainToolInstance *toolInstance) const
 Is the terrain tool instance contained in the simulation?
 
void createRenderTask ()
 
bool disableThreadTimeline (const agx::String &format="chrome")
 Stops recording timeline data and exports gathered data to disk.
 
void dumpMemoryUsage (const agx::String &filePath="TaskTimers.xml")
 Print current agxData buffer allocations to a file.
 
void dumpTaskTimers (const agx::String &filePath="BufferAllocations.xml")
 Print current task performance timers to a file.
 
bool enableThreadTimeline (const agx::String &sessionName="", const agx::String &journalName="Profiling.agxJournal")
 Record profiling information from this simulation and store it in a journal.
 
void garbageCollect ()
 Use with caution!
 
agxControl::ActionManager * getActionManager ()
 Gets the action manager.
 
const AssemblyHashgetAssemblies () const
 
agxSDK::AssemblygetAssembly (const agx::Name &name)
 Find (linear search) and return named Assembly.
 
const agxSDK::AssemblygetAssembly (const agx::Name &name) const
 Find (linear search) and return named Assembly.
 
agxSDK::AssemblygetAssembly (const agx::Uuid &uuid)
 Find (linear search) and return an Assembly matching the given uuid.
 
const agxSDK::AssemblygetAssembly (const agx::Uuid &uuid) const
 Find (linear search) and return an Assembly matching the given uuid.
 
AssemblyPtrVector getAssemblyPtrVector () const
 
agx::ClockgetClock ()
 
const agx::ClockgetClock () const
 
agx::ConstraintgetConstraint (const agx::Name &name)
 Find (linear search) and return named Constraint.
 
template<typename T >
T * getConstraint (const agx::Name &name)
 Find and return named Constraint of a templated type, for example Hinge:
 
const agx::ConstraintgetConstraint (const agx::Name &name) const
 Find (linear search) and return named Constraint.
 
template<typename T >
const T * getConstraint (const agx::Name &name) const
 Find and return named Constraint of a templated type, for example Hinge:
 
agx::ConstraintgetConstraint (const agx::Uuid &uuid)
 Find and return a pointer to a Constraint with the given uuid.
 
template<typename T >
T * getConstraint (const agx::Uuid &uuid)
 Find and return named Constraint of a templated type, for example Hinge:
 
const agx::ConstraintgetConstraint (const agx::Uuid &uuid) const
 Find (linear search) and return a pointer to a Constraint with the given uuid.
 
template<typename T >
const T * getConstraint (const agx::Uuid &uuid) const
 Find and return named Constraint of a templated type, for example Hinge:
 
agx::Constraint1DOFgetConstraint1DOF (const agx::Name &name)
 
agx::Constraint2DOFgetConstraint2DOF (const agx::Name &name)
 
agx::ConstraintRefSetVectorgetConstraints ()
 
const agx::ConstraintRefSetVectorgetConstraints () const
 
agx::UInt8 getContactReductionBinResolution () const
 
agx::UInt getContactReductionThreshold () const
 
agx::DynamicsSystemgetDynamicsSystem ()
 
const agx::DynamicsSystemgetDynamicsSystem () const
 
agx::EmittergetEmitter (const agx::Name &name)
 Find (linear search) and return an emitter matching the given name.
 
agx::EmittergetEmitter (const agx::Name &name) const
 Find (linear search) and return an emitter matching the given name.
 
agx::EmittergetEmitter (const agx::Uuid &uuid)
 Find (linear search) and return an emitter matching the given uuid.
 
const agx::EmittergetEmitter (const agx::Uuid &uuid) const
 Find (linear search) and return an emitter matching the given uuid.
 
agx::EmitterRefVector getEmitters ()
 
agxData::EntityStoragegetEmitterStorage ()
 
bool getEnableClearRenderTemporaries () const
 
agx::RigidBodyPtrSetVectorgetEnabledRigidBodies ()
 
const agx::RigidBodyPtrSetVectorgetEnabledRigidBodies () const
 
bool getEnableRemoteDebugging () const
 
bool getEnableStatistics () const
 
bool getEnableStatisticsRendering () const
 
bool getEnableWebDebugger () const
 
agxSDK::EnergyManagergetEnergyManager () const
 return the energy manager of the system.
 
agxSDK::EventListenergetEventListener (const agx::Name &name)
 Find and return the first matching named event listener.
 
const agxSDK::EventListenergetEventListener (const agx::Name &name) const
 Find and return the first matching named event listener.
 
agxSDK::EventListenergetEventListener (const agx::Uuid &uuid)
 Find (linear search) and return the first event listener matching the uuid.
 
const agxSDK::EventListenergetEventListener (const agx::Uuid &uuid) const
 Find (linear search) and return the first event listener matching the uuid.
 
void getEventListeners (EventListenerPtrVector &eventListeners) const
 Get a vector containing all the registered event listeners.
 
const agxCollide::GeometryRefVectorgetGeometries () const
 
agxCollide::GeometrygetGeometry (const agx::Name &name)
 Find (linear search) and return named collision Geometry.
 
const agxCollide::GeometrygetGeometry (const agx::Name &name) const
 Find (linear search) and return named collision Geometry.
 
agxCollide::GeometrygetGeometry (const agx::Uuid &uuid)
 Find (linear search) and return a geometry matching the given uuid.
 
const agxCollide::GeometrygetGeometry (const agx::Uuid &uuid) const
 Find (linear search) and return a geometry matching the given uuid.
 
agx::GravityFieldgetGravityField ()
 
const agx::GravityFieldgetGravityField () const
 
agx::ComponentgetHeader ()
 
agx::JournalgetJournal ()
 
const agx::JournalgetJournal () const
 
agx::MaterialgetMaterial (const agx::Name &materialName)
 
const agx::MaterialgetMaterial (const agx::Name &materialName) const
 
agx::MaterialgetMaterial (const agx::Uuid &uuid)
 
MaterialManagergetMaterialManager ()
 
const MaterialManagergetMaterialManager () const
 
agx::MergedBodygetMergedBody (agx::UInt i) const
 
agx::MergedBodygetMergedBody (const agx::Name &name)
 Find (linear search) and return named MergedBody.
 
const agx::MergedBodygetMergedBody (const agx::Name &name) const
 Find (linear search) and return named MergedBody.
 
agx::MergedBodygetMergedBody (const agx::Uuid &uuid)
 Find (linear search) and return a pointer to a MergedBody with the given uuid.
 
const agx::MergedBodygetMergedBody (const agx::Uuid &uuid) const
 Find (linear search) and return a pointer to a MergedBody with the given uuid.
 
agxSDK::MergeSplitHandlergetMergeSplitHandler () const
 Merge split handler is an object that enables performance boosts by merging rigid bodies together which results in fewer rigid bodies for the solver to solve for.
 
agx::UInt getNumMergedBodies () const
 
agx::UInt getNumTerrains () const
 
agx::ObserverFramegetObserver (const agx::Name &name)
 Find (linear search) and return named ObserverFrame.
 
const agx::ObserverFramegetObserver (const agx::Name &name) const
 Find (linear search) and return named ObserverFrame.
 
agx::ObserverFramegetObserver (const agx::Uuid &uuid)
 Find (linear search) and return a pointer to a ObserverFrame with the given uuid.
 
const agx::ObserverFramegetObserver (const agx::Uuid &uuid) const
 Find (linear search) and return a pointer to a ObserverFrame with the given uuid.
 
agx::ObserverFramegetObserverFrame (const agx::Name &name)
 Find (linear search) the first ObserverFrame object in the system that matches the name.
 
const agx::ObserverFramegetObserverFrame (const agx::Name &name) const
 Find (linear search) the first ObserverFrame object in the system that matches the name.
 
agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid)
 Find and return a pointer to a ObserverFrame with the given uuid.
 
const agx::ObserverFramegetObserverFrame (const agx::Uuid &uuid) const
 Find (linear search) and return a pointer to a ObserverFrame with the given uuid.
 
agx::ObserverFrameRefSetVectorgetObserverFrames ()
 
const agx::ObserverFrameRefSetVectorgetObserverFrames () const
 
agxSDK::SimulationParametergetParameter (const agx::Name &name)
 
const agxSDK::SimulationParameterRefVectorgetParameters () const
 
agx::ParticleEmitterRefVector getParticleEmitters ()
 
agx::ParticleSystemgetParticleSystem () const
 
agx::ParticleSystemRefVectorgetParticleSystems ()
 
const agx::ParticleSystemRefVectorgetParticleSystems () const
 
agxSDK::PickHandlergetPickHandler ()
 
const agxSDK::PickHandlergetPickHandler () const
 
agxPlot::SystemgetPlotSystem () const
 
bool getPreIntegratePositions () const
 
agx::Real getProfilingFrequency () const
 
agx::Real getRemoteDebuggingTimeStep () const
 
agxRender::RenderManagergetRenderManager ()
 
const agxRender::RenderManagergetRenderManager () const
 
agx::RigidBodyRefVectorgetRigidBodies ()
 
const agx::RigidBodyRefVectorgetRigidBodies () const
 
agx::RigidBodygetRigidBody (const agx::Name &name)
 Find (linear search) and return named RigidBody.
 
const agx::RigidBodygetRigidBody (const agx::Name &name) const
 Find (linear search) and return named RigidBody.
 
agx::RigidBodygetRigidBody (const agx::Uuid &uuid)
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
const agx::RigidBodygetRigidBody (const agx::Uuid &uuid) const
 Find (linear search) and return a pointer to a RigidBody with the given uuid.
 
ISensorEnvironmentgetSensorEnvironment () const
 
SimulationSerializergetSerializer ()
 
const SimulationSerializergetSerializer () const
 
agxSDK::SimulationProxygetSimulationProxy () const
 Internal method.
 
SimulationStatisticsListenergetSimulationStatisticsListener ()
 
const SimulationStatisticsListenergetSimulationStatisticsListener () const
 
agx::SolveModel * getSolveModel (const agx::Name &name)
 
const agx::SolveModelRefVector & getSolveModels () const
 
agx::Solver * getSolver ()
 
const agx::Solver * getSolver () const
 
agxCollide::SpacegetSpace ()
 
const agxCollide::SpacegetSpace () const
 
agxSDK::TerrainInstancegetTerrain (agx::UInt i) const
 
agxSDK::TerrainManager * getTerrainManager () const
 
agxPlot::DataSeriesgetTimeDataSeries () const
 A data series that contains all time stamps of the simulation.
 
agx::Real getTimeStamp () const
 
agx::Real getTimeStep () const
 
agx::Vec3 getUniformGravity () const
 If the current gravity field is not a uniform one (for example PointGravityField), 0,0,0 will be returned.
 
agx::TaskGroupgetUpdateTask ()
 
agxWire::WiregetWire (const agx::Name &name)
 Find and return the first matching named wire.
 
const agxWire::WiregetWire (const agx::Name &name) const
 Find and return the first matching named wire.
 
agxWire::WiregetWire (const agx::Uuid &uuid)
 Find (linear search) and return the first wire matching the uuid.
 
const agxWire::WiregetWire (const agx::Uuid &uuid) const
 Find (linear search) and return the first wire matching the uuid.
 
void handleStabiltyReport (const agx::StabilityReport *stabilityReport)
 Internal method.
 
void loadSolveModels (const agx::String &path, bool clear=false)
 
size_t read (const agx::String &filename, agxSDK::Assembly *parent=nullptr, agx::UInt selection=READ_DEFAULT)
 Read serialized simulation from the specified file and append to this simulation.
 
size_t read (std::istream &stream, bool isBinary, agxSDK::Assembly *parent=nullptr, agx::UInt selection=READ_DEFAULT)
 Read serialized simulation from the specified stream.
 
void readStoragePermutations (agxStream::InputArchive &in, bool clearStorages=false)
 
bool remove (agx::Component *subComponent)
 Remove a sub component from Simulation.
 
bool remove (agx::Constraint *constraint)
 Remove a constraint from the simulation.
 
bool remove (agx::ContactMaterial *material)
 Remove an explicit contact material from the set of existing ContactMaterials.
 
bool remove (agx::Emitter *emitter, bool removeGeometries=true)
 Remove an emitter from the system.
 
bool remove (agx::Interaction *interaction)
 Remove an Interaction from the Simulation.
 
bool remove (agx::Material *material)
 Remove a specified material from the simulation.
 
bool remove (agx::MergedBody *mergedBody)
 Removes the merged body from this simulation.
 
bool remove (agx::ObserverFrame *observerFrame)
 Remove a ObserverFrame to the Simulation.
 
bool remove (agx::ParticleContactSensor *sensor)
 Remove a particle contact sensor from the system.
 
bool remove (agx::ParticleSystem *particleSystem)
 Remove a particle system from the simulation.
 
bool remove (agx::RigidBody *body, bool removeGeometries=true)
 Remove a body from the Simulation, the body will be disabled!
 
bool remove (agxCollide::Geometry *geometry)
 Remove geometry from collision space.
 
bool remove (agxControl::Action *action)
 Remove an action from this simulation.
 
bool remove (agxControl::Operation *operation)
 Remove an operation from this simulation.
 
bool remove (agxSDK::Assembly *assembly, bool removeAllEntries=true)
 Remove an assembly from the simulation.
 
bool remove (agxSDK::EventListener *listener)
 Remove a Event listener.
 
bool remove (agxSDK::SimulationParameter *parameter)
 Remove a parameter from the simulation configuration interface.
 
bool remove (agxSDK::TerrainInstance *terrain)
 Remove terrain (agxTerrain::Terrain) instance from this simulation.
 
bool remove (agxSDK::TerrainToolInstance *toolInstance)
 Remove a terrain tool instance from this simulation.
 
bool remove (agxStream::Serializable *object)
 Remove an object as a serializable object.
 
bool removeEventListener (agxSDK::EventListener *listener)
 Remove the specified listener.
 
bool removeRestoreListener (agxStream::RestoreListener *listener)
 Remove an existing listener in a simulation.
 
void removeSolveModel (agx::SolveModel *model)
 
void renderComponents ()
 
void resetTaskTimers ()
 Reset profiling timers.
 
void restore (agxStream::InputArchive &in, agxSDK::Assembly *parent=nullptr, agx::UInt selection=READ_DEFAULT, bool replaceUsingCache=false)
 Read data from the input archive and add to the simulation.
 
bool restore (const agx::String &filename, agx::UInt selection=READ_DEFAULT)
 Restore state from a serialized scene file.
 
bool restore (std::istream &stream, bool isBinary, agx::UInt selection=READ_DEFAULT)
 
void sendSimulation ()
 Send the simulation to the remote debugger (if enabled)
 
void setActionManagerTimeStamp (const agx::TimeStamp &time)
 Truncating an AGX simulation does not reset the timestamp in the action manager.
 
void setContactReductionBinResolution (agx::UInt8 binResolution)
 Specify the bin resolution used when evaluating contacts for reduction between body-body contacts.
 
void setContactReductionThreshold (agx::UInt threshold)
 Specify the minimum number of contacts between two bodies required to execute contact reduction.
 
void setDynamicsSystem (agx::DynamicsSystem *system)
 Replace the current DynamicsSystem with system.
 
void setEnableClearRenderTemporaries (bool enable)
 
void setEnableRemoteDebugging (bool flag, agx::Int16 port=-1, bool useCompression=false, bool waitForSynchronization=true)
 Enable/Disable remote debugging.
 
void setEnableSimulationStatisticsListener (bool flag)
 Enable/disable the listener that collects all statistics data from the simulation.
 
void setEnableStatistics (bool enable)
 Enable/disable statistics logging to disk.
 
void setEnableStatisticsRendering (bool enable)
 
void setEnableWebDebugger (bool flag, agx::UInt16 port=9001)
 Enable/Disable the Web debugger simulation WebSocket API.
 
void setGravityField (agx::GravityField *gravityField)
 Set the GravityField model used in gravity calculations.
 
void setMainWorkThread (agx::Thread *thread)
 Specify which is the main working thread for the Simulation.
 
void setPickHandler (agxSDK::PickHandler *pickHandler)
 Assign interface for pick handler.
 
void setPlotSystem (agxPlot::System *plotSystem)
 Replace the current PlotSystem with plotSystem.
 
void setPreIntegratePositions (bool flag)
 Set true to integrate positions at the start of the timestep rather than at the end.
 
void setProfilingFrequency (agx::Real frequency)
 Specify the frequency for performance profiling.
 
void setRemoteDebuggingTimeStep (agx::Real timeStep)
 Sets the time step for remote debugging.
 
void setSensorEnvironment (ISensorEnvironment *environment)
 Assign new sensor environment to this simulation, nullptr to remove the current environment.
 
void setSerializer (SimulationSerializer *serializer)
 Replace the current SimulationSerializer with a new instance.
 
void setSpace (agxCollide::Space *space)
 Replace the current Collision space with space.
 
void setStatisticsInterval (agx::Real interval)
 
void setStatisticsPath (const agx::String &path)
 Specify the path to a file where the statistics information will be written when enabled.
 
void setTimeStamp (agx::TimeStamp t)
 Set the timestamp for the simulation (and the DynamicsSystem)
 
bool setTimeStep (agx::Real timeStep)
 Sets the time step determined by the TimeGovernor in the DynamicsSystem.
 
bool setUniformGravity (const agx::Vec3 &g)
 Set the uniform gravity.
 
void stepForward ()
 Take one step forward in the simulation.
 
agx::TimeStamp stepTo (agx::TimeStamp t)
 Step the simulation forward 1 or more time steps in time until we get to the time t.
 
void store (agxStream::OutputArchive &archive) const
 Save this simulation to the output archive.
 
bool triggerEvent (const GuiEvent &e)
 Execute a GuiEvent.
 
void updateActionManager ()
 Internal method.
 
void updateRenderManager ()
 Make an explicit call to RenderManager::update() to update the debug rendering information.
 
void updateStatisticsRenderData ()
 Make an explicit call to RenderManager::update() to update the statistics rendering information.
 
size_t write (const agx::String &filename) const
 Serialize the simulation to the specified file.
 
size_t write (std::ostream &stream, bool binary) const
 Serialize the simulation to the specified file.
 
void writeStatisticsFiles (const agx::String &directoryPath="Statistics", bool taskProfile=true, bool threadTimeline=true, const agx::Vector< agx::String > &timelineFormats=agx::Vector< agx::String >(), bool bufferAllocations=true)
 
void writeStoragePermutations (agxStream::OutputArchive &archive) const
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::DevicegetDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::DevicegetDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::ObjectgetObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVectorgetObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual ObjectgetResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::ObjectgetContext ()
 
template<typename T >
T * getContext ()
 
const agx::ObjectgetContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::NamegetImplementationName () const
 
agx::ModelgetModel ()
 
const agx::ModelgetModel () const
 
const agx::NamegetName () const
 
agx::ObjectgetNextSibling ()
 
const agx::ObjectgetNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::ObjectgetRootContext ()
 
const agx::ObjectgetRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) 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.
 

Static Public Member Functions

static agx::ModelClassModel ()
 Internal method.
 
static agxSDK::SimulationProxyRef createDefaultProxy (agxSDK::Simulation *simulation)
 Creates new simulation proxy of default type.
 
static Simulationload (agx::TiXmlElement *eSimulation, agx::Device *device)
 
- Static Public Member Functions inherited from agx::Component
static Component_load (TiXmlElement *eComponent, Device *device)
 
static agx::ModelClassModel ()
 
static Componentload (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Componentload (const String &path, const Path &_namespace=Path())
 
static Componentload (const String &path, Device *device, const Path &_namespace=Path())
 
static Componentload (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::ModelClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Objectload (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Objectload (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Objectload (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

ConstraintEvent addConstraintEvent
 
ContactMaterialEvent addContactMaterialEvent
 
GeometryEvent addGeometryEvent
 
MaterialEvent addMaterialEvent
 
RigidBodyEvent addRigidBodyEvent
 
JournalAttachEvent journalAttachedEvent
 
ConstraintEvent removeConstraintEvent
 
ContactMaterialEvent removeContactMaterialEvent
 
GeometryEvent removeGeometryEvent
 
MaterialEvent removeMaterialEvent
 
RigidBodyEvent removeRigidBodyEvent
 
- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 

Protected Member Functions

virtual ~Simulation ()
 Destructor.
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

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

Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation system agx::DynamicsSystem.

All add/remove of objects must go through a the interface for Simulation.

Definition at line 130 of file Simulation.h.

Member Typedef Documentation

◆ ConstraintEvent

◆ ContactMaterialEvent

◆ GeometryEvent

◆ JournalAttachEvent

◆ MaterialEvent

◆ RigidBodyEvent

Member Enumeration Documentation

◆ CleanupSelectionMask

Specification of what should be cleaned up from a simulation during a call to the cleanup() method.

These flags can be bit masked/or:ed together.

Enumerator
STEP_LISTENERS 

Remove all step contact listeners.

CONTACT_LISTENERS 

Remove all contact contact listeners.

GUI_LISTENERS 

Remove all gui event listeners.

LISTENERS 

Remove all listeners.

SYSTEM 

Remove the dynamic system.

SPACE 

Remove the collision space.

MATERIALS 

Remove all materials.

ASSEMBLIES 

Remove all assemblies.

PARTICLE_SYSTEMS 

Remove all particle systems.

CONTACT_DATA 

Remove all contact data.

PLOTSYSTEM 

Remove plotsystem.

CLEANUP_ALL 

Definition at line 1026 of file Simulation.h.

◆ ReadSelectionMask

Enum for specifying some additional, part of a simulation that can be restored from a serialization.

Enumerator
READ_NONE 

! Select to read none of the items below

READ_TIMESTEP 

! Select to read and restore the TimeStep of the Simulation.

READ_TIMESTAMP 

! Select to read the TimeStamp (current time of the simulation)

READ_GRAVITY 

! Select to read and restore the Gravity model of the simulation.

READ_SOLVER 

! Select to read solver parameters.

READ_ALL 
READ_DEFAULT 

Definition at line 1046 of file Simulation.h.

Constructor & Destructor Documentation

◆ Simulation() [1/2]

agxSDK::Simulation::Simulation ( )

Default constructor This constructor CAN Throw a std::runtime_exception if configuration file is broken/invalid.

◆ Simulation() [2/2]

agxSDK::Simulation::Simulation ( agx::Device device)

Special constructor which will associate the Simulation to a specified device.

◆ ~Simulation()

virtual agxSDK::Simulation::~Simulation ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ add() [1/20]

bool agxSDK::Simulation::add ( agx::Component subComponent)

Add a sub component to the Simulation.

Parameters
subComponent- The component to be added as a sub component to this Simulation
Returns
true if adding the component was successful.

◆ add() [2/20]

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

Add a constraint to the simulation.

Parameters
constraint- The constraint to be added.
Returns
true if the constraint was successfully added (and not already added)

◆ add() [3/20]

bool agxSDK::Simulation::add ( agx::ContactMaterial material)

Add an explicit contact material to the simulation.

Returns
true if the contact material was successfully added to the simulation

◆ add() [4/20]

bool agxSDK::Simulation::add ( agx::Emitter emitter,
bool  addGeometries = true 
)

Add an emitter to the Simulation.

Parameters
emitter- The emitter to be added.
addGeometries- true if the emitter geometry should be added to the simulation, false otherwise. (Default: true)
Returns
true if the emitter was successfully added.

◆ add() [5/20]

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

Add an Interaction to the Simulation.

Parameters
interaction
Returns
true if adding was successful (and not already added)

◆ add() [6/20]

bool agxSDK::Simulation::add ( agx::Material material)

Add a material to the simulation.

If a material with the same name already exists, it will return false.

Returns
true if adding the material was successfully added to the simulation.

◆ add() [7/20]

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

Add a merged body to this simulation.

Parameters
mergedBody- merged body to add
Returns
true if added, otherwise false

◆ add() [8/20]

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

Add a ObserverFrame to the Simulation.

Parameters
observerFramethe frame to add
Returns
true if adding the frame was successful

◆ add() [9/20]

bool agxSDK::Simulation::add ( agx::ParticleContactSensor sensor)

Add a particle contact sensor to the Simulation.

Parameters
sensor- The particle contact sensor to be added.
Returns
true if the particle contact sensor was successfully added.

◆ add() [10/20]

bool agxSDK::Simulation::add ( agx::ParticleSystem particleSystem)

Add a particle system to the simulation.

Parameters
particleSystem- The particle system to be added.
Returns
true if the particle system was successfully added.

◆ add() [11/20]

bool agxSDK::Simulation::add ( agx::RigidBody body,
bool  addGeometries = true 
)

Add a body to the Simulation. Side effect: the associated Geometries will also be added to Collision space (if addGeometries is == true)

Parameters
body- The body that will be added to the simulation.
addGeometries- If true, then all geometries in body will also be added to simulation.
Returns
true if adding was successful (and not already added)

◆ add() [12/20]

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

Add a geometry to the Simulation Side effect: Will add the material associated to the geometry to the material manager too.

Returns
true if adding was successful (and not already added)

◆ add() [13/20]

bool agxSDK::Simulation::add ( agxControl::Action *  action)

Register an action to this simulation.

Parameters
action- action to add
Returns
true if added (and not already added)

◆ add() [14/20]

bool agxSDK::Simulation::add ( agxControl::Operation *  operation)

Register an operation to this simulation.

Parameters
operation- operation to add
Returns
true if added (and not already added)

◆ add() [15/20]

bool agxSDK::Simulation::add ( agxSDK::Assembly assembly,
bool  addAllEntries = true 
)

Add an assembly to the simulation including all its parts.

Parameters
assembly- The assembly to be added
addAllEntries- If true (default) all its contained entries will also be added.
Returns
false if one of the elements in the assembly failed to be added

◆ add() [16/20]

bool agxSDK::Simulation::add ( agxSDK::EventListener listener,
int  priority = EventManager::DEFAULT_PRIORITY 
)

Add an event listener The listener will get a call to its addNotification method if adding was successful.

Parameters
listener- Pointer to the listener that will be activated during events.
priority- An execution priority for this listener. Higher executed earlier in the list of added listeners. Range of priority is [EventManager::LOWEST_PRIORITY, EventManager::HIGHEST_PRIORITY]
Returns
false if listener was already added, or if priority is outside of the valid range, otherwise true.

◆ add() [17/20]

bool agxSDK::Simulation::add ( agxSDK::SimulationParameter parameter)

Add a parameter to the simulation configuration interface.

◆ add() [18/20]

bool agxSDK::Simulation::add ( agxSDK::TerrainInstance terrain)

Add terrain (agxTerrain::Terrain) instance to this simulation.

Parameters
terrain- terrain to add
Returns
true if added, false if nullptr or already present in this or another simulation

◆ add() [19/20]

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

Add a terrain tool instance to this simulation.

Parameters
toolInstance- the terrain tool instance to add
Returns
true if added, false if nullptr or already present in this or another simulation

◆ add() [20/20]

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

Add an object as a serializable object.

Might be any of the above classes having an add method: Geometry, RigidBody etc.

Return values
successfully added (and not already added)?

◆ addEventListener()

bool agxSDK::Simulation::addEventListener ( agxSDK::EventListener listener,
int  priority = EventManager::DEFAULT_PRIORITY 
)

Add an event listener The listener will get a call to its addNotification method if adding was successful.

Parameters
listener- Pointer to the listener that will be activated during events.
priority- An execution priority for this listener. Higher executed earlier in the list of added listeners. Range of priority is [EventManager::LOWEST_PRIORITY, EventManager::HIGHEST_PRIORITY]
Returns
false if listener was already added, or if priority is outside of the valid range, otherwise true.

◆ addRestoreListener()

bool agxSDK::Simulation::addRestoreListener ( agxStream::RestoreListener listener)

Add a restore listener to the Simulation.

Whenever a simulation is restored from a serialization, these listeners will be called upon.

Parameters
listener- A pointer to a RestoreListener
Returns
true if listener did not previously existed, and hence is added

◆ addSolveModel()

void agxSDK::Simulation::addSolveModel ( agx::SolveModel *  model)

◆ allowCreateParticles()

bool agxSDK::Simulation::allowCreateParticles ( ) const
Returns
true if particles are allowed to be created at this point in the simulaion step

Definition at line 1919 of file Simulation.h.

◆ breakStepTo()

bool agxSDK::Simulation::breakStepTo ( )

Break an initiated stepTo() after the current simulation step.

When stepTo() is called, a number if iterations calling stepForward() will be done. If you want to cancel these iterations from within an EventListener you can call breakStepTo().

Returns
true if a started stepTo() is stopped, otherwise it returns false and does nothing.

◆ ClassModel()

static agx::Model * agxSDK::Simulation::ClassModel ( )
static

Internal method.

◆ cleanup()

void agxSDK::Simulation::cleanup ( agx::UInt  selection = CLEANUP_ALL,
bool  fast = false 
)

This method will remove/cleanup selected parts of the simulation.

By using the CleanupSelectionMask one can select what should be removed, for example all contact listeners.

Parameters
selection- Specify from enum CleanupSelectionMask what should be cleaned up
fast- If true, we will try to remove bodies, geometries, listeners one by one instead of creating new DynamicsSystem, Space etc. which does have a lot of overhead.

◆ clearContactData()

void agxSDK::Simulation::clearContactData ( )

Clears contact data in the simulation.

◆ commit()

void agxSDK::Simulation::commit ( agxSDK::SimulationProxy simulationProxy)

Internal method.

Add content from a simulation proxy to this simulation.

Parameters
simulationProxy- simulation proxy to commit

◆ contains() [1/3]

bool agxSDK::Simulation::contains ( const agx::Component object) const

Is the object contained in the simulation?

Parameters
object- The object to test
Returns
true if the object is contained in the simulation.
Note
Might be linear complexity in all the objects of the same type in the simulation.

◆ contains() [2/3]

bool agxSDK::Simulation::contains ( const agxSDK::TerrainInstance terrain) const

Is the terrain contained in the simulation?

Parameters
terrain- The terrain to test
Returns
true if the terrain is contained in the simulation.
Note
Might be linear complexity in all the objects of the same type in the simulation.

◆ contains() [3/3]

bool agxSDK::Simulation::contains ( const agxSDK::TerrainToolInstance toolInstance) const

Is the terrain tool instance contained in the simulation?

Parameters
toolInstance- The terrain tool instance to test
Returns
true if the terrain tool instance is contained in the simulation.
Note
Might be linear complexity in all the objects of the same type in the simulation.

◆ createDefaultProxy()

static agxSDK::SimulationProxyRef agxSDK::Simulation::createDefaultProxy ( agxSDK::Simulation simulation)
static

Creates new simulation proxy of default type.

Returns
new simulation proxy of default type

◆ createRenderTask()

void agxSDK::Simulation::createRenderTask ( )

◆ disableThreadTimeline()

bool agxSDK::Simulation::disableThreadTimeline ( const agx::String format = "chrome")

Stops recording timeline data and exports gathered data to disk.

If specified format is "svg", then multiple svg files with timeline data are generated. Default format is chrome which produces a ChromeTracing.json file which can be viewed in a Chromium based browser, e.g. Google Chrome, by opening chrome://tracing/ and loading the generated file.

Generated data will be created in directory named Profiling/ThreadTimelines/{sessionName}/.

Parameters
formatOutput format for timelines, valid options are "svg" or "chrome".
Returns
True if recording of timeline data could be stopped and timelines generated.

◆ dumpMemoryUsage()

void agxSDK::Simulation::dumpMemoryUsage ( const agx::String filePath = "TaskTimers.xml")

Print current agxData buffer allocations to a file.

◆ dumpTaskTimers()

void agxSDK::Simulation::dumpTaskTimers ( const agx::String filePath = "BufferAllocations.xml")

Print current task performance timers to a file.

◆ enableThreadTimeline()

bool agxSDK::Simulation::enableThreadTimeline ( const agx::String sessionName = "",
const agx::String journalName = "Profiling.agxJournal" 
)

Record profiling information from this simulation and store it in a journal.

When the simulation is destoryed, or if disableThreadTimeline is called, thread timelines will be generated from the journal and stored to disk. See also setProfilingFrequency for control of how often data is gathered.

Parameters
sessionNameName for profiling session. If left empty, current date and time will be used as name.
journalNameName for journal file used when recording timeline data. Parameter is used the first time recording is enabled, then the journal is reused.
Returns
True if attaching journal for profile data could be performed successfully.
Note
Two different simulations can not store data to the same journal at the same time. Concurrent simulations should specify the journalName and use unique filenames. A single simulation can use the default filename.

◆ garbageCollect()

void agxSDK::Simulation::garbageCollect ( )

Use with caution!

Collect garbage of internal states (e.g., removed geometries and rigid bodies). The garbage will default be collected automatically during next simulation step.

Note
After calling this method e.g., the geometry contact list could be invalid. Other internal structures may as well become invalid. So in general it is not recommended to call this method at all.

◆ getActionManager()

agxControl::ActionManager * agxSDK::Simulation::getActionManager ( )

Gets the action manager.

◆ getAssemblies()

const AssemblyHash & agxSDK::Simulation::getAssemblies ( ) const
Returns
all assemblies added to the Simulation.

◆ getAssembly() [1/4]

agxSDK::Assembly * agxSDK::Simulation::getAssembly ( const agx::Name name)

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [2/4]

const agxSDK::Assembly * agxSDK::Simulation::getAssembly ( const agx::Name name) const

Find (linear search) and return named Assembly.

Parameters
name- name of the Assembly to find
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [3/4]

agxSDK::Assembly * agxSDK::Simulation::getAssembly ( const agx::Uuid uuid)

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

Parameters
uuid- uuid of the Assembly to find
Returns
pointer to the found Assembly, null if not found

◆ getAssembly() [4/4]

const agxSDK::Assembly * agxSDK::Simulation::getAssembly ( const agx::Uuid uuid) const

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

Parameters
uuid- uuid of the Assembly to find
Returns
pointer to the found Assembly, null if not found

◆ getAssemblyPtrVector()

AssemblyPtrVector agxSDK::Simulation::getAssemblyPtrVector ( ) const
Returns
all assemblies in this simulation

◆ getClock() [1/2]

agx::Clock * agxSDK::Simulation::getClock ( )
Returns
The clock.

Definition at line 1909 of file Simulation.h.

◆ getClock() [2/2]

const agx::Clock * agxSDK::Simulation::getClock ( ) const
Returns
The clock.

Definition at line 1914 of file Simulation.h.

◆ getConstraint() [1/8]

agx::Constraint * agxSDK::Simulation::getConstraint ( const agx::Name name)

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [2/8]

template<typename T >
T * agxSDK::Simulation::getConstraint ( const agx::Name name)

Find and return named Constraint of a templated type, for example Hinge:

agx::Hinge *hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");

Parameters
name- name of the Constraint to find
Returns
typed pointer to the found Constraint, null if not found

Definition at line 1942 of file Simulation.h.

References getConstraint().

◆ getConstraint() [3/8]

const agx::Constraint * agxSDK::Simulation::getConstraint ( const agx::Name name) const

Find (linear search) and return named Constraint.

Parameters
name- name of the Constraint to find
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [4/8]

template<typename T >
const T * agxSDK::Simulation::getConstraint ( const agx::Name name) const

Find and return named Constraint of a templated type, for example Hinge:

const agx::Hinge* hinge = simulation->getConstraint<agx::Hinge>("FrontWheelHinge");

Parameters
name- name of the Constraint to find
Returns
typed pointer to the found Constraint, null if not found

Definition at line 1948 of file Simulation.h.

References getConstraint().

◆ getConstraint() [5/8]

agx::Constraint * agxSDK::Simulation::getConstraint ( const agx::Uuid uuid)

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

Parameters
uuid- uuid of the requested constraint
Returns
pointer to the found Constraint, null if not found

◆ getConstraint() [6/8]

template<typename T >
T * agxSDK::Simulation::getConstraint ( const agx::Uuid uuid)

Find and return named Constraint of a templated type, for example Hinge:

agx::Hinge *hinge = simulation->getConstraint<agx::Hinge>(uuid);

Parameters
uuid- uuid of the Constraint to find
Returns
typed pointer to the found Constraint, null if not found

Definition at line 1930 of file Simulation.h.

References getConstraint().

◆ getConstraint() [7/8]

const agx::Constraint * agxSDK::Simulation::getConstraint ( const agx::Uuid uuid) const

Find (linear search) and return a pointer to a Constraint with the given uuid.

Parameters
uuid- uuid of the requested constraint
Returns
const pointer to the found constraint, null if not found

Referenced by getConstraint().

◆ getConstraint() [8/8]

template<typename T >
const T * agxSDK::Simulation::getConstraint ( const agx::Uuid uuid) const

Find and return named Constraint of a templated type, for example Hinge:

const agx::Hinge* hinge = simulation->getConstraint<agx::Hinge>(uuid);

Parameters
uuid- uuid of the Constraint to find
Returns
typed pointer to the found Constraint, null if not found

Definition at line 1936 of file Simulation.h.

References getConstraint().

◆ getConstraint1DOF()

agx::Constraint1DOF * agxSDK::Simulation::getConstraint1DOF ( const agx::Name name)
inline

Definition at line 1584 of file Simulation.h.

◆ getConstraint2DOF()

agx::Constraint2DOF * agxSDK::Simulation::getConstraint2DOF ( const agx::Name name)
inline

Definition at line 1585 of file Simulation.h.

◆ getConstraints() [1/2]

agx::ConstraintRefSetVector & agxSDK::Simulation::getConstraints ( )
Returns
All constraints in the system.

◆ getConstraints() [2/2]

const agx::ConstraintRefSetVector & agxSDK::Simulation::getConstraints ( ) const
Returns
All constraints in the system.

◆ getContactReductionBinResolution()

agx::UInt8 agxSDK::Simulation::getContactReductionBinResolution ( ) const
Returns
the bin resolution used in body-body contact reduction for this Simulation.

◆ getContactReductionThreshold()

agx::UInt agxSDK::Simulation::getContactReductionThreshold ( ) const
Returns
The minimum number of contacts between two bodies required to execute the contact reduction.

◆ getDynamicsSystem() [1/2]

agx::DynamicsSystem * agxSDK::Simulation::getDynamicsSystem ( )
Returns
A pointer to the DynamicsSystem used in the Simulation

Definition at line 1898 of file Simulation.h.

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

◆ getDynamicsSystem() [2/2]

const agx::DynamicsSystem * agxSDK::Simulation::getDynamicsSystem ( ) const
Returns
A pointer to the DynamicsSystem used in the Simulation

Definition at line 1893 of file Simulation.h.

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

◆ getEmitter() [1/4]

agx::Emitter * agxSDK::Simulation::getEmitter ( const agx::Name name)

Find (linear search) and return an emitter matching the given name.

Parameters
name- name of the emitter to find
Returns
pointer to the found emitter, null if not found

◆ getEmitter() [2/4]

agx::Emitter * agxSDK::Simulation::getEmitter ( const agx::Name name) const

Find (linear search) and return an emitter matching the given name.

Parameters
name- name of the emitter to find
Returns
pointer to the found emitter, null if not found

◆ getEmitter() [3/4]

agx::Emitter * agxSDK::Simulation::getEmitter ( const agx::Uuid uuid)

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

Parameters
uuid- uuid of the emitter to find
Returns
pointer to the found emitter, null if not found

◆ getEmitter() [4/4]

const agx::Emitter * agxSDK::Simulation::getEmitter ( const agx::Uuid uuid) const

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

Parameters
uuid- uuid of the emitter to find
Returns
pointer to the found emitter, null if not found

◆ getEmitters()

agx::EmitterRefVector agxSDK::Simulation::getEmitters ( )
Returns
a vector of all emitters in the simulation, including ParticleEmitters and RigidBodyEmitters

◆ getEmitterStorage()

agxData::EntityStorage * agxSDK::Simulation::getEmitterStorage ( )

◆ getEnableClearRenderTemporaries()

bool agxSDK::Simulation::getEnableClearRenderTemporaries ( ) const

◆ getEnabledRigidBodies() [1/2]

agx::RigidBodyPtrSetVector & agxSDK::Simulation::getEnabledRigidBodies ( )
Returns
a set of all enabled bodies in this system

◆ getEnabledRigidBodies() [2/2]

const agx::RigidBodyPtrSetVector & agxSDK::Simulation::getEnabledRigidBodies ( ) const
Returns
a set of all enabled bodies in this system

◆ getEnableRemoteDebugging()

bool agxSDK::Simulation::getEnableRemoteDebugging ( ) const
Returns
true if remote debugging is enabled

◆ getEnableStatistics()

bool agxSDK::Simulation::getEnableStatistics ( ) const
Returns
true if statistics logging is enabled

◆ getEnableStatisticsRendering()

bool agxSDK::Simulation::getEnableStatisticsRendering ( ) const
Returns
true if rendering of statistics is enabled

◆ getEnableWebDebugger()

bool agxSDK::Simulation::getEnableWebDebugger ( ) const
Returns
true if WebDebugger is enabled.

◆ getEnergyManager()

agxSDK::EnergyManager * agxSDK::Simulation::getEnergyManager ( ) const

return the energy manager of the system.

◆ getEventListener() [1/4]

agxSDK::EventListener * agxSDK::Simulation::getEventListener ( const agx::Name name)

Find and return the first matching named event listener.

Parameters
name- name of the event listener to find
Returns
pointer to the found event listener, null if not found

◆ getEventListener() [2/4]

const agxSDK::EventListener * agxSDK::Simulation::getEventListener ( const agx::Name name) const

Find and return the first matching named event listener.

Parameters
name- name of the event listener to find
Returns
pointer to the found event listener, null if not found

◆ getEventListener() [3/4]

agxSDK::EventListener * agxSDK::Simulation::getEventListener ( const agx::Uuid uuid)

Find (linear search) and return the first event listener matching the uuid.

Parameters
uuid- uuid of the event listener to find
Returns
pointer to the found event listener, null if not found

◆ getEventListener() [4/4]

const agxSDK::EventListener * agxSDK::Simulation::getEventListener ( const agx::Uuid uuid) const

Find (linear search) and return the first event listener matching the uuid.

Parameters
uuid- uuid of the event listener to find
Returns
pointer to the found event listener, null if not found

◆ getEventListeners()

void agxSDK::Simulation::getEventListeners ( EventListenerPtrVector eventListeners) const

Get a vector containing all the registered event listeners.

◆ getGeometries()

const agxCollide::GeometryRefVector & agxSDK::Simulation::getGeometries ( ) const
Returns
vector of geometries which has been added to this space

◆ getGeometry() [1/4]

agxCollide::Geometry * agxSDK::Simulation::getGeometry ( const agx::Name name)

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [2/4]

const agxCollide::Geometry * agxSDK::Simulation::getGeometry ( const agx::Name name) const

Find (linear search) and return named collision Geometry.

Parameters
name- name of the collision Geometry to find
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [3/4]

agxCollide::Geometry * agxSDK::Simulation::getGeometry ( const agx::Uuid uuid)

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

Parameters
uuid- uuid of the collision Geometry to find
Returns
pointer to the found collision Geometry, null if not found

◆ getGeometry() [4/4]

const agxCollide::Geometry * agxSDK::Simulation::getGeometry ( const agx::Uuid uuid) const

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

Parameters
uuid- uuid of the collision Geometry to find
Returns
pointer to the found collision Geometry, null if not found

◆ getGravityField() [1/2]

agx::GravityField * agxSDK::Simulation::getGravityField ( )
Returns
the current GravityField

◆ getGravityField() [2/2]

const agx::GravityField * agxSDK::Simulation::getGravityField ( ) const
Returns
the current GravityField

◆ getHeader()

agx::Component * agxSDK::Simulation::getHeader ( )

◆ getJournal() [1/2]

agx::Journal * agxSDK::Simulation::getJournal ( )
Returns
The attached simulation journal.

◆ getJournal() [2/2]

const agx::Journal * agxSDK::Simulation::getJournal ( ) const
Returns
The attached simulation journal.

◆ getMaterial() [1/3]

agx::Material * agxSDK::Simulation::getMaterial ( const agx::Name materialName)
Returns
a material given a name, null if not found.

◆ getMaterial() [2/3]

const agx::Material * agxSDK::Simulation::getMaterial ( const agx::Name materialName) const
Returns
a material given a name, null if not found.

◆ getMaterial() [3/3]

agx::Material * agxSDK::Simulation::getMaterial ( const agx::Uuid uuid)
Returns
a material given a name, null if not found.

◆ getMaterialManager() [1/2]

MaterialManager * agxSDK::Simulation::getMaterialManager ( )
Returns
the material manager.

◆ getMaterialManager() [2/2]

const MaterialManager * agxSDK::Simulation::getMaterialManager ( ) const
Returns
the material manager.

◆ getMergedBody() [1/5]

agx::MergedBody * agxSDK::Simulation::getMergedBody ( agx::UInt  i) const
See also
getNumMergedBodies
Returns
merged body with index i

◆ getMergedBody() [2/5]

agx::MergedBody * agxSDK::Simulation::getMergedBody ( const agx::Name name)

Find (linear search) and return named MergedBody.

Parameters
name- name of the body to find
Returns
pointer to the found MergedBody body, null if not found

◆ getMergedBody() [3/5]

const agx::MergedBody * agxSDK::Simulation::getMergedBody ( const agx::Name name) const

Find (linear search) and return named MergedBody.

Parameters
name- name of the body to find
Returns
pointer to the found MergedBody body, null if not found

◆ getMergedBody() [4/5]

agx::MergedBody * agxSDK::Simulation::getMergedBody ( const agx::Uuid uuid)

Find (linear search) and return a pointer to a MergedBody with the given uuid.

Parameters
uuid- uuid of the requested rigid body
Returns
pointer to the found MergedBody, null if not found

◆ getMergedBody() [5/5]

const agx::MergedBody * agxSDK::Simulation::getMergedBody ( const agx::Uuid uuid) const

Find (linear search) and return a pointer to a MergedBody with the given uuid.

Parameters
uuid- uuid of the requested rigid body
Returns
pointer to the found MergedBody, null if not found

◆ getMergeSplitHandler()

agxSDK::MergeSplitHandler * agxSDK::Simulation::getMergeSplitHandler ( ) const

Merge split handler is an object that enables performance boosts by merging rigid bodies together which results in fewer rigid bodies for the solver to solve for.

Returns
the merge split handler for this simulation

◆ getNumMergedBodies()

agx::UInt agxSDK::Simulation::getNumMergedBodies ( ) const
Returns
the number of merged bodies

◆ getNumTerrains()

agx::UInt agxSDK::Simulation::getNumTerrains ( ) const
Returns
the number of current terrains in the simulation

◆ getObserver() [1/4]

agx::ObserverFrame * agxSDK::Simulation::getObserver ( const agx::Name name)

Find (linear search) and return named ObserverFrame.

Parameters
name- name of the observer to find
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserver() [2/4]

const agx::ObserverFrame * agxSDK::Simulation::getObserver ( const agx::Name name) const

Find (linear search) and return named ObserverFrame.

Parameters
name- name of the observer to find
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserver() [3/4]

agx::ObserverFrame * agxSDK::Simulation::getObserver ( const agx::Uuid uuid)

Find (linear search) and return a pointer to a ObserverFrame with the given uuid.

Parameters
uuid- uuid of the requested observer frame
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserver() [4/4]

const agx::ObserverFrame * agxSDK::Simulation::getObserver ( const agx::Uuid uuid) const

Find (linear search) and return a pointer to a ObserverFrame with the given uuid.

Parameters
uuid- uuid of the requested observer frame
Returns
pointer to the found ObserverFrame, null if not found

◆ getObserverFrame() [1/4]

agx::ObserverFrame * agxSDK::Simulation::getObserverFrame ( const agx::Name name)

Find (linear search) the first ObserverFrame object in the system that matches the name.

Returns
a pointer to the found observer frame, nullptr if none found.

◆ getObserverFrame() [2/4]

const agx::ObserverFrame * agxSDK::Simulation::getObserverFrame ( const agx::Name name) const

Find (linear search) the first ObserverFrame object in the system that matches the name.

Returns
a pointer to the found observer frame, nullptr if none found.

◆ getObserverFrame() [3/4]

agx::ObserverFrame * agxSDK::Simulation::getObserverFrame ( const agx::Uuid uuid)

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

Parameters
uuid- uuid of the requested observer frame
Returns
pointer to the found observer frame, null if not found

◆ getObserverFrame() [4/4]

const agx::ObserverFrame * agxSDK::Simulation::getObserverFrame ( const agx::Uuid uuid) const

Find (linear search) and return a pointer to a ObserverFrame with the given uuid.

Parameters
uuid- uuid of the requested observer frame
Returns
const pointer to the found observer frame, null if not found

◆ getObserverFrames() [1/2]

agx::ObserverFrameRefSetVector & agxSDK::Simulation::getObserverFrames ( )
Returns
All observer frames in the system.

◆ getObserverFrames() [2/2]

const agx::ObserverFrameRefSetVector & agxSDK::Simulation::getObserverFrames ( ) const
Returns
All observer frames in the system.

◆ getParameter()

agxSDK::SimulationParameter * agxSDK::Simulation::getParameter ( const agx::Name name)
Returns
The parameter with a specified name.

◆ getParameters()

const agxSDK::SimulationParameterRefVector & agxSDK::Simulation::getParameters ( ) const
Returns
The set of published simulation parameters.

◆ getParticleEmitters()

agx::ParticleEmitterRefVector agxSDK::Simulation::getParticleEmitters ( )
Returns
a vector of all particle emitters in the simulation

◆ getParticleSystem()

agx::ParticleSystem * agxSDK::Simulation::getParticleSystem ( ) const
Returns
The active particle system in the simulation.

◆ getParticleSystems() [1/2]

agx::ParticleSystemRefVector & agxSDK::Simulation::getParticleSystems ( )
Returns
a vector of all particle systems which is added to this Simulation

◆ getParticleSystems() [2/2]

const agx::ParticleSystemRefVector & agxSDK::Simulation::getParticleSystems ( ) const
Returns
a vector of all particle systems which is added to this Simulation

◆ getPickHandler() [1/2]

agxSDK::PickHandler * agxSDK::Simulation::getPickHandler ( )
Returns
the interface to the pick handler associated to this simulation object
Note
If no pick handler has been set, these methods will return zero.

◆ getPickHandler() [2/2]

const agxSDK::PickHandler * agxSDK::Simulation::getPickHandler ( ) const
Returns
the interface to the pick handler associated to this simulation object
Note
If no pick handler has been set, these methods will return zero.

◆ getPlotSystem()

agxPlot::System * agxSDK::Simulation::getPlotSystem ( ) const
Returns
A pointer to the PlotSystem used in the Simulation

◆ getPreIntegratePositions()

bool agxSDK::Simulation::getPreIntegratePositions ( ) const
Returns
True if the positions are integrated at the start of the timestep, false if integrated at the end.

◆ getProfilingFrequency()

agx::Real agxSDK::Simulation::getProfilingFrequency ( ) const
Returns
The profiling frequency

◆ getRemoteDebuggingTimeStep()

agx::Real agxSDK::Simulation::getRemoteDebuggingTimeStep ( ) const
Returns
the time step for remote debugging. Should be a multiple of the simulation time step.

◆ getRenderManager() [1/2]

agxRender::RenderManager * agxSDK::Simulation::getRenderManager ( )
Returns
a pointer to the RenderManager for this simulation

◆ getRenderManager() [2/2]

const agxRender::RenderManager * agxSDK::Simulation::getRenderManager ( ) const
Returns
a pointer to the RenderManager for this simulation

◆ getRigidBodies() [1/2]

agx::RigidBodyRefVector & agxSDK::Simulation::getRigidBodies ( )
Returns
a vector of all bodies in the DynamicsSystem, both enabled and disabled

◆ getRigidBodies() [2/2]

const agx::RigidBodyRefVector & agxSDK::Simulation::getRigidBodies ( ) const
Returns
a vector of all bodies in the DynamicsSystem, both enabled and disabled

◆ getRigidBody() [1/4]

agx::RigidBody * agxSDK::Simulation::getRigidBody ( const agx::Name name)

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
Returns
pointer to the found RigidBody body, null if not found

◆ getRigidBody() [2/4]

const agx::RigidBody * agxSDK::Simulation::getRigidBody ( const agx::Name name) const

Find (linear search) and return named RigidBody.

Parameters
name- name of the body to find
Returns
pointer to the found RigidBody body, null if not found

◆ getRigidBody() [3/4]

agx::RigidBody * agxSDK::Simulation::getRigidBody ( const agx::Uuid uuid)

Find (linear search) and return a pointer to a RigidBody with the given uuid.

Parameters
uuid- uuid of the requested rigid body
Returns
pointer to the found RigidBody, null if not found

◆ getRigidBody() [4/4]

const agx::RigidBody * agxSDK::Simulation::getRigidBody ( const agx::Uuid uuid) const

Find (linear search) and return a pointer to a RigidBody with the given uuid.

Parameters
uuid- uuid of the requested rigid body
Returns
pointer to the found RigidBody, null if not found

◆ getSensorEnvironment()

ISensorEnvironment * agxSDK::Simulation::getSensorEnvironment ( ) const
Returns
the sensor environment for this simulation if created, otherwise nullptr

◆ getSerializer() [1/2]

SimulationSerializer * agxSDK::Simulation::getSerializer ( )
Returns
a pointer to the SimulationSerializer which is a StepEventListener that will be periodically called from the Simulation's stepForward method to store the simulation state to disk (if enabled)

◆ getSerializer() [2/2]

const SimulationSerializer * agxSDK::Simulation::getSerializer ( ) const
Returns
a pointer to the SimulationSerializer which is a StepEventListener that will be periodically called from the Simulation's stepForward method to store the simulation state to disk (if enabled)

◆ getSimulationProxy()

agxSDK::SimulationProxy * agxSDK::Simulation::getSimulationProxy ( ) const

Internal method.

Proxy of this object used by objects running in parallel and still needs to add/remove things from this simulation.

◆ getSimulationStatisticsListener() [1/2]

SimulationStatisticsListener * agxSDK::Simulation::getSimulationStatisticsListener ( )

◆ getSimulationStatisticsListener() [2/2]

const SimulationStatisticsListener * agxSDK::Simulation::getSimulationStatisticsListener ( ) const

◆ getSolveModel()

agx::SolveModel * agxSDK::Simulation::getSolveModel ( const agx::Name name)

◆ getSolveModels()

const agx::SolveModelRefVector & agxSDK::Simulation::getSolveModels ( ) const

Definition at line 1924 of file Simulation.h.

◆ getSolver() [1/2]

agx::Solver * agxSDK::Simulation::getSolver ( )
Returns
the solver.

◆ getSolver() [2/2]

const agx::Solver * agxSDK::Simulation::getSolver ( ) const
Returns
the solver.

◆ getSpace() [1/2]

agxCollide::Space * agxSDK::Simulation::getSpace ( )
Returns
A pointer to the Collision space used in the Simulation

Definition at line 1883 of file Simulation.h.

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

◆ getSpace() [2/2]

const agxCollide::Space * agxSDK::Simulation::getSpace ( ) const
Returns
A pointer to the Collision space used in the Simulation

Definition at line 1888 of file Simulation.h.

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

◆ getTerrain()

agxSDK::TerrainInstance * agxSDK::Simulation::getTerrain ( agx::UInt  i) const
Parameters
i- index (i < getNumTerrains())
Returns
terrain instance at given index i

◆ getTerrainManager()

agxSDK::TerrainManager * agxSDK::Simulation::getTerrainManager ( ) const

◆ getTimeDataSeries()

agxPlot::DataSeries * agxSDK::Simulation::getTimeDataSeries ( ) const

A data series that contains all time stamps of the simulation.

◆ getTimeStamp()

agx::Real agxSDK::Simulation::getTimeStamp ( ) const
Returns
The current accumulated simulation time.

Definition at line 1878 of file Simulation.h.

References agx::Clock::getTime().

◆ getTimeStep()

agx::Real agxSDK::Simulation::getTimeStep ( ) const
Returns
the time step determined by the TimeGovernor in the DynamicsSystem.

Definition at line 1903 of file Simulation.h.

◆ getUniformGravity()

agx::Vec3 agxSDK::Simulation::getUniformGravity ( ) const

If the current gravity field is not a uniform one (for example PointGravityField), 0,0,0 will be returned.

Returns
the uniform gravity

◆ getUpdateTask()

agx::TaskGroup * agxSDK::Simulation::getUpdateTask ( )

◆ getWire() [1/4]

agxWire::Wire * agxSDK::Simulation::getWire ( const agx::Name name)

Find and return the first matching named wire.

Parameters
name- name of the wire to find
Returns
pointer to the found wire, null if not found

◆ getWire() [2/4]

const agxWire::Wire * agxSDK::Simulation::getWire ( const agx::Name name) const

Find and return the first matching named wire.

Parameters
name- name of the wire to find
Returns
pointer to the found wire, null if not found

◆ getWire() [3/4]

agxWire::Wire * agxSDK::Simulation::getWire ( const agx::Uuid uuid)

Find (linear search) and return the first wire matching the uuid.

Parameters
uuid- uuid of the wire to find
Returns
pointer to the found wire, null if not found

◆ getWire() [4/4]

const agxWire::Wire * agxSDK::Simulation::getWire ( const agx::Uuid uuid) const

Find (linear search) and return the first wire matching the uuid.

Parameters
uuid- uuid of the wire to find
Returns
pointer to the found wire, null if not found

◆ handleStabiltyReport()

void agxSDK::Simulation::handleStabiltyReport ( const agx::StabilityReport stabilityReport)

Internal method.

Handles stability report sent from the solver.

◆ load()

static Simulation * agxSDK::Simulation::load ( agx::TiXmlElement *  eSimulation,
agx::Device device 
)
static

◆ loadSolveModels()

void agxSDK::Simulation::loadSolveModels ( const agx::String path,
bool  clear = false 
)

◆ read() [1/2]

size_t agxSDK::Simulation::read ( const agx::String filename,
agxSDK::Assembly parent = nullptr,
agx::UInt  selection = READ_DEFAULT 
)

Read serialized simulation from the specified file and append to this simulation.

Parameters
parent- If != nullptr, all read objects will be added to this parent too.
selection- Options for reading in. See ReadSelectionMask.
Returns
number of serialized objects read from file

◆ read() [2/2]

size_t agxSDK::Simulation::read ( std::istream &  stream,
bool  isBinary,
agxSDK::Assembly parent = nullptr,
agx::UInt  selection = READ_DEFAULT 
)

Read serialized simulation from the specified stream.

Parameters
stream- Stream from which serialized data is to be read.
isBinary- if true, it's a binary dataset.
parent- If != nullptr, all read objects will be added to this parent too.
selection- Options for reading in. See ReadSelectionMask.
Returns
number of serialized objects read from file

◆ readStoragePermutations()

void agxSDK::Simulation::readStoragePermutations ( agxStream::InputArchive in,
bool  clearStorages = false 
)

◆ remove() [1/20]

bool agxSDK::Simulation::remove ( agx::Component subComponent)

Remove a sub component from Simulation.

Parameters
subComponent- The component to be removed
Returns
true if the removal was successful.

◆ remove() [2/20]

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

Remove a constraint from the simulation.

Parameters
constraint- The constraint to be removed.
Returns
true if removal was successful (was part of the simulation)

◆ remove() [3/20]

bool agxSDK::Simulation::remove ( agx::ContactMaterial material)

Remove an explicit contact material from the set of existing ContactMaterials.

Returns
true if the contact material existed and was successfully removed

Referenced by agxUtil::GeneralContactEventListener< T >::separation().

◆ remove() [4/20]

bool agxSDK::Simulation::remove ( agx::Emitter emitter,
bool  removeGeometries = true 
)

Remove an emitter from the system.

Parameters
emitter- The emitter to be removed.
removeGeometries- true if the emitter geometry should be removed from the simulation, false otherwise. (Default: true)
Returns
true if the emitter was successfully removed.

◆ remove() [5/20]

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

Remove an Interaction from the Simulation.

Parameters
interaction- The object to be removed
Returns
true if the interaction was successfully removed

◆ remove() [6/20]

bool agxSDK::Simulation::remove ( agx::Material material)

Remove a specified material from the simulation.

Returns
true if material was successfully removed

◆ remove() [7/20]

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

Removes the merged body from this simulation.

Parameters
mergedBody- merged body to remove
Returns
true if removed, otherwise false

◆ remove() [8/20]

bool agxSDK::Simulation::remove ( agx::ObserverFrame observerFrame)

Remove a ObserverFrame to the Simulation.

Parameters
observerFramethe frame to remove
Returns
true if removal of the frame was successful

◆ remove() [9/20]

bool agxSDK::Simulation::remove ( agx::ParticleContactSensor sensor)

Remove a particle contact sensor from the system.

Parameters
sensor- The particle contact sensor to be removed.
Returns
true if the particle contact sensor was successfully removed.

◆ remove() [10/20]

bool agxSDK::Simulation::remove ( agx::ParticleSystem particleSystem)

Remove a particle system from the simulation.

Parameters
particleSystem- The particle system to be removed.
Returns
true if the particle system was successfully removed.

◆ remove() [11/20]

bool agxSDK::Simulation::remove ( agx::RigidBody body,
bool  removeGeometries = true 
)

Remove a body from the Simulation, the body will be disabled!

Parameters
body- The body that should be removed
removeGeometries- If true, any geometries associated with this body should also silently be removed. If the removal of any of these geometries fails, it is not reported in the return value of this method.
Returns
true if the body was successfully removed

◆ remove() [12/20]

bool agxSDK::Simulation::remove ( agxCollide::Geometry geometry)

Remove geometry from collision space.

Any subsequent call to Space::testGeometryOverlap will not contain this geometry.

Space will keep one reference to the geometry until next call to Space::update() where it will be released. Also The Geometry will also possibly be present in the list of contacts and BroadPhase overlaps. This will also be cleaned up after next call to Space::update()

Returns
true if removal was successful.

◆ remove() [13/20]

bool agxSDK::Simulation::remove ( agxControl::Action *  action)

Remove an action from this simulation.

Parameters
action- action to remove
Returns
true if removed

◆ remove() [14/20]

bool agxSDK::Simulation::remove ( agxControl::Operation *  operation)

Remove an operation from this simulation.

Parameters
operation- operation to remove
Returns
true if removed (and not already added)

◆ remove() [15/20]

bool agxSDK::Simulation::remove ( agxSDK::Assembly assembly,
bool  removeAllEntries = true 
)

Remove an assembly from the simulation.

Parameters
removeAllEntries- If true (default) it will also remove all its contained entries, such as geometries, bodies, EventListeners, sub-assemblies and constraints
Returns
true if assembly and all its contained elements (if removeAllEntries==true are) successfully removed

◆ remove() [16/20]

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

Remove a Event listener.

Parameters
listenerThe listener to remove.
Return values
trueif successfully removed (and part of Simulation before).

◆ remove() [17/20]

bool agxSDK::Simulation::remove ( agxSDK::SimulationParameter parameter)

Remove a parameter from the simulation configuration interface.

◆ remove() [18/20]

bool agxSDK::Simulation::remove ( agxSDK::TerrainInstance terrain)

Remove terrain (agxTerrain::Terrain) instance from this simulation.

Parameters
terrain- terrain to remove
Returns
true if removed, false if nullptr or not part of this simulation

◆ remove() [19/20]

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

Remove a terrain tool instance from this simulation.

Parameters
toolInstance- terrain tool instance to remove
Returns
true if removed, false if nullptr or not part of this simulation

◆ remove() [20/20]

bool agxSDK::Simulation::remove ( agxStream::Serializable object)

Remove an object as a serializable object.

Might be any of the above classes having an add method: Geometry, RigidBody etc.

Return values
successfully removed?

◆ removeEventListener()

bool agxSDK::Simulation::removeEventListener ( agxSDK::EventListener listener)

Remove the specified listener.

The listener will get a call to its removeNotification method if removal was successful.

Returns
true if the listener was successfully removed.

◆ removeRestoreListener()

bool agxSDK::Simulation::removeRestoreListener ( agxStream::RestoreListener listener)

Remove an existing listener in a simulation.

Parameters
listenerThe listener to be removed
Returns
true if listener existed and hence was removed

◆ removeSolveModel()

void agxSDK::Simulation::removeSolveModel ( agx::SolveModel *  model)

◆ renderComponents()

void agxSDK::Simulation::renderComponents ( )

◆ resetTaskTimers()

void agxSDK::Simulation::resetTaskTimers ( )

Reset profiling timers.

◆ restore() [1/3]

void agxSDK::Simulation::restore ( agxStream::InputArchive in,
agxSDK::Assembly parent = nullptr,
agx::UInt  selection = READ_DEFAULT,
bool  replaceUsingCache = false 
)

Read data from the input archive and add to the simulation.

Parameters
in- Archive to read from
parent- if != nullptr, all items will also be added to this assembly
selection- Options for reading in. See ReadSelectionMask.
replaceUsingCache- Replace current state by archive, but reuse matching objects that exist in both representations

◆ restore() [2/3]

bool agxSDK::Simulation::restore ( const agx::String filename,
agx::UInt  selection = READ_DEFAULT 
)

Restore state from a serialized scene file.

Matching object UUIDs, so any object present in both current simulation and the serialized scene will retain the current object.

Returns
true if successful

◆ restore() [3/3]

bool agxSDK::Simulation::restore ( std::istream &  stream,
bool  isBinary,
agx::UInt  selection = READ_DEFAULT 
)

◆ sendSimulation()

void agxSDK::Simulation::sendSimulation ( )

Send the simulation to the remote debugger (if enabled)

◆ setActionManagerTimeStamp()

void agxSDK::Simulation::setActionManagerTimeStamp ( const agx::TimeStamp time)

Truncating an AGX simulation does not reset the timestamp in the action manager.

This function allows for resetting the action manager timestamp from Simulation.h

◆ setContactReductionBinResolution()

void agxSDK::Simulation::setContactReductionBinResolution ( agx::UInt8  binResolution)

Specify the bin resolution used when evaluating contacts for reduction between body-body contacts.

(Body-body contact reduction is not enabled by default, see settings in ContactMaterial to enable it). A high value will keep more contacts, lower will result in more aggressive reduction. Commonly a value of 2-3 will give good results. Default is 3. Values from 1 to 10 are valid.

Parameters
binResolution- parameter to ContactReducer.

◆ setContactReductionThreshold()

void agxSDK::Simulation::setContactReductionThreshold ( agx::UInt  threshold)

Specify the minimum number of contacts between two bodies required to execute contact reduction.

Default value is 3 contacts.

Parameters
threshold- Set the lower bound threshold for number of contact points in a body-body rigid body contact in order run contact reduction on it.

◆ setDynamicsSystem()

void agxSDK::Simulation::setDynamicsSystem ( agx::DynamicsSystem system)

Replace the current DynamicsSystem with system.

◆ setEnableClearRenderTemporaries()

void agxSDK::Simulation::setEnableClearRenderTemporaries ( bool  enable)

◆ setEnableRemoteDebugging()

void agxSDK::Simulation::setEnableRemoteDebugging ( bool  flag,
agx::Int16  port = -1,
bool  useCompression = false,
bool  waitForSynchronization = true 
)

Enable/Disable remote debugging.

Parameters
flag- If true, a server for remote debugging will be created
port- Socket port. If -1, the default port will be used.
useCompression- If true the data will be compressed before sent to the remote listener
waitForSynchronization- If true the server will wait for the client to ask for more data before it sends another frame

◆ setEnableSimulationStatisticsListener()

void agxSDK::Simulation::setEnableSimulationStatisticsListener ( bool  flag)

Enable/disable the listener that collects all statistics data from the simulation.

Disabling will remove/delete the previous listener, hence no data will be stored. Make sure you update any external pointers to the SimulationStatisticsListener retrieved through the getSimulationStatisticsListener() method.

◆ setEnableStatistics()

void agxSDK::Simulation::setEnableStatistics ( bool  enable)

Enable/disable statistics logging to disk.

This will also toggle the agx::Statistics::instance()->setEnable() which will control whether statistics data is logged at all.

◆ setEnableStatisticsRendering()

void agxSDK::Simulation::setEnableStatisticsRendering ( bool  enable)
Parameters
enable- if true, the rendering of statistics will be dispatched to the agxRender::RenderManager

◆ setEnableWebDebugger()

void agxSDK::Simulation::setEnableWebDebugger ( bool  flag,
agx::UInt16  port = 9001 
)

Enable/Disable the Web debugger simulation WebSocket API.

Note
Side effects from using this method is that any previously enabled DebugRenderProxies will be disabled. There can only be one DebugRenderer connected to a simulation. Also the rendering flags for the RenderingManager will be modified.
Parameters
flag- If true the webdebugger WebSocket server will be started.
port- WebSocket port to which the client should connect to receive data.

◆ setGravityField()

void agxSDK::Simulation::setGravityField ( agx::GravityField gravityField)

Set the GravityField model used in gravity calculations.

Default is UniformGravityField.

Parameters
gravityField- The model used.

◆ setMainWorkThread()

void agxSDK::Simulation::setMainWorkThread ( agx::Thread thread)

Specify which is the main working thread for the Simulation.

All calls from event listeners (StepEventListener::pre() etc.) will come from this thread.

Parameters
thread- A pointer to the thread that should be the main thread.

◆ setPickHandler()

void agxSDK::Simulation::setPickHandler ( agxSDK::PickHandler pickHandler)

Assign interface for pick handler.

Parameters
pickHandler- pick handler interface

◆ setPlotSystem()

void agxSDK::Simulation::setPlotSystem ( agxPlot::System plotSystem)

Replace the current PlotSystem with plotSystem.

◆ setPreIntegratePositions()

void agxSDK::Simulation::setPreIntegratePositions ( bool  flag)

Set true to integrate positions at the start of the timestep rather than at the end.

◆ setProfilingFrequency()

void agxSDK::Simulation::setProfilingFrequency ( agx::Real  frequency)

Specify the frequency for performance profiling.

◆ setRemoteDebuggingTimeStep()

void agxSDK::Simulation::setRemoteDebuggingTimeStep ( agx::Real  timeStep)

Sets the time step for remote debugging.

Should be a multiple of the simulation time step. If timeStep=0, then the simulation time step will be used.

◆ setSensorEnvironment()

void agxSDK::Simulation::setSensorEnvironment ( ISensorEnvironment environment)

Assign new sensor environment to this simulation, nullptr to remove the current environment.

If an environement already exist, and environment is valid, the previous environment will be removed.

Parameters
environment- new sensor enviroment for this simulation, nullptr to remove the current.

◆ setSerializer()

void agxSDK::Simulation::setSerializer ( SimulationSerializer serializer)

Replace the current SimulationSerializer with a new instance.

◆ setSpace()

void agxSDK::Simulation::setSpace ( agxCollide::Space space)

Replace the current Collision space with space.

◆ setStatisticsInterval()

void agxSDK::Simulation::setStatisticsInterval ( agx::Real  interval)
Parameters
interval- specifies the interval in seconds for writing statistics data down to disk

◆ setStatisticsPath()

void agxSDK::Simulation::setStatisticsPath ( const agx::String path)

Specify the path to a file where the statistics information will be written when enabled.

Parameters
path- The path to a filename into which statistics information will be written.

◆ setTimeStamp()

void agxSDK::Simulation::setTimeStamp ( agx::TimeStamp  t)

Set the timestamp for the simulation (and the DynamicsSystem)

Parameters
t- New timestamp

◆ setTimeStep()

bool agxSDK::Simulation::setTimeStep ( agx::Real  timeStep)

Sets the time step determined by the TimeGovernor in the DynamicsSystem.

Parameters
timeStep- The new time step.
Returns
true if the timestep was set successfully, false otherwise.

◆ setUniformGravity()

bool agxSDK::Simulation::setUniformGravity ( const agx::Vec3 g)

Set the uniform gravity.

If a non-uniform gravity field is currently used (for example PointGravityField), this method will return false and will not change anything. If this is the case, and you want a uniform field, you need to create a uniform gravity field: sim->setGravityField(new agx::UniformGravityField(g))

Parameters
g- Gravity vector
Returns
True if the uniform gravity could be set. False if a non-uniform gravity field is currently being used in the DynamicsSystem

◆ stepForward()

void agxSDK::Simulation::stepForward ( )

Take one step forward in the simulation.

Length of time step is determined by the TimeGovernor in the DynamicsSystem

◆ stepTo()

agx::TimeStamp agxSDK::Simulation::stepTo ( agx::TimeStamp  t)

Step the simulation forward 1 or more time steps in time until we get to the time t.

The length of time step is determined by the TimeGovernor in the DynamicsSystem.

Returns
the current timestamp of the system. This can be now+t, but it can also be less due to a call to the breakStepTo() method from a method in an EventListener.

◆ store()

void agxSDK::Simulation::store ( agxStream::OutputArchive archive) const

Save this simulation to the output archive.

Parameters
archive- Archive associated to a stream to which the data will be written.

◆ triggerEvent()

bool agxSDK::Simulation::triggerEvent ( const GuiEvent e)

Execute a GuiEvent.

Returns
true if event is listened to and handled.

◆ updateActionManager()

void agxSDK::Simulation::updateActionManager ( )

Internal method.

Update the internal active ActionManager in the simulation

◆ updateRenderManager()

void agxSDK::Simulation::updateRenderManager ( )

Make an explicit call to RenderManager::update() to update the debug rendering information.

◆ updateStatisticsRenderData()

void agxSDK::Simulation::updateStatisticsRenderData ( )

Make an explicit call to RenderManager::update() to update the statistics rendering information.

◆ write() [1/2]

size_t agxSDK::Simulation::write ( const agx::String filename) const

Serialize the simulation to the specified file.

Parameters
filename- Name of file to which the simulation will be written
Returns
Number of objects serialized to disk

◆ write() [2/2]

size_t agxSDK::Simulation::write ( std::ostream &  stream,
bool  binary 
) const

Serialize the simulation to the specified file.

Parameters
stream- The stream to which the simulation object will be written
binary- if true, it's a binary dataset.
Returns
Number of objects serialized to disk

◆ writeStatisticsFiles()

void agxSDK::Simulation::writeStatisticsFiles ( const agx::String directoryPath = "Statistics",
bool  taskProfile = true,
bool  threadTimeline = true,
const agx::Vector< agx::String > &  timelineFormats = agx::Vectoragx::String >(),
bool  bufferAllocations = true 
)

◆ writeStoragePermutations()

void agxSDK::Simulation::writeStoragePermutations ( agxStream::OutputArchive archive) const

Member Data Documentation

◆ addConstraintEvent

ConstraintEvent agxSDK::Simulation::addConstraintEvent

Definition at line 146 of file Simulation.h.

◆ addContactMaterialEvent

ContactMaterialEvent agxSDK::Simulation::addContactMaterialEvent

Definition at line 152 of file Simulation.h.

◆ addGeometryEvent

GeometryEvent agxSDK::Simulation::addGeometryEvent

Definition at line 140 of file Simulation.h.

◆ addMaterialEvent

MaterialEvent agxSDK::Simulation::addMaterialEvent

Definition at line 149 of file Simulation.h.

◆ addRigidBodyEvent

RigidBodyEvent agxSDK::Simulation::addRigidBodyEvent

Definition at line 143 of file Simulation.h.

◆ journalAttachedEvent

JournalAttachEvent agxSDK::Simulation::journalAttachedEvent

Definition at line 155 of file Simulation.h.

◆ removeConstraintEvent

ConstraintEvent agxSDK::Simulation::removeConstraintEvent

Definition at line 147 of file Simulation.h.

◆ removeContactMaterialEvent

ContactMaterialEvent agxSDK::Simulation::removeContactMaterialEvent

Definition at line 153 of file Simulation.h.

◆ removeGeometryEvent

GeometryEvent agxSDK::Simulation::removeGeometryEvent

Definition at line 141 of file Simulation.h.

◆ removeMaterialEvent

MaterialEvent agxSDK::Simulation::removeMaterialEvent

Definition at line 150 of file Simulation.h.

◆ removeRigidBodyEvent

RigidBodyEvent agxSDK::Simulation::removeRigidBodyEvent

Definition at line 144 of file Simulation.h.


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