![]() |
VR-Link API Documentation for HLA 1516
|
A reflected object is a class used to store information about an object that has been discovered on the exercise connection.
A reflected object list keeps track of multiple reflected objects. The reflected object lists also handle the callbacks associated with discovering, updating, and deleting objects. This means that when an object is published from a source that the VR-Link application can receive information from, the reflected object list is notified and handles the information according to its callback functions. For example, if an object is discovered, the reflected object list stores it. If an object is updated, the refelected object is updated.
In the F-18 example, the ReflectedEntityList is used to store multiple ReflectedEntity types. First, the reflected list is created using the exercise connection defined.
Now that the ReflectedEntityList is hooked into the exercise connection, we need to make sure the exercise connection is listening to input. To do that we use the drainInput(t) function inside the simulation's main loop. drainInput() takes a double representing the max time between updates. In f18-Sharp:
This used so that the exercise connection is constantly listening to input (negative value).
From this point we have a ReflectedEntityList that will pick up entities that are published on the exercise connection. In the f18-Sharp example, the reflected entity list is used to find the closest entity when firing a projectile. Here is an example of a way to use this information:
[<< Publishing Objects] [Home] [Top of Page] [Callbacks and Interactions >>]