![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrftasks library between VR-Forces 5.2 and VR-Forces 5.3.
The vrftasks library defines the task, set-data request, report, and admin content classes that are exchanged over the simulation control protocol, so changes here affect remote control applications, plug-ins, and any code that constructs or interprets VR-Forces messages.
The 5.3 release adds hit zone targeting parameters to the weapon tasks, generalizes the sensor aiming request into an aimable system request that also serves search lights and laser lights, adds sound playback and sound query messages, and removes the Tactical Data Link messaging request along with the rest of the internal TDL subsystem.
Changes that are internal to an implementation or limited to comments are not listed.
DtSetAimSensorRequest no longer models a sensor field of view specifically. It now models any aimable system, which allows the new search light and laser light requests to derive from it. The header it pulls in, the enumeration type it uses, and two of its accessors were renamed accordingly.
The included header changed from vrfExtObjects/sensorFieldOfViewEnums.h to vrfExtObjects/aimableSystemEnums.h. Code that relied on setAimSensorRequest.h to transitively provide the sensor field of view enumerations must include the enumeration header it needs directly.
| 5.2 declaration | 5.3 declaration |
|---|---|
DtSensorTrackingMode aimingMode() const | DtAimableSystemTrackingMode aimingMode() const |
void setAimingMode(DtSensorTrackingMode) | void setAimingMode(DtAimableSystemTrackingMode) |
DtString sensorFieldOfViewId() const | DtString aimableSystemId() const |
void setSensorFieldOfViewId(const DtString&) | void setAimableSystemId(const DtString&) |
The enumerators of DtAimableSystemTrackingMode are declared in vrfExtObjects/aimableSystemEnums.h; consult that header for the current names.
The rename affects classes that derive from DtSetAimSensorRequest and override these virtual methods; an override that still declares a DtSensorTrackingMode parameter no longer overrides the base method. The aimingPoint, objectToTrack, aimingAzimuth, and aimingElevation accessors are unchanged. The protected reader/writer members were reordered and mySensorFieldOfViewId was renamed to myAimableSystemId, which affects derived classes that reference them directly.
The single ground clamp flag proved ambiguous and was replaced by a set of independent altitude controls. keepGroundClamped() was removed outright. setKeepGroundClamped(bool) was retained only as an inline forwarding call to the new setter, so existing code that sets the flag still compiles, but code that reads it does not.
Replace calls to keepGroundClamped() with keepCurrentAltitudeAboveTerrain(). Note that the meaning of the flag changed: in 5.2 it clamped the object to the ground, while in 5.3 it preserves the object's current altitude above the terrain. To place an object at a specific height above the terrain, call setUseAltitudeAboveTerrain(true) together with setAltitudeAboveTerrain. To hold an air vehicle at its current absolute altitude, call setKeepCurrentAltitude(true).
The protected member myKeepGroundClamped was removed and replaced by myAltitudeAboveTerrain, myClampAboveTerrain, myKeepCurrentAltitudeAboveTerrain, and myKeepCurrentAltitude.
The four file-scope string constants that named the built-in navigation preferences were removed from the header:
There is no replacement symbol. DtSetNavigationPreference::setNavigationPreference takes an arbitrary DtString whose value must match one of the preference strings declared in the component descriptor in the system definition file, which allows sites to define their own preferences. Code that used the constants should pass the equivalent string literal, or better, read the permitted values from the system definition rather than hard-coding them.
The system list response now reports which hit zone each component system is associated with, so addSystem gained a fourth parameter. There is no default argument, so every call site must be updated.
DtHitZoneId is declared in vrfutil/hitZoneId.h, which systemListResponseAdmin.h now includes. It pairs a zone function with a zone number and packs into an int. Pass a default-constructed DtHitZoneId when the system is not associated with a hit zone.
The ComponentSystem structure gained a public int myHitZoneId member that holds the packed identifier. Code that aggregate-initializes ComponentSystem must supply the additional member.
The class and its accessors are unchanged and code that uses it still compiles, but automatic countermeasure launching is now driven by the Evade_Missile reactive task. DtSetAutoLaunchEnabledRequest is retained only so that scenarios authored against 5.2 continue to load; sending it does not change entity behavior. Replace its use with the reactive task.
The set message type constant for Tactical Data Link messaging was removed along with the request class:
See Removed Headers below.
The weapon tasks can now name the hit zone function that the shot should be directed at, which lets a task target a specific subsystem of an entity rather than the entity as a whole. The same pair of accessors was added to four tasks:
The zone function values are the DtHitZoneFunction... constants declared in vrfutil/hitZoneId.h: DtHitZoneFunctionUnspecified, DtHitZoneFunctionWeapon, DtHitZoneFunctionSensor, DtHitZoneFunctionMovement, and DtHitZoneFunctionAny.
The new header vrftasks/setHitZoneStatusRequest.h defines DtSetHitZoneStatusRequest, a DtSetDataRequest that sets the damage state of an individual hit zone. Its message type is DtSetHitZoneStatusType.
It follows the standard request construction pattern: a default constructor, a constructor taking a write name and an optional DtReaderWriterRegistry*, a copy constructor of the same shape, and a static creator().
The ballistic gun task can now specify the munition to fire, overriding the controller's default selection:
DtFireForEffectTask gained two options that control how the impact altitude is computed:
applyHeightAboveTerrain gates the existing heightAboveTerrain value, and allowTargetInsideStructure permits an aim point that falls inside a structure.
The expendable resource type is now optional. When it is not set, the task can instead name the type of the threat being defended against, and the controller chooses a suitable expendable:
DtFollowEntityTask gained an optional aiming reference, which is either a geocentric point or an entity whose location is resolved each tick:
The new header vrftasks/absoluteFollowEntityTask.h defines DtAbsoluteFollowEntityTask, a DtSimTask that follows an entity at a fixed world-frame offset rather than an offset expressed in the followed entity's body frame. Its message type is DtAbsoluteFollowEntityTaskType.
The offset accessors are entityToFollow, absoluteBearing (radians clockwise from true north), horizontalDistance (meters), and relativeAltitude (meters above the followed entity). It carries the same optional aimingPoint reference as DtFollowEntityTask.
The orbit task can now hold an altitude offset relative to the orbit center or orbited object:
The convenience constructor gained a corresponding trailing parameter with a default value, so existing calls compile unchanged:
Two new requests derive from DtSetAimSensorRequest and reuse its aiming point, tracked object, azimuth, elevation, aiming mode, aimable system ID, and power state parameters.
vrftasks/setAimSearchLightRequest.h defines DtSetAimSearchLightRequest, whose message type is DtSetAimSearchLightType, and which adds:
vrftasks/setAimLaserLightRequest.h defines DtSetAimLaserLightRequest, whose message type is DtSetAimLaserLightType, and which adds:
The new header vrftasks/setTerrainAvoidanceRequest.h defines DtSetTerrainAvoidanceRequest, which enables or disables terrain avoidance on a rotary-wing pilot or any other component registered for DtSetTerrainAvoidanceType:
The new header vrftasks/setSignalFlagsRequest.h defines DtSetSignalFlagsRequest, which sets the signal flags flown by a vessel. Flags are organized as a list of halyards, each holding several flags, represented by DtRwNavigationSignalFlagVectorList from vrfutil/rwNavigationSignalFlagVector.h. Its message type is DtSetSignalFlagsType.
DtSetSurfaceVesselLightingRequest gained four light groups, each with the same getter, setter, and specified-predicate triple used by the existing light groups:
| Light group | Accessors |
|---|---|
| Aground | agroundLightsOn, setAgroundLightsOn, agroundLightsOnSpecified |
| Constrained by draft | constrainedByDraftLightsOn, setConstrainedByDraftLightsOn, constrainedByDraftLightsOnSpecified |
| Man overboard operation | mobOperationLightsOn, setMobOperationLightsOn, mobOperationLightsOnSpecified |
| Signal | signalLightsOn, setSignalLightsOn, signalLightsOnSpecified |
vrftasks/playSoundTask.h defines DtPlaySoundTask, a DtSimTask that plays a sound on an entity. Its message type is DtPlaySoundTaskType and the sound is identified by a DIS/RPR entity type enumeration:
vrftasks/soundListRequestAdmin.h defines DtSoundListRequestAdmin, an admin content with no payload that queries the sounds available on an entity. Its message type is DtRequestSoundListAdminType.
vrftasks/soundListResponseAdmin.h defines DtSoundListResponseAdmin, the corresponding response, whose message type is DtSoundListResponseAdminType. The header also declares two supporting typedefs:
The response exposes the list directly through const and non-const soundTypes() accessors, plus addSoundType(const DtRwSoundType&) and clearSoundTypes().
vrftasks/requestNotifyLevelAdmin.h defines the functor DtRequestNotifyLevelAdminTypeFunctor and the typedef DtRequestNotifyLevelAdmin, which is a DtNoDataAdminContent specialization that asks for an entity's current notify level. Its message type is DtRequestNotifyLevelAdminType.
vrftasks/requestNotifyLevelResponseAdmin.h defines DtRequestNotifyLevelResponseAdmin, the corresponding DtAdminContent response, whose message type is DtRequestNotifyLevelResponseAdminType:
DtSpotReport gained equality operators, so reports can be compared directly rather than field by field:
It also gained the sending simulation address and the perceived symbol identification code of the contact:
The protected member mySender was added. Note that mySender is a plain DtSimulationAddress rather than a reader/writer member.
setSpotReportingRequest.h declares a fourth spot reporting mode constant:
When effective reporting is currently disabled, this mode enables reporting and routes reports only to the GUI, preserving the existing reporting and receiver settings. The normal receiver fields of the request are ignored in this mode. The existing constants DtSetSpotReportingRequestOff, DtSetSpotReportingRequestOn, and DtSetSpotReportingRequestUseGlobalSetting are unchanged.
A new overload accepts a vector of entity types, which allows a scripted task parameter to carry a list of munition or platform types:
radioMessageTypes.h declares the following identifiers for the new messages described above, plus DtSetSidcSetType, which names the scripted set that assigns a symbol identification code.
| Constant | Kind | Wire name |
|---|---|---|
DtRequestNotifyLevelAdminType | DtAdminContentMessageType | notify-level-request |
DtRequestNotifyLevelResponseAdminType | DtAdminContentMessageType | notify-level-response |
DtRequestSoundListAdminType | DtAdminContentMessageType | sound-list-request |
DtSoundListResponseAdminType | DtAdminContentMessageType | sound-list-response |
DtSetSignalFlagsType | DtSetMessageType | set-signal-flags |
DtSetAimSearchLightType | DtSetMessageType | set-aim-search-light |
DtSetAimLaserLightType | DtSetMessageType | set-aim-laser-light |
DtSetTerrainAvoidanceType | DtSetMessageType | set-terrain-avoidance |
DtSetHitZoneStatusType | DtSetMessageType | set-hit-zone-status |
DtSetSidcSetType | DtSimTaskMessageType | set_sidc |
DtAbsoluteFollowEntityTaskType | DtSimTaskMessageType | absolute-follow-entity |
DtPlaySoundTaskType | DtSimTaskMessageType | play-sound-task |
The following identifier was removed:
| Constant | Kind | Wire name |
|---|---|---|
DtSetTDLMessagingType | DtSetMessageType | tdl-messaging-request |
The header and the DtSetTDLMessagingRequest class it declared were removed together with the internal Tactical Data Link subsystem. The associated message type constant DtSetTDLMessagingType was removed from radioMessageTypes.h at the same time.
There is no replacement. Applications that sent TDL messaging requests must implement the equivalent data link behavior themselves, either as a plug-in that defines its own set data request type or by using DtSetTargetRequest and the standard engagement messages where those are sufficient. The \link tdlmessagesim TDL Message Sim \endlink example that demonstrated the request was removed as well.
| Header | Breaking | Additions |
|---|---|---|
absoluteFollowEntityTask.h | None | New header; DtAbsoluteFollowEntityTask |
fireBallisticGunTask.h | None | hitZoneFunction; ammoType |
fireCruiseMissileTask.h | None | hitZoneFunction |
fireForEffectOnTargetTask.h | None | hitZoneFunction |
fireForEffectTask.h | None | applyHeightAboveTerrain; allowTargetInsideStructure |
fireMissileLauncherTask.h | None | hitZoneFunction |
followEntityTask.h | None | aimingPoint |
launchExpendableResourceTask.h | None | targetType |
orbitTask.h | None | relativeAltitude; constructor default argument |
playSoundTask.h | None | New header; DtPlaySoundTask |
radioMessageTypes.h | DtSetTDLMessagingType removed | Twelve new message type constants |
requestNotifyLevelAdmin.h | None | New header; DtRequestNotifyLevelAdmin |
requestNotifyLevelResponseAdmin.h | None | New header; DtRequestNotifyLevelResponseAdmin |
scriptedTaskTask.h | None | setValue overload for std::vector<DtEntityType> |
setAimLaserLightRequest.h | None | New header; DtSetAimLaserLightRequest |
setAimSearchLightRequest.h | None | New header; DtSetAimSearchLightRequest |
setAimSensorRequest.h | Tracking mode type and aimable system ID accessors renamed; enum header changed | objectToTrackRelativeOffset; powerOn |
setAutoLaunchEnabledRequest.h | Deprecated; no longer affects behavior | None |
setHitZoneStatusRequest.h | None | New header; DtSetHitZoneStatusRequest |
setLocationRequest.h | keepGroundClamped removed | keepCurrentAltitudeAboveTerrain; keepCurrentAltitude; useAltitudeAboveTerrain; altitudeAboveTerrain |
setNavigationPreference.h | Navigation preference string constants removed | None |
setSignalFlagsRequest.h | None | New header; DtSetSignalFlagsRequest |
setSpotReportingRequest.h | None | DtSetSpotReportingRequestEnableToGuiIfOff |
setSurfaceVesselLightingRequest.h | None | Aground, constrained by draft, man overboard, and signal light groups |
setTDLMessagingRequest.h | Header removed | None |
setTerrainAvoidanceRequest.h | None | New header; DtSetTerrainAvoidanceRequest |
soundListRequestAdmin.h | None | New header; DtSoundListRequestAdmin |
soundListResponseAdmin.h | None | New header; DtSoundListResponseAdmin; DtRwSoundType and DtSoundTypeList typedefs |
spotReport.h | None | operator==; operator!=; sender; contactSidc |
systemListResponseAdmin.h | addSystem gained a required DtHitZoneId parameter | ComponentSystem::myHitZoneId |
Return to VR-Forces 5.3 API Migration Guide.
[Home]