VR-Engage  2.3
Loading...
Searching...
No Matches
flightControlsInputLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file flightControlsInputLogic.h
7//! \brief Defines DtFlightControlsInputLogic for managing aircraft control inputs
8//! \ingroup vrePilotFrontend
9
10#pragma once
11
14#include <vreUtil/attribute.h>
15
16namespace makVre
17{
18//! \brief Forward declaration of the pilot simulation logic class
19class DtPilotSimLogic;
20
21//! \brief Input logic component for aircraft flight controls
22//!
23//! DtFlightControlsInputLogic manages user input processing for aircraft
24//! flight controls, handling keyboard, joystick, and controller inputs for
25//! both fixed-wing and rotary-wing aircraft. It translates raw input values
26//! into appropriate control actions for the aircraft entity.
28{
29public:
30 //! \brief Constructor
31 //! \param simLogic Reference to the pilot simulation logic component
32 //! \param configFile Path to the input configuration file
33 DtFlightControlsInputLogic(DtPilotSimLogic& simLogic, const std::string& configFile);
34
35 //! \brief Virtual destructor
36 virtual ~DtFlightControlsInputLogic() override;
37
38 //! \brief Initializes the flight controls input logic
39 //! \param isFixedWing True for fixed-wing aircraft, false for rotary-wing
40 //! \param useDroneFunctionGroup True to override function group name to "drone".
41 //! \param useRTD True to use RTDynamics modelling, false otherwise
42 virtual void initialize(bool isFixedWing, bool useDroneFunctionGroup, bool useRTD);
43
44 //! \brief Sets the flight controls mode based on aircraft type
45 //! \param isFixedWing True for fixed-wing aircraft, false for rotary-wing
46 //! \param useDroneFunctionGroup True to override function group name to "drone".
47 //! \param useRTD True to use real-time dynamics, false otherwise
48 //! \return Name of the configured function group
49 virtual std::string setFlightControls(bool isFixedWing, bool useDroneFunctionGroup, bool useRTD);
50
51 //! \brief Gets the current flight controls function group name
52 //! \return Name of the current function group
53 virtual std::string flightControlsFunctionGroup() const;
54
55 //! \brief Handles air brake control input
56 //! \param val Input value in the range [0.0, 1.0]
57 virtual void airBrake(float val);
58
59 //! \brief Handles flap state control input
60 //! \param val Input value determining flap state
61 virtual void flapState(float val);
62
63 //! \brief Handles landing gear control input
64 //! \param val Input value controlling gear state
65 virtual void landingGear(float val);
66
67 //! \brief Handles rudder pedal control input
68 //! \param val Input value in the range [-1.0, 1.0]
69 virtual void pedal(float val);
70
71 //! \brief Handles pitch control input
72 //! \param val Input value in the range [-1.0, 1.0], where positive is nose down
73 virtual void pitch(float val);
74
75 //! \brief Handles roll control input
76 //! \param val Input value in the range [-1.0, 1.0], where positive is right roll
77 virtual void roll(float val);
78
79 //! \brief Handles throttle control input
80 //! \param val Input value in the range [0.0, 1.0]
81 virtual void throttle(float val);
82
83 //! \brief Handles wheel brake control input
84 //! \param val Input value in the range [0.0, 1.0]
85 virtual void wheelBrake(float val);
86
87 //! \brief Handles collective control input (for helicopters)
88 //! \param val Input value in the range [0.0, 1.0]
89 virtual void collective(float val);
90
91 //! \brief Handles yaw control input
92 //! \param val Input value in the range [-1.0, 1.0]
93 virtual void yaw(float val);
94
95
96 //! \brief Activates autopilot mode 1
97 //! \param val Input value, typically 1.0 for activation
98 virtual void autopilotMode1(float val);
99
100 //! \brief Activates autopilot mode 2
101 //! \param val Input value, typically 1.0 for activation
102 virtual void autopilotMode2(float val);
103
104 //! \brief Toggles autopilot on/off
105 //! \param val Input value, typically 1.0 for activation
106 virtual void autopilotToggle(float val);
107
108 //! \brief Cycles to the next weapon with ammunition
109 //! \param val Input value, typically 1.0 for activation
110 virtual void cycleWeapon(float val);
111
112 //! \brief Sets the flap to a specific position
113 //! \param flap Flap position index to set
114 virtual void setFlap(int flap);
115
116 //! \brief Sets flaps to position 1
117 //! \param val Input value, typically 1.0 for activation
118 virtual void flap1(float val);
119
120 //! \brief Sets flaps to position 2
121 //! \param val Input value, typically 1.0 for activation
122 virtual void flap2(float val);
123
124 //! \brief Toggles flaps between positions
125 //! \param val Input value, defaults to 1.0 for activation
126 virtual void flapToggle(float val = 1);
127
128 //! \brief Controls nose wheel steering
129 //! \param val Input value in the range [-1.0, 1.0], where positive is right
130 virtual void setNoseWheelSteering(float val);
131
132 //! \brief Refills fuel resources and ammunition counts
133 //! \param val Input value, typically 1.0 for activation
134 virtual void replenishFuelAndAmmo(float val);
135
136 //! \brief Toggles landing gear between raised and lowered positions
137 //! \param val Input value, defaults to 1.0 for activation
138 virtual void toggleLandingGear(float val = 1);
139
140 //! \brief Raises the landing gear
141 virtual void raiseLandingGear();
142
143 //! \brief Lowers the landing gear
144 virtual void lowerLandingGear();
145
146 //! \brief Activates the weapon trigger
147 //! \param val Input value, typically 1.0 for activation
148 virtual void trigger(float val);
149
150 //! \brief Launches specified countermeasures
151 //! \param countermeasuresName Name of the countermeasures to launch
152 virtual void launchCountermeasures(const std::string& countermeasuresName);
153
154 //! \brief Toggles automatic countermeasures deployment
155 //! \param val Input value, defaults to 1.0 for activation
156 virtual void toggleAutomaticCountermeasures(float val = 1);
157
158 //! \brief Launches chaff countermeasures
159 //! \param val Input value, typically 1.0 for activation
160 virtual void launchChaff(float val);
161
162 //! \brief Launches flare countermeasures
163 //! \param val Input value, typically 1.0 for activation
164 virtual void launchFlares(float val);
165
166 //! \brief Suppresses warning notifications
167 //! \param val Input value, typically 1.0 for activation
168 virtual void suppressWarnings(float val);
169
170 //! \brief Toggles AR camera menu display
171 //! \param val Input value, typically 1.0 for activation
172 virtual void toggleArCameraMenu(float val);
173
174 //! \brief Toggles the observer attachment mode
175 //! \param val Input value, typically 1.0 for activation
176 virtual void toggleObserverAttachMode(float val);
177
178protected:
179 //! \brief Reference to the pilot simulation logic component
181
182 //! \brief Path to the input configuration file
183 std::string myConfigFile;
184
185 //! \brief Current flight controls function group name
186 std::string myFunctionGroup;
187
188 //! \brief Flag indicating if nose wheel steering is active
190
191 //! \brief Current flap state position
193
194 //! \brief Attribute handle storing the current flap position state.
195 //! \vreAttrKey{flapState}
197
198 //! \brief Attribute handle indicating whether automatic countermeasures are enabled.
199 //! \vreAttrKey{automaticCountermeasures}
201};
202} // namespace makVre
Provides attribute handling system for hierarchical data storage and manipulation.
Type-specific handle class for attributes.
Definition attributeHandle.h:229
virtual void pitch(float val)
Handles pitch control input.
virtual void airBrake(float val)
Handles air brake control input.
virtual void throttle(float val)
Handles throttle control input.
virtual std::string setFlightControls(bool isFixedWing, bool useDroneFunctionGroup, bool useRTD)
Sets the flight controls mode based on aircraft type.
bool myNoseWheelSteering
Flag indicating if nose wheel steering is active.
Definition flightControlsInputLogic.h:189
virtual ~DtFlightControlsInputLogic() override
Virtual destructor.
virtual void raiseLandingGear()
Raises the landing gear.
std::string myConfigFile
Path to the input configuration file.
Definition flightControlsInputLogic.h:183
virtual void launchChaff(float val)
Launches chaff countermeasures.
virtual void autopilotMode2(float val)
Activates autopilot mode 2.
virtual void initialize(bool isFixedWing, bool useDroneFunctionGroup, bool useRTD)
Initializes the flight controls input logic.
virtual void pedal(float val)
Handles rudder pedal control input.
virtual void autopilotToggle(float val)
Toggles autopilot on/off.
virtual void lowerLandingGear()
Lowers the landing gear.
virtual void cycleWeapon(float val)
Cycles to the next weapon with ammunition.
virtual void flap1(float val)
Sets flaps to position 1.
virtual void toggleLandingGear(float val=1)
Toggles landing gear between raised and lowered positions.
DtPilotSimLogic & mySimLogic
Reference to the pilot simulation logic component.
Definition flightControlsInputLogic.h:180
virtual void yaw(float val)
Handles yaw control input.
virtual void landingGear(float val)
Handles landing gear control input.
virtual void flap2(float val)
Sets flaps to position 2.
virtual void autopilotMode1(float val)
Activates autopilot mode 1.
virtual void collective(float val)
Handles collective control input (for helicopters)
int myFlapState
Current flap state position.
Definition flightControlsInputLogic.h:192
virtual void flapToggle(float val=1)
Toggles flaps between positions.
virtual void toggleArCameraMenu(float val)
Toggles AR camera menu display.
std::string myFunctionGroup
Current flight controls function group name.
Definition flightControlsInputLogic.h:186
virtual void flapState(float val)
Handles flap state control input.
virtual void wheelBrake(float val)
Handles wheel brake control input.
virtual std::string flightControlsFunctionGroup() const
Gets the current flight controls function group name.
virtual void toggleObserverAttachMode(float val)
Toggles the observer attachment mode.
virtual void launchFlares(float val)
Launches flare countermeasures.
DtAttributeHandleType< int > myFlapStateAttr
Attribute handle storing the current flap position state.
Definition flightControlsInputLogic.h:196
virtual void replenishFuelAndAmmo(float val)
Refills fuel resources and ammunition counts.
DtFlightControlsInputLogic(DtPilotSimLogic &simLogic, const std::string &configFile)
Constructor.
virtual void setFlap(int flap)
Sets the flap to a specific position.
virtual void trigger(float val)
Activates the weapon trigger.
virtual void roll(float val)
Handles roll control input.
virtual void toggleAutomaticCountermeasures(float val=1)
Toggles automatic countermeasures deployment.
virtual void setNoseWheelSteering(float val)
Controls nose wheel steering.
DtAttributeHandleType< bool > myAutomaticCountermeasuresAttr
Attribute handle indicating whether automatic countermeasures are enabled.
Definition flightControlsInputLogic.h:200
virtual void launchCountermeasures(const std::string &countermeasuresName)
Launches specified countermeasures.
virtual void suppressWarnings(float val)
Suppresses warning notifications.
DtInputLogic()
Constructor.
Simulation logic component for the pilot role.
Definition pilotSimLogic.h:93
Defines export/import macros for the Pilot Frontend library.
#define PILOT_DLL
Definition export.h:19
Defines the DtInputLogic class for handling input in VR-Engage.
!
Definition glsVreMessageUtil.h:50