VR-Engage  2.3
Loading...
Searching...
No Matches
pilotSimLogic.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file pilotSimLogic.h
7//! \brief Defines DtPilotSimLogic for managing aircraft simulation control logic
8//! \ingroup vrePilotFrontend
9
10#pragma once
11
17
18#include <matrix/vlVector.h>
19
20#include <string>
21#include <vector>
22
24
25namespace makVrv
26{
27//! \brief Forward declaration of the display element class
28class DtDe;
29
30//! \brief Forward declaration of the scene object class
31class DtSceneObject;
32
33//! \brief Forward declaration of the observer class
34class DtObserver;
35}; // namespace makVrv
36
37namespace makAudio
38{
39//! \brief Forward declaration of the sound class
40class DtSound;
41} // namespace makAudio
42
43namespace makVre
44{
45//! \brief Forward declaration of the flight controls input logic class
47
48//! \brief Forward declaration of the pilot instruments input logic class
50
52{
53//! \ingroup RoleConfigParams
54//! \defgroup PilotSimLogicRoleParams Pilot Simulation Logic Role Parameters
55//! \roleInherits{EntityControlLogicRoleParams}
56//! Configuration Options for pilotSimLogic role.
57//! @{
58
59//! \vreRoleParam{lowAltitudeThreshold,double,500.0,pilotSimLogic,Altitude threshold in feet below which low altitude warning is triggered.}
60constexpr const char* lowAltitudeThreshold = "lowAltitudeThreshold";
61
62//! \vreRoleParam{rwrConfig,table,{},pilotSimLogic,Configuration table for radar warning receiver (RWR) settings and sound mappings.}
63constexpr const char* rwrConfig = "rwrConfig";
64
65//! \vreRoleParam{sensorName,string,"Gimbaled Sensor",pilotSimLogic,Name of the primary sensor system for this aircraft.}
66constexpr const char* sensorName = "sensorName";
67
68//! \vreRoleParam{stallThreshold,double,100.0,pilotSimLogic,Airspeed threshold in knots below which stall warning is triggered.}
69constexpr const char* stallThreshold = "stallThreshold";
70
71//! \vreRoleParam{useHelicopterControls,bool,false,pilotSimLogic,Whether to use helicopter control scheme instead of fixed-wing controls.}
72constexpr const char* useHelicopterControls = "useHelicopterControls";
73
74//! \vreRoleParam{useRTD,bool,false,pilotSimLogic,Whether to use RTDynamics movement modeling for flight simulation.}
75constexpr const char* useRTD = "useRTD";
76
77//! \vreRoleParam{isDrone,bool,false,pilotSimLogic,Overrides movement function group to be "drone".}
78constexpr const char* useDroneFunctionGroup = "useDroneFunctionGroup";
79
80//! @}
81} // namespace PilotSimLogicConfig
82
83//! \brief Type identifier for DtPilotSimLogic component
84constexpr const char* DtPilotSimLogicType = "DtPilotSimLogic";
85
86//! \brief Simulation logic component for the pilot role
87//!
88//! DtPilotSimLogic manages aircraft simulation behavior including flight controls,
89//! weapons systems, sensors, and aircraft-specific functionality. It provides methods
90//! for controlling aircraft systems and responding to simulation events while acting
91//! as the main control logic for pilot entities.
93{
94public:
95 //! \brief Default constructor
97
98 //! \brief Virtual destructor
99 virtual ~DtPilotSimLogic() override;
100
101 //! \brief Initializes the pilot simulation logic component
102 //! \param player Pointer to the player station
103 //! \param config Configuration settings for initialization
104 //! \return True if initialization was successful, false otherwise
105 virtual bool initialize(DtPlayerStation* player, DtInitTable& config) override;
106
107 virtual bool postInitialize() override;
108
109 //! \brief Updates simulation state for the current frame
110 //! \param dt Delta time since the last frame in seconds
111 virtual void tick(double dt) override;
112
113 //! \brief Cleans up resources when the component is being shut down
114 virtual void shutdown() override;
115
116 //! \brief Returns the component type identifier
117 //! \return The component type string
118 virtual const char* type() const override;
119
120 //! \brief Sends a joystick control message to the simulation
121 //! \param functionGroup Function group name for the joystick control
122 //! \param function Function name for the joystick control
123 //! \param val Input value for the function
124 //! \param delay Optional delay in seconds before the message is processed
126 const std::string& functionGroup, const std::string& function, double val, double delay = 0);
127
128 //! \brief Checks if real-time dynamics are enabled
129 //! \return True if real-time dynamics are enabled, false otherwise
130 virtual bool useRTD();
131
132 //! \brief Gets a reference to the flight controls input logic
133 //! \return Reference to the flight controls input logic component
135
136 //! \brief Gets a reference to the instrument controls input logic
137 //! \return Reference to the instrument controls input logic component
139
140 //! \brief Checks if the aircraft is a helicopter
141 //! \return True if the aircraft is a helicopter, false if it's fixed-wing
142 virtual bool isHelo() { return myHelo; };
143
144 //! \brief Checks if the cargo door is open
145 //! \return True if the cargo door is open, false otherwise
146 virtual bool isCargoDoorOpen();
147
148 //! \brief Opens the cargo door
149 virtual void openCargoDoor();
150
151 //! \brief Closes the cargo door
152 virtual void closeCargoDoor();
153
154 //! \brief Checks if the sliding door is open
155 //! \return True if the sliding door is open, false otherwise
156 virtual bool isSlidingDoorOpen();
157
158 //! \brief Opens the sliding door
159 virtual void openSlidingDoor();
160
161 //! \brief Closes the sliding door
162 virtual void closeSlidingDoor();
163
164 //! \brief Checks if the sling load door is open
165 //! \return True if the sling load door is open, false otherwise
166 virtual bool isSlingLoadDoorOpen();
167
168 //! \brief Opens the sling load door
169 virtual void openSlingLoadDoor();
170
171 //! \brief Closes the sling load door
172 virtual void closeSlingLoadDoor();
173
174 //! \brief Checks if the landing gear is down
175 //! \return True if the landing gear is down, false if it's up
176 virtual bool isLandingGearDown();
177
178 //! \brief Requests a Synthetic Aperture Radar (SAR) image
179 virtual void requestSarImage();
180
181 //! \brief Commands the gimbal sensor to track a laser code
182 //! \param laserCode The laser code to track
183 //! \param continuousTrack Flag indicating whether to continuously track the code
184 virtual void gimbalTrackLaserCode(int laserCode, bool continuousTrack);
185
186 //! \brief Commands the gimbal sensor to track an MGRS coordinate
187 //! \param mgrsCoord MGRS coordinate string to track
188 virtual void gimbalTrackMgrsCoord(const std::string& mgrsCoord);
189 //! \brief Cycles to the next gimbal sensor mode
190 //!
191 //! Cycles through available sensor modes which typically include IR (infrared),
192 //! NVG (night vision), and OTW (out-the-window/normal vision).
193 virtual void cycleGimbalSensorMode();
194
195 //! \brief Sets the autopilot mode
196 //! \param newMode New autopilot mode to set ("OFF", "PATH", "ALT/HDG/SPD", "ALT", "HDG", "SPD")
197 //! \param stayDisabledIfOff If true and the mode is set to "OFF", autopilot will remain off when toggled
198 //!
199 //! Pass an empty string to cycle to the next setting.
200 virtual void setAutopilot(const std::string& newMode, bool stayDisabledIfOff = false);
201
202 //! \brief Toggles the autopilot on/off
203 virtual void toggleAutopilot();
204
205 //! \brief Resets a fixed-wing aircraft to its saved location.
206 //! \param val Input value, typically 1.0 for activation.
207 //!
208 //! Clamps the aircraft to terrain when its saved location is on the ground.
209 virtual void reset(float val) override;
210
211 //! \brief Resets the aircraft in its current location
212 //! \param val Input value, typically 1.0 for activation
213 //!
214 //! Overloaded to handle special case when the aircraft is on the ground
215 virtual void resetInPlace(float val = 1) override;
216
217 //! \brief Sets the flap position
218 //! \param flap Flap position index to set
219 virtual void setFlap(int flap);
220
221 //! \brief Sets the autopilot mode extended data
222 //! \param value Mode value as a string
223 virtual void setAutopilotMode(const std::string& value);
224
225 //! \brief Sets the autopilot heading extended data
226 //! \param value Heading value as a string
227 virtual void setAutopilotHeading(const std::string& value);
228
229 //! \brief Sets the autopilot altitude extended data
230 //! \param value Altitude value as a string
231 virtual void setAutopilotAltitude(const std::string& value);
232
233 //! \brief Sets the autopilot speed extended data
234 //! \param value Speed value as a string
235 virtual void setAutopilotSpeed(const std::string& value);
236
237 //! \brief Sets the autopilot route extended data
238 //! \param value Route value as a string
239 virtual void setAutopilotRoute(const std::string& value);
240
241 //! \brief Suppresses warning messages temporarily
242 //!
243 //! Suppresses audio and visual warnings for a configured duration
244 virtual void suppressWarnings();
245
246 //! \name Joystick Function Processing
247 //! Methods for processing joystick inputs. The input value range is typically 0.0 to 1.0
248 //! and can represent either an axis value or a button value.
249 //! @{
250
251 //! \brief Handles joystick trigger input
252 //! \param val Input value, typically 1.0 for activation
253 virtual void trigger(double val);
254
255 //! \brief Toggles between first-person and third-person view modes
256 //! \param val Input value, typically 1.0 for activation
257 virtual void toggleObserverAttachMode(double val);
258
259 //! \brief Toggles the laser designator on/off
260 virtual void toggleLasingState();
261
262 //! \brief Sets the laser designator code
263 //! \param val Laser code to set
264 virtual void setLaserCode(int val);
265
266 //! \brief Sets the target as the bullseye reference point
267 //! \param target Entity identifier of the target to set as bullseye
268 virtual void setBullseye(const DtEntityIdentifier& target);
269
270 //! \brief Commands the gimbal sensor to track a radar-detected entity
271 //!
272 //! Directs the gimbal sensor to slew to and track the currently designated radar target
274
275 //! \brief Structure containing countermeasures launch parameters
277 {
278 public:
279 int numToFire; //!< Number of countermeasures to fire
280 double fireInterval; //!< Time interval between successive launches in seconds
281 DtEntityType cmType; //!< Entity type of the countermeasures to launch
282 };
283
284 //! \brief Gets the launch parameters for a specific countermeasure type
285 //! \param countermeasuresName Name of the countermeasures type
286 //! \return Launch parameters for the specified countermeasures
287 virtual CmLaunchParameters countermeasuresLaunchParameters(const std::string& countermeasuresName);
288
289 //! \brief Clears the cached location the gimbaled sensor is pointing at
290 virtual void clearTrackingLocation();
291
292 //! \brief Toggles between true north and magnetic north reference
293 //! \param val Input value, typically 1.0 for activation
294 virtual void toggleNorthReference(double val);
295
296 //! @}
297
298protected:
299 //! \name Message Handler Methods
300 //! Methods for handling various message types from the message manager
301 //! @{
302
303 //! \brief Handles simulation state messages
304 //! \param msg Pointer to the message being processed
305 //! \return Message processing result
306 //!
307 //! Updates state attributes based on ownship simulation state.
309
310 //! \brief Handles cockpit initialized messages
311 //! \param msg Pointer to the message being processed
312 //! \return Message processing result
313 //!
314 //! Updates the master warning enabled/disabled state on cockpit initialization.
316
317 //! \brief Handles RWR catalog request messages
318 //! \param msg Pointer to the message being processed
319 //! \return Message processing result
320 //!
321 //! Updates the Radar Warning Receiver with the configured catalog when the RWR is initialized.
323
324 //! \brief Handles RWR play sound messages
325 //! \param msg Pointer to the message being processed
326 //! \return Message processing result
327 //!
328 //! Plays the specified RWR sound or stops all sounds when "Stop" is specified.
330
331 //! \brief Handles RWR sounds enabled messages
332 //! \param msg Pointer to the message being processed
333 //! \return Message processing result
334 //!
335 //! Sets the "rwrSoundsEnabled" state attribute.
337
338 //! \brief Handles gimbal cycle sensor mode messages
339 //! \param msg Pointer to the message being processed
340 //! \return Message processing result
341 //!
342 //! If this message is intended for this entity, cycles the gimbal view by calling
343 //! cycleGimbalSensorMode(). This causes the gimbal view of the Multi-Functional
344 //! Display to cycle to the next sensor view (typically IR, NVG, and Out-the-Window).
345 //! This message can be received from a GL Studio mouse button click or controller input.
347 //! @}
348
349 //! \brief Handles cycle selected weapon messages
350 //! \param msg Pointer to the message being processed
351 //! \return Message processing result
352 //!
353 //! If this message is intended for this entity, cycles the selected weapon.
354 //! This message is received from an MFD button click when the Weapons and Stores panel
355 //! is activated.
357
358 //! \brief Handles toggle auto countermeasures messages
359 //! \param msg Pointer to the message being processed
360 //! \return Message processing result
361 //!
362 //! If this message is intended for this entity, toggles automatic countermeasures on/off.
363 //! This message is received from an MFD button click when the Weapons and Stores panel
364 //! is activated.
366
367 //! \brief Handles designated targets update messages
368 //! \param msg Pointer to the message being processed
369 //! \return Message processing result
370 //!
371 //! Handles radar target selection messages, which are received from a radar 'z' button
372 //! click when in radar MFD or cursor select from joystick. Allows the gimbal sensor to
373 //! track a radar-detected entity.
375
376 //! \brief Handles window created messages
377 //! \param msg Pointer to the message being processed
378 //! \return Message processing result
379 //!
380 //! Caches the window and channel name for the gimbaled sensor when windows are created.
382
383 //! \brief Adds a sound to the RWR sound system
384 //! \param key Identifier key for the sound
385 //! \param soundFile Path to the sound file
386 //! \param pitch Pitch adjustment for the sound
387 //! \param volume Volume level for the sound
388 //! \param repeatSound Whether the sound should loop
389 virtual void addRwrSound(
390 const std::string& key, const std::string& soundFile, double pitch, double volume, bool repeatSound);
391
392 //! \brief Plays a specific RWR sound
393 //! \param key Identifier key of the sound to play
394 virtual void playRwrSound(const std::string& key);
395
396 //! \brief Stops all currently playing RWR sounds
397 virtual void stopRwrSounds();
398
399 //! \brief Stops the laser designator
400 //!
401 //! Deactivates the laser designator and stops lasing the current location
402 virtual void stopLasingLocation();
403
404 //! \brief Starts the laser designator
405 //!
406 //! Activates the laser designator and begins lasing the current target location
407 virtual void startLasingLocation();
408
409protected:
410 //! \brief Whether RTDynamics movement modelling is enabled.
412
413 //! \brief Whether the entity should override its function group to be "drone".
415
416 //! \brief Pointer to the flight controls input logic component
418
419 //! \brief Pointer to the instruments input logic component
421
422 //! \brief Current observer attachment type
424
425 //! \brief Offset vector for observer attachment
427
428 //! \brief Orientation for observer attachment
430
431 //! \brief Map of RWR sounds indexed by sound key
432 //!
433 //! Sounds to play for various RWR events, such as when a new contact is added.
434 std::map<std::string, makAudio::DtSound*> myRwrSoundMap;
435
436 //! \brief Cached RWR configuration table
437 //!
438 //! Caches the Radar Warning Receiver catalog to send to the RWR once it's initialized.
440
441 //! \brief Flag indicating if the aircraft is a helicopter
442 bool myHelo;
443
444 //! \brief Previously set autopilot mode
446
447 //! \brief Altitude threshold for low altitude warnings in meters
449
450 //! \brief Airspeed threshold for stall warnings in meters per second
452
453 //! \brief Time remaining for warning suppression in seconds
455
456 //! \brief Name of the window containing the gimbal display
458
459 //! \brief Name of the channel containing the gimbal display
461
462 //! \brief Name of the current sensor
463 std::string mySensorName;
464
465 //! \brief Vector of available gimbal sensor modes
466 //!
467 //! The different gimbal sensor modes (IR, NVG, Out-the-Window).
468 //! The first element of the vector is the current mode.
469 //! When cycling modes, the vector elements are rotated.
470 //! - IR: infrared sensor view
471 //! - NVG: night vision sensor view
472 //! - Out-the-Window: regular view without special effects
473 std::vector<std::string> myGimbalSensorModes;
474
475 //! \brief Pointer to the observer for getting position and orientation
476 //!
477 //! Used in gun fire to get observer X,Y,Z & H,P,R
478 makVrv::DtObserver* myObserver;
479
480 //! \brief Entity identifier of the currently designated radar target
481 DtEntityIdentifier myDesginatedRadarTarget;
482
483 //! \brief Map of countermeasures launch parameters indexed by name
484 std::map<std::string, CmLaunchParameters> myCmLaunchParameters;
485
486 //! \brief Tracks the temporary compass visibility override.
488
489 //! \brief Attribute handle indicating whether the aircraft has landed.
490 //! \vreAttrKey{landed}
492
493 //! \brief Attribute handle storing the current autopilot mode string.
494 //! \vreAttrKey{AutopilotMode}
496
497 //! \brief Attribute handle indicating whether the landing gear is extended.
498 //! \vreAttrKey{landingGearState}
500
501 //! \brief Attribute handle indicating whether the aircraft has retractable landing gear.
502 //! \vreAttrKey{landingGear}
504
505 //! \brief Attribute handle indicating whether the powerplant is active.
506 //! \vreAttrKey{powerplantOn}
508
509 //! \brief Attribute handle indicating whether a low altitude warning is active.
510 //! \vreAttrKey{low-altitude}
512
513 //! \brief Attribute handle indicating whether a stall warning is active.
514 //! \vreAttrKey{stall}
516
517 //! \brief Attribute handle indicating whether the master caution warning is active.
518 //! \vreAttrKey{master-caution}
520
521 //! \brief Attribute handle storing the name of the currently selected weapon system.
522 //! \vreAttrKey{SelectedWeapon}
524
525 //! \brief Attribute handle indicating whether the laser designator is currently active.
526 //! \vreAttrKey{laserOn}
528
529 //! \brief Attribute handle storing the current north reference mode (True, Magnetic, or Grid).
530 //! \vreAttrKey{northReference}
532
533 //! \brief Attribute handle indicating whether the mimic camera offset mode is active.
534 //! \vreAttrKey{mimicOffset}
536
537 //! \brief Attribute handle indicating whether the autopilot is maintaining altitude.
538 //! \vreAttrKey{maintainAltitude}
540
541 //! \brief Attribute handle indicating whether the autopilot is maintaining heading.
542 //! \vreAttrKey{maintainHeading}
544
545 //! \brief Attribute handle indicating whether the autopilot is maintaining speed.
546 //! \vreAttrKey{maintainSpeed}
548
549 //! \brief Attribute handle storing the cargo door open/closed state.
550 //! \vreAttrKey{cargoDoorState}
552
553 //! \brief Attribute handle storing the sliding door open/closed state.
554 //! \vreAttrKey{slidingDoorState}
556
557 //! \brief Attribute handle storing the sling load door open/closed state.
558 //! \vreAttrKey{slingLoadDoorState}
560};
561} // namespace makVre
Type-specific handle class for attributes.
Definition attributeHandle.h:229
DtEntityControlLogic()
Constructor.
Input logic component for aircraft flight controls.
Definition flightControlsInputLogic.h:28
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Input logic for aircraft instrument controls.
Definition instrumentsInputLogic.h:36
virtual DtVreMessageResult handleSetRwrSoundsEnabledMessage(DtVreMessage *msg)
Handles RWR sounds enabled messages.
virtual void gimbalTrackDesignatedRadarTrack()
Commands the gimbal sensor to track a radar-detected entity.
virtual bool isLandingGearDown()
Checks if the landing gear is down.
virtual void openSlingLoadDoor()
Opens the sling load door.
virtual void setAutopilotAltitude(const std::string &value)
Sets the autopilot altitude extended data.
virtual void closeSlingLoadDoor()
Closes the sling load door.
DtAttributeHandleType< bool > mySlingLoadDoorStateAttr
Attribute handle storing the sling load door open/closed state.
Definition pilotSimLogic.h:559
virtual void toggleObserverAttachMode(double val)
Toggles between first-person and third-person view modes.
bool myUseRTD
Whether RTDynamics movement modelling is enabled.
Definition pilotSimLogic.h:411
std::string myGimbalWindowName
Name of the window containing the gimbal display.
Definition pilotSimLogic.h:457
virtual void requestSarImage()
Requests a Synthetic Aperture Radar (SAR) image.
bool myHelo
Flag indicating if the aircraft is a helicopter.
Definition pilotSimLogic.h:442
DtAttributeHandleType< bool > myMaintainAltitudeAttr
Attribute handle indicating whether the autopilot is maintaining altitude.
Definition pilotSimLogic.h:539
std::vector< std::string > myGimbalSensorModes
Vector of available gimbal sensor modes.
Definition pilotSimLogic.h:473
virtual void openCargoDoor()
Opens the cargo door.
DtAttributeHandleType< bool > myMimicOffsetAttr
Attribute handle indicating whether the mimic camera offset mode is active.
Definition pilotSimLogic.h:535
DtAttributeHandleType< DtString > mySelectedWeaponAttr
Attribute handle storing the name of the currently selected weapon system.
Definition pilotSimLogic.h:523
virtual void gimbalTrackMgrsCoord(const std::string &mgrsCoord)
Commands the gimbal sensor to track an MGRS coordinate.
virtual void cycleGimbalSensorMode()
Cycles to the next gimbal sensor mode.
virtual const char * type() const override
Returns the component type identifier.
virtual void gimbalTrackLaserCode(int laserCode, bool continuousTrack)
Commands the gimbal sensor to track a laser code.
makVrv::DtObserver * myObserver
Pointer to the observer for getting position and orientation.
Definition pilotSimLogic.h:478
DtVector myAttachOffset
Offset vector for observer attachment.
Definition pilotSimLogic.h:426
virtual DtVreMessageResult handleRwrPlaySound(DtVreMessage *msg)
Handles RWR play sound messages.
std::string mySensorName
Name of the current sensor.
Definition pilotSimLogic.h:463
DtPilotInstrumentsInputLogic * myInstrumentsInputLogic
Pointer to the instruments input logic component.
Definition pilotSimLogic.h:420
virtual bool isHelo()
Checks if the aircraft is a helicopter.
Definition pilotSimLogic.h:142
virtual void setAutopilotMode(const std::string &value)
Sets the autopilot mode extended data.
std::string myGimbalChannelName
Name of the channel containing the gimbal display.
Definition pilotSimLogic.h:460
virtual bool isCargoDoorOpen()
Checks if the cargo door is open.
std::map< std::string, makAudio::DtSound * > myRwrSoundMap
Map of RWR sounds indexed by sound key.
Definition pilotSimLogic.h:434
virtual void reset(float val) override
Resets a fixed-wing aircraft to its saved location.
virtual void setFlap(int flap)
Sets the flap position.
virtual DtVreMessageResult handleCycleSelectedWeaponMessage(DtVreMessage *msg)
Handles cycle selected weapon messages.
virtual void tick(double dt) override
Updates simulation state for the current frame.
virtual DtVreMessageResult handleDesignatedTargetsUpdate(DtVreMessage *msg)
Handles designated targets update messages.
virtual DtVreMessageResult handleWindowCreated(DtVreMessage *msg)
Handles window created messages.
DtEntityIdentifier myDesginatedRadarTarget
Entity identifier of the currently designated radar target.
Definition pilotSimLogic.h:481
virtual CmLaunchParameters countermeasuresLaunchParameters(const std::string &countermeasuresName)
Gets the launch parameters for a specific countermeasure type.
virtual void openSlidingDoor()
Opens the sliding door.
DtAttributeHandleType< std::string > myAutopilotModeAttr
Attribute handle storing the current autopilot mode string.
Definition pilotSimLogic.h:495
DtFlightControlsInputLogic * myFlightControlsInputLogic
Pointer to the flight controls input logic component.
Definition pilotSimLogic.h:417
virtual DtFlightControlsInputLogic & flightControls()
Gets a reference to the flight controls input logic.
virtual void setLaserCode(int val)
Sets the laser designator code.
virtual ~DtPilotSimLogic() override
Virtual destructor.
DtAttributeHandleType< bool > myLaserOnAttr
Attribute handle indicating whether the laser designator is currently active.
Definition pilotSimLogic.h:527
DtAttributeHandleType< bool > myCargoDoorStateAttr
Attribute handle storing the cargo door open/closed state.
Definition pilotSimLogic.h:551
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the pilot simulation logic component.
virtual bool isSlidingDoorOpen()
Checks if the sliding door is open.
DtAttributeHandleType< bool > myMasterCautionAttr
Attribute handle indicating whether the master caution warning is active.
Definition pilotSimLogic.h:519
std::string myCachedAutopilotMode
Previously set autopilot mode.
Definition pilotSimLogic.h:445
virtual DtVreMessageResult handleSimState(DtVreMessage *msg) override
Handles simulation state messages.
DtAttributeHandleType< bool > myLandingGearStateAttr
Attribute handle indicating whether the landing gear is extended.
Definition pilotSimLogic.h:499
DtAttributeHandleType< bool > myLandingGearAttr
Attribute handle indicating whether the aircraft has retractable landing gear.
Definition pilotSimLogic.h:503
virtual void toggleNorthReference(double val)
Toggles between true north and magnetic north reference.
DtAttributeHandleType< std::string > myNorthReferenceAttr
Attribute handle storing the current north reference mode (True, Magnetic, or Grid).
Definition pilotSimLogic.h:531
virtual bool isSlingLoadDoorOpen()
Checks if the sling load door is open.
virtual void closeCargoDoor()
Closes the cargo door.
virtual void clearTrackingLocation()
Clears the cached location the gimbaled sensor is pointing at.
virtual DtPilotInstrumentsInputLogic & instrumentControls()
Gets a reference to the instrument controls input logic.
virtual void toggleAutopilot()
Toggles the autopilot on/off.
double myWarningsSuppressed
Time remaining for warning suppression in seconds.
Definition pilotSimLogic.h:454
virtual void setAutopilotSpeed(const std::string &value)
Sets the autopilot speed extended data.
DtAttributeHandleType< bool > myMaintainSpeedAttr
Attribute handle indicating whether the autopilot is maintaining speed.
Definition pilotSimLogic.h:547
virtual DtVreMessageResult handleCockpitInitialized(DtVreMessage *msg)
Handles cockpit initialized messages.
virtual void sendJoystickMessage(const std::string &functionGroup, const std::string &function, double val, double delay=0)
Sends a joystick control message to the simulation.
virtual void setAutopilot(const std::string &newMode, bool stayDisabledIfOff=false)
Sets the autopilot mode.
int myAttachType
Current observer attachment type.
Definition pilotSimLogic.h:423
DtInitTable myRwrConfig
Cached RWR configuration table.
Definition pilotSimLogic.h:439
virtual void setAutopilotRoute(const std::string &value)
Sets the autopilot route extended data.
DtAttributeHandleType< bool > mySlidingDoorStateAttr
Attribute handle storing the sliding door open/closed state.
Definition pilotSimLogic.h:555
virtual void stopRwrSounds()
Stops all currently playing RWR sounds.
DtAttributeHandleType< bool > myLowAltitudeAttr
Attribute handle indicating whether a low altitude warning is active.
Definition pilotSimLogic.h:511
virtual void suppressWarnings()
Suppresses warning messages temporarily.
virtual void playRwrSound(const std::string &key)
Plays a specific RWR sound.
double myStallThreshold
Airspeed threshold for stall warnings in meters per second.
Definition pilotSimLogic.h:451
virtual DtVreMessageResult handleRwrCatalogRequest(DtVreMessage *msg)
Handles RWR catalog request messages.
std::map< std::string, CmLaunchParameters > myCmLaunchParameters
Map of countermeasures launch parameters indexed by name.
Definition pilotSimLogic.h:484
virtual void trigger(double val)
Handles joystick trigger input.
DtAttributeHandleType< bool > myLandedAttr
Attribute handle indicating whether the aircraft has landed.
Definition pilotSimLogic.h:491
virtual void stopLasingLocation()
Stops the laser designator.
DtAttributeHandleType< bool > myStallAttr
Attribute handle indicating whether a stall warning is active.
Definition pilotSimLogic.h:515
DtAttributeHandleType< bool > myMaintainHeadingAttr
Attribute handle indicating whether the autopilot is maintaining heading.
Definition pilotSimLogic.h:543
virtual bool useRTD()
Checks if real-time dynamics are enabled.
DtPilotSimLogic()
Default constructor.
DtSettingsOverrideGuard mySettingsOverrideGuard
Tracks the temporary compass visibility override.
Definition pilotSimLogic.h:487
virtual void startLasingLocation()
Starts the laser designator.
virtual bool postInitialize() override
Performs post-initialization setup.
DtTaitBryan myAttachOrientation
Orientation for observer attachment.
Definition pilotSimLogic.h:429
DtAttributeHandleType< bool > myPowerplantOnAttr
Attribute handle indicating whether the powerplant is active.
Definition pilotSimLogic.h:507
bool myUseDroneFunctionGroup
Whether the entity should override its function group to be "drone".
Definition pilotSimLogic.h:414
virtual void resetInPlace(float val=1) override
Resets the aircraft in its current location.
virtual void addRwrSound(const std::string &key, const std::string &soundFile, double pitch, double volume, bool repeatSound)
Adds a sound to the RWR sound system.
virtual DtVreMessageResult handleGimbalCycleSensorModeMessage(DtVreMessage *msg)
Handles gimbal cycle sensor mode messages.
virtual DtVreMessageResult handleToggleAutoCountermeasuresMessage(DtVreMessage *msg)
Handles toggle auto countermeasures messages.
virtual void closeSlidingDoor()
Closes the sliding door.
virtual void setBullseye(const DtEntityIdentifier &target)
Sets the target as the bullseye reference point.
double myLowAltitudeThreshold
Altitude threshold for low altitude warnings in meters.
Definition pilotSimLogic.h:448
virtual void shutdown() override
Cleans up resources when the component is being shut down.
virtual void toggleLasingState()
Toggles the laser designator on/off.
virtual void setAutopilotHeading(const std::string &value)
Sets the autopilot heading extended data.
virtual DtPlayerStation & player()
Gets the player station.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Tracks temporary settings overrides and conditionally restores them.
Definition settingsOverrideGuard.h:180
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Provides coordinate conversion functionality between different coordinate systems.
Defines the logic for controlling entities in VR-Engage.
Defines helper utilities for working with entities in VR-Engage.
constexpr const char * sensorName
Definition pilotSimLogic.h:66
constexpr const char * useHelicopterControls
Definition pilotSimLogic.h:72
constexpr const char * stallThreshold
Definition pilotSimLogic.h:69
constexpr const char * useRTD
Definition pilotSimLogic.h:75
constexpr const char * useDroneFunctionGroup
Definition pilotSimLogic.h:78
constexpr const char * rwrConfig
Definition pilotSimLogic.h:63
constexpr const char * lowAltitudeThreshold
Definition pilotSimLogic.h:60
Defines export/import macros for the Pilot Frontend library.
#define PILOT_DLL
Definition export.h:19
Component configuration and usage details.
Definition audioUpdater.h:21
Definition pilotSimLogic.h:52
!
Definition glsVreMessageUtil.h:50
constexpr const char * DtPilotSimLogicType
Type identifier for DtPilotSimLogic component.
Definition pilotSimLogic.h:84
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
Defines a guard for temporary, non-persistent settings overrides.
Structure containing countermeasures launch parameters.
Definition pilotSimLogic.h:277
int numToFire
Number of countermeasures to fire.
Definition pilotSimLogic.h:279
double fireInterval
Time interval between successive launches in seconds.
Definition pilotSimLogic.h:280
DtEntityType cmType
Entity type of the countermeasures to launch.
Definition pilotSimLogic.h:281
Defines the base class for all VREngage messages.