![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the vrfmodel library between VR-Forces 5.2 and 5.3.
vrfmodel contains the simulation controllers, actuators, and sensor components that toolkit and plug-in developers most often subclass, so a change to a virtual function signature in this library is a compile-time break for any derived class that overrides it.
The following public headers changed in a way that affects application source code:
vrfmodel/aggregateAntiAirController.hvrfmodel/aggregateIndirectFireController.hvrfmodel/aggregateReleaseBombController.hvrfmodel/aimWeaponController.hvrfmodel/airRefuelSupplierController.hvrfmodel/airVehicleSetController.hvrfmodel/automotiveActuatorComponent.hvrfmodel/ballisticGun.hvrfmodel/ballisticGunController.hvrfmodel/bindableLuaComponent.hvrfmodel/convoyTaskController.hvrfmodel/cruiseMissileLaunchController.hvrfmodel/damageAdjudicationActuator.hvrfmodel/diGuyController.hvrfmodel/disaggregatedFormationController.hvrfmodel/disaggregatedSetController.hvrfmodel/fixedWingActuatorComponent.hvrfmodel/fixedWingEmbarkationController.hvrfmodel/fixedWingEntitySetController.hvrfmodel/fixedWingHoldController.hvrfmodel/genericWeaponInfo.hvrfmodel/groundAutoControllerComponent.hvrfmodel/groundMoveToDestinationControllerComponent.hvrfmodel/groundMoveToObstacleAvoider.hvrfmodel/humanDamageActuator.hvrfmodel/humanMovementActuator.hvrfmodel/humanWeaponStateActuator.hvrfmodel/iffControllerComponent.hvrfmodel/indirectFireWeaponController.hvrfmodel/integratedLaserGuidedLauncherController.hvrfmodel/javelinLauncherController.hvrfmodel/laserGuidedLauncherController.hvrfmodel/lasingController.hvrfmodel/launchExpendableResourceController.hvrfmodel/launcherActuator.hvrfmodel/launcherController.hvrfmodel/localEntitySetController.hvrfmodel/loiterMunitionLaunchController.hvrfmodel/missileMoveToControllerComponent.hvrfmodel/multipleHitDamageActuator.hvrfmodel/munitionLaunchController.hvrfmodel/navigationPreferenceController.hvrfmodel/objectSensor.hvrfmodel/provideIndirectFireController.hvrfmodel/resupplyReceiverController.hvrfmodel/resupplySupplierController.hvrfmodel/roadDrivingLogic.hvrfmodel/roadMovementController.hvrfmodel/roadObstructionFinder.hvrfmodel/roadPathFunctions.hvrfmodel/roadSegment.hvrfmodel/rotaryWingActuatorComponent.hvrfmodel/rotaryWingFollowEntityController.hvrfmodel/rotaryWingLoiterControllerComponent.hvrfmodel/scriptMultiTaskController.hvrfmodel/sensorGimbalController.hvrfmodel/shipAisController.hvrfmodel/signatureObjectSensor.hvrfmodel/simpleRotaryWingPilot.hvrfmodel/spotReportGeneratorController.hvrfmodel/tacticalGraphicSetController.hvrfmodel/turretAcquireController.hvrfmodel/turretReturnToHeadingController.hvrfmodel/warheadDetonationActuator.hvrfmodel/weaponController.hNew headers and removed headers are listed in the Additions and Removed Headers sections. Changes that are internal to an implementation or limited to comments are not listed.
VR-Forces 5.3 introduces hit zones, which let a weapon aim at a named functional region of a target entity rather than at its center. Every createFireTask entry point therefore takes an additional DtU8 hitZoneFunction argument. This is the single most widely felt break in this library: the method is virtual on eight controllers, and any override must be updated or it will silently stop participating in dispatch.
Pass 0 for hitZoneFunction to request the previous behavior of aiming at the entity as a whole. The affected declarations are:
DtGenericWeaponInfo::FireTaskFcn changed in step. Any code that installs a fire-task callback with setFireTaskFcn must supply a callable with the new three-argument shape:
munitionType is the caller's preferred munition, normally the result of a prior bestMunitionForTarget query. Pass DtEntityType::nullType() when there is no preference. Controllers whose task type has no ammunition field ignore the argument.
The type-only ammunition predicate was removed throughout the weapon controller hierarchy and replaced by a location-aware selector that reports both the chosen munition and the reason each candidate was accepted or rejected.
DtGenericWeaponInfo lost targetAmmunition and setTargetAmmunitionFcn, along with the TargetAmmunitionFcn typedef and the myTargetAmmunitionFcn member:
MunitionEvaluationReasons maps each evaluated munition type to a human-readable string. The selected munition maps to "selected"; rejected munitions map to a rejection reason such as "no stock", "OutOfRange", or "NoSolution".
DtWeaponController::targetAmmunition and DtBallisticGunController::targetAmmunition were removed outright. A subclass that overrode either one must delete the override and, if it supplied custom selection logic, reimplement it as an override of bestMunitionForTargetNoSideEffects on the relevant controller. That method is new in 5.3 and is declared on DtBallisticGunController, DtIndirectFireWeaponController, DtLauncherController, DtCruiseMissileLaunchController, DtLaserGuidedLauncherController, DtIntegratedLaserGuidedLauncherController, and DtLoiterMunitionLaunchController:
Unlike the older chooseAmmo path, this query has no side effects: it does not set the current munition type, manipulate loaders, set status bits, or log warnings.
DtBallisticGunController declares its own MunitionEvaluationReasons typedef with the same definition, and its bestMunitionForTargetNoSideEffects is non-const.
withinTargetRegion, setTargetRegionFcn, and positionWithinTargetRegion are still present but are now marked [[deprecated]]. They are no longer installed through setTargetRegionFcn by the built-in controllers, and are retained only so that existing subclasses continue to compile and so that indirect-fire and cruise-missile controllers keep working until they migrate.
| Deprecated declaration | Replacement |
|---|---|
DtGenericWeaponInfo::withinTargetRegion | bestMunitionForTarget / canEngageTarget on the PSR |
DtGenericWeaponInfo::setTargetRegionFcn | setCanEngageTargetFcn on DtVrfTurretedBalGunPSR |
DtWeaponController::positionWithinTargetRegion | canEngageTarget on the PSR |
DtBallisticGunController::positionWithinTargetRegion | canEngageTarget on the PSR |
Builds that treat deprecation warnings as errors will fail until the call sites are moved to the canEngageTarget / canAcquireTarget / canFaceTarget chain installed on the process state repository.
createMountPartList was replaced by a setter that takes the whole list at once, and it is no longer virtual:
Code that called createMountPartList once per part must accumulate the parts into a std::list<DtArtPartType> and make a single setMountPartList call.
The weapon priority accessors and their backing member were removed entirely:
There is no replacement. Weapon ordering is now decided by the engageability chain and by bestMunitionForTarget rather than by a static priority value.
The three kill predicates changed signature and became pure virtual, so every derived damage adjudication actuator must implement all three:
Code that previously called isMobilityKilled() to query the entity's current state should call the new state accessors instead. These are not pure virtual and carry the meaning the old is...Killed methods had for callers:
In the opposite direction, adjudicateDirectDamage and adjudicateCollateralDamage are no longer pure virtual and now have base-class implementations. A derived class that only existed to satisfy those two pure virtuals can drop its overrides.
The base class also gained determineMobilityKilled, determineFirepowerKilled, and determineSensorsKilled, which check for hit zones associated with each function, apply the damage rules to them, and fall back to the corresponding set...Killed call when no such zone exists. These are the methods that invoke the pure virtual is...Killed predicates.
Three protected virtuals changed shape. Results that were previously written to member state are now returned through out parameters.
Note that checkDamageType also lost the default argument on isDirectDamage, so single-argument calls no longer compile. setDamagePoints was replaced by addDamagePoints, which takes the increment* rather than the new absolute total and returns the resulting total.
The three-argument setLocation overload replaced its bool keepOnGround flag with an integer mode flag plus an explicit altitude:
The two-argument setLocation(DtVector, bool keepOnGround) overload is unchanged. The same change applies to the overrides in DtAirVehicleSetController and DtFixedWingEntitySetController, and DtTacticalGraphicSetController gained an override with the new signature. Any subclass of these controllers that overrides setLocation must be updated.
vrfSensorFieldOfView.h now includes vrfExtObjects/aimableSystemEnums.h instead of vrfExtObjects/sensorFieldOfViewEnums.h, and the tracking-mode accessors changed type:
DtObjectSensor::trackingMode changed in the same way, and objectSensor.h switched to the same header. Code that stores a tracking mode in a variable of type DtSensorTrackingMode, or that switches on its enumerators, must move to DtAimableSystemTrackingMode.
Almost every accessor on DtVrfSensorFieldOfView also became virtual, and several changed their return type to add a top-level const:
The radius, half-angle, azimuth limit, elevation limit, zoom, and color accessors were virtualized the same way. Existing call sites compile unchanged; classes that derive from DtVrfSensorFieldOfView and shadowed these names now override them instead.
DtAggregateIndirectFireController, DtAggregateAntiAirController, and DtAggregateReleaseBombController no longer derive directly from DtScriptEnableController:
DtAggregateWeaponPowerController is itself derived from DtScriptEnableController, so upcasts to that type still work. What changed is the extension point. Each of the three controllers removed its preFirstTickInit override and now implements two pure virtuals from the new base:
A subclass of any of the three that overrode preFirstTickInit to set up weapon power must move that logic into setIndirectPowerBindings and report its weapon name from weaponName. A subclass that derives directly from DtAggregateWeaponPowerController must implement both, because they are pure virtual.
The automatic countermeasure launch feature was removed from this controller. The following protected virtuals and members no longer exist:
setAutoLaunchEnabledCallback and processSetAutoLaunchEnabled survive but moved from the public to the protected section and are themselves deprecated; the implementation now only prints a warning. There is no replacement within this controller. Applications that relied on automatic countermeasure release must drive it from a task or script.
The aim point is now resolved internally from the target reference and hit-zone function rather than being passed in pre-computed. Passing a pre-baked, hit-zone-adjusted location caused the point to go stale for moving targets, so that input was removed.
When target is valid the aim point is taken from the target's current position and the hit-zone function. When target is invalid the aim point comes from the fire mission's currentTargetLocation(), which is the pure-location fire case.
Two further changes in the same class:
muzzleLocalPosition now returns by value. Code that bound its result to a const DtVector& reference still compiles, but the reference no longer aliases controller state.
The allow-elevation-aiming input port and its protected member were removed:
myAllowAzimuthAimingPort is unchanged. Subclasses that read the elevation-aiming port must be updated; there is no replacement port.
The obstacle avoider was reworked to score several hypothetical paths rather than a single heading, and its protected virtuals changed accordingly. Every one of the following is virtual, so overrides must be updated.
| 5.2 declaration | 5.3 change |
|---|---|
computeSpeedAndScoreForStraightAhead(...) | Added bool goalIsInThisDirection before the out parameters |
computeSpeedConstraintFromDynamicObstacle(...) | Added leading DtString label, double currentMinTurnRadius, and trailing DynamicObstacleInfo& info |
computeSpeedConstraintFromStaticObstacle(...) | Added trailing double distanceOfGoalAhead; method is now const |
updateBestScoreAndSpeed(...) | Trailing applyYield / isStatic flags replaced by const SpeedConstraint& constraint |
combinedScore(...) | Trailing yieldTo / isStatic flags replaced by const SpeedConstraint& constraints |
putFeatureInCache(const MAKVRinTerra::DtFeature&) | Now takes const MAKVRinTerra::DtFeatureGeometry& |
dynamicObstacleVisualization(DtExtent&) | Removed; see the new visualization methods below |
The obstacle set member changed type in line with the features library rework:
dynamicObstacleVisualization was replaced by a set of narrower virtuals that report their results through out parameters: pathSearchVisualization, entityReferenceFrameVisualization, entityBoundingBoxVisualization, entityTurnRadiusVisualization, and entityPathVisualization. The DynamicObstacleInfo, HypotheticalPathInfo, and StraightPathInfo structs used by these methods are new nested types on the class.
DtLaneSegment in roadSegment.h was declared final, its destructor is no longer virtual, and every member function lost the virtual keyword:
Any class deriving from DtLaneSegment will fail to compile. Lane behavior must be customized through the road driving logic and path functions instead. The full set of devirtualized members is clone, laneGeometry (both overloads), trafficControlDevice, setTrafficControlDevice, laneNumber, setLaneNumber, parentRoadSegment, setParentRoadSegment, generateFirstHalfLanePoints, generateSecondHalfLanePoints, connectingDownstreamLane, setConnectingDownstreamLane, connectingUpstreamLane, setConnectingUpstreamLane, calculateInsideEntryCurveGeometry, calculateEntryCurveGeometry, calculateInsideExitCurveGeometry, and calculateExitCurveGeometry. Signatures are otherwise unchanged.
The signature and behavior are unchanged; the name now reflects that the return value is a lane number rather than a position along the lane.
The road preference is no longer a Boolean; it names the preference to apply.
Because bool does not implicitly convert to DtString, existing calls will fail to compile rather than silently change meaning.
The argument is interpreted as a signed throttle value rather than an acceleration. Overrides must be renamed.
The missile path and bounding-box center are now derived internally:
Initialization moved from preFirstTickInit to postAddComponentsInit, and lookupAndCachePSR now reports whether the lookup succeeded. Overrides of either must be updated; a lookupAndCachePSR override must return true on success.
The body-velocity cache and the disabled pitch and roll calculation stubs were removed:
The calculatePitchAcceleration, calculatePitchRate, calculateRollAcceleration, and calculateRollRate declarations, which were already inside an #if 0 block, were deleted as well. Subclasses that read myBodyVelocity must compute it from the entity's velocity and orientation.
The TDL messaging message handler was removed and replaced by a symbol-code handler:
This is part of the removal of the internal Tactical Data Link subsystem described under Removed Headers**.
Three accessors became const. Overrides that are not const-qualified no longer override the base declaration and will be flagged by the override specifier, or silently hide the base method if the specifier is absent.
| Class | 5.2 | 5.3 |
|---|---|---|
DtAirRefuelSupplierController | virtual double selfRefuelMaxRate(); | virtual double selfRefuelMaxRate() const; |
DtResupplyReceiverController | virtual double lookupMaxRate(const DtEntityType& type); | virtual double lookupMaxRate(const DtEntityType& type) const; |
DtRoadObstructionFinder | void getBoxPointsFromVolume(Dt3dBoundingVolume&, DtVector&, DtDcm&, ...) | void getBoxPointsFromVolume(const Dt3dBoundingVolume&, const DtVector&, const DtDcm&, ...) |
A new allowOverrideSpeedLimit flag was inserted before the trailing debug argument, so calls that passed debug positionally now bind it to the wrong parameter:
Review every call site that passed an explicit debug value.
Existing call sites are unaffected. A derived class that previously defined a same-named method now overrides the base method rather than hiding it, which changes which implementation runs through a base-class pointer.
vrfmodel/aggregateWeaponPowerController.h defines a new abstract base for aggregate weapon controllers, derived from DtScriptEnableController. It centralizes indirect-fire power bookkeeping that was previously duplicated in each aggregate controller's preFirstTickInit. Derived classes implement weaponName and setIndirectPowerBindings; the base provides preFirstTickInit, postAddComponentsInit, and the protected updateIndirectFirePower(bool overwriteExistingValues).
Five new headers implement controllable search lights and laser lights as first-class aimable systems:
vrfmodel/vrfSearchLight.h defines DtVrfSearchLight, a wrapper over makVrf::DtSearchLightStateComponent with accessors for power, relative location and orientation, targeted entity and location, tracking mode, light type, intensity, range, cone angle, and color.vrfmodel/searchLightController.h defines DtSearchLightController, a DtSingleTaskControllerComponent with Lua bindings that handles the set-aim-search-light task, supports point, angle, object-tracking, and scanning aiming modes, and manages the azimuth and elevation articulated parts.vrfmodel/searchLightActuator.h defines DtSearchLightActuator, the DtActuatorComponent that drives the articulated parts and publishes the search light limits on output ports.vrfmodel/vrfLaserLight.h and vrfmodel/laserLightController.h / vrfmodel/laserLightActuator.h provide the equivalent trio for laser lights, with DtVrfLaserLight exposing signal, spread, and wavelength in place of the search light's photometric properties.vrfmodel/rotaryWingFlyIntoController.h defines a rotary-wing counterpart to the existing fixed-wing fly-into controller. It derives from DtRotaryWingMoveToControllerComponent and handles the crash-into task for both object and location targets, exposing processCrashInto, processCrashIntoObject, and processCrashIntoLocation along with overrides for velocity control and desired position.
vrfmodel/playSoundController.h defines a DtSingleTaskControllerComponent that plays a sound event for a given entity type. It exposes sendSoundEvent(const DtEntityType&), durationForSoundType(const DtEntityType&) const, and a request handler processRequestSoundList(const DtVrfObjectMessage*) that reports the available sounds.
vrfmodel/signalFlagsSetController.h defines a DtSetController that handles the set-signal-flags message, maintains a DtSignalFlagControllerPSR, and publishes the flag state as a state property through publishSignalFlagsStateProperty.
A new header with two free functions supporting the hit-zone feature:
Two new virtuals answer whether a target can be engaged, without the side effects of the old target-region path:
Both are registered on the process state repository from postAddComponentsInit, so engagement gating can query them without holding a pointer to the controller. canFaceTarget is permissive: it returns true when the required articulated parts cannot be resolved.
DtWeaponController gained a target-with-offset path that combines entity and location targeting:
DtMunitionLaunchController gained provider callbacks for the target hit-zone offset and function (provideTargetHitZoneOffset, targetHitZoneFunction, processProvideTargetHitZoneOffset, processTargetHitZoneFunction), and DtMissileMoveToControllerComponent gained setTargetEntityAndHitZone(const DtUUID&, const DtVector&) and targetHitZone().
DtObjectSensor gained targetObjectOffset() and a matching target-object-offset input port, so a sensor can be aimed at a point relative to its target rather than at the target's origin.
New protected virtuals support peacetime preloading and per-loader munition selection:
preferLoadedIfApplicable lets a selector keep the round that is already in the tube when it is applicable to the target, avoiding a wasteful unload and reload cycle. The hysteresis window used by shouldPreloadNow is exposed as the static constant PreloadHoldSeconds.
ballisticGun.h gained methods for computing and executing a ballistic solution directly:
Beyond the breaking changes above, the actuator gained hit-zone queries and debug visualization:
It also overrides updateTaskVisualizations and updateImgui, returns true from taskVisualizationsActive, and adds updateDirectHitTaskVis, updateCollateralHitTaskVis, and updateHitZoneTaskVis, together with the nested DtDamageAdjudicationDirectHitTaskVisInformation and DtDamageAdjudicationCollateralHitTaskVisInformation structs that hold the pending visualization data. Hit-zone status notifications arrive through the new setHitZoneStatusNotificationCallback / processSetHitZoneStatusNotification pair.
DtLocalEntitySetController gained handlers for symbol code and hit-zone status:
DtTacticalGraphicSetController gained the same processSetSidc / setSidcCallback pair, plus createPSR, tick, and the setLocation override described above. DtSpotReportGeneratorController gained adjustSidc(const DtString& sidc, const DtRwSensorContactInfo&, const DtAppearance&) const so derived classes can refine the reported symbol code.
Tests a rectangle directly ahead of the vehicle, the width of the vehicle and a portion of its body length, and reports the distance from the front bumper to the first obstruction.
roadPathFunctions.h gained adjustPathStartForShortSegment(DtRoadSegmentList& roadPath, bool debug).DtRoadDrivingLogic gained the virtual desiredDynamicHeadway(double currentSpeed), which defaults to the larger of the fixed headway and three seconds of travel at the current speed.DtGroundAutoControllerComponent gained obstacleAvoidanceOperation(), which returns the name of the area feature set operation used for obstacle avoidance.DtGroundMoveToDestinationControllerComponent gained markAsInUse(const DtString& name) and markAllForRemoval() for managing path search region visualizations.DtConvoyTaskController gained isEntireConvoyStopped(const DtSimObject* leader) const.DtRotaryWingFollowEntityController gained processAbsoluteFollowEntityTask, computeHeadingToEntity(const DtVector&) const, and updateTaskVisualizations, supporting an absolute bearing/distance/altitude follow offset and an aiming point.DtRotaryWingLoiterControllerComponent gained computeHeadingToOrbitCenter(const DtVector& centerLoc) const.DtSimpleRotaryWingPilot gained isCheckingTerrainAvoidance() const and a terrain-avoidance message callback pair.DtFixedWingHoldController gained a tick override.DtFixedWingEmbarkationController gained overrides of processLoadEntity, processEmbarkObjectCallback, embarkationRefused, and setState.DtHumanDamageActuator gained executeSetPosture(DtLifeformState lifeformState).DtHumanMovementActuator gained an on-posture-change-done input port member.DtDiGuyController gained createOnPostureChangeDonePort() and overrideOrderedAnimation() const, plus the corresponding output port.DtHumanWeaponStateActuator gained a preFirstTickInit override and lookupAndCacheBalGunPSR().DtResupplySupplierController and DtResupplyReceiverController both gained virtual int lookupBin(const DtEntityType&) const, and DtLauncherActuator and DtLauncherController gained munition bin ports, so resupply can address individual munition bins.
Six public static constants name the AIS set variables:
DtScriptMultiTaskController gained overrides of scriptSetTickWhileDestroyed, scriptSetTickImmediately, and taskVisualizationsActive.DtBindableLuaComponent gained a virtual cleanup(lua_State*) hook and a clearBackingPointer(void*) override, so a component can release Lua-side references when it is destroyed.DtSensorGimbalController gained leftAzimuthLimit() const, rightAzimuthLimit() const, and a registerTaskMsgCallbacks override.DtDisaggregatedFormationController gained livingFormationAnchor().DtIffControllerComponent gained setupStaticMode5Settings().DtTurretReturnToHeadingController gained a lookupAndCacheProcessSR override.DtWarheadDetonationActuator gained lookupLaserDesignator().The internal Tactical Data Link subsystem was removed from VR-Forces in 5.3. The following headers no longer exist, and the classes they declared are gone:
| Removed header | Removed class | Replacement |
|---|---|---|
vrfmodel/tdlMessageGeneratorController.h | DtTDLMessageGeneratorController | None |
vrfmodel/vrfTDLMessageGeneratorController.h | DtVrfTDLMessageGeneratorController | None |
vrfmodel/tdlPPLIMessageGeneratorController.h | DtTDLPPLIMessageGeneratorController | None |
vrfmodel/tdlContactMessageGeneratorController.h | DtTDLContactMessageGeneratorController | None |
vrfmodel/tdlStatusMessageGeneratorController.h | DtTDLStatusMessageGeneratorController | None |
There is no in-library replacement. Applications that derived from any of these controllers, or that registered them with the component factory, must remove that code. The related setTDLMessagingCallback / processSetTDLMessaging handlers on DtDisaggregatedSetController were removed at the same time, as described under Breaking Changes. Tactical data link functionality is now provided outside the core vrfmodel library.
Return to VR-Forces 5.3 API Migration Guide.
[Home]