![]() |
VR-Forces Developer's Guide
|
VR-Vantage renders simulated sensor views – night-vision goggles, thermal imagers, and other electro-optical modes – by applying a named, persisted configuration to an observer's channel.
This chapter shows how a toolkit developer creates, reads, and modifies those configurations at runtime, wires them to observer modes, and understands the split between the two sensor rendering backends that ship with the product.
The chapter covers the public API a plugin or application calls. It does not describe the internal rendering pipeline of either backend; that lives in the class documentation for the individual sensor modules.
The subsystem uses a small vocabulary that recurs throughout the API.
Five public classes carry the API surface a toolkit developer touches.
DtSensorManager is a per-DtDe singleton that owns every registered sensor and every registered sensor module. Retrieve it with DtSensorManager::instance(de). It exposes lookup (findSensor(), findSensorModule()), enumeration (getSensors(), getSensorModules()), enable/disable of a sensor on a channel, persistence (saveAsDefaults(), loadDefaults(), importSettings(), exportSettings()), and the runtime availability check hasSensorModuleForSensor().
DtSensor represents a single sensor's persisted configuration. It carries four attribute maps (bool, int, float, string) plus the sensor's unique name and the module name that should render it. All accessors are read-only: attributeBool(), attributeInt(), attributeFloat(), attributeString(), and the change signals signal_attributeChangedXxx. To modify a sensor, use a controller.
DtSensorModule is the interface each rendering backend implements. Its name() is the module identifier stored in a DtSensor, and displayName() is the human-readable form shown in the sensor menu. A module registers itself with the sensor manager during plugin initialization and is asked to enableSensor() or disableSensor() on a channel when the observer's active sensor changes.
DtSensorController is the base class used to write sensor attributes on the local display engine. DtMasterSensorController wraps a DtSensorController together with a distribution agent so that setParameterXxx(), setSensorModule(), and rename() apply immediately to the master display engine and are forwarded to remote display engines. Use the master controller from the main thread in any distributed session; use the local controller only when there is no need to broadcast the change.
DtObserverModeManager owns the per-observer-mode configuration, including which sensor is active for a given mode. Its setSensor(modeKey, sensorName) selects the sensor a mode should use, and its return value reports whether the required sensor module is loaded in the current runtime.
VR-Vantage ships with two independent sensor modules. A given sensor is bound to exactly one of them by its moduleName.
CameraFX is the built-in module in the base runtime. It is implemented by DtSenSimSensorModule and is registered under the module name "CameraFxSensorModule" (display name "CameraFX"). CameraFX applies fast post-processing effects – noise, blur, gain, level, halos, black hot, motion blur, filter – to the rendered scene. It is always available.
SensorFX is a separately licensed plugin, built on the JRM Technologies SigSim runtime. It is implemented by JrmSensorModule and is registered under the module name "SensorFxSensorModule" (display name "SensorFX"). SensorFX drives a physically based pipeline with sensor-specific radiance modeling, thermal spinup of materials, atmospheric processing, and LWIR-, NVG-, and visual-band sensor modes. It is available only when the SensorFX plugin is loaded.
Because a saved sensor may name a module that is not loaded, always ask the manager whether the current runtime can render it before enabling it:
Reads go through DtSensor directly. Writes go through a controller. This asymmetry is the single most important rule of the sensor API: application code never mutates a DtSensor in place.
A few properties of this pattern are worth calling out.
"noiseOn", "GainAdjustment", "agcOn", and so on). Check DtSensor::attributeExists() if the module in use is not fixed.signal_attributeChangedBool, signal_attributeChangedInt, signal_attributeChangedFloat, signal_attributeChangedString, and signal_setFromRecord. Connect these when a widget or driver must react to sensor changes made elsewhere in the process (including changes arriving from a distributed session).DtSensorManager::saveAsDefaults(). The manager also supports file-based persistence with exportSettings(filename) and importSettings(filename), which are the recommended way to move a configured sensor set between machines or scenarios.An observer mode owns a sensor name. Selecting the mode activates the sensor on the observer's channel. To wire a mode to a sensor:
The manager stores the sensor by name only; the module-availability check is done at set time and again at activation time. This is how a scene authored with SensorFX sensors can still be loaded in a base VR-Vantage runtime without producing broken observer modes – the unavailable sensor simply does not activate. DtSensorManager::hasSensorModuleForSensor() reports the same result and can be used to filter a sensor menu.
Three example plug-ins in the toolkit exercise different corners of the sensor API. Each has full source in the Examples section of this documentation.
DtSensorManager::saveAsDefaults(). This is the closest match to the pattern shown in .4 - Reading and Changing Settings."LWIR (SensorFX)" sensor when the mode is selected, and consumes the SensorFX pre-aperture radiance texture from a custom post processor.The SensorFX-only examples require the SensorFX plugin to be loaded; their provided launch scripts (*_sensorFX.bat or *_stealth.bat with the SensorFX plugin enabled) take care of the setup.