3#include <NDEVR/SoftwareService.h>
4#include <NDEVR/Battery.h>
5#include <NDEVR/Dictionary.h>
6#include <NDEVR/Buffer.h>
7#include <NDEVR/Vector.h>
8#include <NDEVR/RGBColor.h>
238 ControllerInterfaceManager();
A specification of upper and lower bounds in N-dimensions.
The equivelent of std::vector but with a bit more control.
void controllerConnectionsChangedSignal()
Emitted when controllers are added or removed.
void setDefaultWindowInstance(WindowInstance *default_window_instance)
Sets the default window instance for input routing to all controllers.
void findControllersSignal()
Emitted to request a scan for new controllers.
WindowInstance * m_default_window_instance
Default window instance for input routing.
const Dictionary< UUID, ControllerInterface * > & controllers() const
Returns the dictionary of all registered controllers.
void addController(ControllerInterface *joystick)
Registers a controller with the manager.
static ControllerInterfaceManager & Default()
Returns the singleton ControllerInterfaceManager instance.
Thread * m_controller_thread
Background thread for polling controller state.
void updateStates()
Polls all registered controllers and updates their input states.
void removeController(UUID id)
Removes a controller from the manager by its unique identifier.
Dictionary< UUID, ControllerInterface * > m_controllers
Map of controller UUIDs to their interfaces.
Provides standard logic shared across all hardware controllers to be used with the software.
virtual Buffer< ControlButton > rightButtons() const =0
Returns the right-side buttons on the controller.
virtual bool requestColor(const RGBColor &color)=0
Requests the controller LED to display the given color.
virtual Buffer< ControlStick > rightSticks() const =0
Returns the right-side analog sticks on the controller.
virtual Buffer< ControlTrigger > rightTriggers() const =0
Returns the right-side triggers on the controller.
virtual Vector< 2, fltp08 > vibration() const =0
Returns the current vibration intensity for both motors.
virtual Buffer< ControlStick > leftSticks() const =0
Returns the left-side analog sticks on the controller.
virtual UUID id() const =0
Returns the unique identifier of this controller.
void onUpdated()
Emitted after the controller state has been updated.
virtual void setWindowInstance(WindowInstance *)
Associates a window instance with this controller for input routing.
virtual Buffer< HapticFeedback > hapticFeedback() const =0
Returns the haptic feedback outputs available on this controller.
virtual Buffer< ControlTrigger > leftTriggers() const =0
Returns the left-side triggers on the controller.
virtual RGBColor color() const =0
Returns the current LED color of the controller, if supported.
virtual bool requestVibrating(fltp08 left, fltp08 right)=0
Requests the controller to vibrate with the given intensities.
virtual void updateState()=0
Polls the controller hardware and updates the internal input state.
virtual Buffer< ControlButton > centerButtons() const =0
Returns the center buttons on the controller (e.g., start, select).
virtual Buffer< ControlButton > leftButtons() const =0
Returns the left-side buttons on the controller (e.g., D-pad).
virtual Buffer< Battery * > batteries() const =0
Returns the batteries associated with this controller.
A hash-based key-value store, useful for quick associative lookups.
Represents a color in the RGB space with optional alpha transparency.
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String class for the NDEVR API.
The default thread class for executing concurrent sequences in the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Contains core information about a Viewport.
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
ControlStick(const UUID &id)
Constructs a ControlStick with the given identifier.
ControlStick(const UUID &id, Vector< 2, fltp08 > &position)
Constructs a ControlStick with the given identifier and position.
bool pressed
Whether the stick is pressed down (clicked).
Vector< 2, fltp08 > position
Current 2D position of the analog stick.
ControlTrigger(const UUID &id, fltp08 percent)
Constructs a ControlTrigger with the given identifier and depression amount.
bool pressed
Whether the trigger is considered pressed (above 50% depression).
fltp08 percent
Trigger depression from 0 (released) to 1 (fully pressed).
ControlTrigger(const UUID &id)
Constructs a ControlTrigger with the given identifier.
UUID feedback_part_id
ID of the associated input (e.g., joystick or trigger). Invalid if a general rumbler.
HapticFeedback(const UUID &id, fltp08 intensity)
Constructs a HapticFeedback with the given identifier and intensity.
HapticFeedback(const UUID &id)
Constructs a HapticFeedback with the given identifier.
fltp08 intensity
Feedback intensity from 0 (off) to 1 (maximum).