|
VR-Engage
2.2
|
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>
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 DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () 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 |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtSlewToCueControl::DtSlewToCueControl | ( | ) |
Constructor for DtSlewToCueControl.
Initializes the component with default settings for slew control
|
overridevirtual |
Virtual destructor for DtSlewToCueControl.
|
overridevirtual |
Initializes the slew-to-cue control component.
| player | Pointer to the player station this component belongs to |
| config | Configuration table containing slew control settings |
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().
|
overridevirtual |
Performs post-initialization after all components are initialized.
Verifies the presence of weaponLocation and weaponOrientation attributes and sets up the attribute change callback for orientation updates
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Called every frame to update the slew control state.
| dt | Delta 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.
|
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.
|
overridevirtual |
Returns the type identifier for this component.
Implements makVre::DtPlayerComponent.
|
virtual |
Input handler for activating/deactivating slew-to-cue.
| val | Input 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
|
protectedvirtual |
Callback for weapon orientation attribute changes.
| ori | New orientation value |
Determines if the orientation change exceeds the configured delta angle threshold and sets the update needed flag accordingly
|
protected |
Input logic for handling slew control input bindings.
|
protected |
Name of the weapon system to send slew commands to.
|
protected |
Flag indicating if slewing is currently active.
|
protected |
Flag indicating if an update needs to be sent.
|
protected |
Minimum time between slew updates in seconds.
|
protected |
Timer tracking time until next possible update.
|
protected |
Minimum angle change in degrees to trigger an update.
|
protected |
Last sent forward vector for angle change comparison.