VR-Engage  2.2
Loading...
Searching...
No Matches
vreRtd::DtVreRtdTraitJoyControllerExtension Class Reference

Detailed Description

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>

Inheritance diagram for vreRtd::DtVreRtdTraitJoyControllerExtension:
[legend]

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
 

Constructor & Destructor Documentation

◆ DtVreRtdTraitJoyControllerExtension()

vreRtd::DtVreRtdTraitJoyControllerExtension::DtVreRtdTraitJoyControllerExtension ( )

Constructor.

Initializes a new joystick controller extension trait with default values.

◆ ~DtVreRtdTraitJoyControllerExtension()

virtual vreRtd::DtVreRtdTraitJoyControllerExtension::~DtVreRtdTraitJoyControllerExtension ( )
virtual

Virtual destructor.

Cleans up resources used by the joystick controller extension trait.

Member Function Documentation

◆ tick()

virtual void vreRtd::DtVreRtdTraitJoyControllerExtension::tick ( bool myJoystickEnabled)
virtual

Performs per-frame processing.

Parameters
myJoystickEnabledWhether 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.

◆ createJoystickEnabledPort()

virtual bool vreRtd::DtVreRtdTraitJoyControllerExtension::createJoystickEnabledPort ( )
virtual

Creates the joystick enabled output port.

Returns
True if the port was successfully created, false otherwise

Creates the output port that indicates whether joystick control is enabled. This port can be connected to other components to synchronize control states.

◆ processSetJoyDeviceSwitch()

virtual void vreRtd::DtVreRtdTraitJoyControllerExtension::processSetJoyDeviceSwitch ( DtSimMessage * msg)
virtual

Processes a joystick device switch message.

Parameters
msgThe 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.

◆ disable()

virtual void vreRtd::DtVreRtdTraitJoyControllerExtension::disable ( )
virtual

Disables the joystick controller.

Disables joystick input processing, usually when player control is deactivated.

Reimplemented in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.

◆ enable()

virtual void vreRtd::DtVreRtdTraitJoyControllerExtension::enable ( )
virtual

Enables the joystick controller.

Enables joystick input processing, usually when player control is activated.

Reimplemented in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.

◆ setIsEnabled()

virtual void vreRtd::DtVreRtdTraitJoyControllerExtension::setIsEnabled ( bool yes)
virtual

Sets the enabled state of the joystick controller.

Parameters
yesTrue to enable the controller, false to disable

Directly sets the enabled state of the joystick controller.

Reimplemented in FwlCgfVrf::DtVreFwlJoyController, and RlCgfVrf::DtVreRlJoyController.

Member Data Documentation

◆ myJoystickEnabledPort

DtBooleanOutputPort* vreRtd::DtVreRtdTraitJoyControllerExtension::myJoystickEnabledPort
protected

Output port for joystick enabled state.

Port that indicates whether the joystick is currently enabled.

◆ myFirstTick

bool vreRtd::DtVreRtdTraitJoyControllerExtension::myFirstTick
protected

Flag indicating whether this is the first tick.

Used to handle initialization during the first simulation frame.

◆ myPreviousJoystickState

bool vreRtd::DtVreRtdTraitJoyControllerExtension::myPreviousJoystickState
protected

Previous joystick state.

Stores the joystick state from the previous frame to detect state changes.


The documentation for this class was generated from the following file: