VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
- Sensors

Table of Contents

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.

\vrv_sensors.1 - Core Concepts

The subsystem uses a small vocabulary that recurs throughout the API.

\vrv_sensors.2 - Class Roles

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.

\vrv_sensors.3 - The Two Sensor Modules: CameraFX vs SensorFX

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:

using namespace makVrv;
if (sensorMgr.hasSensorModuleForSensor("Long-Range LWIR"))
{
// safe to select this sensor on a channel or observer mode
}

\vrv_sensors.4 - Reading and Changing Settings

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.

using namespace makVrv;
// Find the sensor by name.
DtSensor* sensor = DtSensorManager::instance(de).findSensor("Wide FOV NVG");
if (sensor == nullptr) { return; }
// Read attributes directly.
bool noiseOn = sensor->attributeBool("noiseOn");
float gain = sensor->attributeFloat("GainAdjustment");
// Write attributes through a master controller so remote engines see the
// change too. The controller creates the sensor if the name does not exist.
DtMasterSensorController controller(de);
controller.setTargetSensor(sensor->name());
controller.setParameterBool("noiseOn", !noiseOn);
controller.setParameterFloat("GainAdjustment", gain + 0.05f);
// Optional: persist the change as the runtime default.

A few properties of this pattern are worth calling out.

\vrv_sensors.5 - Observer Mode Integration

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:

using namespace makVrv;
const int modeKey = modeMgr.lookupObserverModeKey("Pre-Aperture Radiance");
// setSensor returns false when the sensor's module is not loaded in the
// current runtime. Treat that as "sensor not available" rather than an error.
if (!modeMgr.setSensor(modeKey, "LWIR (SensorFX)"))
{
// SensorFX is not loaded in this runtime; leave the mode's sensor unset.
}

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.

\vrv_sensors.6 - Complete Example

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.

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.

\vrv_sensors.7 - Related Reference


Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)