![]() |
VR-Exchange 2.6 API Documentation
|
The Portal provides a framework for creating objects (which have state) and interactions (event messages) that pass through a distributed messaging system. VR-Exchange provides many object and interaction classes in the Portal language. The Portal language is defined in the libPortal library. The table lists the objects and interactions supported by the Portal language.
Objects and interactions have attributes that describe their state, such as location, type, velocity, and target. Each attribute is a unique data field transmitted in a protocol-independent way. That means attributes cannot always be directly copied into Portal messages.
The Portal framework allows you to create new types of objects and interactions. Brokers can create, update, and delete objects, and send interactions to the Portal. They can also subscribe to the objects and interactions they want to receive from the Portal.
If you add a new object type you do not have to recompile all brokers, only those brokers that need to translate the new object type.
The job of a broker is to translate object and interaction message attributes from the broker's simulation standard to the Portal language. The translation process involves the following:
Each of these issues is highly protocol-dependent. The following sections provide a general description of how VR-Exchange's data exchange represents objects and attributes. For details, refer to the class documentation.
The Portal identifies each object by a string. The string must be unique, but this is not enforced by the Portal. Future versions of the Portal may choose to enforce this. For protocols that do not identify objects by a string, some form of conversion must be developed by the broker architect.
In the default HLA broker, objects are identified by their HLA object name.
The attribute representations used by the Portal language draw heavily on the data types used by the DIS protocol. For example, Entity Location is transmitted as three doubles: X, Y, and Z, using geocentric coordinates. This method of defining location was chosen because it is widely used by both DIS and the RPR FOM, as well as most RPR FOM variants. FOMs or protocols that use geodetic (latitude, longitude, and altitude) locations must convert to geocentric coordinates before updating location data in the Portal.
All enumeration attributes use values defined in SISO-REF-010-2005, the Enumerations document used for both DIS and the RPR-FOM. The Portal uses a macro called DtDEC_ATTRIBUTE to declare attributes for objects and interactions. For example, an attribute called DamageState might be declared like this:
This macro will create two public functions like this:
and a protected variable called:
[<< Introduction to The VR-Exchange API] [Home] [Top of Page] [The Portal API >>]