![]() |
VR-Vantage 2.2 API Documentation
|
The Driver layer drives the control interfaces.
Drivers take input from the simulation network and/or users and sends instructions to the VR-Vantage Control Interface. The job of a driver is to compose the scene. For example the DIS driver will take data from a distributed simulation and create and maintain agents (part of the control interface layer) to add entities to the scene. The scene driver will create the environment and terrain. And the input driver will take keyboard and mouse input control the observer.
Each driver is designed to be modular and may be user-controllable. Drivers can be added and removed from the display engine once it is initialized. Multiple drivers can be (and typically are) active at the same time.
A driver can be in a stopped state or a running state. Initially a driver is in the stopped state. A stopped driver is functionally inactive. Drivers can be started and stopped any number of times. When a driver is started it creates the resources it will update. While a driver is running, it creates, destroys, and updates these resources. When a driver stops, it must deallocate all allocated resources. It must restore the scene to the state that existed before the driver was started. This capability is used to reload the scene when connecting to display engines.
You can set drivers to automatically start and stop based upon the existence of windows. When a driver is running it is constantly ticked at the rate of the display engine. To ensure good performance, a driver should try to do as little work as possible in its tick() function.
The display engine supports many simultaneous running drivers. The use, configuration, and runtime behavior of drivers is application-specific. Some drivers are built into the display engine, while others are available from other VR-Vantage modules. Two important built-in drivers are the scene driver and the input driver.
The scene driver, DtSceneDriver, is the default logic for the built-in scene logic for the display engine. The scene driver owns a scene (DtScene). It can load and save the scene using the VR-Vantage scene file format. The scene driver is automatically started when the display engine is initialized. It does not perform any actions during tick(). You can extend the scene driver class by replacing the corresponding creator instance. The VR-Vantage Toolkit assumes there is a valid scene driver at all times.
Typically, VR-Vantage applications get their data from networked simulations or hosts. VR-Vantage is designed for this and most of the time the correct place for an agent to get created is in a driver. VR-Vantage includes drivers for HLA 1.3, HLA 1516, HLA Evolved, CIGI, and DIS.
Like the scene driver, the input driver is started automatically when the display engine is initialized. The input driver creates observers as requested, processes mouse events, processes key events using the Key Map Manager, and controls the observer based on the mouse and key events. It also interacts with the Selection Manager (DtSelectionManager) when processing certain mouse events. When the input driver is created, it creates the Key Map Manager. It creates the observer controller and the key and mouse event listener when it starts, and destroys them when it stops.
exampleDistributedDraw- Creates a driver that that controls a distributed draw object. | |
exampleDistributedObject - Creates a distributed object that loads a model and rotates it using an agent. | |
exampleDriver - Creates a driver and uses it to put an entity in the scene. | |
exampleDriverPlugin - Creates a driver and uses it to put an entity in the scene. | |
exampleAccessory - Shows how to create an accessory to extend a driver. | |
exampleCloudDriver - Creates a new driver that demonstrates how to create clouds based on an external data source and how to dynamically move those clouds based on wind. | |
| tutorialDistributedSimulation1 - Multi-part tutorial that creates a simple distributed simulation VR-Vantage plug-in. |
[<< The Control Interface Layer] [Home] [Top of Page] [The GUI Layer >>]