![]() |
VR-Forces 4.0.4 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 | 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. | |
Protected Attributes | |
| DtScheduler * | myScheduler |
| Objects we create. | |
| DtExerciseClock * | myExerciseClock |
| The simulation back-end's clock. | |
| DtNoArgumentCallbackList | myTickList |
| DtFrameRateMonitor * | myFrameRateMonitor |
| DtVrfSimSettingsManager * | myVrfSimSettingsManager |
| DtVrfMessageInterface * | myMessageInterface |
| out message interface | |
| DtExerciseConn * | myExerciseConn |
| Objects we hold pointers onto for others. | |
| DtPhysicalWorld * | myPhysicalWorld |
| DtCommModelManager * | myCommModelManager |
| DtVrfObjectManager * | myVrfObjectManager |
| DtAggregateSpatialModel * | myAggregateSpatialModel |
| DtDetonationManager * | myDetonationManager |
| DtFireManager * | myFireManager |
| DtGlobalPlanManager * | myGlobalPlanManager |
| DtJoyDeviceManager * | myJoyDeviceManager |
| DtHostilityManager * | myHostilityManager |
| DtScenarioExtrasMgr * | myScenarioExtrasMgr |
| DtResourceMonitor * | myResourceMonitor |
| DtStealthRemoteController * | myStealthRemoteController |
| int | myTargetFrameRate |
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 DtSimManager::~DtSimManager | ( | ) | [virtual] |
destructor
| DtSimManager::DtSimManager | ( | const DtSimManager & | orig | ) | [private] |
Copy constructor - not implemented.
| DtSimManager& DtSimManager::operator= | ( | const DtSimManager & | orig | ) | [private] |
Assignment operator - not implemented.
| virtual bool DtSimManager::init | ( | ) | [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 bool DtSimManager::createExerciseClock | ( | ) | [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 bool DtSimManager::createScheduler | ( | ) | [virtual] |
| virtual bool DtSimManager::createMessageInterface | ( | ) | [virtual] |
| virtual bool DtSimManager::createFrameRateMonitor | ( | ) | [virtual] |
| virtual bool DtSimManager::createVrfSimSettingsManager | ( | ) | [virtual] |
Creates the DtVrfSimSettingsManager.
| virtual void DtSimManager::tick | ( | ) | [virtual] |
Ticks the scheduler and then all registered tick callbacks.
Calls sleep().
| virtual void DtSimManager::setTargetFrameRate | ( | int | rate | ) | [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 int DtSimManager::targetFrameRate | ( | ) | const [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 void DtSimManager::sleep | ( | ) | const [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 bool DtSimManager::deliverMessage | ( | const DtSimInterfaceMessage & | msg | ) | [virtual] |
| virtual bool DtSimManager::receiveMessage | ( | const DtSimInterfaceMessage & | msg | ) | [virtual] |
| virtual bool DtSimManager::createAndDeliverMessage | ( | const DtSimulationAddress & | recipient, |
| const DtSimInterfaceContent & | content, | ||
| bool | overrideTimestampOrder = true |
||
| ) | [virtual] |
| virtual void DtSimManager::addTickEntry | ( | DtSimTickFunction | tickFunction, |
| void * | userData | ||
| ) | [virtual] |
Callback that will be called every simulation tick of the system.
| virtual void DtSimManager::removeTickEntry | ( | DtSimTickFunction | tickFunction, |
| void * | userData | ||
| ) | [virtual] |
Callback that will be called every simulation tick of the system.
| virtual DtExerciseConn* DtSimManager::exerciseConn | ( | ) | [virtual] |
exerciseConn() provides access to the virtual network.
Use it to send or register callbacks for interactions (but see the interaction manager below).
| virtual DtExerciseClock* DtSimManager::exerciseClock | ( | ) | [virtual] |
exerciseClock() provides access to the current dT, current exercise time and current elapsed time.
| virtual DtFrameRateMonitor* DtSimManager::frameRateMonitor | ( | ) | [virtual] |
provides access to the frameRateMonitor, which is responsible for providing frame rate statistics as requested.
| virtual DtScheduler* DtSimManager::scheduler | ( | ) | [virtual] |
scheduler() is used to schedule, control, and delete internal events.
| virtual void DtSimManager::setPhysicalWorld | ( | DtPhysicalWorld * | newPhysicalWorld | ) | [virtual] |
| virtual DtPhysicalWorld* DtSimManager::physicalWorld | ( | ) | [virtual] |
| virtual const DtPhysicalWorld* DtSimManager::physicalWorld | ( | ) | const [virtual] |
| virtual void DtSimManager::setCommModelManager | ( | DtCommModelManager * | newCommModelManager | ) | [virtual] |
| virtual DtCommModelManager* DtSimManager::commModelManager | ( | ) | [virtual] |
| virtual const DtCommModelManager* DtSimManager::commModelManager | ( | ) | const [virtual] |
| virtual void DtSimManager::setVrfObjectManager | ( | DtVrfObjectManager * | entityManager | ) | [virtual] |
vrfObjectManager() provides access to all the objects in the system; both local and remote.
Objects include entities, control objects.
| virtual DtVrfObjectManager* DtSimManager::vrfObjectManager | ( | ) | [virtual] |
| virtual const DtVrfObjectManager* DtSimManager::vrfObjectManager | ( | ) | const [virtual] |
| virtual void DtSimManager::setAggregateSpatialModel | ( | DtAggregateSpatialModel * | aggregateSpatialModel | ) | [virtual] |
aggregateSpatialModel() provides an up to date view of all aggregates' location (location, velocity, orientation, and bounding geometry).
| virtual DtAggregateSpatialModel* DtSimManager::aggregateSpatialModel | ( | ) | [virtual] |
| virtual const DtAggregateSpatialModel* DtSimManager::aggregateSpatialModel | ( | ) | const [virtual] |
| virtual void DtSimManager::setDetonationManager | ( | DtDetonationManager * | detonationManager | ) | [virtual] |
Manages the detonation callbacks generated by the simulation.
Notifies the appropriate registered DtVrfObjects (entities) of detonations they should process.
| virtual DtDetonationManager* DtSimManager::detonationManager | ( | ) | [virtual] |
| virtual void DtSimManager::setFireManager | ( | DtFireManager * | fireManager | ) | [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 DtFireManager* DtSimManager::fireManager | ( | ) | [virtual] |
| virtual void DtSimManager::setGlobalPlanManager | ( | DtGlobalPlanManager * | planManager | ) | [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 const DtGlobalPlanManager* DtSimManager::globalPlanManager | ( | ) | const [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 DtGlobalPlanManager* DtSimManager::globalPlanManager | ( | ) | [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 void DtSimManager::setJoyDeviceManager | ( | DtJoyDeviceManager * | joyDeviceManager | ) | [virtual] |
joyDeviceManager() is used to access the joystick manager.
| virtual const DtJoyDeviceManager* DtSimManager::joyDeviceManager | ( | ) | const [virtual] |
| virtual DtJoyDeviceManager* DtSimManager::joyDeviceManager | ( | ) | [virtual] |
| virtual void DtSimManager::setHostilityManager | ( | DtHostilityManager * | hostilityManager | ) | [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual const DtHostilityManager* DtSimManager::hostilityManager | ( | ) | const [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual DtHostilityManager* DtSimManager::hostilityManager | ( | ) | [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual void DtSimManager::setScenarioExtrasMgr | ( | DtScenarioExtrasMgr * | scenarioExtrasMgr | ) | [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual const DtScenarioExtrasMgr* DtSimManager::scenarioExtrasMgr | ( | ) | const [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual DtScenarioExtrasMgr* DtSimManager::scenarioExtrasMgr | ( | ) | [virtual] |
The hostility manager keeps track of which forces are hostile to each other.
| virtual void DtSimManager::setStealthRemoteController | ( | DtStealthRemoteController * | controller | ) | [virtual] |
Allow access to the global stealth remote controller.
| virtual DtStealthRemoteController* DtSimManager::stealthRemoteController | ( | ) | [virtual] |
| virtual DtVrfSimSettingsManager* DtSimManager::vrfSimSettingsManager | ( | ) | [virtual] |
Returns the DtVrfSimSettingsManager.
| virtual void DtSimManager::addMessageCallback | ( | int | type, |
| DtMessageCallbackFcn | fcn, | ||
| void * | usrData | ||
| ) | [virtual] |
Add/Remove a function to be called when a particular message type is received.
| virtual void DtSimManager::removeMessageCallback | ( | int | type, |
| DtMessageCallbackFcn | fcn, | ||
| void * | usrData | ||
| ) | [virtual] |
| virtual DtVrfMessageInterface* DtSimManager::messageInterface | ( | ) | const [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 DtInterfaceMessageExecutive* DtSimManager::messageExecutive | ( | ) | [virtual] |
| static void DtSimManager::TickFunction | ( | void * | userData | ) | [static] |
This function is registered on the execution list for the sim thread (called pvPacketThread, currently).
It actually calls the simManager->tick().
| virtual void DtSimManager::registerInterfaceCallbacks | ( | ) | [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 const DtSimulationAddress& DtSimManager::messageAddress | ( | ) | const [virtual] |
This is the address that should be used as the sender for all messages originating from the backend.
| static void DtSimManager::randSeedCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callbacks registered on the simManagers Message executive.
| virtual unsigned long DtSimManager::sequenceNumber | ( | ) | [virtual] |
Gets the sequence number of the current scenario.
| virtual void DtSimManager::setSequenceNumber | ( | unsigned long | sequenceNumber | ) | [virtual] |
Sets the sequence number -- should only be called from classes which actually create and send out the number in a load scenario message.
| DtResourceMonitor * DtSimManager::resourceMonitor | ( | ) | [inline] |
Get/set resource monitor.
References myResourceMonitor.
| void DtSimManager::setResourceMonitor | ( | DtResourceMonitor * | m | ) | [inline] |
References myResourceMonitor.
| virtual int DtSimManager::vrfSessionId | ( | ) | const [virtual] |
Returns the session id from the message interface.
| virtual int DtSimManager::vrfMessageVersionSupported | ( | ) | const [virtual] |
Returns the vrf message version from the message interface.
DtScheduler* DtSimManager::myScheduler [protected] |
Objects we create.
DtExerciseClock* DtSimManager::myExerciseClock [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.
DtNoArgumentCallbackList DtSimManager::myTickList [protected] |
DtFrameRateMonitor* DtSimManager::myFrameRateMonitor [protected] |
DtVrfMessageInterface* DtSimManager::myMessageInterface [protected] |
out message interface
DtExerciseConn* DtSimManager::myExerciseConn [protected] |
Objects we hold pointers onto for others.
DtPhysicalWorld* DtSimManager::myPhysicalWorld [protected] |
DtCommModelManager* DtSimManager::myCommModelManager [protected] |
DtVrfObjectManager* DtSimManager::myVrfObjectManager [protected] |
DtDetonationManager* DtSimManager::myDetonationManager [protected] |
DtFireManager* DtSimManager::myFireManager [protected] |
DtGlobalPlanManager* DtSimManager::myGlobalPlanManager [protected] |
DtJoyDeviceManager* DtSimManager::myJoyDeviceManager [protected] |
DtHostilityManager* DtSimManager::myHostilityManager [protected] |
DtScenarioExtrasMgr* DtSimManager::myScenarioExtrasMgr [protected] |
DtResourceMonitor* DtSimManager::myResourceMonitor [protected] |
Referenced by resourceMonitor(), and setResourceMonitor().
int DtSimManager::myTargetFrameRate [protected] |