VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtLaserTargetDesignatorSimLogic Class Reference

Detailed Description

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):

  • Group: "laser-target-designator"
  • Handler functions: "toggle-laser", "press-and-hold-to-lase"

#include <laserTargetDesignatorSimLogic.h>

Inheritance diagram for makVre::DtLaserTargetDesignatorSimLogic:
[legend]

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 DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () 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
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtLaserTargetDesignatorSimLogic()

makVre::DtLaserTargetDesignatorSimLogic::DtLaserTargetDesignatorSimLogic ( )

Constructor for DtLaserTargetDesignatorSimLogic.

Initializes component state with default values

◆ ~DtLaserTargetDesignatorSimLogic()

virtual makVre::DtLaserTargetDesignatorSimLogic::~DtLaserTargetDesignatorSimLogic ( )
overridevirtual

Virtual destructor for DtLaserTargetDesignatorSimLogic.

Member Function Documentation

◆ initialize()

virtual bool makVre::DtLaserTargetDesignatorSimLogic::initialize ( DtPlayerStation * player,
DtInitTable & config )
overridevirtual

Initializes the laser target designator component.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing laser designator settings
Returns
True if initialization succeeded, false otherwise

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().

◆ tick()

virtual void makVre::DtLaserTargetDesignatorSimLogic::tick ( double dt)
overridevirtual

Called every frame to update the laser designator.

Parameters
dtDelta time since the last frame in seconds

Updates the laser target location if the laser is currently active

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void makVre::DtLaserTargetDesignatorSimLogic::shutdown ( )
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.

◆ type()

virtual const char * makVre::DtLaserTargetDesignatorSimLogic::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtLaserTargetDesignatorSimLogic

Implements makVre::DtPlayerComponent.

◆ startLasingLocation()

virtual void makVre::DtLaserTargetDesignatorSimLogic::startLasingLocation ( )
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

◆ stopLasingLocation()

virtual void makVre::DtLaserTargetDesignatorSimLogic::stopLasingLocation ( )
virtual

Stops the laser target designator.

Sends a StopLasingLocationMessage and sets the laser state to off

◆ updateLasingLocation()

virtual void makVre::DtLaserTargetDesignatorSimLogic::updateLasingLocation ( )
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

◆ toggleLasingState()

virtual void makVre::DtLaserTargetDesignatorSimLogic::toggleLasingState ( )
virtual

Toggles the laser target designator on or off.

If the laser is currently on, calls stopLasingLocation(); otherwise, calls startLasingLocation()

◆ toggleIRSensor()

virtual void makVre::DtLaserTargetDesignatorSimLogic::toggleIRSensor ( )
virtual

Toggles between IR and visual sensor modes.

Switches the observer's sensor mode between IR and visual, updating the IRSensorOn state attribute accordingly

◆ handleToggleLaser()

virtual void makVre::DtLaserTargetDesignatorSimLogic::handleToggleLaser ( float value)
virtual

Input handler function for toggle laser action.

Parameters
valueInput value (1.0 to toggle the laser state)

Toggles the laser on/off when the incoming value is 1

◆ handlePressAndHoldToLase()

virtual void makVre::DtLaserTargetDesignatorSimLogic::handlePressAndHoldToLase ( float value)
virtual

Input handler function for press-and-hold lasing action.

Parameters
valueInput 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

◆ isLasingOn()

virtual bool makVre::DtLaserTargetDesignatorSimLogic::isLasingOn ( ) const
virtual

Checks if the laser is currently active.

Returns
True if the laser is currently on, false otherwise

Returns the current state of the "laserOn" attribute

◆ handleMenuMessage()

virtual DtVreMessageResult makVre::DtLaserTargetDesignatorSimLogic::handleMenuMessage ( makVre::DtVreMessage * msg)
virtual

Handles menu action messages for the laser designator.

Parameters
msgThe menu action message to handle
Returns
Message handling result indicating if the message was handled

Processes "toggleLasingState", "toggleIRSensor", and "laserCodeInput" actions

◆ handleLaserOnChange()

void makVre::DtLaserTargetDesignatorSimLogic::handleLaserOnChange ( bool on)
protected

Handles changes to the laserOn attribute.

Parameters
onNew value of the laserOn attribute

Updates the laserState attribute text based on the on/off state

◆ updatePoseInformation()

void makVre::DtLaserTargetDesignatorSimLogic::updatePoseInformation ( )
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

Member Data Documentation

◆ myInputLogic

DtInputLogic makVre::DtLaserTargetDesignatorSimLogic::myInputLogic
protected

Input logic that handles mapping of input actions to functions.

◆ myObserver

makVrv::DtObserver* makVre::DtLaserTargetDesignatorSimLogic::myObserver
protected

Pointer to the observer used for ray casting and sensor mode control.

◆ myInputConfigFile

std::string makVre::DtLaserTargetDesignatorSimLogic::myInputConfigFile
protected

Path to the input configuration file.

◆ myIRSensorMode

std::string makVre::DtLaserTargetDesignatorSimLogic::myIRSensorMode
protected

Name of the IR sensor mode in VR-Vantage.

◆ myVisualSensorMode

std::string makVre::DtLaserTargetDesignatorSimLogic::myVisualSensorMode
protected

Name of the visual sensor mode in VR-Vantage.

◆ myCachedSensorMode

std::string makVre::DtLaserTargetDesignatorSimLogic::myCachedSensorMode
protected

Original sensor mode to restore on shutdown.

◆ myLaserStarted

bool makVre::DtLaserTargetDesignatorSimLogic::myLaserStarted
protected

Flag indicating if the laser has been started.

◆ myDisableVrHeadPose

bool makVre::DtLaserTargetDesignatorSimLogic::myDisableVrHeadPose
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


The documentation for this class was generated from the following file: