VR-Engage  2.3
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 Toggles entity label/overlay visibility
211 //! \param val Input value, typically 1.0 for activation
212 //!
213 //! Action handler for "toggle-entityLabels" control. Forwards to DtHumanControlLogic::toggleOverlays().
214 virtual void toggleOverlays(double val);
215
216 //! \brief Cycles through weapon states (ready, down, stowed)
217 //! \param value Input value, typically 1.0 for activation
218 virtual void cycleWeaponState(float value);
219
220 //! \brief Toggles free look mode
221 //! \param value Input value, typically 1.0 for activation
222 virtual void freeLook(float value);
223
224 //! \brief Switches to first-person view mode
225 //! \param value Input value, typically 1.0 for activation
226 virtual void firstPersonMode(float value);
227
228 //! \brief Switches to third-person view mode
229 //! \param value Input value, typically 1.0 for activation
230 virtual void thirdPersonMode(float value);
231
232 //! \brief Toggles between view modes
233 //! \param value Input value, typically 1.0 for activation
234 virtual void toggleViewMode(float value);
235
236 //! \brief Toggles night vision goggles
237 //! \param value Input value, typically 1.0 for activation
238 virtual void toggleNVG(float value);
239
240 //! \brief Toggles binoculars equipment
241 //! \param value Input value, typically 1.0 for activation
242 virtual void toggleBinoculars(float value);
243
244 //! \brief Toggles flashlight on/off
245 //! \param value Input value, typically 1.0 for activation
246 virtual void toggleFlashlight(float value);
247
248 //! \brief Toggles compass display
249 //! \param value Input value, typically 1.0 for activation
250 virtual void toggleCompass(float value);
251
252 //! \brief Toggles between compass unit types
253 //! \param value Input value, typically 1.0 for activation
254 virtual void toggleCompassUnits(float value);
255
256 //! \brief Deploys the parachute
257 //! \param value Input value, typically 1.0 for activation
258 virtual void parachuteDeploy(float value);
259
260 //! \brief Enables or disables parachute controls
261 //! \param enabled True to enable parachute controls, false to disable
262 virtual void setParachuteControls(bool enabled);
263
264 //! \brief Toggles left parachute control
265 //! \param value Input value, typically 1.0 for activation
266 virtual void parachuteLeftToggle(float value);
267
268 //! \brief Toggles right parachute control
269 //! \param value Input value, typically 1.0 for activation
270 virtual void parachuteRightToggle(float value);
271
272 //! \brief Cycles minimap display modes
273 //! \param value Input value, typically 1.0 for activation
274 virtual void minimapCycle(float value);
275
276 //! \brief Zooms in the minimap
277 //! \param value Input value, typically 1.0 for activation
278 virtual void minimapZoomIn(float value);
279
280 //! \brief Zooms out the minimap
281 //! \param value Input value, typically 1.0 for activation
282 virtual void minimapZoomOut(float value);
283
284 //! \brief Resets minimap zoom to default
285 //! \param value Input value, typically 1.0 for activation
286 virtual void minimapResetZoom(float value);
287
288 //! \brief Toggles AR camera menu display
289 //! \param value Input value, typically 1.0 for activation
290 virtual void toggleARCameraMenu(float value);
291
292 //! \brief Enables or disables binoculars-specific controls
293 //! \param enabled True to enable binoculars controls, false to disable
294 virtual void setBinocularsControls(bool enabled);
295
296 //! \brief Zooms in with current optical equipment
297 //! \param value Input value, typically 1.0 for activation
298 virtual void zoomIn(float value);
299
300 //! \brief Zooms out with current optical equipment
301 //! \param value Input value, typically 1.0 for activation
302 virtual void zoomOut(float value);
303
304 //! \brief Controls continuous zoom level
305 //! \param value Input value in the range [-1.0, 1.0], where positive is zoom in
306 virtual void zoom(float value);
307
308 //! \brief Enables or disables launcher-specific controls
309 //! \param enabled True to enable launcher controls, false to disable
310 virtual void setLauncherControls(bool enabled);
311
312 //! \brief Handles first stage trigger input for weapons
313 //! \param value Input value, typically 1.0 for activation
314 virtual void firstStageTrigger(float value);
315
316 //! \brief Toggles the missile attack mode
317 //! \param value Input value, typically 1.0 for activation
318 //!
319 //! Toggles between top attack mode and direct attack mode for missile launchers
320 virtual void toggleMissileAttackMode(float value);
321
322 //! \brief Enables or disables scope-specific controls
323 //! \param enabled True to enable scope controls, false to disable
324 virtual void setScopeControls(bool enabled);
325
326 //! \brief Enables or disables drone-specific controls
327 //! \param enabled True to enable drone controls, false to disable
328 virtual void setDroneControls(bool enabled);
329
330 //! \brief Toggles remote view viewport for drone
331 //! \param value Input value, typically 1.0 for activation
332 virtual void toggleRemoteViewViewport(float value);
333
334 //! \brief Toggles focus on controlled drone
335 //! \param value Input value, typically 1.0 for activation
336 virtual void toggleFocusOnDrone(float value);
337
338 //! \brief Toggles drone PID control menu
339 //! \param value Input value, typically 1.0 for activation
340 virtual void toggleDronePIDMenu(float value);
341
342 //! \brief Cycles the selected drone automated task mode
343 //! \param value Input value, typically 1.0 for activation
344 virtual void cycleDroneLoiterMode(float value);
345
346 //! \brief Triggers the currently selected drone automated task mode
347 //! \param value Input value, typically 1.0 for activation
348 virtual void triggerDroneLoiter(float value);
349
350 //! \brief Controls drone collective (vertical movement)
351 //! \param value Input value in the range [-1.0, 1.0], where positive is up
352 virtual void droneCollective(float value);
353
354 //! \brief Controls drone pitch (forward/backward tilt)
355 //! \param value Input value in the range [-1.0, 1.0], where positive is down
356 virtual void dronePitch(float value);
357
358 //! \brief Controls drone roll (left/right tilt)
359 //! \param value Input value in the range [-1.0, 1.0], where positive is right
360 virtual void droneRoll(float value);
361
362 //! \brief Controls drone pedal (yaw/rotation)
363 //! \param value Input value in the range [-1.0, 1.0], where positive is right
364 virtual void dronePedal(float value);
365
366 //! \brief Controls drone wheel brake
367 //! \param value Input value, typically 1.0 for activation
368 virtual void droneWheelBrake(float value);
369
370 //! \brief Controls drone camera elevation
371 //! \param value Input value in the range [-1.0, 1.0], where positive is down
372 virtual void droneCameraElevation(float value);
373
374 //! \brief Controls drone camera zoom
375 //! \param value Input value in the range [-1.0, 1.0], where positive is zoom in
376 virtual void droneCameraZoom(float value);
377
378 //! \brief Captures an image from the drone camera
379 //! \param value Input value, typically 1.0 for activation
380 virtual void droneCaptureImage(float value);
381
382protected:
383 //! \brief Sends a joystick command to the controlled drone
384 //! \param functionGroup Function group name for the command
385 //! \param function Function name for the command
386 //! \param value Command value
387 virtual void sendDroneJoystickCommand(const std::string& functionGroup, const std::string& function, double value);
388
389 //! \brief Reference to the human control logic component
391
392 //! \brief Path to the input configuration file
393 std::string myConfigFile;
394
395 //! \brief Flag indicating if binoculars controls are enabled
397
398 //! \brief Flag indicating if scope controls are enabled
400
401 bool myParachuteEnabled = false;
402 bool myLauncherEnabled = false;
403 bool myDroneEnabled = false;
404};
405} // namespace makVre
Control logic component for the human entity.
Definition humanControlLogic.h:142
virtual void triggerDroneLoiter(float value)
Triggers the currently selected drone automated task mode.
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:396
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:390
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.
bool myDroneEnabled
Definition humanInputLogic.h:403
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:399
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 cycleDroneLoiterMode(float value)
Cycles the selected drone automated task mode.
virtual void strafeLeft(float value)
Handles leftward movement input.
virtual void selectWeapon8(float value)
Selects weapon 8.
bool myParachuteEnabled
Definition humanInputLogic.h:401
virtual void moveBackward(float value)
Handles backward movement input.
bool myLauncherEnabled
Definition humanInputLogic.h:402
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:393
virtual void toggleOverlays(double val)
Toggles entity label/overlay visibility.
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.
!
Definition glsVreMessageUtil.h:50