|
VR-Engage
2.3
|
DtPilotSimLogic manages aircraft simulation behavior including flight controls, weapons systems, sensors, and aircraft-specific functionality. It provides methods for controlling aircraft systems and responding to simulation events while acting as the main control logic for pilot entities.
#include <pilotSimLogic.h>
Classes | |
| struct | CmLaunchParameters |
Public Member Functions | |
| DtPilotSimLogic () | |
| virtual | ~DtPilotSimLogic () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | sendJoystickMessage (const std::string &functionGroup, const std::string &function, double val, double delay=0) |
| virtual bool | useRTD () |
| virtual DtFlightControlsInputLogic & | flightControls () |
| virtual DtPilotInstrumentsInputLogic & | instrumentControls () |
| virtual bool | isHelo () |
| virtual bool | isCargoDoorOpen () |
| virtual void | openCargoDoor () |
| virtual void | closeCargoDoor () |
| virtual bool | isSlidingDoorOpen () |
| virtual void | openSlidingDoor () |
| virtual void | closeSlidingDoor () |
| virtual bool | isSlingLoadDoorOpen () |
| virtual void | openSlingLoadDoor () |
| virtual void | closeSlingLoadDoor () |
| virtual bool | isLandingGearDown () |
| virtual void | requestSarImage () |
| virtual void | gimbalTrackLaserCode (int laserCode, bool continuousTrack) |
| virtual void | gimbalTrackMgrsCoord (const std::string &mgrsCoord) |
| virtual void | cycleGimbalSensorMode () |
| virtual void | setAutopilot (const std::string &newMode, bool stayDisabledIfOff=false) |
| virtual void | toggleAutopilot () |
| virtual void | reset (float val) override |
| virtual void | resetInPlace (float val=1) override |
| virtual void | setFlap (int flap) |
| virtual void | setAutopilotMode (const std::string &value) |
| virtual void | setAutopilotHeading (const std::string &value) |
| virtual void | setAutopilotAltitude (const std::string &value) |
| virtual void | setAutopilotSpeed (const std::string &value) |
| virtual void | setAutopilotRoute (const std::string &value) |
| virtual void | suppressWarnings () |
Joystick Function Processing | |
Methods for processing joystick inputs. The input value range is typically 0.0 to 1.0 and can represent either an axis value or a button value. | |
| virtual void | trigger (double val) |
| virtual void | toggleObserverAttachMode (double val) |
| virtual void | toggleLasingState () |
| virtual void | setLaserCode (int val) |
| virtual void | setBullseye (const DtEntityIdentifier &target) |
| virtual void | gimbalTrackDesignatedRadarTrack () |
| virtual CmLaunchParameters | countermeasuresLaunchParameters (const std::string &countermeasuresName) |
| virtual void | clearTrackingLocation () |
| virtual void | toggleNorthReference (double val) |
Public Member Functions inherited from makVre::DtEntityControlLogic | |
| DtEntityControlLogic () | |
| virtual | ~DtEntityControlLogic () override |
| virtual void | setMouseControlEnabled (bool enabled) |
| virtual bool | isMouseControlEnabled () |
| virtual bool | isMouseControlSupportAllowed () const |
| virtual void | setMouseControlSupportAllowed (bool enable) |
| virtual const std::vector< std::string > & | joystickGroups () const |
| virtual void | sendJoystickCommand (const DtEntityIdentifier &id, const std::string &functionGroup, const std::string &function, double val, bool repeat=false) |
| virtual makVre::DtVreMessageResult | handleReset (makVre::DtVreMessage *message) |
| virtual makVre::DtVreMessageResult | handleCreationStatus (makVre::DtVreMessage *message) |
| virtual void | toggleMouseControl (float val) |
| virtual void | enableMouseControl (float val) |
| virtual makVre::DtVreMessageResult | handleFocusMessage (makVre::DtVreMessage *message) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| bool | componentReady () const |
| void | setComponentReady (bool ready) |
| virtual DtInitTickStatus | finalizeInitTick (double dt) |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
| virtual const DtAttributeHandle & | ownshipState () const |
| virtual void | setExtendedData (const std::string &key, const std::string &value, DtEntityIdentifier entity=DtEntityIdentifier::nullId()) |
| makVre::DtPilotSimLogic::DtPilotSimLogic | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the pilot simulation logic component.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtEntityControlLogic.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Completes initialization tasks that require other components to be already initialized. This typically includes setting up connections to other components and starting entity control.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Updates simulation state for the current frame.
| dt | Delta time since the last frame in seconds |
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Cleans up resources when the component is being shut down.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Returns the component type identifier.
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Sends a joystick control message to the simulation.
| functionGroup | Function group name for the joystick control |
| function | Function name for the joystick control |
| val | Input value for the function |
| delay | Optional delay in seconds before the message is processed |
|
virtual |
Checks if real-time dynamics are enabled.
|
virtual |
Gets a reference to the flight controls input logic.
|
virtual |
Gets a reference to the instrument controls input logic.
|
inlinevirtual |
Checks if the aircraft is a helicopter.
References myHelo.
|
virtual |
Checks if the cargo door is open.
|
virtual |
Opens the cargo door.
|
virtual |
Closes the cargo door.
|
virtual |
Checks if the sliding door is open.
|
virtual |
Opens the sliding door.
|
virtual |
Closes the sliding door.
|
virtual |
Checks if the sling load door is open.
|
virtual |
Opens the sling load door.
|
virtual |
Closes the sling load door.
|
virtual |
Checks if the landing gear is down.
|
virtual |
Requests a Synthetic Aperture Radar (SAR) image.
|
virtual |
Commands the gimbal sensor to track a laser code.
| laserCode | The laser code to track |
| continuousTrack | Flag indicating whether to continuously track the code |
|
virtual |
Commands the gimbal sensor to track an MGRS coordinate.
| mgrsCoord | MGRS coordinate string to track |
|
virtual |
Cycles to the next gimbal sensor mode.
Cycles through available sensor modes which typically include IR (infrared), NVG (night vision), and OTW (out-the-window/normal vision).
|
virtual |
Sets the autopilot mode.
| newMode | New autopilot mode to set ("OFF", "PATH", "ALT/HDG/SPD", "ALT", "HDG", "SPD") |
| stayDisabledIfOff | If true and the mode is set to "OFF", autopilot will remain off when toggled |
Pass an empty string to cycle to the next setting.
|
virtual |
Toggles the autopilot on/off.
|
overridevirtual |
Resets a fixed-wing aircraft to its saved location.
| val | Input value, typically 1.0 for activation. |
Clamps the aircraft to terrain when its saved location is on the ground.
Reimplemented from makVre::DtEntityControlLogic.
|
overridevirtual |
Resets the aircraft in its current location.
| val | Input value, typically 1.0 for activation |
Overloaded to handle special case when the aircraft is on the ground
Reimplemented from makVre::DtEntityControlLogic.
|
virtual |
Sets the flap position.
| flap | Flap position index to set |
|
virtual |
Sets the autopilot mode extended data.
| value | Mode value as a string |
|
virtual |
Sets the autopilot heading extended data.
| value | Heading value as a string |
|
virtual |
Sets the autopilot altitude extended data.
| value | Altitude value as a string |
|
virtual |
Sets the autopilot speed extended data.
| value | Speed value as a string |
|
virtual |
Sets the autopilot route extended data.
| value | Route value as a string |
|
virtual |
Suppresses warning messages temporarily.
Suppresses audio and visual warnings for a configured duration
|
virtual |
Handles joystick trigger input.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles between first-person and third-person view modes.
| val | Input value, typically 1.0 for activation |
|
virtual |
Toggles the laser designator on/off.
|
virtual |
Sets the laser designator code.
| val | Laser code to set |
|
virtual |
Sets the target as the bullseye reference point.
| target | Entity identifier of the target to set as bullseye |
|
virtual |
Commands the gimbal sensor to track a radar-detected entity.
Directs the gimbal sensor to slew to and track the currently designated radar target
|
virtual |
Gets the launch parameters for a specific countermeasure type.
| countermeasuresName | Name of the countermeasures type |
|
virtual |
Clears the cached location the gimbaled sensor is pointing at.
|
virtual |
Toggles between true north and magnetic north reference.
| val | Input value, typically 1.0 for activation |
|
overrideprotectedvirtual |
Handles simulation state messages.
| msg | Pointer to the message being processed |
Updates state attributes based on ownship simulation state.
Reimplemented from makVre::DtEntityControlLogic.
|
protectedvirtual |
Handles cockpit initialized messages.
| msg | Pointer to the message being processed |
Updates the master warning enabled/disabled state on cockpit initialization.
|
protectedvirtual |
Handles RWR catalog request messages.
| msg | Pointer to the message being processed |
Updates the Radar Warning Receiver with the configured catalog when the RWR is initialized.
|
protectedvirtual |
Handles RWR play sound messages.
| msg | Pointer to the message being processed |
Plays the specified RWR sound or stops all sounds when "Stop" is specified.
|
protectedvirtual |
Handles RWR sounds enabled messages.
| msg | Pointer to the message being processed |
Sets the "rwrSoundsEnabled" state attribute.
|
protectedvirtual |
Handles gimbal cycle sensor mode messages.
| msg | Pointer to the message being processed |
If this message is intended for this entity, cycles the gimbal view by calling cycleGimbalSensorMode(). This causes the gimbal view of the Multi-Functional Display to cycle to the next sensor view (typically IR, NVG, and Out-the-Window). This message can be received from a GL Studio mouse button click or controller input.
|
protectedvirtual |
Handles cycle selected weapon messages.
| msg | Pointer to the message being processed |
If this message is intended for this entity, cycles the selected weapon. This message is received from an MFD button click when the Weapons and Stores panel is activated.
|
protectedvirtual |
Handles toggle auto countermeasures messages.
| msg | Pointer to the message being processed |
If this message is intended for this entity, toggles automatic countermeasures on/off. This message is received from an MFD button click when the Weapons and Stores panel is activated.
|
protectedvirtual |
Handles designated targets update messages.
| msg | Pointer to the message being processed |
Handles radar target selection messages, which are received from a radar 'z' button click when in radar MFD or cursor select from joystick. Allows the gimbal sensor to track a radar-detected entity.
|
protectedvirtual |
Handles window created messages.
| msg | Pointer to the message being processed |
Caches the window and channel name for the gimbaled sensor when windows are created.
|
protectedvirtual |
Adds a sound to the RWR sound system.
| key | Identifier key for the sound |
| soundFile | Path to the sound file |
| pitch | Pitch adjustment for the sound |
| volume | Volume level for the sound |
| repeatSound | Whether the sound should loop |
|
protectedvirtual |
Plays a specific RWR sound.
| key | Identifier key of the sound to play |
|
protectedvirtual |
Stops all currently playing RWR sounds.
|
protectedvirtual |
Stops the laser designator.
Deactivates the laser designator and stops lasing the current location
|
protectedvirtual |
Starts the laser designator.
Activates the laser designator and begins lasing the current target location
|
protected |
Whether RTDynamics movement modelling is enabled.
|
protected |
Whether the entity should override its function group to be "drone".
|
protected |
Pointer to the flight controls input logic component.
|
protected |
Pointer to the instruments input logic component.
|
protected |
Current observer attachment type.
|
protected |
Offset vector for observer attachment.
|
protected |
Orientation for observer attachment.
|
protected |
Map of RWR sounds indexed by sound key.
Sounds to play for various RWR events, such as when a new contact is added.
|
protected |
Cached RWR configuration table.
Caches the Radar Warning Receiver catalog to send to the RWR once it's initialized.
|
protected |
Flag indicating if the aircraft is a helicopter.
Referenced by isHelo().
|
protected |
Previously set autopilot mode.
|
protected |
Altitude threshold for low altitude warnings in meters.
|
protected |
Airspeed threshold for stall warnings in meters per second.
|
protected |
Time remaining for warning suppression in seconds.
|
protected |
Name of the window containing the gimbal display.
|
protected |
Name of the channel containing the gimbal display.
|
protected |
Name of the current sensor.
|
protected |
Vector of available gimbal sensor modes.
The different gimbal sensor modes (IR, NVG, Out-the-Window). The first element of the vector is the current mode. When cycling modes, the vector elements are rotated.
|
protected |
Pointer to the observer for getting position and orientation.
Used in gun fire to get observer X,Y,Z & H,P,R
|
protected |
Entity identifier of the currently designated radar target.
|
protected |
Map of countermeasures launch parameters indexed by name.
|
protected |
Tracks the temporary compass visibility override.
|
protected |
Attribute handle indicating whether the aircraft has landed.
| Attribute Store Key | landed |
|---|
|
protected |
Attribute handle storing the current autopilot mode string.
| Attribute Store Key | AutopilotMode |
|---|
|
protected |
Attribute handle indicating whether the landing gear is extended.
| Attribute Store Key | landingGearState |
|---|
|
protected |
Attribute handle indicating whether the aircraft has retractable landing gear.
| Attribute Store Key | landingGear |
|---|
|
protected |
Attribute handle indicating whether the powerplant is active.
| Attribute Store Key | powerplantOn |
|---|
|
protected |
Attribute handle indicating whether a low altitude warning is active.
| Attribute Store Key | low-altitude |
|---|
|
protected |
Attribute handle indicating whether a stall warning is active.
| Attribute Store Key | stall |
|---|
|
protected |
Attribute handle indicating whether the master caution warning is active.
| Attribute Store Key | master-caution |
|---|
|
protected |
Attribute handle storing the name of the currently selected weapon system.
| Attribute Store Key | SelectedWeapon |
|---|
|
protected |
Attribute handle indicating whether the laser designator is currently active.
| Attribute Store Key | laserOn |
|---|
|
protected |
Attribute handle storing the current north reference mode (True, Magnetic, or Grid).
| Attribute Store Key | northReference |
|---|
|
protected |
Attribute handle indicating whether the mimic camera offset mode is active.
| Attribute Store Key | mimicOffset |
|---|
|
protected |
Attribute handle indicating whether the autopilot is maintaining altitude.
| Attribute Store Key | maintainAltitude |
|---|
|
protected |
Attribute handle indicating whether the autopilot is maintaining heading.
| Attribute Store Key | maintainHeading |
|---|
|
protected |
Attribute handle indicating whether the autopilot is maintaining speed.
| Attribute Store Key | maintainSpeed |
|---|
|
protected |
Attribute handle storing the cargo door open/closed state.
| Attribute Store Key | cargoDoorState |
|---|
|
protected |
Attribute handle storing the sliding door open/closed state.
| Attribute Store Key | slidingDoorState |
|---|
|
protected |
Attribute handle storing the sling load door open/closed state.
| Attribute Store Key | slingLoadDoorState |
|---|