![]() |
VR-Forces Developer's Guide
|
State and parameter properties are the easiest way to extend the state of VR-Forces simulation objects.
State and parameter properties can be defined in the OPE files and sysdef files of an SMS, adding new object state without the need for plug-in code. Both of the built-in EntityLevel and AggregateLevel models make heavy use of these properties.
VR-Forces users can add their own state properties and parameter properties without using the VR-Forces Toolkit. The VR-Forces Users Guide offers details on how state and parameter properties are defined in the section titled State Properties and Parameter Properties.
There are three types of properties:
External state and parameter properties are stored in separate lists within the DtStatePropertiesStateComponent of all VR-Forces simulation objects. They can be most easily accessed using the DtVrfSimulatedSimObjectFacade.
Internal state properties are stored in the DtVrfObjectStateRepository of the DtLocalObject. They can only be accessed by the local entity and its components.
More details on how to access state properties from within sim engine plug-in code can be found on the following page:
Getting and Setting State Property Values
Please see the Add State Property (addStatePropertySim) example plug-in to see some sample code.
External state properties can be accessed from a DtGuiSimObject or DtSimObjectReference. Internal state properties are not published, and therefore are not accessible in the GUI. Please see the Add State Property (addStatePropertyGui) example plug-in to see some sample code for accessing the values of state properties for an entity.
More details on how to access state properties from within sim engine plug-in code can be found on the following page:
Getting and Setting State Property Values
Other applications that use VR-Link can access external state properties by instantiating special reflected lists that support them. These are DtReflectedVrfExtEntityList, DtReflectedVrfExtAggregateList, and DtReflectedVrfControlObjectList. The VRF Message Dump (vrfMsgDump) tool has a DtVrfStatePropertyPrinter that serves as an example of how to use these classes in your own remote application.
If you wish to access external state properties in other applications that are not using VR-Link, and therefore cannot use the extended reflected lists mentioned above, state properties can be published to HLA attributes or DIS Attribute PDU records. For more details on how state properties can be published, see the following page:
Internal state properties are not published, and therefore are not accessible in remote applications.
The following table identifies the data types supported for state properties. The Data Type column indicates the name of the data type used in the C++ code. (The data types used in OPE files are slightly different.) The Description column describes the format of this type. The HLA Representation/Encoding column indicates what type should be used in an HLA 1516 FOM to match the specification in the OPE.
| Data Types Supported for State Properties and Parameter Properties | ||
|---|---|---|
| Data Type | Description | HLA Representation/Encoding |
| DtRwInt, DtRwInt32 | A 32-bit integer | RPRunsignedInteger32BE, HLAinteger32BE |
| DtRwInt16 | A 16-bit integer | RPRunsignedInteger16BE, HLAinteger16BE |
| DtRwInt8 | An 8-bit integer | RPRunsignedInteger8BE, HLAoctet |
| DtRwReal, DtRwReal64 | A 64-bit float | HLAfloat64BE |
| DtRwReal32 | A 32-bit float | HLAfloat32BE |
| DtRwBoolean | A Boolean | RPRboolean |
| DtRwString | An ASCII string | RPRnullTerminatedArray of HLAASCIIchar |
| DtRwVector | A location in geocentric coordinates | WorldLocationStruct, from the RPR FOM |
|
OPE:DtRwFixedArray | A fixed size list of items | HLAFixedArray |
|
OPE: DtRwSizedString | An ASCII string (alternate encoding for DtRwString) | HLAASCIIstring |
|
OPE: DtRwStructure | A fixed structure with multiple named fields | HLAfixedRecord with matching fields |
|
C++: DtRwPropertiesList OPE: DtRwList | A variable sized list of items | HLAvariableArray |
|
C++: DtRwPropertiesMap OPE: DtRwMap | A variable sized map of items | HLAvariableArray of HLAfixedRecords, where the first field in each record is the key |