|
VR-Engage
2.2
|
This class provides common functionality for joystick controllers in the VREngage RTD system. It handles joystick state management, port creation, and state transitions for controllers. This trait is used by both fixed-wing and rotary-wing joystick controllers to share common functionality.
#include <vreRtdTraitJoyControllerExtension.h>
Public Member Functions | |
| DtVreRtdTraitJoyControllerExtension () | |
| virtual | ~DtVreRtdTraitJoyControllerExtension () |
| virtual void | tick (bool myJoystickEnabled) |
| virtual bool | createJoystickEnabledPort () |
| virtual void | processSetJoyDeviceSwitch (DtSimMessage *msg) |
| virtual void | disable () |
| virtual void | enable () |
| virtual void | setIsEnabled (bool yes) |
Protected Attributes | |
| DtBooleanOutputPort * | myJoystickEnabledPort |
| bool | myFirstTick |
| bool | myPreviousJoystickState |
| vreRtd::DtVreRtdTraitJoyControllerExtension::DtVreRtdTraitJoyControllerExtension | ( | ) |
Constructor.
Initializes a new joystick controller extension trait with default values.
|
virtual |
Virtual destructor.
Cleans up resources used by the joystick controller extension trait.
|
virtual |
Performs per-frame processing.
| myJoystickEnabled | Whether the joystick is currently enabled |
Called once per simulation frame to update the joystick controller state. This function handles state transitions when joystick control is enabled or disabled.
|
virtual |
Creates the joystick enabled output port.
Creates the output port that indicates whether joystick control is enabled. This port can be connected to other components to synchronize control states.
|
virtual |
Processes a joystick device switch message.
| msg | The message to process |
Processes a message that indicates a change in the joystick device state. This function is only available in RTD VRF plugin versions earlier than 4.40.
|
virtual |
Disables the joystick controller.
Disables joystick input processing, usually when player control is deactivated.
Reimplemented in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.
|
virtual |
Enables the joystick controller.
Enables joystick input processing, usually when player control is activated.
Reimplemented in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.
|
virtual |
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 in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.
|
protected |
Output port for joystick enabled state.
Port that indicates whether the joystick is currently enabled.
|
protected |
Flag indicating whether this is the first tick.
Used to handle initialization during the first simulation frame.
|
protected |
Previous joystick state.
Stores the joystick state from the previous frame to detect state changes.