![]() |
VR-Forces Developer's Guide
|
The API Migration Guide is written for developer's to understand what changes to the API are most likely to affect any previous plugins or remote control applications they may have developped.
While the VR-Forces API undergoes many changes that may not be listed here, most are unlikely to affect existing code.
Addendums to this Guide may also be posted to the MAK Knowledge Base after release.
Changes that might affect scenarios or simulation model sets rather than code are documented in the separate VR-Forces Migration Guide.
The class DtObjectType (which was a subclass of DtEntityType that added the notion of a superType), has been removed. If you have code that references this class, replace that class with DtEntityType. If you have used the constructor that takes the super type as an argument, simply remove it.
If you have used the superType() in any conditional statements to determine if an object is an aggregate, this check can be substituted for kind() == 11.
Previously there were many tasks which were duplicated to support handling both a location and a simulation object. For example, DtMoveToLocationTask moved to a location and DtMoveToTask moved to a waypoint. These tasks have been merged into a single task and associated code for the old task has been removed. These tasks, when merged, have changed to use the new DtRwLocationReference class which can contain either a vector location or a uuid of an object to reference.
For scenario loading this should have no visible effect. Scenarios, when loaded or imported, will have their tasks automatically changed to the new tasks. When saved the scenario will contain only the new tasks.
The following scripted tasks have been changed from location/waypoint versions to using a location reference entry widget. While the Location version of the tasks have been depreceted, in order to support their editing in current plan dialogs the UI still exists. Newly created tasks will show the location reference entry widget
The DtRotaryWingMoveToLocationController, DtMissileTrackEntityController, DtGroundMoveToLocationController, DtFixedWingMoveToLocation, DtDisaggregatedMoveToLocation, and DtSurfaceEntityMoveToLocationController have been removed and functionality they had needed have been moved into the base controller class. If you have subclassed any of these controllers you can now subclass their parent controllers to add your overridden functionality.
The DtTaskLaseLocation, DtReleaseBombOnLocation, DtTaskMoveToDestination, DtTaskFFE, DtTaskFFL, DtTaskMoveToLocation have all been removed.
Most joystick controls in VR-Forces have been deprecated. Some minimal controls have been maintained. Other controls that were previously supported have been moved to an example. This example is not supported, but is provided as a basis for plugin developer's who wish to create their own joystick plugins.
The DtBallisticGunJoy, DtBallisticGunJoyController, DtFixedWingJoyFlightController, DtGroundJoyTurretController, DtRotaryWingJoyDeviceControllerDescriptor, and DtRotaryWingJoyFlightController sim components have been moved to the new example.
Previously, resources in VR-Forces were of three types: Integer, Real or Munition. For 5.2 this has been collapsed into a single concept of a resource that has a DIS enumeration, a current amount and a full amount. No longer will resources be referenced by a string name nor differentiate between a type. There is only a single type of resource, and that is the DtSimResource.
Resources, now, can also be in multiple "locations" in the resource manager. This answers the question of "how can an entity that is a fuel provider also consume fuel?". There are two default locations defined for resources – Unspecified and Cargo. These locations are defined in the VR-Forces enumarations file:
<enum uid="1000000" name="VR-Forces Resource Bins" footnote="Enumerated Types for VR-Forces resource bins."> <enumrow value="0" description="Unspecified"> <enumrow value="1" description="Cargo"> </enum>
There is no limit to the number of locations available, and, new locations can be added in code. If there is no enumeration for it, it will show up on the GUI as "VR-Forces Resource Location <number>".
For details on how to upgrade an existing SMS to use the new resources, please see the main VR-Forces Migration Guide (as opposed to this API Migration Guide).
The ground vehicle movement system has changed extensively. This has resulted in new movement tasks that have replaced the old ones, and in some cases may produce different results. Existing Lua scripts, plugins, and remote-control applications that issue movement tasks to ground vehicles may need to be updated. Please see the user’s level VR-Forces Migration Guide for details on which 5.2 ground vehicle movement tasks should replace existing 5.1.1 tasks.
Most terrain intersection functions in DtPhysicalWorld and DtAttachedTerrain and some other related classes have been modified to use a new style API that allows for specifcation of new options, specified in DtTerrainIntersectOptions class. The DtTerrainInterface API did not change significantly, since it already had the new-style API allongside the old API.
Upgrading terrain API calls:
The new DtTerrainCategoryMask option allows terrain intersections to run against only a subset of the terrain, which can greatly improve terrain paging speed by avoiding page-in of data sources that are not required for paricular intersections. It is highly suggested that you pass only the most restrictive mask applicable to your intersection call for best performance.
The notification system for the terrain changes has been refactored. Clients can register a callback function through the function DtTerrainInterface::addTerrainChangeNotificationCallback(). The callback will be invoked when changes in the terrain occur - i.e. caused by craters, switch nodes, destructible buildings, etc.
Callback functions for processing terrain changes should follow this function signature.
To register the callback:
Although the previous mechanism for terrain change notifications (using DtTerrainInterface::queryDynamicTerrainFeatures()) is still available, it is recommended to use the new mechanism instead, as it returns a smaller area containing the location of the terrain change, as opposed to the queryDynamicTerrainFeatures() which returns the entire terrain tile containing the changed area.
The DtInitializeVrfSettings entry point for sim engine plugins has been changed to pass in a pointer to the DtCgf. The prototype of the entry point has changed from:
to:
The initializeCommandLineArguments function in GUI plugins has changed to take a makVrv::DtVrvCommandLineProcessor from a makVrf::DtVrfGuiCommandLineParser. This allows the entry point to be used for either a GUI plugin or a Simulation Object Editor plugin. Please dynamically cast to either a DtVrfGuiCommandLineParser or DtSimulationObjectEditorCommandLineParser to get the correct class. See interfacemanipulation for more information.
DtStateView, DtSimEntry and all references to data in the simData() and DtVrfStateViewCollectionManager have been removed and replaced with the DtVrfGuiSimObjectManager. Objects in the GUI can now be referenced in much the same manner as they are in the back-end. There is no longer a need for update rates or forcing updates. You can retrieve a DtSimObject in the GUI from the DtVrfGuiSimObjectManager and use the API in the GUI to reference object data in much the same way you do in the sim engine.
For more information please reference:
VR-Forces is now using version 1.84.0 of the Boost libraries.
Boost smart pointers have been replaced with the equivalent C++ smart pointers.
std::auto_ptr is not longer used.
The rewind functions have been replaced by rollback functions.
Removed:
Replaced:
In the DtRemoteEnvironmentController, the visibility accessor functions setVisibility() and visibility() have been replaced by setVisibilityAndObscurant() and visibilityAndObscurant(). These set and retrieve both the visibility and the obscurant at the same time. Visibility and obscurant are corelated environmental parameters and must to be set together.
The AIEnabled state property has been renamed AutonomousActionsEnabled. Any plugins that referenced this property should be updated to reference the new property name.
State properties can now be either internal or external. As a result, the state-data section of the OPE and sysdef files in any Simulation Model Sets may be renamed to external-state-data, though the state-data name will work as an alias for this. It is recommended that any unpublished state properties be moved to a new internal-state-data section, as internal properties have better performance. Published state properties must be in external-state-data. Please see the Developer’s Guide section on State and Parameter Properties for more information on state properties.
[Home]