![]() |
VR-Forces 4.2 Class Documentation
|
The Remote Control API consists of several libraries.
The vrfControl library contains most of the classes that provide the top-level API for controlling VR-Forces applications. This library also uses code from several other libraries that the Remote Control API shares with the VR-Forces API. For example, both the Remote Control API and the VR-Forces API use the same classes to represent the messages that are exchanged between them.
The central class in the Remote Control API is DtVrfRemoteController, defined in vrfController.h. An application that wants to control remote VR-Forces applications needs to instantiate DtVrfRemoteController and use its member functions to send instructions to the simulation engine, for example, loadScenario(), pause(), run(), createEntity(), modifyRoute(), deleteObject(), setEntitySpeed(), or assignTask(). Please see the comments in vrfController.h for the complete list.
For example, the following code implements an application that tells remote VR-Forces applications to load the scenario called "foo.scn".
A DtVrfRemoteController uses a VR-Link exercise connection (DtExerciseConn) to send its control messages to VR-Forces applications (illustrated below). Therefore an exercise connection must be passed to its constructor. An alternate constructor allows you to pass a DtVrfMessageInterface - a wrapper around DtExerciseConn that is able to decode some VR-Forces protocol extensions. (When you use the main constructor, the DtVrfRemoteController instantiates its own DtVrfMessageInterface.)
Like all DIS and HLA applications that are based on VR-Link, applications that use the VR-Forces Remote Control API must call drainInput() periodically on the
DtExerciseConn. In HLA, this allows VR-Link to give the RTI some processing time by calling RTItick(). In both DIS and HLA, it ensures that the DtVrfRemoteController can get necessary feedback from remote VR-Forces applications, acknowledge messages, find out if VR-Forces applications have joined or left the exercise, and so on.
[<< Introduction to the Remote Control API] [Home] [Top of Page] [Choosing Which VR-Forces Applications to Control >>]