|
VR-Engage
2.2
|
The DtCommanderControlLogic provides control functionality for vehicle commander sensor systems, supporting orientation in azimuth and elevation, zoom control, and the ability to switch between different sensor modes (e.g., IR, NVG, visual).
Input handler details (for configuring in an SMS input configuration file):
This class has the following input handler functions that may be configured to map to input devices in role input configuration files:
The group name is provided in the role configuration file and is used to distinguish input handlers when multiple handlers are present on the entity.
#include <commanderControlLogic.h>
Public Member Functions | |
| DtCommanderControlLogic () | |
| virtual | ~DtCommanderControlLogic () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | azimuth (double val) |
| virtual void | elevation (double val) |
| virtual void | zoomIn (double val) |
| virtual void | zoomOut (double val) |
| virtual void | zoom (float val) |
| virtual void | nextSensor (double val) |
| virtual makVre::DtVreMessageResult | handleMenuMessage (makVre::DtVreMessage *msg) |
Public Member Functions inherited from makVre::DtEntityControlLogic | |
| DtEntityControlLogic () | |
| virtual | ~DtEntityControlLogic () override |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
| virtual void | setMouseControlEnabled (bool enabled) |
| virtual bool | isMouseControlEnabled () |
| virtual bool | isMouseControlSupportAllowed () const |
| virtual void | setMouseControlSupportAllowed (bool enable) |
| virtual const std::vector< std::string > & | joystickGroups () const |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleStateMessages (makVre::DtVreMessage *message) |
| virtual makVre::DtVreMessageResult | handleReset (makVre::DtVreMessage *message) |
| virtual void | reset (float val) |
| virtual void | resetInPlace (float val) |
| virtual void | toggleMouseControl (float val) |
| virtual void | enableMouseControl (float val) |
| virtual makVre::DtVreMessageResult | handleFocusMessage (makVre::DtVreMessage *message) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Attributes | |
| DtInputLogic | myInputLogic |
| std::string | myMainControlGroup |
| bool | myOutTheHatchMode |
| float | myAzimuthInput |
| float | myElevationInput |
| float | myMaxZoom |
| float | myMinZoom |
| bool | myEnableZoom |
Protected Attributes inherited from makVre::DtEntityControlLogic | |
| std::vector< std::string > | myJoystickFunctionGroups |
| DtInputLogic | myCommonInputLogic |
| std::string | myInputConfigFile |
| bool | myMouseControlEnabled |
| bool | myMouseControlSupportAllowed |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtEntityControlLogic | |
| virtual void | takeControlOfPlayerEntity () |
| virtual void | releaseControlOfPlayerEntity () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
| makVre::DtCommanderControlLogic::DtCommanderControlLogic | ( | ) |
Constructor for DtCommanderControlLogic.
Initializes the component with the name "DtCommanderControlLogic" and default values. Also checks out the required VR Engage Ground license.
|
overridevirtual |
Virtual destructor for DtCommanderControlLogic.
|
overridevirtual |
Initializes the component with configuration from Lua.
Sets up input handlers, zoom limits, and initializes state attributes needed for sensor control. Configures the component based on provided configuration.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing initialization parameters |
Reimplemented from makVre::DtEntityControlLogic.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Sets up input handler callbacks after all components have been initialized.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Updates the component state.
Called each frame to handle sensor control logic, particularly handling special cases like "out the hatch" mode.
| dt | Delta time in seconds since the last tick |
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Shuts down the component.
Cleans up resources and disconnects input handlers.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Input handler for sensor azimuth (horizontal) control.
Controls the horizontal rotation of the sensor. In normal mode, sends joystick messages scaled by the current zoom level. In "out the hatch" mode, stores the input value for processing during tick().
| val | The azimuth input value, typically from -1.0 to 1.0 |
|
virtual |
Input handler for sensor elevation (vertical) control.
Controls the vertical tilt of the sensor. In normal mode, sends joystick messages scaled by the current zoom level. In "out the hatch" mode, stores the input value for processing during tick().
| val | The elevation input value, typically from -1.0 to 1.0 |
|
virtual |
Input handler for zoom in functionality.
Increases the sensor's magnification level by a factor of 2, up to the configured maximum zoom level.
| val | The zoom in input value, positive values trigger zoom |
|
virtual |
Input handler for zoom out functionality.
Decreases the sensor's magnification level by a factor of 0.5, down to the configured minimum zoom level.
| val | The zoom out input value, positive values trigger zoom |
|
virtual |
Combined input handler for zoom functionality.
Routes to zoomIn or zoomOut based on whether the input value is positive or negative.
| val | The zoom input value, positive for zoom in, negative for zoom out |
|
virtual |
Input handler for cycling through sensor modes.
Cycles to the next available sensor mode (e.g., visual, NVG, thermal) when triggered.
| val | The input value, a value of 1.0 triggers the sensor change |
|
virtual |
Handles menu action messages.
Processes menu actions, particularly the "cycleSensor" action which triggers the nextSensor functionality.
| msg | The message to process |
|
protected |
Input handler logic for processing input device events.
|
protected |
Main control group name from configuration.
Used to identify the function group when sending joystick messages.
|
protected |
Flag indicating whether "out the hatch" mode is active.
When true, sensor control directly affects the observer view rather than sending joystick messages to control a vehicle sensor.
|
protected |
Current azimuth input value for "out the hatch" mode.
|
protected |
Current elevation input value for "out the hatch" mode.
|
protected |
Maximum allowed zoom level.
|
protected |
Minimum allowed zoom level.
|
protected |