![]() |
VR-Forces 4.1.1 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 bool | createExerciseClock () |
| Exercise clock for back-end. | |
| virtual bool | createScheduler () |
| virtual bool | createMessageInterface () |
| virtual bool | createFrameRateMonitor () |
| virtual bool | createVrfSimSettingsManager () |
| Creates the DtVrfSimSettingsManager. | |
| 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 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 | 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 | 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 void | setStealthRemoteController (DtStealthRemoteController *controller) |
| Allow access to the global stealth remote controller. | |
| virtual DtStealthRemoteController * | stealthRemoteController () |
| 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 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 | 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 | 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 | 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 | 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. | |
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. | |
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 |
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 |
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.
|
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 |
scheduler() is used to schedule, control, and delete internal events.
|
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 |
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 |
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 |
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 |
Allow access to the global stealth remote controller.
|
virtual |
|
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 |
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.
|
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 |
out message interface
|
protected |
Objects we hold pointers onto for others.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by resourceMonitor(), and setResourceMonitor().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |