|
VR-Engage
2.2
|
This class manages joystick input for fixed-wing aircraft and converts it into appropriate control surface movements. It handles various input devices and maps their values to aircraft control ports, providing a bridge between the physical joystick and the aircraft flight model.
#include <vreFwlJoyController.h>
Public Member Functions | |
| DtVreFwlJoyController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtVreFwlJoyController () override |
| virtual bool | init () override |
| virtual void | tick () override |
| virtual void | calcAndSetPortValues (const DtString &functionGroup, const DtString &function, double value, bool repeat) override |
| virtual bool | createPorts () override |
| virtual const char * | type () const override |
| virtual void | disable () override |
| virtual void | enable () override |
| virtual void | setIsEnabled (bool yes) override |
Public Member Functions inherited from makVre::DtFixedWingJoyFlightController | |
| DtFixedWingJoyFlightController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtFixedWingJoyFlightController () override |
Public Member Functions inherited from vreRtd::DtVreRtdTraitJoyControllerExtension | |
| DtVreRtdTraitJoyControllerExtension () | |
| virtual | ~DtVreRtdTraitJoyControllerExtension () |
| virtual void | tick (bool myJoystickEnabled) |
| virtual bool | createJoystickEnabledPort () |
| virtual void | processSetJoyDeviceSwitch (DtSimMessage *msg) |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Static Public Member Functions inherited from makVre::DtFixedWingJoyFlightController | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Private Member Functions | |
| DtVreFwlJoyController (const DtVreFwlJoyController &orig) | |
| DtVreFwlJoyController & | operator= (const DtVreFwlJoyController &orig) |
Private Attributes | |
| const DtVreFwlJoyControllerDescriptor * | myDesc |
| DtBooleanOutputPort * | myLandingGearOutputPort |
| DtIntegerOutputPort * | myFlapSettingOutputPort |
| DtAnalogOutputPort * | myAirBrakeOutputPort |
| DtAnalogOutputPort * | myWheelBrakeOutputPort |
| bool | myLandingGearStateChanged |
| DtConstrainedDualAxisAnalogOutputPort * | myStickOutputPort |
| DtConstrainedAnalogOutputPort * | myPedalOutputPort |
| DtConstrainedAnalogOutputPort * | myThrottleOutputPort |
| makVrf::DtArticulatedPartStateRepository * | myXPartRep |
| makVrf::DtArticulatedPartStateRepository * | myYPartRep |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtFixedWingJoyFlightController | |
| virtual void | joystickConnected () override |
| virtual void | joystickDisconnected () override |
Protected Attributes inherited from vreRtd::DtVreRtdTraitJoyControllerExtension | |
| DtBooleanOutputPort * | myJoystickEnabledPort |
| bool | myFirstTick |
| bool | myPreviousJoystickState |
| FwlCgfVrf::DtVreFwlJoyController::DtVreFwlJoyController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc = 0, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| name | The name of the component |
| owner | The local object this component belongs to |
| simManager | The simulation services manager |
| desc | Component descriptor containing configuration |
| parentRegistry | Parent registry for reader/writer functionality |
Initializes a new fixed-wing joystick controller component for VREngage control.
Referenced by DtVreFwlJoyController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the joystick controller component.
|
private |
Copy constructor (not implemented)
| orig | The source object |
References DtVreFwlJoyController().
|
overridevirtual |
Initializes the joystick controller.
Performs initial setup of the joystick controller, including configuration loading and port initialization.
|
overridevirtual |
Performs per-frame processing.
Called once per simulation frame to calculate new control values based on current joystick input and update the output ports.
|
overridevirtual |
Calculates and sets port values for a specific joystick function.
| functionGroup | The function group of the joystick input |
| function | The specific function within the group |
| value | The input value from the joystick |
| repeat | Whether this is a repeated input |
Maps joystick inputs to the appropriate aircraft control outputs.
Reimplemented from makVre::DtFixedWingJoyFlightController.
|
overridevirtual |
Creates component ports.
Creates output ports for stick, pedals, throttle, landing gear, flaps, and other aircraft controls.
|
overridevirtual |
Gets the component type.
Returns TS_JoyController as the component type identifier.
Reimplemented from makVre::DtFixedWingJoyFlightController.
|
overridevirtual |
Disables the joystick controller.
Disables joystick input processing, usually when player control is deactivated.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
overridevirtual |
Enables the joystick controller.
Enables joystick input processing, usually when player control is activated.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
overridevirtual |
Sets the enabled state of the joystick controller.
| yes | True to enable the controller, false to disable |
Directly sets the enabled state of the joystick controller.
Reimplemented from vreRtd::DtVreRtdTraitJoyControllerExtension.
|
static |
Component factory function.
| name | The name for the new component |
| owner | The local object the component will belong to |
| simManager | The simulation services manager |
| desc | Component descriptor containing configuration |
| parentRegistry | Parent registry for reader/writer functionality |
Static factory function used for component creation through the component registry.
|
private |
Assignment operator (not implemented)
| orig | The source object |
References DtVreFwlJoyController().
|
private |
Component descriptor containing configuration parameters.
|
private |
Output port for landing gear control.
|
private |
Output port for flap setting.
|
private |
Output port for air brake control.
|
private |
Output port for wheel brake control.
|
private |
Flag tracking whether landing gear state has changed.
|
private |
Output port for control stick (pitch/roll)
|
private |
Output port for rudder pedals (yaw)
|
private |
Output port for throttle control.
|
private |
State repository for X-axis articulation.
|
private |
State repository for Y-axis articulation.