|
VR-Engage
2.3
|
DtLaserTargetDesignatorSimLogic provides the capability to turn a laser target designator device on/off. A laser may be either immediately toggled on/off or started and then stopped at some later time, to provide a 'press and hold' interface to the device.
Input handler details (for configuring in an SMS input configuration file):
#include <laserTargetDesignatorSimLogic.h>
Public Member Functions | |
| DtLaserTargetDesignatorSimLogic () | |
| virtual | ~DtLaserTargetDesignatorSimLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | startLasingLocation () |
| virtual void | stopLasingLocation () |
| virtual void | updateLasingLocation () |
| virtual void | toggleLasingState () |
| virtual void | toggleIRSensor () |
| virtual void | handleToggleLaser (float value) |
| virtual void | handlePressAndHoldToLase (float value) |
| virtual bool | isLasingOn () const |
| virtual DtVreMessageResult | handleMenuMessage (makVre::DtVreMessage *msg) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual bool | postInitialize () |
| bool | componentReady () const |
| void | setComponentReady (bool ready) |
| virtual DtInitTickStatus | finalizeInitTick (double dt) |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
| virtual const DtAttributeHandle & | ownshipState () const |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
Protected Member Functions | |
| void | appendLaserDesignatorElements (std::vector< makVrv::DtElementID > &ignoreList) const |
| void | handleLaserOnChange (bool on) |
| void | updatePoseInformation () |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| DtInputLogic | myInputLogic |
| makVrv::DtObserver * | myObserver |
| std::string | myInputConfigFile |
| std::string | myIRSensorMode |
| std::string | myVisualSensorMode |
| std::string | myCachedSensorMode |
| bool | myLaserStarted |
| bool | myDisableVrHeadPose |
| DtAttributeHandleType< int > | myLaserCodeAttr |
| DtAttributeHandleType< bool > | myLaserOnAttr |
| DtAttributeHandleType< std::string > | myLaserStateAttr |
| DtAttributeHandleType< bool > | myIRSensorOnAttr |
| DtAttributeHandleType< bool > | myVrEnabledAttr |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| bool | myComponentReady = true |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| DtVreMessageHandlerGroup | myMessageHandlers |
| makVre::DtLaserTargetDesignatorSimLogic::DtLaserTargetDesignatorSimLogic | ( | ) |
Constructor for DtLaserTargetDesignatorSimLogic.
Initializes component state with default values
|
overridevirtual |
Virtual destructor for DtLaserTargetDesignatorSimLogic.
|
overridevirtual |
Initializes the laser target designator component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing laser designator settings |
Configures input handlers, sets up message handlers, initializes sensor modes, and connects to necessary signals for pose information updates
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Called every frame to update the laser designator.
| dt | Delta time since the last frame in seconds |
Updates the laser target location if the laser is currently active
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the laser target designator component.
Cleans up input handlers, message handlers, disconnects signals, and restores original sensor mode
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
virtual |
Starts the laser target designator at the current aim point.
Performs a ray cast from the observer through the center of the screen, sends a StartLasingLocationMessage with the detected location, and sets the laser state to on
|
virtual |
Stops the laser target designator.
Sends a StopLasingLocationMessage and sets the laser state to off
|
virtual |
Updates the current laser target location.
Performs a ray cast from the observer through the center of the screen and sends a SetLasingLocationMessage with the updated location
|
virtual |
Toggles the laser target designator on or off.
If the laser is currently on, calls stopLasingLocation(); otherwise, calls startLasingLocation()
|
virtual |
Toggles between IR and visual sensor modes.
Switches the observer's sensor mode between IR and visual, updating the IRSensorOn state attribute accordingly
|
virtual |
Input handler function for toggle laser action.
| value | Input value (1.0 to toggle the laser state) |
Toggles the laser on/off when the incoming value is 1
|
virtual |
Input handler function for press-and-hold lasing action.
| value | Input value (1.0 = on, 0.0 = off) |
Turns the laser on if the incoming value is 1, and turns it off if the incoming value is 0
|
virtual |
Checks if the laser is currently active.
Returns the current state of the "laserOn" attribute
|
virtual |
Handles menu action messages for the laser designator.
| msg | The menu action message to handle |
Processes "toggleLasingState", "toggleIRSensor", and "laserCodeInput" actions
|
protected |
Appends all laser designator element IDs to a raycast ignore list.
| ignoreList | List of element IDs the lasing ray cast should pass through |
Laser designator visuals (spot and code text) are pickable, so the center-screen lasing ray cast can hit a designator's own visualization and feed that location back to the simulation, walking the laser spot toward the viewer. Ignoring all laser designator elements lets the ray reach the entity or terrain behind them.
|
protected |
Handles changes to the laserOn attribute.
| on | New value of the laserOn attribute |
Updates the laserState attribute text based on the on/off state
|
protected |
Updates pose information for VR head tracking.
If VR is enabled and disableVrHeadPose is true, this method resets the camera position and orientation to prevent head tracking from affecting the aiming of the laser designator
|
protected |
Input logic that handles mapping of input actions to functions.
|
protected |
Pointer to the observer used for ray casting and sensor mode control.
|
protected |
Path to the input configuration file.
|
protected |
Name of the IR sensor mode in VR-Vantage.
|
protected |
Name of the visual sensor mode in VR-Vantage.
|
protected |
Original sensor mode to restore on shutdown.
|
protected |
Flag indicating if the laser has been started.
|
protected |
Flag controlling whether VR head pose is disabled during lasing.
When true, VR head tracking is disabled to prevent head movement from affecting the aim point of the laser designator
|
protected |
Attribute handle storing the laser code used for target designation.
| Attribute Store Key | laserCode |
|---|
|
protected |
Attribute handle indicating whether the laser designator is currently lasing.
| Attribute Store Key | laserOn |
|---|
|
protected |
Attribute handle storing the laser state string ("ON" or "OFF").
| Attribute Store Key | laserState |
|---|
|
protected |
Attribute handle indicating whether the IR sensor is currently active.
| Attribute Store Key | IRSensorOn |
|---|
|
protected |
Attribute handle indicating whether VR mode is enabled for the player.
| Attribute Store Key | vr-enabled |
|---|