VR-Engage  2.3
Loading...
Searching...
No Matches
vreCommonComponents Library API Changes

This page covers changed reusable role components in vreCommonComponents. Update C++ users and Lua role configuration together when moving from the former deployables component to the focused components.

Breaking changes

Deployables component split

vreCommonComponents/deployableObjectsSimLogic.h and deployableObjectsInputLogic.h were removed. DtDeployableObjectsSimLogic and DtDeployableObjectsInputLogic no longer provide the combined launcher, drone, embedded-entity, and remote-view interface. Use these public replacements:

Former responsibility Replacement header and class Representative method
Drone flight, control, and battery state droneControlLogic.h, DtDroneControlLogic useDrone(const DtEntityIdentifier&, const std::string&)
Drone input mappings droneInputLogic.h, DtDroneInputLogic setDroneControls(bool)
Drone autopilot and loiter tasks droneTaskLogic.h, DtDroneTaskLogic startDroneLoiter(const DtRwLocationReference&)
Launcher firing and target lock launcherControlLogic.h, DtLauncherControlLogic fireMissile(const std::string& rangeId = "")
Launcher input mappings launcherInputLogic.h, DtLauncherInputLogic setLauncherControls(bool)
Drone and launcher remote views remoteSensorViewLogic.h, DtRemoteSensorViewLogic openRemoteSensorView(const DtEntityIdentifier&)
Deploying and recovering embedded entities embeddedEntityLogic.h, DtEmbeddedEntityLogic deployEmbeddedEntity(const std::string&)

The header deployableObjectsTypes.h now contains shared deployables state types. Rename C++ includes and component lookups; the old component type is not registered. Avoid mapping a single old derived override to a single new class: methods and state have different owners.

Custom Lua roles must replace the former deployableObjectLogic entry (componentType = "DtDeployableObjectsSimLogic") with the relevant entries. The new keys and component type strings are distinct. For example:

components = {
["droneControlLogic"] = {
componentType = "DtDroneControlLogic";
maxPGain = 2.0; maxIGain = 0.05; maxDGain = 1.0; maxFGain = 1.0;
};
["launcherControlLogic"] = {
componentType = "DtLauncherControlLogic";
};
["remoteSensorViewLogic"] = {
componentType = "DtRemoteSensorViewLogic";
};
["embeddedEntityLogic"] = {
componentType = "DtEmbeddedEntityLogic";
roleHasDeployables = true;
};
}

Place the remoteViewer table on remoteSensorViewLogic; place drone gains and battery settings on droneControlLogic. Place launcher lock timings on launcherControlLogic and roleHasDeployables on embeddedEntityLogic. See data/simulationModelSets/VR-Engage/roles/devices/deployableObjects.lua for a complete droneTaskLogic setup and sensor-view table.

Towing moved out of driver control

DtDriverControlLogic removed setHook(double val) and the protected onHookTargetUuidChanged(const std::string&) callback from driverControlLogic.h. Use DtTowingControlLogic from vreCommonComponents/towingControlLogic.h for both methods. Its role parameter TowingControlLogicConfig::hasTowHook replaces DriverControlLogicConfig::hasTowHook, although both map to the Lua key "hasTowHook". Move this key to a towingControlLogic component entry with componentType = "DtTowingControlLogic". Do not leave the key only on driverControlLogic.

Gunner and radio overrides

DtGunnerControlLogic no longer declares slewToCue(bool onoff) or handleSlewToCue(float val) in gunnerControlLogic.h. Use DtSlewToCueControl from vreCommonComponents/slewToCueControl.h for slew-to-cue behavior. Move slewToCueTargetSystem, slewToCueUpdateRate, and slewToCueUpdateDeltaThreshold role settings to its weaponSystemToSlew, updateRate, and updateDeltaAngle parameters, respectively. The old angle threshold compared vector dot products; updateDeltaAngle is in degrees. Recalculate custom thresholds instead of copying their numeric values. updateRate is a time interval in seconds.

DtRadioLogic in radioLogic.h changes the protected callbacks handleEmbarkedOnChanged(DtEntityIdentifier) to handleEmbarkedOnChanged(const DtEntityIdentifier&), handleSetRadio(MenuActionMessage*) to handleSetRadio(const MenuActionMessage*), and handleCryptoKeyInput(MenuActionMessage*) to handleCryptoKeyInput(const MenuActionMessage*). handleCycleDuplex(MenuActionMessage*) becomes handleCycleAudioChannel(MenuActionMessage*). The protected currentRadioName() and currentChannelName() methods now have const qualifiers. Update derived declarations and radio menu action names; duplex and audio-channel values are not equivalent.

Other removed overrides

DtBinocularsOverlay::setVisible(bool) was removed from vreBinocularsOverlay.h. Replace calls with DtQtQuickOverlay::setVisibility(bool) from qtQuickOverlay.h. DtExtendedStateLogic::addAdditionalAttributesToState(std::vector<std::string>&, std::vector<std::string>&) was removed from extendedStateLogic.h. Derived implementations must publish additional state through the current attribute API rather than overriding this hook. DtMetaRoleControlLogic::mySubStations changed from std::vector<DtPlayerStation*> to std::vector<std::unique_ptr<DtPlayerStation>> in metaRoleControlLogic.h. Derived classes must stop manually deleting stations and account for unique ownership.

Additions

Role and view components

entityOverlayComponent.h adds DtEntityOverlayComponent, a Qt Quick entity overlay. towingControlLogic.h adds towing ownership handoff settings: ownershipAcquireDelaySeconds (default 0.5), ownershipReleaseDelaySeconds (default 1.0), and hookHandoffTimeoutSeconds (default 10.0). Set these on towingControlLogic when custom towing needs different transfer timing.

DtDroneTaskLogic supports targetMode = "OwnshipTarget" or "DeployableTarget" and optional loiterDefaults. DtRemoteSensorViewLogic adds enablePitchRollStabilization (default true). Both settings belong to their respective component entries, not the removed deployables entry.

Initialization and module lifecycle

DtWindowLayoutComponent::finalizeInitTick(double dt) now applies one-time window geometry while the player loads; its tick(double dt) is a no-op. Move custom per-frame window-layout work into a derived tick() implementation if it must still run during engagement. vreCommonComponents/plugin.h adds shutdownPlayerStationModule(makVre::DtPlayerStationApp* app) to remove registered component creators. Call it during application teardown to remove creators. The current frontend loader retains recognized plugin libraries until process exit; shutdown alone does not make a manual DLL unload safe. See Frontend plugin lifecycle.

Additional extension points

DtMetaRoleControlLogic adds currentSubStation() const, handleMenuMessage(DtVreMessage*), and the protected initializeStation(DtPlayerStation*). Separate role parameters nextSubRoleInputAction and nextSubRoleMenuAction let a meta role bind input and menu actions independently. DtGunnerControlLogic adds projectedTargetDistance (meters, default 0.0). Set a positive distance to project an aim point when center-screen intersection misses terrain and entities.