18#include <vrvCore/DtUniqueID.h>
128 virtual void tick(
double dt)
override;
136 virtual const char*
type()
const override;
Handle class for safe access to attributes.
Definition attributeHandle.h:30
DtEntityControlLogic()
Constructor.
virtual void cycleAimingMode()
Cycles between available aiming modes.
DtInputLogic myInputLogic
Input logic that handles mapping of input actions to functions.
Definition gunnerControlLogic.h:244
virtual makVre::DtVreMessageResult handleMenuMessage(makVre::DtVreMessage *msg)
Handles action menu messages for the gunner role.
virtual void shutdown() override
Shuts down the gunner control logic component.
std::string myMainControlGroup
Primary control group name for this gunner station.
Definition gunnerControlLogic.h:241
double myMinRange
Definition gunnerControlLogic.h:312
makVre::DtInitTable myExtendedWeaponSystems
Configuration table for extended weapon systems.
Definition gunnerControlLogic.h:259
double mySlewToCueUpdateRate
Rate at which to send slew-to-cue updates (seconds)
Definition gunnerControlLogic.h:277
std::string myAzimuthStateAttribute
Definition gunnerControlLogic.h:319
std::string mySlewToCueTargetSystem
Name of the target system for slew-to-cue functionality.
Definition gunnerControlLogic.h:271
virtual void zoomIn(double val)
Increases the sight magnification level.
virtual void stabilize(double val)
Controls weapon stabilization system.
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the gunner control logic component.
DtWeaponResourceLogic * myResourceLogic
Pointer to the weapon resource logic component.
Definition gunnerControlLogic.h:250
DtVector mySlewToCueLastSentVector
Last direction vector sent in a slew-to-cue message.
Definition gunnerControlLogic.h:286
double mySlewToCueTimer
Timer for tracking when to send the next slew-to-cue update.
Definition gunnerControlLogic.h:280
bool myIsOverrideRole
Flag indicating if this gunner is in override mode.
Definition gunnerControlLogic.h:292
virtual void previousWeapon(double val)
Selects the previous available weapon.
double myMinGunAzimuth
Definition gunnerControlLogic.h:317
std::string myForceResourceType
Allow the configuration to specify a resource name directly.
Definition gunnerControlLogic.h:304
virtual void azimuth(double val)
Controls turret azimuth (horizontal rotation)
double myMissileX
Definition gunnerControlLogic.h:309
virtual void fire(double val)
Input functions mapped to particular action strings in configuration.
virtual void missileY(double val)
virtual void turretDown(float val)
Moves turret downward (direct control)
std::string myAltRole
Name of the alternate role to switch to.
Definition gunnerControlLogic.h:289
virtual void switchToAltRole()
Switches between gunner and alternate role (e.g., commander RWS)
std::string myArmedStateProperty
Definition gunnerControlLogic.h:321
virtual void turretRight(float val)
Moves turret to the right (direct control)
DtAttributeHandle myResourceHandle
Definition gunnerControlLogic.h:306
std::vector< double > myZoomLevels
Available zoom magnification levels.
Definition gunnerControlLogic.h:253
double myMaxRange
Definition gunnerControlLogic.h:313
virtual ~DtGunnerControlLogic() override
Destructor for DtGunnerControlLogic.
makVrv::DtElementID myTargetElement
Element ID of the current target.
Definition gunnerControlLogic.h:268
virtual bool postInitialize() override
Performs post-initialization after all components are initialized.
virtual void turretUp(float val)
Moves turret upward (direct control)
bool myPreviousMissileInFlight
Definition gunnerControlLogic.h:315
double myMaxGunAzimuth
Definition gunnerControlLogic.h:318
virtual void toggleArmed()
Toggles armed state for a weapon that requires arming (weapons don't by default).
std::string myOverrideSystem
Name of the system to override.
Definition gunnerControlLogic.h:295
virtual void tick(double dt) override
Called every frame to update gunner control logic.
DtAttributeHandle myMunitionHandle
Definition gunnerControlLogic.h:307
virtual void aimMissile(double x, double y)
Update missile's target point based on the x and y input. Called any time x and y are not 0.
virtual void turretLeft(float val)
Moves turret to the left (direct control)
virtual void slewToCue(bool onoff)
Activates or deactivates slew-to-cue functionality.
virtual void nextSensor(double val)
Cycles to the next available sensor type (visual, NVG, thermal)
DtGunnerControlLogic()
Constructor for DtGunnerControlLogic.
virtual bool canFire()
Returns true if the weapon can fire. Checks for range, azimuth and isArmed.
virtual void missileX(double val)
Set x and y inputs for manual missile aiming.
std::string myPreviousMunitionType
Previously used munition name, used to detect changes.
Definition gunnerControlLogic.h:238
virtual bool aimWithObserver() const
Determines if aiming should use the observer's view.
virtual void setCommanderOverrideActive(bool active) const
Sets the commander override active state.
int myZoomIndex
Current index into the zoom levels array.
Definition gunnerControlLogic.h:256
DtVector myTargetLocation
Current target location for extended weapon systems.
Definition gunnerControlLogic.h:265
virtual void handleSlewToCue(float val)
Handles input for slew-to-cue activation.
virtual void handleSwitchToAltRole(float val)
Handles input for switching to alternate role.
std::string mySystemName
Name of the weapon system controlled by this gunner.
Definition gunnerControlLogic.h:247
virtual const char * type() const override
Returns the component type identifier.
void sendJoystickMessage(const std::string &func, const double val)
Sends a joystick message to the entity.
virtual void nextWeapon(double val)
Selects the next available weapon.
virtual void zoom(float val)
Controls continuous zoom level directly.
virtual void elevation(double val)
Controls turret elevation (vertical angle)
bool mySlewToCueActive
Flag indicating if slew-to-cue is currently active.
Definition gunnerControlLogic.h:274
double myDelayedCycleWeaponTimer
Timer for delaying weapon cycling operations.
Definition gunnerControlLogic.h:301
virtual void zoomOut(double val)
Decreases the sight magnification level.
double mySlewToCueUpdateDeltaThreshold
Threshold for determining when to send updates based on angle change.
Definition gunnerControlLogic.h:283
makVre::DtInitTable myCurrentExtendedSystem
Configuration for the currently active extended weapon system.
Definition gunnerControlLogic.h:262
bool myCycleWeaponFlag
Flag indicating if a weapon cycle operation is in progress.
Definition gunnerControlLogic.h:298
double myMissileY
Definition gunnerControlLogic.h:310
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Component for managing weapon resources, equipment, and related state attributes.
Definition weaponResourceLogic.h:45
Defines the logic for controlling entities in VR-Engage.
constexpr const char * minFireRange
Definition gunnerControlLogic.h:67
constexpr const char * fireRequiresIntersection
Definition gunnerControlLogic.h:49
constexpr const char * azimuthStateAttribute
Definition gunnerControlLogic.h:43
constexpr const char * slewToCueUpdateRate
Definition gunnerControlLogic.h:79
constexpr const char * maxFireRange
Definition gunnerControlLogic.h:61
constexpr const char * armedProperty
Definition gunnerControlLogic.h:40
constexpr const char * extendedWeaponSystems
Definition gunnerControlLogic.h:46
constexpr const char * zoomLevels
\vreRoleParam{zoomLevels,table,"{1,2,4,8,16,32}",gunnerControlLogic,Array of available zoom magnifica...
Definition gunnerControlLogic.h:85
constexpr const char * maxFireDegreesAzimuth
Definition gunnerControlLogic.h:58
constexpr const char * altRole
Definition gunnerControlLogic.h:37
constexpr const char * isOverrideRole
Definition gunnerControlLogic.h:55
constexpr const char * systemName
Definition gunnerControlLogic.h:82
constexpr const char * minFireDegreesAzimuth
Definition gunnerControlLogic.h:64
constexpr const char * slewToCueTargetSystem
Definition gunnerControlLogic.h:73
constexpr const char * forceResourceType
Definition gunnerControlLogic.h:52
constexpr const char * slewToCueUpdateDeltaThreshold
Definition gunnerControlLogic.h:76
constexpr const char * overrideSystem
Definition gunnerControlLogic.h:70
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
Provides configuration initialization for VREngage components.
Definition gunnerControlLogic.h:29
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtGunnerControlLogicType
Type identifier for DtGunnerControlLogic component.
Definition gunnerControlLogic.h:91
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the base class for all VREngage messages.