18#include <vrvCore/DtUniqueID.h>
20#include <matrix/vlVector.h>
21#include <matrix/vlTaitBryan.h>
22#include <vlpi/entityIdentifier.h>
134 virtual void tick(
double dt)
override;
142 virtual const char*
type()
const override;
237 const DtVector& targetPos);
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:229
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:247
DtAttributeHandleType< bool > myArmedStateAttr
Attribute handle indicating whether the weapon system is in the armed state.
Definition gunnerControlLogic.h:337
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.
DtAttributeHandleType< bool > myLauncherHasTargetEntityAttr
Attribute handle indicating whether the missile launcher has a locked target entity.
Definition gunnerControlLogic.h:380
DtAttributeHandleType< std::string > myCurrentMunitionAttr
Attribute handle storing the name of the currently selected munition.
Definition gunnerControlLogic.h:444
std::string myMainControlGroup
Primary control group name for this gunner station.
Definition gunnerControlLogic.h:244
double myMinRange
Definition gunnerControlLogic.h:311
double myProjectedTargetDistance
Distance (meters) to project a fallback aim point along the observer's boresight when the center-scre...
Definition gunnerControlLogic.h:294
makVre::DtInitTable myExtendedWeaponSystems
Configuration table for extended weapon systems.
Definition gunnerControlLogic.h:262
DtAttributeHandleType< bool > myFireRequiresIntersectionAttr
Attribute handle indicating whether an intersection point is required before firing.
Definition gunnerControlLogic.h:356
DtAttributeHandleType< DtEntityIdentifier > myAttachedToAttr
Attribute handle storing the entity identifier of the vehicle the gunner is attached to.
Definition gunnerControlLogic.h:428
bool myTargetIsProjected
True when the current extended-weapon-system target came from projecting a fallback aim point (no rea...
Definition gunnerControlLogic.h:300
DtAttributeHandleType< DtVector > myExtendedWeaponTargetLocationAttr
Attribute handle storing the geocentric location of the extended weapon target.
Definition gunnerControlLogic.h:368
virtual void zoomIn(double val)
Increases the sight magnification level.
DtAttributeHandleType< std::string > myExtendedWeaponTargetElementNameAttr
Attribute handle storing the display name of the extended weapon target entity.
Definition gunnerControlLogic.h:376
virtual void stabilize(double val)
Controls weapon stabilization system.
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the gunner control logic component.
DtAttributeHandleType< DtVector > myMissileTargetLocationAttr
Attribute handle storing the target impact point for missile guidance.
Definition gunnerControlLogic.h:396
DtAttributeHandleType< DtTaitBryan > myObserverOrientationAttr
Attribute handle storing the observer's current orientation in Tait-Bryan angles.
Definition gunnerControlLogic.h:440
DtAttributeHandleType< std::string > mySystemCurrentMunitionAttr
Attribute handle storing the currently selected munition type for this weapon system.
Definition gunnerControlLogic.h:323
DtWeaponResourceLogic * myResourceLogic
Pointer to the weapon resource logic component.
Definition gunnerControlLogic.h:253
bool myIsOverrideRole
Flag indicating if this gunner is in override mode.
Definition gunnerControlLogic.h:277
DtAttributeHandleType< bool > myZoomChangedAttr
Attribute handle indicating whether the zoom level has changed and interpolation needs updating.
Definition gunnerControlLogic.h:364
virtual void previousWeapon(double val)
Selects the previous available weapon.
double myMinGunAzimuth
Definition gunnerControlLogic.h:316
DtAttributeHandleType< bool > myHasLauncherTargetModesAttr
Attribute handle indicating whether the launcher supports selectable target modes.
Definition gunnerControlLogic.h:416
std::string myForceResourceType
Allow the configuration to specify a resource name directly.
Definition gunnerControlLogic.h:289
DtAttributeHandleType< makVrv::DtElementID > myExtendedWeaponTargetElementAttr
Attribute handle storing the scene element ID of the extended weapon target entity.
Definition gunnerControlLogic.h:372
virtual void azimuth(double val)
Controls turret azimuth (horizontal rotation)
double myMissileX
Definition gunnerControlLogic.h:308
virtual void fire(double val)
Input functions mapped to particular action strings in configuration.
virtual void missileY(double val)
DtAttributeHandleType< double > myZoomAttr
Attribute handle storing the current zoom magnification level.
Definition gunnerControlLogic.h:360
virtual void turretDown(float val)
Moves turret downward (direct control)
DtAttributeHandleType< bool > myUsingIndirectCoordinateAttr
Attribute handle indicating whether indirect-fire coordinate targeting mode is active.
Definition gunnerControlLogic.h:408
std::string myAltRole
Name of the alternate role to switch to.
Definition gunnerControlLogic.h:274
DtAttributeHandleType< std::string > myLauncherTargetModeAttr
Attribute handle storing the name of the currently selected launcher target mode.
Definition gunnerControlLogic.h:420
virtual void switchToAltRole()
Switches between gunner and alternate role (e.g., commander RWS)
virtual void turretRight(float val)
Moves turret to the right (direct control)
DtAttributeHandleType< bool > myIsArmedAttr
Attribute handle indicating whether the weapon system is in a fully armed and ready state.
Definition gunnerControlLogic.h:424
std::vector< double > myZoomLevels
Available zoom magnification levels.
Definition gunnerControlLogic.h:256
double myMaxRange
Definition gunnerControlLogic.h:312
DtAttributeHandleType< std::vector< std::string > > mySensorModesAttr
Attribute handle storing the list of available sensor mode name strings.
Definition gunnerControlLogic.h:404
DtAttributeHandleType< DtTaitBryan > myWeaponOrientationAttr
Attribute handle storing the weapon's current orientation in Tait-Bryan angles.
Definition gunnerControlLogic.h:436
virtual ~DtGunnerControlLogic() override
Destructor for DtGunnerControlLogic.
makVrv::DtElementID myTargetElement
Element ID of the current target.
Definition gunnerControlLogic.h:271
virtual bool postInitialize() override
Performs post-initialization after all components are initialized.
virtual void turretUp(float val)
Moves turret upward (direct control)
DtAttributeHandleType< bool > myManualMissileControlAttr
Attribute handle indicating whether the player has manual control of a missile in flight.
Definition gunnerControlLogic.h:388
DtAttributeHandleType< DtVector > myWeaponLocationAttr
Attribute handle storing the weapon muzzle location in geocentric coordinates.
Definition gunnerControlLogic.h:352
bool myPreviousMissileInFlight
Definition gunnerControlLogic.h:314
double myMaxGunAzimuth
Definition gunnerControlLogic.h:317
DtAttributeHandle myResourcesAttr
Definition gunnerControlLogic.h:303
DtAttributeHandleType< bool > myIsInGunnerSeatAttr
Attribute handle indicating whether the player is currently occupying the gunner's seat.
Definition gunnerControlLogic.h:400
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:280
virtual void tick(double dt) override
Called every frame to update gunner control logic.
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)
DtAttributeHandle myMunitionInfoAttr
Definition gunnerControlLogic.h:306
virtual void sendMissileTargetUpdate(const DtEntityIdentifier &missileId, const std::string &missileMarking, const DtVector &targetPos)
DtAttributeHandleType< bool > myFiringAttr
Attribute handle indicating whether the weapon is currently firing.
Definition gunnerControlLogic.h:331
DtAttributeHandleType< bool > myWeaponPoseValidAttr
Attribute handle indicating whether a valid weapon intersection pose has been computed.
Definition gunnerControlLogic.h:348
DtAttributeHandleType< double > myAzimuthStateAttr
Attribute handle storing the current main-gun azimuth angle in radians.
Definition gunnerControlLogic.h:344
DtAttributeHandleType< double > myRangeAttr
Attribute handle storing the calculated range to the current aim point.
Definition gunnerControlLogic.h:432
virtual void nextSensor(double val)
Cycles to the next available sensor type (visual, NVG, thermal)
DtAttributeHandleType< bool > myMissileInFlightAttr
Attribute handle indicating whether a guided missile is currently in flight.
Definition gunnerControlLogic.h:384
DtGunnerControlLogic()
Constructor for DtGunnerControlLogic.
DtAttributeHandleType< int > myCurrentSensorAttr
Attribute handle storing the active sensor view index (0=Visual, 1=NVG, 2=Thermal-white,...
Definition gunnerControlLogic.h:327
virtual bool canFire()
Returns true if the weapon can fire. Checks for range, azimuth and isArmed.
DtAttributeHandleType< DtVector > myObserverLocationAttr
Attribute handle storing the observer's geocentric position for targeting calculations.
Definition gunnerControlLogic.h:392
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:241
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:259
DtVector myTargetLocation
Current target location for extended weapon systems.
Definition gunnerControlLogic.h:268
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:250
virtual const char * type() const override
Returns the component type identifier.
DtAttributeHandleType< DtVector > myIndirectFireCoordinateAttr
Attribute handle storing the geocentric coordinate used for indirect fire targeting.
Definition gunnerControlLogic.h:412
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)
double myDelayedCycleWeaponTimer
Timer for delaying weapon cycling operations.
Definition gunnerControlLogic.h:286
virtual void zoomOut(double val)
Decreases the sight magnification level.
makVre::DtInitTable myCurrentExtendedSystem
Configuration for the currently active extended weapon system.
Definition gunnerControlLogic.h:265
bool myCycleWeaponFlag
Flag indicating if a weapon cycle operation is in progress.
Definition gunnerControlLogic.h:283
double myMissileY
Definition gunnerControlLogic.h:309
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:71
constexpr const char * fireRequiresIntersection
Definition gunnerControlLogic.h:53
constexpr const char * azimuthStateAttribute
Definition gunnerControlLogic.h:47
constexpr const char * slewToCueUpdateRate
Definition gunnerControlLogic.h:86
constexpr const char * maxFireRange
Definition gunnerControlLogic.h:65
constexpr const char * armedProperty
Definition gunnerControlLogic.h:44
constexpr const char * extendedWeaponSystems
Definition gunnerControlLogic.h:50
constexpr const char * zoomLevels
\vreRoleParam{zoomLevels,table,"{1,2,4,8,16,32}",gunnerControlLogic,Array of available zoom magnifica...
Definition gunnerControlLogic.h:92
constexpr const char * maxFireDegreesAzimuth
Definition gunnerControlLogic.h:62
constexpr const char * altRole
Definition gunnerControlLogic.h:41
constexpr const char * isOverrideRole
Definition gunnerControlLogic.h:59
constexpr const char * projectedTargetDistance
Definition gunnerControlLogic.h:77
constexpr const char * systemName
Definition gunnerControlLogic.h:89
constexpr const char * minFireDegreesAzimuth
Definition gunnerControlLogic.h:68
constexpr const char * slewToCueTargetSystem
Definition gunnerControlLogic.h:80
constexpr const char * forceResourceType
Definition gunnerControlLogic.h:56
constexpr const char * slewToCueUpdateDeltaThreshold
Definition gunnerControlLogic.h:83
constexpr const char * overrideSystem
Definition gunnerControlLogic.h:74
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:33
!
Definition glsVreMessageUtil.h:50
constexpr const char * DtGunnerControlLogicType
Type identifier for DtGunnerControlLogic component.
Definition gunnerControlLogic.h:98
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the base class for all VREngage messages.