|
VR-Engage
2.2
|
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 () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| 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 |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| 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 |
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