VR-Engage  2.2
Loading...
Searching...
No Matches
humanInputLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file humanInputLogic.h
7//! \brief Defines DtHumanInputLogic for handling human-specific inputs
8//! \ingroup vreHumanFrontend
9
10#pragma once
11
12#include "vreHumanFrontEnd/export.h"
14
15namespace makVre
16{
17//! \brief Forward declaration of the human control logic class
19
20//! \brief Input logic component for the human role
21//!
22//! DtHumanInputLogic manages user input processing for the human role,
23//! handling keyboard, mouse, and controller inputs for character movement,
24//! weapon operations, view modes, and special equipment. It translates raw input
25//! values into appropriate control actions for the human entity.
27{
28public:
29 //! \brief Constructor
30 //! \param simLogic Reference to the human control logic component
31 //! \param configFile Path to the input configuration file
32 DtHumanInputLogic(DtHumanControlLogic& simLogic, const std::string& configFile);
33
34 //! \brief Virtual destructor
35 virtual ~DtHumanInputLogic() override;
36
37 //! \brief Initializes the input logic component
38 //!
39 //! Sets up input bindings and default configuration
40 virtual void initialize() override;
41
42 //! \brief Loads a specific input configuration group
43 //! \param group Name of the configuration group to load
44 virtual void loadConfigGroup(const std::string& group);
45
46 //! \brief Unloads a specific input configuration group
47 //! \param group Name of the configuration group to unload
48 virtual void unloadConfigGroup(const std::string& group);
49
50 //! \brief Handles forward/backward movement input
51 //! \param value Input value in the range [-1.0, 1.0], where positive is forward
52 virtual void move(float value);
53
54 //! \brief Handles left/right movement input
55 //! \param value Input value in the range [-1.0, 1.0], where positive is right
56 virtual void strafe(float value);
57
58 //! \brief Handles yaw (left/right turning) input
59 //! \param value Input value in the range [-1.0, 1.0], where positive is right
60 virtual void yaw(float value);
61
62 //! \brief Handles pitch (up/down looking) input
63 //! \param value Input value in the range [-1.0, 1.0], where positive is down
64 virtual void pitch(float value);
65
66 //! \brief Handles mouse-specific yaw input
67 //! \param value Input value derived from mouse movement
68 virtual void mouseYaw(float value);
69
70 //! \brief Handles mouse-specific pitch input
71 //! \param value Input value derived from mouse movement
72 virtual void mousePitch(float value);
73
74 //! \brief Activates sprint movement
75 //! \param value Input value, typically 1.0 for activation
76 virtual void sprint(float value);
77
78 //! \brief Activates walk movement
79 //! \param value Input value, typically 1.0 for activation
80 virtual void walk(float value);
81
82 //! \brief Handles forward movement input
83 //! \param value Input value, typically 1.0 for full forward
84 virtual void moveForward(float value);
85
86 //! \brief Handles backward movement input
87 //! \param value Input value, typically 1.0 for full backward
88 virtual void moveBackward(float value);
89
90 //! \brief Handles leftward movement input
91 //! \param value Input value, typically 1.0 for full left
92 virtual void strafeLeft(float value);
93
94 //! \brief Handles rightward movement input
95 //! \param value Input value, typically 1.0 for full right
96 virtual void strafeRight(float value);
97
98 //! \brief Handles leftward turning input
99 //! \param value Input value, typically 1.0 for activation
100 virtual void yawLeft(float value);
101
102 //! \brief Handles rightward turning input
103 //! \param value Input value, typically 1.0 for activation
104 virtual void yawRight(float value);
105
106 //! \brief Handles upward looking input
107 //! \param value Input value, typically 1.0 for activation
108 virtual void pitchUp(float value);
109
110 //! \brief Handles downward looking input
111 //! \param value Input value, typically 1.0 for activation
112 virtual void pitchDown(float value);
113 //! \brief Selects posture based on current state
114 //! \param value Input value, typically 1.0 for activation
115 virtual void postureSelect(float value);
116
117 //! \brief Transitions to a more upright posture
118 //! \param value Input value, typically 1.0 for activation
119 virtual void postureUp(float value);
120
121 //! \brief Transitions to a more prone posture
122 //! \param value Input value, typically 1.0 for activation
123 virtual void postureDown(float value);
124
125 //! \brief Transitions to standing posture
126 //! \param value Input value, typically 1.0 for activation
127 virtual void postureStand(float value);
128
129 //! \brief Transitions to prone posture
130 //! \param value Input value, typically 1.0 for activation
131 virtual void postureProne(float value);
132
133 //! \brief Fires the current weapon
134 //! \param value Input value, typically 1.0 for activation
135 virtual void fire(float value);
136
137 //! \brief Initiates weapon reload
138 //! \param value Input value, typically 1.0 for activation
139 virtual void reload(float value);
140
141 //! \brief Activates aiming mode
142 //! \param value Input value, typically 1.0 for activation
143 virtual void aim(float value);
144
145 //! \brief Cycles through available weapons
146 //! \param value Input value, typically 1.0 for activation
147 virtual void weaponCycle(float value);
148
149 //! \brief Switches to the next weapon
150 //! \param value Input value, typically 1.0 for activation
151 virtual void nextWeapon(float value);
152 //! \brief Selects a specific weapon by index
153 //! \param value Input value, typically 1.0 for activation
154 //! \param index Index of the weapon to select (0-based)
155 virtual void selectWeapon(float value, int index);
156
157 //! \brief Selects weapon 1
158 //! \param value Input value, typically 1.0 for activation
159 virtual void selectWeapon1(float value);
160
161 //! \brief Selects weapon 2
162 //! \param value Input value, typically 1.0 for activation
163 virtual void selectWeapon2(float value);
164
165 //! \brief Selects weapon 3
166 //! \param value Input value, typically 1.0 for activation
167 virtual void selectWeapon3(float value);
168
169 //! \brief Selects weapon 4
170 //! \param value Input value, typically 1.0 for activation
171 virtual void selectWeapon4(float value);
172
173 //! \brief Selects weapon 5
174 //! \param value Input value, typically 1.0 for activation
175 virtual void selectWeapon5(float value);
176
177 //! \brief Selects weapon 6
178 //! \param value Input value, typically 1.0 for activation
179 virtual void selectWeapon6(float value);
180
181 //! \brief Selects weapon 7
182 //! \param value Input value, typically 1.0 for activation
183 virtual void selectWeapon7(float value);
184
185 //! \brief Selects weapon 8
186 //! \param value Input value, typically 1.0 for activation
187 virtual void selectWeapon8(float value);
188
189 //! \brief Selects weapon 9
190 //! \param value Input value, typically 1.0 for activation
191 virtual void selectWeapon9(float value);
192
193 //! \brief Selects weapon 10
194 //! \param value Input value, typically 1.0 for activation
195 virtual void selectWeapon10(float value);
196 //! \brief Toggles weapon stowed state
197 //! \param value Input value, typically 1.0 for activation
198 virtual void toggleWeaponStowed(float value);
199
200 //! \brief Toggles weapon down state
201 //! \param value Input value, typically 1.0 for activation
202 virtual void toggleWeaponDown(float value);
203
204 //! \brief Toggles HUD visibility
205 //! \param value Input value, typically 1.0 for activation
206 //!
207 //! Action handler for "toggle-HUD" control. Calls corresponding function in mySimLogic.
208 virtual void toggleHUD(float value);
209
210 //! \brief Cycles through weapon states (ready, down, stowed)
211 //! \param value Input value, typically 1.0 for activation
212 virtual void cycleWeaponState(float value);
213
214 //! \brief Toggles free look mode
215 //! \param value Input value, typically 1.0 for activation
216 virtual void freeLook(float value);
217
218 //! \brief Switches to first-person view mode
219 //! \param value Input value, typically 1.0 for activation
220 virtual void firstPersonMode(float value);
221
222 //! \brief Switches to third-person view mode
223 //! \param value Input value, typically 1.0 for activation
224 virtual void thirdPersonMode(float value);
225
226 //! \brief Toggles between view modes
227 //! \param value Input value, typically 1.0 for activation
228 virtual void toggleViewMode(float value);
229
230 //! \brief Toggles night vision goggles
231 //! \param value Input value, typically 1.0 for activation
232 virtual void toggleNVG(float value);
233
234 //! \brief Toggles binoculars equipment
235 //! \param value Input value, typically 1.0 for activation
236 virtual void toggleBinoculars(float value);
237
238 //! \brief Toggles flashlight on/off
239 //! \param value Input value, typically 1.0 for activation
240 virtual void toggleFlashlight(float value);
241
242 //! \brief Toggles compass display
243 //! \param value Input value, typically 1.0 for activation
244 virtual void toggleCompass(float value);
245
246 //! \brief Toggles between compass unit types
247 //! \param value Input value, typically 1.0 for activation
248 virtual void toggleCompassUnits(float value);
249
250 //! \brief Deploys the parachute
251 //! \param value Input value, typically 1.0 for activation
252 virtual void parachuteDeploy(float value);
253
254 //! \brief Enables or disables parachute controls
255 //! \param enabled True to enable parachute controls, false to disable
256 virtual void setParachuteControls(bool enabled);
257
258 //! \brief Toggles left parachute control
259 //! \param value Input value, typically 1.0 for activation
260 virtual void parachuteLeftToggle(float value);
261
262 //! \brief Toggles right parachute control
263 //! \param value Input value, typically 1.0 for activation
264 virtual void parachuteRightToggle(float value);
265
266 //! \brief Cycles minimap display modes
267 //! \param value Input value, typically 1.0 for activation
268 virtual void minimapCycle(float value);
269
270 //! \brief Zooms in the minimap
271 //! \param value Input value, typically 1.0 for activation
272 virtual void minimapZoomIn(float value);
273
274 //! \brief Zooms out the minimap
275 //! \param value Input value, typically 1.0 for activation
276 virtual void minimapZoomOut(float value);
277
278 //! \brief Resets minimap zoom to default
279 //! \param value Input value, typically 1.0 for activation
280 virtual void minimapResetZoom(float value);
281
282 //! \brief Toggles AR camera menu display
283 //! \param value Input value, typically 1.0 for activation
284 virtual void toggleARCameraMenu(float value);
285
286 //! \brief Enables or disables binoculars-specific controls
287 //! \param enabled True to enable binoculars controls, false to disable
288 virtual void setBinocularsControls(bool enabled);
289
290 //! \brief Zooms in with current optical equipment
291 //! \param value Input value, typically 1.0 for activation
292 virtual void zoomIn(float value);
293
294 //! \brief Zooms out with current optical equipment
295 //! \param value Input value, typically 1.0 for activation
296 virtual void zoomOut(float value);
297
298 //! \brief Controls continuous zoom level
299 //! \param value Input value in the range [-1.0, 1.0], where positive is zoom in
300 virtual void zoom(float value);
301
302 //! \brief Enables or disables launcher-specific controls
303 //! \param enabled True to enable launcher controls, false to disable
304 virtual void setLauncherControls(bool enabled);
305
306 //! \brief Handles first stage trigger input for weapons
307 //! \param value Input value, typically 1.0 for activation
308 virtual void firstStageTrigger(float value);
309
310 //! \brief Toggles the missile attack mode
311 //! \param value Input value, typically 1.0 for activation
312 //!
313 //! Toggles between top attack mode and direct attack mode for missile launchers
314 virtual void toggleMissileAttackMode(float value);
315
316 //! \brief Enables or disables scope-specific controls
317 //! \param enabled True to enable scope controls, false to disable
318 virtual void setScopeControls(bool enabled);
319
320 //! \brief Enables or disables drone-specific controls
321 //! \param enabled True to enable drone controls, false to disable
322 virtual void setDroneControls(bool enabled);
323
324 //! \brief Toggles remote view viewport for drone
325 //! \param value Input value, typically 1.0 for activation
326 virtual void toggleRemoteViewViewport(float value);
327
328 //! \brief Toggles focus on controlled drone
329 //! \param value Input value, typically 1.0 for activation
330 virtual void toggleFocusOnDrone(float value);
331
332 //! \brief Toggles drone PID control menu
333 //! \param value Input value, typically 1.0 for activation
334 virtual void toggleDronePIDMenu(float value);
335
336 //! \brief Controls drone collective (vertical movement)
337 //! \param value Input value in the range [-1.0, 1.0], where positive is up
338 virtual void droneCollective(float value);
339
340 //! \brief Controls drone pitch (forward/backward tilt)
341 //! \param value Input value in the range [-1.0, 1.0], where positive is down
342 virtual void dronePitch(float value);
343
344 //! \brief Controls drone roll (left/right tilt)
345 //! \param value Input value in the range [-1.0, 1.0], where positive is right
346 virtual void droneRoll(float value);
347
348 //! \brief Controls drone pedal (yaw/rotation)
349 //! \param value Input value in the range [-1.0, 1.0], where positive is right
350 virtual void dronePedal(float value);
351
352 //! \brief Controls drone wheel brake
353 //! \param value Input value, typically 1.0 for activation
354 virtual void droneWheelBrake(float value);
355
356 //! \brief Controls drone camera elevation
357 //! \param value Input value in the range [-1.0, 1.0], where positive is down
358 virtual void droneCameraElevation(float value);
359
360 //! \brief Controls drone camera zoom
361 //! \param value Input value in the range [-1.0, 1.0], where positive is zoom in
362 virtual void droneCameraZoom(float value);
363
364 //! \brief Captures an image from the drone camera
365 //! \param value Input value, typically 1.0 for activation
366 virtual void droneCaptureImage(float value);
367
368protected:
369 //! \brief Sends a joystick command to the controlled drone
370 //! \param functionGroup Function group name for the command
371 //! \param function Function name for the command
372 //! \param value Command value
373 virtual void sendDroneJoystickCommand(const std::string& functionGroup, const std::string& function, double value);
374
375 //! \brief Reference to the human control logic component
377
378 //! \brief Path to the input configuration file
379 std::string myConfigFile;
380
381 //! \brief Flag indicating if binoculars controls are enabled
383
384 //! \brief Flag indicating if scope controls are enabled
386};
387} // namespace makVre
Control logic component for the human entity.
Definition humanControlLogic.h:138
virtual void parachuteLeftToggle(float value)
Toggles left parachute control.
virtual void toggleARCameraMenu(float value)
Toggles AR camera menu display.
bool myBinocularsEnabled
Flag indicating if binoculars controls are enabled.
Definition humanInputLogic.h:382
virtual void zoom(float value)
Controls continuous zoom level.
virtual void pitchDown(float value)
Handles downward looking input.
virtual void parachuteRightToggle(float value)
Toggles right parachute control.
virtual void moveForward(float value)
Handles forward movement input.
virtual void postureUp(float value)
Transitions to a more upright posture.
virtual void nextWeapon(float value)
Switches to the next weapon.
virtual void toggleNVG(float value)
Toggles night vision goggles.
virtual void loadConfigGroup(const std::string &group)
Loads a specific input configuration group.
virtual void postureStand(float value)
Transitions to standing posture.
virtual void toggleRemoteViewViewport(float value)
Toggles remote view viewport for drone.
virtual void firstPersonMode(float value)
Switches to first-person view mode.
virtual void selectWeapon3(float value)
Selects weapon 3.
virtual void zoomOut(float value)
Zooms out with current optical equipment.
virtual void setLauncherControls(bool enabled)
Enables or disables launcher-specific controls.
virtual void fire(float value)
Fires the current weapon.
virtual void toggleCompass(float value)
Toggles compass display.
virtual void selectWeapon6(float value)
Selects weapon 6.
virtual void droneRoll(float value)
Controls drone roll (left/right tilt)
virtual void zoomIn(float value)
Zooms in with current optical equipment.
virtual ~DtHumanInputLogic() override
Virtual destructor.
DtHumanControlLogic & mySimLogic
Reference to the human control logic component.
Definition humanInputLogic.h:376
virtual void selectWeapon(float value, int index)
Selects a specific weapon by index.
virtual void mouseYaw(float value)
Handles mouse-specific yaw input.
virtual void selectWeapon7(float value)
Selects weapon 7.
virtual void initialize() override
Initializes the input logic component.
virtual void firstStageTrigger(float value)
Handles first stage trigger input for weapons.
virtual void dronePedal(float value)
Controls drone pedal (yaw/rotation)
virtual void yawLeft(float value)
Handles leftward turning input.
virtual void toggleMissileAttackMode(float value)
Toggles the missile attack mode.
virtual void toggleFocusOnDrone(float value)
Toggles focus on controlled drone.
virtual void strafe(float value)
Handles left/right movement input.
virtual void pitch(float value)
Handles pitch (up/down looking) input.
virtual void selectWeapon1(float value)
Selects weapon 1.
virtual void setBinocularsControls(bool enabled)
Enables or disables binoculars-specific controls.
virtual void reload(float value)
Initiates weapon reload.
DtHumanInputLogic(DtHumanControlLogic &simLogic, const std::string &configFile)
Constructor.
virtual void move(float value)
Handles forward/backward movement input.
virtual void toggleBinoculars(float value)
Toggles binoculars equipment.
virtual void toggleWeaponStowed(float value)
Toggles weapon stowed state.
bool myScopeEnabled
Flag indicating if scope controls are enabled.
Definition humanInputLogic.h:385
virtual void dronePitch(float value)
Controls drone pitch (forward/backward tilt)
virtual void postureDown(float value)
Transitions to a more prone posture.
virtual void postureProne(float value)
Transitions to prone posture.
virtual void mousePitch(float value)
Handles mouse-specific pitch input.
virtual void toggleViewMode(float value)
Toggles between view modes.
virtual void walk(float value)
Activates walk movement.
virtual void droneCaptureImage(float value)
Captures an image from the drone camera.
virtual void setScopeControls(bool enabled)
Enables or disables scope-specific controls.
virtual void thirdPersonMode(float value)
Switches to third-person view mode.
virtual void toggleCompassUnits(float value)
Toggles between compass unit types.
virtual void minimapZoomOut(float value)
Zooms out the minimap.
virtual void selectWeapon5(float value)
Selects weapon 5.
virtual void sendDroneJoystickCommand(const std::string &functionGroup, const std::string &function, double value)
Sends a joystick command to the controlled drone.
virtual void postureSelect(float value)
Selects posture based on current state.
virtual void minimapZoomIn(float value)
Zooms in the minimap.
virtual void strafeRight(float value)
Handles rightward movement input.
virtual void minimapCycle(float value)
Cycles minimap display modes.
virtual void freeLook(float value)
Toggles free look mode.
virtual void strafeLeft(float value)
Handles leftward movement input.
virtual void selectWeapon8(float value)
Selects weapon 8.
virtual void moveBackward(float value)
Handles backward movement input.
virtual void toggleDronePIDMenu(float value)
Toggles drone PID control menu.
virtual void selectWeapon4(float value)
Selects weapon 4.
virtual void selectWeapon10(float value)
Selects weapon 10.
virtual void toggleHUD(float value)
Toggles HUD visibility.
virtual void selectWeapon2(float value)
Selects weapon 2.
virtual void toggleFlashlight(float value)
Toggles flashlight on/off.
virtual void setDroneControls(bool enabled)
Enables or disables drone-specific controls.
virtual void selectWeapon9(float value)
Selects weapon 9.
virtual void droneCameraZoom(float value)
Controls drone camera zoom.
virtual void pitchUp(float value)
Handles upward looking input.
virtual void yaw(float value)
Handles yaw (left/right turning) input.
std::string myConfigFile
Path to the input configuration file.
Definition humanInputLogic.h:379
virtual void parachuteDeploy(float value)
Deploys the parachute.
virtual void yawRight(float value)
Handles rightward turning input.
virtual void droneCollective(float value)
Controls drone collective (vertical movement)
virtual void sprint(float value)
Activates sprint movement.
virtual void cycleWeaponState(float value)
Cycles through weapon states (ready, down, stowed)
virtual void aim(float value)
Activates aiming mode.
virtual void unloadConfigGroup(const std::string &group)
Unloads a specific input configuration group.
virtual void weaponCycle(float value)
Cycles through available weapons.
virtual void droneWheelBrake(float value)
Controls drone wheel brake.
virtual void droneCameraElevation(float value)
Controls drone camera elevation.
virtual void minimapResetZoom(float value)
Resets minimap zoom to default.
virtual void setParachuteControls(bool enabled)
Enables or disables parachute controls.
virtual void toggleWeaponDown(float value)
Toggles weapon down state.
DtInputLogic()
Constructor.
#define HUMAN_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