![]() |
VR-Forces 4.3 Class Documentation
|
The simulation engine is controlled by a single,top-level class called the Simulation Manager. More...
Public Member Functions | |
| DtSimManager (DtExerciseConn *connection) | |
| constructor | |
| virtual | ~DtSimManager () |
| destructor | |
| virtual bool | init () |
| creates all the other pieces. | |
| virtual const DtVrfSimOptionsInterface * | simOptions () const |
| Access sim options object. | |
| virtual void | setSimOptions (const DtVrfSimOptionsInterface &) |
| Takes ownership. | |
| virtual bool | createExerciseClock () |
| Exercise clock for back-end. | |
| virtual bool | createScheduler () |
| virtual bool | createMessageInterface () |
| virtual bool | createFrameRateMonitor () |
| virtual bool | createVrfSimSettingsManager () |
| Creates the DtVrfSimSettingsManager. | |
| virtual bool | createParallelTickManager () |
| virtual void | tick () |
| Ticks the scheduler and then all registered tick callbacks. | |
| virtual void | sleep () const |
| Calls DtSleep(0.01) when the simulation is paused or when the mean frame rate is above the frame rate specified by targetFrameRate(). | |
| virtual bool | deliverMessage (const DtSimInterfaceMessage &msg) |
| virtual bool | receiveMessage (const DtSimInterfaceMessage &msg) |
| virtual bool | createAndDeliverMessage (const DtSimulationAddress &recipient, const DtSimInterfaceContent &content, bool overrideTimestampOrder=true) |
| virtual DtExerciseConn * | exerciseConn () |
| exerciseConn() provides access to the virtual network. | |
| virtual DtExerciseClock * | exerciseClock () |
| exerciseClock() provides access to the current dT, current exercise time and current elapsed time. | |
| virtual DtFrameRateMonitor * | frameRateMonitor () |
| provides access to the frameRateMonitor, which is responsible for providing frame rate statistics as requested. | |
| virtual DtParallelTickManager * | parallelTickManager () |
| Access parallelTickManager which can be used to execute code concurrently in the main thread. | |
| virtual DtScheduler * | scheduler () |
| scheduler() is used to schedule, control, and delete internal events. | |
| virtual void | setVrfObjectManager (DtVrfObjectManager *entityManager) |
| vrfObjectManager() provides access to all the objects in the system; both local and remote. | |
| virtual DtVrfObjectManager * | vrfObjectManager () |
| virtual const DtVrfObjectManager * | vrfObjectManager () const |
| virtual void | setEmbeddedEntityInfoManager (DtEmbeddedEntityInfoManager *eeInfManager) |
| embeddedEntityInfoManager() manages and provides information caches that concern Embedded Entities, including whether a particular type has embedded entities, and the available tasks/sets that those entities are capable of. | |
| virtual DtEmbeddedEntityInfoManager * | embeddedEntityInfoManager () |
| virtual const DtEmbeddedEntityInfoManager * | embeddedEntityInfoManager () const |
| virtual void | setModelSet (const DtModelSet &) |
| Model set is all entries that can be created from the model sets loaded with the simulationModelSet. | |
| const DtModelSet * | modelSet () const |
| virtual void | setScriptedTaskManager (DtScriptedTaskManager *) |
| scriptedTaskManager() provides access to all the scripted tasks in the system. | |
| virtual DtScriptedTaskManager * | scriptedTaskManager () |
| virtual const DtScriptedTaskManager * | scriptedTaskManager () const |
| virtual void | setScenarioEventManager (DtScenarioEventManager *) |
| scenarioEventManager() provides access to all the scenario events in the system. | |
| virtual DtScenarioEventManager * | scenarioEventManager () |
| virtual const DtScenarioEventManager * | scenarioEventManager () const |
| virtual void | setHazardAreaManager (DtHazardAreaManager *) |
| hazardAreaManager() provides access to all the hazard areas in the system. | |
| virtual DtHazardAreaManager * | hazardAreaManager () |
| virtual const DtHazardAreaManager * | hazardAreaManager () const |
| virtual void | setIntelCollectionAreaManager (DtIntelCollectionAreaManager *) |
| intelCollectionAreaManager() provides access to all the intel collection areas in the system. | |
| virtual DtIntelCollectionAreaManager * | intelCollectionAreaManager () |
| virtual const DtIntelCollectionAreaManager * | intelCollectionAreaManager () const |
| virtual void | setScriptedObjectsMovementManager (DtScriptedObjectsMovementManager *) |
| scriptedObjectsMovementManager() provides access to all the scripted movement objects in the system. | |
| virtual DtScriptedObjectsMovementManager * | scriptedObjectsMovementManager () |
| virtual const DtScriptedObjectsMovementManager * | scriptedObjectsMovementManager () const |
| virtual void | setAggregateSpatialModel (DtAggregateSpatialModel *aggregateSpatialModel) |
| aggregateSpatialModel() provides an up to date view of all aggregates' location (location, velocity, orientation, and bounding geometry). | |
| virtual DtAggregateSpatialModel * | aggregateSpatialModel () |
| virtual const DtAggregateSpatialModel * | aggregateSpatialModel () const |
| virtual void | setDetonationManager (DtDetonationManager *detonationManager) |
| Manages the detonation callbacks generated by the simulation. | |
| virtual DtDetonationManager * | detonationManager () |
| virtual void | setFireManager (DtFireManager *fireManager) |
| Manages the fire callbacks (fire/detonation interactions) generated by the simulation. | |
| virtual DtFireManager * | fireManager () |
| virtual void | setJoyDeviceManager (DtJoyDeviceManager *joyDeviceManager) |
| joyDeviceManager() is used to access the joystick manager. | |
| virtual const DtJoyDeviceManager * | joyDeviceManager () const |
| virtual DtJoyDeviceManager * | joyDeviceManager () |
| virtual DtVrfSimSettingsManager * | vrfSimSettingsManager () |
| Returns the DtVrfSimSettingsManager. | |
| virtual void | addMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData) |
| Add/Remove a function to be called when a particular message type is received. | |
| virtual void | removeMessageCallback (int type, DtMessageCallbackFcn fcn, void *usrData) |
| virtual DtVrfMessageInterface * | messageInterface () const |
| messageInterface() provides access to the interface used to send messages between the simulation back-end and a (logically or physically) remote front-end command interface. | |
| virtual DtInterfaceMessageExecutive * | messageExecutive () |
| virtual void | registerInterfaceCallbacks () |
| Register callbacks on the sim manager's interface message executive. | |
| virtual bool | processExtendedPropertySettings () |
| Processes the settings which specify the extended property attributes available to VRF objects. | |
| virtual const DtSimulationAddress & | messageAddress () const |
| This is the address that should be used as the sender for all messages originating from the backend. | |
| virtual unsigned long | sequenceNumber () |
| Gets the sequence number of the current scenario. | |
| virtual void | setSequenceNumber (unsigned long sequenceNumber) |
| Sets the sequence number – should only be called from classes which actually create and send out the number in a load scenario message. | |
| DtResourceMonitor * | resourceMonitor () |
| Get/set resource monitor. | |
| void | setResourceMonitor (DtResourceMonitor *) |
| virtual int | vrfSessionId () const |
| Returns the session id from the message interface. | |
| virtual int | vrfMessageVersionSupported () const |
| Returns the vrf message version from the message interface. | |
| virtual void | runForDuration (double) |
| Starts a run duration. | |
| virtual double | runDurationTime () const |
| virtual void | stopSimulationDurationTimer () |
| Stops the current duration run timer. | |
| virtual void | processRunDurationComplete () |
| virtual void | addSimulationRunDurationCallback (DtRunDurationCallbackFcn tickFunction, void *userData) |
| Adds callbacks for simulation completion from duration timeout. | |
| virtual void | removeSimulationRunDurationCallback (DtRunDurationCallbackFcn tickFunction, void *userData) |
| virtual void | setSetScenarioStartTimeAtLocalOnFirstObjectCreation (bool, int defaultTime=36000) |
| Sets whether or not to set the simulation time to the specified local time at todays date when the first object is created at the location of the created object. | |
| virtual bool | shouldSetScenarioStartTimeAtLocalOnFirstObjectCreation () const |
| virtual int | setScenarioStartTimeAtLocalOnFirstObjectCreation () const |
| virtual void | setTargetFrameRate (int rate) |
| The frame rate above which the back-end will call sleep() in order to yield CPU time to other processes. | |
| virtual int | targetFrameRate () const |
| The frame rate above which the back-end will call sleep() in order to yield CPU time to other processes. | |
| virtual void | addTickEntry (DtSimTickFunction tickFunction, void *userData) |
| Callback that will be called every simulation tick of the system. | |
| virtual void | removeTickEntry (DtSimTickFunction tickFunction, void *userData) |
| Callback that will be called every simulation tick of the system. | |
| virtual void | addPostTickEntry (DtSimTickFunction tickFunction, void *userData) |
| Callbacks invoked at the end of the tick function. | |
| virtual void | removePostTickEntry (DtSimTickFunction tickFunction, void *userData) |
| Callbacks invoked at the end of the tick function. | |
| virtual void | setPhysicalWorld (DtPhysicalWorld *newPhysicalWorld) |
| virtual DtPhysicalWorld * | physicalWorld () |
| virtual const DtPhysicalWorld * | physicalWorld () const |
| virtual void | setCommModelManager (DtCommModelManager *newCommModelManager) |
| virtual DtCommModelManager * | commModelManager () |
| virtual const DtCommModelManager * | commModelManager () const |
| virtual void | setSimTerrainRequestManager (DtSimTerrainRequestManager *newSimTerrainRequestManager) |
| virtual DtSimTerrainRequestManager * | simTerrainRequestManager () |
| virtual const DtSimTerrainRequestManager * | simTerrainRequestManager () const |
| virtual void | setGlobalPlanManager (DtGlobalPlanManager *planManager) |
| The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole. | |
| virtual const DtGlobalPlanManager * | globalPlanManager () const |
| The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole. | |
| virtual DtGlobalPlanManager * | globalPlanManager () |
| The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole. | |
| virtual void | setStealthCommandsManager (DtStealthCommandsManager *planManager) |
| The stealth commands manager maintains and executes stealth commands. | |
| virtual const DtStealthCommandsManager * | stealthCommandsManager () const |
| The stealth commands manager maintains and executes stealth commands. | |
| virtual DtStealthCommandsManager * | stealthCommandsManager () |
| The stealth commands manager maintains and executes stealth commands. | |
| virtual void | setHostilityManager (DtHostilityManager *hostilityManager) |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual const DtHostilityManager * | hostilityManager () const |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual DtHostilityManager * | hostilityManager () |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual void | setScenarioExtrasMgr (DtScenarioExtrasMgr *scenarioExtrasMgr) |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual const DtScenarioExtrasMgr * | scenarioExtrasMgr () const |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual DtScenarioExtrasMgr * | scenarioExtrasMgr () |
| The hostility manager keeps track of which forces are hostile to each other. | |
| virtual void | setDynamicFeaturesManager (DtDynamicFeaturesManager *mgr) |
| The dynamic features manager allows sim objects to be added to feature layers. | |
| virtual const DtDynamicFeaturesManager * | dynamicFeaturesManager () const |
| The dynamic features manager allows sim objects to be added to feature layers. | |
| virtual DtDynamicFeaturesManager * | dynamicFeaturesManager () |
| The dynamic features manager allows sim objects to be added to feature layers. | |
Static Public Member Functions | |
| static void | TickFunction (void *userData) |
| This function is registered on the execution list for the sim thread (called pvPacketThread, currently). | |
| static void | randSeedCallback (DtSimMessage *msg, void *usr) |
| Callbacks registered on the simManagers Message executive. | |
| static void | runDurationCompleteCallback (DtTimer *) |
| Callback for when duration run timer has completed. | |
| static void | setAppDataDir (const DtString &) |
| static const DtString & | appDataDir () |
Private Member Functions | |
| DtSimManager (const DtSimManager &orig) | |
| Copy constructor - not implemented. | |
| DtSimManager & | operator= (const DtSimManager &orig) |
| Assignment operator - not implemented. | |
The simulation engine is controlled by a single,top-level class called the Simulation Manager.
All the objects in the simulation backend are owned by the Simulation Manager. The Simulation Manager will be called via a tick() member function once each simulation frame, at which time it will process incoming messages and provide execution control to all the other objects it manages.
| DtSimManager::DtSimManager | ( | DtExerciseConn * | connection | ) |
constructor
|
virtual |
destructor
|
private |
Copy constructor - not implemented.
|
private |
Assignment operator - not implemented.
|
virtual |
creates all the other pieces.
Note that the object id generator is created and set in the DtVrfObjectIdGenerator class as the default generator to use. If yo have not set a new creator in the factory, reset in the DtVrfObjectIdGenerator class after init() is called
|
virtual |
Access sim options object.
|
virtual |
Takes ownership.
|
virtual |
Exercise clock for back-end.
Maintains concept of simulation time, frame rate and the various frame rate modes (variable, fixed-frame best effort, fixed-frame run to complete). If application is HLA13 or HLA1516 (i.e. if DtHLA is defined), creates a clock of type DtHlaExerciseClock. Otherwise, creates a a clock of type DtExerciseClock. DtHlaExerciseClock is extended to include the concept of HLA time management mode. Clock may optionally be configured to enable time regulating and constrained modes. Configurable through the vrfSim.mtl parameter file.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Creates the DtVrfSimSettingsManager.
|
virtual |
|
virtual |
Ticks the scheduler and then all registered tick callbacks.
Calls sleep().
|
virtual |
The frame rate above which the back-end will call sleep() in order to yield CPU time to other processes.
Once the frame rate drops below this level, the back-end will no longer sleep. This parameter only takes effect when the simulation is running in variable frame mode.
|
virtual |
The frame rate above which the back-end will call sleep() in order to yield CPU time to other processes.
Once the frame rate drops below this level, the back-end will no longer sleep. This parameter only takes effect when the simulation is running in variable frame mode.
|
virtual |
Calls DtSleep(0.01) when the simulation is paused or when the mean frame rate is above the frame rate specified by targetFrameRate().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Callback that will be called every simulation tick of the system.
|
virtual |
Callback that will be called every simulation tick of the system.
|
static |
Set/get the appData directory. Note that setting this after initialization might not catch all cases where this is used. Default is ../appData
|
static |
Set/get the appData directory. Note that setting this after initialization might not catch all cases where this is used. Default is ../appData
|
virtual |
Callbacks invoked at the end of the tick function.
The callback function signature is: void callback(void* usr)
|
virtual |
Callbacks invoked at the end of the tick function.
The callback function signature is: void callback(void* usr)
|
virtual |
exerciseConn() provides access to the virtual network.
Use it to send or register callbacks for interactions (but see the interaction manager below).
|
virtual |
exerciseClock() provides access to the current dT, current exercise time and current elapsed time.
|
virtual |
provides access to the frameRateMonitor, which is responsible for providing frame rate statistics as requested.
|
virtual |
Access parallelTickManager which can be used to execute code concurrently in the main thread.
|
virtual |
scheduler() is used to schedule, control, and delete internal events.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
vrfObjectManager() provides access to all the objects in the system; both local and remote.
Objects include entities, control objects.
|
virtual |
|
virtual |
|
virtual |
embeddedEntityInfoManager() manages and provides information caches that concern Embedded Entities, including whether a particular type has embedded entities, and the available tasks/sets that those entities are capable of.
|
virtual |
|
virtual |
|
virtual |
Model set is all entries that can be created from the model sets loaded with the simulationModelSet.
| const DtModelSet* DtSimManager::modelSet | ( | ) | const |
|
virtual |
scriptedTaskManager() provides access to all the scripted tasks in the system.
|
virtual |
|
virtual |
|
virtual |
scenarioEventManager() provides access to all the scenario events in the system.
|
virtual |
|
virtual |
|
virtual |
hazardAreaManager() provides access to all the hazard areas in the system.
|
virtual |
|
virtual |
|
virtual |
intelCollectionAreaManager() provides access to all the intel collection areas in the system.
|
virtual |
|
virtual |
|
virtual |
scriptedObjectsMovementManager() provides access to all the scripted movement objects in the system.
|
virtual |
|
virtual |
|
virtual |
aggregateSpatialModel() provides an up to date view of all aggregates' location (location, velocity, orientation, and bounding geometry).
|
virtual |
|
virtual |
|
virtual |
Manages the detonation callbacks generated by the simulation.
Notifies the appropriate registered DtVrfObjects (entities) of detonations they should process.
|
virtual |
|
virtual |
Manages the fire callbacks (fire/detonation interactions) generated by the simulation.
Notifies the appropriate registered DtVrfObjects (entities) of fire interactions and detonation interactions they should process for under-fire determination.
|
virtual |
|
virtual |
The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole.
|
virtual |
The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole.
|
virtual |
The global plan manager tracks and executes all "global plans" which are plans that are not associated with a particular entity, but rather with the simulation as a whole.
|
virtual |
The stealth commands manager maintains and executes stealth commands.
|
virtual |
The stealth commands manager maintains and executes stealth commands.
|
virtual |
The stealth commands manager maintains and executes stealth commands.
|
virtual |
joyDeviceManager() is used to access the joystick manager.
|
virtual |
|
virtual |
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The hostility manager keeps track of which forces are hostile to each other.
|
virtual |
The dynamic features manager allows sim objects to be added to feature layers.
|
virtual |
The dynamic features manager allows sim objects to be added to feature layers.
|
virtual |
The dynamic features manager allows sim objects to be added to feature layers.
|
virtual |
Returns the DtVrfSimSettingsManager.
|
virtual |
Add/Remove a function to be called when a particular message type is received.
|
virtual |
|
virtual |
messageInterface() provides access to the interface used to send messages between the simulation back-end and a (logically or physically) remote front-end command interface.
|
virtual |
|
static |
This function is registered on the execution list for the sim thread (called pvPacketThread, currently).
It actually calls the simManager->tick().
|
virtual |
Register callbacks on the sim manager's interface message executive.
If you override this make sure you call the base function, or the entity manager will stop responding to those messages.
|
virtual |
Processes the settings which specify the extended property attributes available to VRF objects.
|
virtual |
This is the address that should be used as the sender for all messages originating from the backend.
|
static |
Callbacks registered on the simManagers Message executive.
|
virtual |
Gets the sequence number of the current scenario.
|
virtual |
Sets the sequence number – should only be called from classes which actually create and send out the number in a load scenario message.
|
inline |
Get/set resource monitor.
References myResourceMonitor.
|
inline |
References myResourceMonitor.
|
virtual |
Returns the session id from the message interface.
|
virtual |
Returns the vrf message version from the message interface.
|
virtual |
Starts a run duration.
If there is an existing run duration cancels that duration and creates a new one. When the run duration is complete the timer is removed and the scenario is paused
|
virtual |
|
virtual |
Stops the current duration run timer.
|
static |
Callback for when duration run timer has completed.
|
virtual |
|
virtual |
Adds callbacks for simulation completion from duration timeout.
|
virtual |
|
virtual |
Sets whether or not to set the simulation time to the specified local time at todays date when the first object is created at the location of the created object.
Default is false
|
virtual |
|
virtual |
|
protected |
|
protected |
Objects we create.
|
protected |
The simulation back-end's clock.
Note that this clock is different from the clock associated with the exercise connection. The simulation time maintained by the exercise clock may be offset relative to the exercise connection's clock.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
out message interface
|
protected |
Objects we hold pointers onto for others.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by resourceMonitor(), and setResourceMonitor().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
If non-null this scenario is only scheduled to run for the given amount of time delta from the current simulation time.
|
protected |
|
protected |
|
protected |
|
protected |