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