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

Detailed Description

DtSlewToCueControl provides the ability to send slew-to-cue commands to a specified weapon system, directing it to orient toward the player's current view direction. It requires a DtWeaponPoseUpdater component to obtain the current weapon position and orientation data. The component supports rate-limited updates and angle thresholds to optimize network traffic when sending cue commands.

#include <slewToCueControl.h>

Inheritance diagram for makVre::DtSlewToCueControl:
[legend]

Public Member Functions

 DtSlewToCueControl ()
 
virtual ~DtSlewToCueControl () override
 
virtual bool initialize (DtPlayerStation *player, 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 activateSlewToCue (double val)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual void weaponOrientationAttributeUpdated (DtTaitBryan ori)
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

DtInputLogic myInputLogic
 
std::string myWeaponSystemToSlew
 
bool mySlewingActive
 
bool myUpdateNeeded
 
double myUpdateRate
 
double myUpdateTimer
 
double myUpdateDeltaAngle
 
DtVector32 myLastSentVector
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtSlewToCueControl()

makVre::DtSlewToCueControl::DtSlewToCueControl ( )

Constructor for DtSlewToCueControl.

Initializes the component with default settings for slew control

◆ ~DtSlewToCueControl()

virtual makVre::DtSlewToCueControl::~DtSlewToCueControl ( )
overridevirtual

Virtual destructor for DtSlewToCueControl.

Member Function Documentation

◆ initialize()

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

Initializes the slew-to-cue control component.

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

Reads configuration settings for the weapon system to slew, update rate, update delta angle, and sets up input bindings for activation

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ postInitialize()

virtual bool makVre::DtSlewToCueControl::postInitialize ( )
overridevirtual

Performs post-initialization after all components are initialized.

Returns
True if post-initialization succeeded, false otherwise

Verifies the presence of weaponLocation and weaponOrientation attributes and sets up the attribute change callback for orientation updates

Reimplemented from makVre::DtPlayerComponent.

◆ tick()

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

Called every frame to update the slew control state.

Parameters
dtDelta time since the last frame in seconds

When slewing is active, manages update timing and sends slew-to-cue messages based on the configured update rate and angle thresholds

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void makVre::DtSlewToCueControl::shutdown ( )
overridevirtual

Shuts down the slew-to-cue control component.

Removes attribute change callbacks, deactivates slewing if active, and performs base class shutdown operations

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the type identifier for this component.

Returns
The type string for DtSlewToCueControl

Implements makVre::DtPlayerComponent.

◆ activateSlewToCue()

virtual void makVre::DtSlewToCueControl::activateSlewToCue ( double val)
virtual

Input handler for activating/deactivating slew-to-cue.

Parameters
valInput value (1.0 for activation, 0.0 for deactivation)

Activates slew-to-cue when input is pressed and deactivates it when released, sending appropriate messages to the weapon system

◆ weaponOrientationAttributeUpdated()

virtual void makVre::DtSlewToCueControl::weaponOrientationAttributeUpdated ( DtTaitBryan ori)
protectedvirtual

Callback for weapon orientation attribute changes.

Parameters
oriNew orientation value

Determines if the orientation change exceeds the configured delta angle threshold and sets the update needed flag accordingly

Member Data Documentation

◆ myInputLogic

DtInputLogic makVre::DtSlewToCueControl::myInputLogic
protected

Input logic for handling slew control input bindings.

◆ myWeaponSystemToSlew

std::string makVre::DtSlewToCueControl::myWeaponSystemToSlew
protected

Name of the weapon system to send slew commands to.

◆ mySlewingActive

bool makVre::DtSlewToCueControl::mySlewingActive
protected

Flag indicating if slewing is currently active.

◆ myUpdateNeeded

bool makVre::DtSlewToCueControl::myUpdateNeeded
protected

Flag indicating if an update needs to be sent.

◆ myUpdateRate

double makVre::DtSlewToCueControl::myUpdateRate
protected

Minimum time between slew updates in seconds.

◆ myUpdateTimer

double makVre::DtSlewToCueControl::myUpdateTimer
protected

Timer tracking time until next possible update.

◆ myUpdateDeltaAngle

double makVre::DtSlewToCueControl::myUpdateDeltaAngle
protected

Minimum angle change in degrees to trigger an update.

◆ myLastSentVector

DtVector32 makVre::DtSlewToCueControl::myLastSentVector
protected

Last sent forward vector for angle change comparison.


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