NDEVR
API Documentation
ControllerInterfaceabstract

Provides standard logic shared across all hardware controllers to be used with the software. More...

Inheritance diagram for ControllerInterface:
[legend]
Collaboration diagram for ControllerInterface:
[legend]

Classes

struct  ControlButton
 Represents a digital button input on a controller. More...
struct  ControllerInput
 Base structure for all controller input types. More...
struct  ControlStick
 Represents an analog stick input on a controller. More...
struct  ControlTrigger
 Represents an analog trigger input on a controller. More...
struct  HapticFeedback
 Represents a haptic feedback output on a controller. More...

Public Member Functions

virtual Buffer< Battery * > batteries () const =0
 Returns the batteries associated with this controller.
virtual Buffer< ControlButtoncenterButtons () const =0
 Returns the center buttons on the controller (e.g., start, select).
virtual RGBColor color () const =0
 Returns the current LED color of the controller, if supported.
virtual Buffer< HapticFeedbackhapticFeedback () const =0
 Returns the haptic feedback outputs available on this controller.
virtual UUID id () const =0
 Returns the unique identifier of this controller.
virtual Buffer< ControlButtonleftButtons () const =0
 Returns the left-side buttons on the controller (e.g., D-pad).
virtual Buffer< ControlStickleftSticks () const =0
 Returns the left-side analog sticks on the controller.
virtual Buffer< ControlTriggerleftTriggers () const =0
 Returns the left-side triggers on the controller.
void onUpdated ()
 Emitted after the controller state has been updated.
virtual bool requestColor (const RGBColor &color)=0
 Requests the controller LED to display the given color.
virtual bool requestVibrating (fltp08 left, fltp08 right)=0
 Requests the controller to vibrate with the given intensities.
virtual Buffer< ControlButtonrightButtons () const =0
 Returns the right-side buttons on the controller.
virtual Buffer< ControlStickrightSticks () const =0
 Returns the right-side analog sticks on the controller.
virtual Buffer< ControlTriggerrightTriggers () const =0
 Returns the right-side triggers on the controller.
virtual void setWindowInstance (WindowInstance *)
 Associates a window instance with this controller for input routing.
virtual void updateState ()=0
 Polls the controller hardware and updates the internal input state.
virtual Vector< 2, fltp08vibration () const =0
 Returns the current vibration intensity for both motors.

Detailed Description

Provides standard logic shared across all hardware controllers to be used with the software.


Definition at line 18 of file ControllerInterface.h.

Member Function Documentation

◆ batteries()

virtual Buffer< Battery * > ControllerInterface::batteries ( ) const
pure virtual

Returns the batteries associated with this controller.

Returns
A buffer of Battery pointers.

Implemented in DualSenseController, and XBoxController.

◆ centerButtons()

virtual Buffer< ControlButton > ControllerInterface::centerButtons ( ) const
pure virtual

Returns the center buttons on the controller (e.g., start, select).

Returns
A buffer of ControlButton objects.

Implemented in DualSenseController, and XBoxController.

◆ color()

virtual RGBColor ControllerInterface::color ( ) const
pure virtual

Returns the current LED color of the controller, if supported.

Returns
The current RGBColor.

Implemented in DualSenseController, and XBoxController.

Referenced by requestColor().

◆ hapticFeedback()

virtual Buffer< HapticFeedback > ControllerInterface::hapticFeedback ( ) const
pure virtual

Returns the haptic feedback outputs available on this controller.

Returns
A buffer of HapticFeedback objects.

Implemented in DualSenseController, and XBoxController.

◆ id()

virtual UUID ControllerInterface::id ( ) const
pure virtual

Returns the unique identifier of this controller.

Returns
The UUID of the controller.

Implemented in DualSenseController, and XBoxController.

◆ leftButtons()

virtual Buffer< ControlButton > ControllerInterface::leftButtons ( ) const
pure virtual

Returns the left-side buttons on the controller (e.g., D-pad).

Returns
A buffer of ControlButton objects.

Implemented in DualSenseController, and XBoxController.

◆ leftSticks()

virtual Buffer< ControlStick > ControllerInterface::leftSticks ( ) const
pure virtual

Returns the left-side analog sticks on the controller.

Returns
A buffer of ControlStick objects.

Implemented in DualSenseController, and XBoxController.

◆ leftTriggers()

virtual Buffer< ControlTrigger > ControllerInterface::leftTriggers ( ) const
pure virtual

Returns the left-side triggers on the controller.

Returns
A buffer of ControlTrigger objects.

Implemented in DualSenseController, and XBoxController.

◆ requestColor()

virtual bool ControllerInterface::requestColor ( const RGBColor & color)
pure virtual

Requests the controller LED to display the given color.

Parameters
[in]colorThe desired LED color.
Returns
True if the color request was accepted.

Implemented in DualSenseController, and XBoxController.

References color().

◆ requestVibrating()

virtual bool ControllerInterface::requestVibrating ( fltp08 left,
fltp08 right )
pure virtual

Requests the controller to vibrate with the given intensities.

Parameters
[in]leftLeft motor intensity from 0 (off) to 1 (full vibration).
[in]rightRight motor intensity from 0 (off) to 1 (full vibration).
Returns
True if the vibration request was accepted.

Implemented in DualSenseController, and XBoxController.

◆ rightButtons()

virtual Buffer< ControlButton > ControllerInterface::rightButtons ( ) const
pure virtual

Returns the right-side buttons on the controller.

Returns
A buffer of ControlButton objects.

Implemented in DualSenseController, and XBoxController.

◆ rightSticks()

virtual Buffer< ControlStick > ControllerInterface::rightSticks ( ) const
pure virtual

Returns the right-side analog sticks on the controller.

Returns
A buffer of ControlStick objects.

Implemented in DualSenseController, and XBoxController.

◆ rightTriggers()

virtual Buffer< ControlTrigger > ControllerInterface::rightTriggers ( ) const
pure virtual

Returns the right-side triggers on the controller.

Returns
A buffer of ControlTrigger objects.

Implemented in DualSenseController, and XBoxController.

◆ setWindowInstance()

virtual void ControllerInterface::setWindowInstance ( WindowInstance * )
inlinevirtual

Associates a window instance with this controller for input routing.

Parameters
[in]WindowInstancepointer to associate. Can be nullptr.

Reimplemented in DualSenseController.

Definition at line 189 of file ControllerInterface.h.

◆ vibration()

virtual Vector< 2, fltp08 > ControllerInterface::vibration ( ) const
pure virtual

Returns the current vibration intensity for both motors.

Returns
A 2D vector with left and right motor intensities (0 to 1).

Implemented in DualSenseController, and XBoxController.


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