Skip to main content

GamepadState Class

A lightweight class for transferring the state of a Gamepad. More...

Declaration

class helios::input::gamepad::GamepadState { ... }

Public Constructors Index

GamepadState ()=default

Default constructor. More...

GamepadState (float axisLeftX, float axisLeftY, float axisRightX, float axisRightY, float triggerLeft, float triggerRight, bool buttonA, bool buttonB, bool buttonX, bool buttonY, bool buttonStart, bool buttonBack, bool buttonGuide, bool buttonLeftBumper, bool buttonRightBumper, bool buttonLeftThumb, bool buttonRightThumb, bool buttonDpadUp, bool buttonDpadRight, bool buttonDpadDown, bool buttonDpadLeft) noexcept

Creates a new GamepadState object. More...

Public Destructor Index

~GamepadState ()=default

Public Member Functions Index

voidupdateAxes (float axisLeftX, float axisLeftY, float axisRightX, float axisRightY, float triggerLeft, float triggerRight, bool buttonA, bool buttonB, bool buttonX, bool buttonY, bool buttonStart, bool buttonBack, bool buttonGuide, bool buttonLeftBumper, bool buttonRightBumper, bool buttonLeftThumb, bool buttonRightThumb, bool buttonDpadUp, bool buttonDpadRight, bool buttonDpadDown, bool buttonDpadLeft) noexcept

Updates the axes and button states of this GamepadState object. More...

floatleftX () const noexcept

Returns the current value of the left stick's x-axis. More...

floatleftY () const noexcept

Returns the current value of the left stick's y-axis. More...

floatrightX () const noexcept

Returns the current value of the right stick's x-axis. More...

floatrightY () const noexcept

Returns the current value of the right stick's y-axis. More...

floattriggerLeft () const noexcept

Returns the current value of the left trigger. More...

floattriggerRight () const noexcept

Returns the current value of the right trigger. More...

helios::math::vec2fleft () const noexcept

Returns the state of the left stick as a helios::math::vec2f. More...

helios::math::vec2fright () const noexcept

Returns the state of the right stick as a helios::math::vec2f. More...

helios::math::vec2ftrigger () const noexcept

Returns the state of the triggers as a helios::math::vec2f. More...

boolbuttonA () const noexcept

Returns true when the A button is pressed. More...

boolbuttonB () const noexcept

Returns true when the B button is pressed. More...

boolbuttonX () const noexcept

Returns true when the X button is pressed. More...

boolbuttonY () const noexcept

Returns true when the Y button is pressed. More...

boolbuttonStart () const noexcept

Returns true when the Start button is pressed. More...

boolbuttonBack () const noexcept

Returns true when the Back button is pressed. More...

boolbuttonGuide () const noexcept

Returns true when the Guide button is pressed. More...

boolbuttonLeftBumper () const noexcept

Returns true when the left bumper is pressed. More...

boolbuttonRightBumper () const noexcept

Returns true when the right bumper is pressed. More...

boolbuttonLeftThumb () const noexcept

Returns true when the left thumbstick button is pressed. More...

boolbuttonRightThumb () const noexcept

Returns true when the right thumbstick button is pressed. More...

boolbuttonDpadUp () const noexcept

Returns true when the D-pad Up button is pressed. More...

boolbuttonDpadRight () const noexcept

Returns true when the D-pad Right button is pressed. More...

boolbuttonDpadDown () const noexcept

Returns true when the D-pad Down button is pressed. More...

boolbuttonDpadLeft () const noexcept

Returns true when the D-pad Left button is pressed. More...

Private Member Functions Index

voidupdate () const noexcept

Internal method to update the cached vec2f representations. This method should be called when the current values of the axes are queried in vec2f form and `needsUpdate_` evaluates to `true`. More...

Private Member Attributes Index

boolbuttonA_ = false

State of the A button (true if pressed). More...

boolbuttonB_ = false

State of the B button (true if pressed). More...

boolbuttonX_ = false

State of the X button (true if pressed). More...

boolbuttonY_ = false

State of the Y button (true if pressed). More...

boolbuttonStart_ = false

State of the Start button (true if pressed). More...

boolbuttonBack_ = false

State of the Back button (true if pressed). More...

boolbuttonGuide_ = false

State of the Guide button (true if pressed). More...

boolbuttonLeftBumper_ = false

State of the left bumper button (true if pressed). More...

boolbuttonRightBumper_ = false

State of the right bumper button (true if pressed). More...

boolbuttonLeftThumb_ = false

State of the left thumbstick button (true if pressed). More...

boolbuttonRightThumb_ = false

State of the right thumbstick button (true if pressed). More...

boolbuttonDpadUp_ = false

State of the D-pad up button (true if pressed). More...

boolbuttonDpadRight_ = false

State of the D-pad right button (true if pressed). More...

boolbuttonDpadDown_ = false

State of the D-pad down button (true if pressed). More...

boolbuttonDpadLeft_ = false

State of the D-pad left button (true if pressed). More...

boolneedsUpdate_ = true

Flag to indicate if the cached vec2f members need to be recalculated. More...

floataxisLeftX_ {}

Raw float value of the left stick's x-axis. More...

floataxisLeftY_ {}

Raw float value of the left stick's y-axis. More...

floataxisRightX_ {}

Raw float value of the right stick's x-axis. More...

floataxisRightY_ {}

Raw float value of the right stick's y-axis. More...

floattriggerLeft_ {}

Raw float value of the left trigger. More...

floattriggerRight_ {}

Raw float value of the right trigger. More...

helios::math::vec2fleft_

Cached vec2f representation of the left stick (x, y). More...

helios::math::vec2fright_

Cached vec2f representation of the right stick (x, y). More...

helios::math::vec2ftrigger_

Cached vec2f representation of the triggers (left, right). More...

Private Static Attributes Index

static const helios::util::log::Logger &logger_ = helios::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)

Shared logger instance for all GamepadState objects. More...

Description

A lightweight class for transferring the state of a Gamepad.

This class models a reusable object representing the input state of a gamepad. The input state of a gamepad consists of the state of the left and right trigger, ranging from [0, 1], where 1 means fully pressed and 0 means not pressed at all.

Similarly, a GamepadState provides information about the left and the right gamepad axes. Both the x- and the y-axis range from [-1, 1]. For the x-axis, the following holds:

  • 0.00 => not moved at all
  • -1.00 => moved all the way to the left
  • 1.00 => moved all the way to the right

For the y-axis the positive direction corresponds to "up" and the negative direction corresponds to "down".

Updating the values is done by calling `updateAxes` on this object.

For convenient access of the axes in 2D coordinates, the class provides accessors to the sticks' axes in `vec2f` form.

Button states are generally represented with boolean values, i.e. true for pressed, otherwise false.

info

Implementations must account for joystick drift: achieving exactly 0.0 for x/y when no human input occurred is rare. Consider applying a dead zone when processing the GamepadState. Axis values are individually clipped to [-1.0, 1.0], but the magnitude of the resulting (x, y) vector may exceed 1.0. Applications should normalize input vectors where appropriate and possibly offer calibration.

This implementation is inspired by the GLFW gamepad input model.

See Also

https://www.glfw.org/docs/latest/input_guide.html#joystick

Definition at line 54 of file GamepadState.ixx.

Public Constructors

GamepadState()

helios::input::gamepad::GamepadState::GamepadState ()
default

Default constructor.

Initializes all the values with 0.0f.

Definition at line 209 of file GamepadState.ixx.

GamepadState()

helios::input::gamepad::GamepadState::GamepadState (float axisLeftX, float axisLeftY, float axisRightX, float axisRightY, float triggerLeft, float triggerRight, bool buttonA, bool buttonB, bool buttonX, bool buttonY, bool buttonStart, bool buttonBack, bool buttonGuide, bool buttonLeftBumper, bool buttonRightBumper, bool buttonLeftThumb, bool buttonRightThumb, bool buttonDpadUp, bool buttonDpadRight, bool buttonDpadDown, bool buttonDpadLeft)
inline explicit noexcept

Creates a new GamepadState object.

Delegates to `updateAxes` for value initialization.

See Also

updateAxes

Definition at line 218 of file GamepadState.ixx.

218 explicit GamepadState(
219 float axisLeftX, float axisLeftY, float axisRightX,
220 float axisRightY, float triggerLeft, float triggerRight,
221
222 bool buttonA, bool buttonB, bool buttonX, bool buttonY,
223 bool buttonStart, bool buttonBack, bool buttonGuide,
227
228 ) noexcept {
230 axisLeftX, axisLeftY, axisRightX, axisRightY, triggerLeft, triggerRight,
231
235 }

References buttonA, buttonB, buttonBack, buttonDpadDown, buttonDpadLeft, buttonDpadRight, buttonDpadUp, buttonGuide, buttonLeftBumper, buttonLeftThumb, buttonRightBumper, buttonRightThumb, buttonStart, buttonX, buttonY, triggerLeft, triggerRight and updateAxes.

Public Destructor

~GamepadState()

helios::input::gamepad::GamepadState::~GamepadState ()
default

Definition at line 202 of file GamepadState.ixx.

Public Member Functions

buttonA()

bool helios::input::gamepad::GamepadState::buttonA ()
inline nodiscard noexcept

Returns true when the A button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 435 of file GamepadState.ixx.

435 [[nodiscard]] bool buttonA() const noexcept {
436 return buttonA_;
437 };

Referenced by GamepadState and updateAxes.

buttonB()

bool helios::input::gamepad::GamepadState::buttonB ()
inline nodiscard noexcept

Returns true when the B button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 444 of file GamepadState.ixx.

444 [[nodiscard]] bool buttonB() const noexcept {
445 return buttonB_;
446 };

Referenced by GamepadState and updateAxes.

buttonBack()

bool helios::input::gamepad::GamepadState::buttonBack ()
inline nodiscard noexcept

Returns true when the Back button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 480 of file GamepadState.ixx.

480 [[nodiscard]] bool buttonBack() const noexcept {
481 return buttonBack_;
482 };

Referenced by GamepadState and updateAxes.

buttonDpadDown()

bool helios::input::gamepad::GamepadState::buttonDpadDown ()
inline nodiscard noexcept

Returns true when the D-pad Down button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 552 of file GamepadState.ixx.

552 [[nodiscard]] bool buttonDpadDown() const noexcept {
553 return buttonDpadDown_;
554 };

Referenced by GamepadState and updateAxes.

buttonDpadLeft()

bool helios::input::gamepad::GamepadState::buttonDpadLeft ()
inline nodiscard noexcept

Returns true when the D-pad Left button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 561 of file GamepadState.ixx.

561 [[nodiscard]] bool buttonDpadLeft() const noexcept {
562 return buttonDpadLeft_;
563 };

Referenced by GamepadState and updateAxes.

buttonDpadRight()

bool helios::input::gamepad::GamepadState::buttonDpadRight ()
inline nodiscard noexcept

Returns true when the D-pad Right button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 543 of file GamepadState.ixx.

543 [[nodiscard]] bool buttonDpadRight() const noexcept {
544 return buttonDpadRight_;
545 };

Referenced by GamepadState and updateAxes.

buttonDpadUp()

bool helios::input::gamepad::GamepadState::buttonDpadUp ()
inline nodiscard noexcept

Returns true when the D-pad Up button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 534 of file GamepadState.ixx.

534 [[nodiscard]] bool buttonDpadUp() const noexcept {
535 return buttonDpadUp_;
536 };

Referenced by GamepadState and updateAxes.

buttonGuide()

bool helios::input::gamepad::GamepadState::buttonGuide ()
inline nodiscard noexcept

Returns true when the Guide button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 489 of file GamepadState.ixx.

489 [[nodiscard]] bool buttonGuide() const noexcept {
490 return buttonGuide_;
491 };

Referenced by GamepadState and updateAxes.

buttonLeftBumper()

bool helios::input::gamepad::GamepadState::buttonLeftBumper ()
inline nodiscard noexcept

Returns true when the left bumper is pressed.

Returns

true if pressed, false otherwise.

Definition at line 498 of file GamepadState.ixx.

498 [[nodiscard]] bool buttonLeftBumper() const noexcept {
499 return buttonLeftBumper_;
500 };

Referenced by GamepadState and updateAxes.

buttonLeftThumb()

bool helios::input::gamepad::GamepadState::buttonLeftThumb ()
inline nodiscard noexcept

Returns true when the left thumbstick button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 516 of file GamepadState.ixx.

516 [[nodiscard]] bool buttonLeftThumb() const noexcept {
517 return buttonLeftThumb_;
518 };

Referenced by GamepadState and updateAxes.

buttonRightBumper()

bool helios::input::gamepad::GamepadState::buttonRightBumper ()
inline nodiscard noexcept

Returns true when the right bumper is pressed.

Returns

true if pressed, false otherwise.

Definition at line 507 of file GamepadState.ixx.

507 [[nodiscard]] bool buttonRightBumper() const noexcept {
508 return buttonRightBumper_;
509 };

Referenced by GamepadState and updateAxes.

buttonRightThumb()

bool helios::input::gamepad::GamepadState::buttonRightThumb ()
inline nodiscard noexcept

Returns true when the right thumbstick button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 525 of file GamepadState.ixx.

525 [[nodiscard]] bool buttonRightThumb() const noexcept {
526 return buttonRightThumb_;
527 };

Referenced by GamepadState and updateAxes.

buttonStart()

bool helios::input::gamepad::GamepadState::buttonStart ()
inline nodiscard noexcept

Returns true when the Start button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 471 of file GamepadState.ixx.

471 [[nodiscard]] bool buttonStart() const noexcept {
472 return buttonStart_;
473 };

Referenced by GamepadState and updateAxes.

buttonX()

bool helios::input::gamepad::GamepadState::buttonX ()
inline nodiscard noexcept

Returns true when the X button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 453 of file GamepadState.ixx.

453 [[nodiscard]] bool buttonX() const noexcept {
454 return buttonX_;
455 };

Referenced by GamepadState and updateAxes.

buttonY()

bool helios::input::gamepad::GamepadState::buttonY ()
inline nodiscard noexcept

Returns true when the Y button is pressed.

Returns

true if pressed, false otherwise.

Definition at line 462 of file GamepadState.ixx.

462 [[nodiscard]] bool buttonY() const noexcept {
463 return buttonY_;
464 };

Referenced by GamepadState and updateAxes.

left()

helios::math::vec2f helios::input::gamepad::GamepadState::left ()
inline nodiscard noexcept

Returns the state of the left stick as a helios::math::vec2f.

Returns

A helios::math::vec2f, with the first component being the x-axis, the second component the y-axis.

Definition at line 396 of file GamepadState.ixx.

396 [[nodiscard]] helios::math::vec2f left() const noexcept {
397 if (needsUpdate_) {
398 update();
399 }
400 return left_;
401 }

leftX()

float helios::input::gamepad::GamepadState::leftX ()
inline nodiscard noexcept

Returns the current value of the left stick's x-axis.

Returns

float value in the range [-1, 1]

Definition at line 336 of file GamepadState.ixx.

336 [[nodiscard]] float leftX() const noexcept {
337 return axisLeftX_;
338 }

leftY()

float helios::input::gamepad::GamepadState::leftY ()
inline nodiscard noexcept

Returns the current value of the left stick's y-axis.

Returns

float value in the range [-1, 1]

Definition at line 346 of file GamepadState.ixx.

346 [[nodiscard]] float leftY() const noexcept {
347 return axisLeftY_;
348 }

right()

helios::math::vec2f helios::input::gamepad::GamepadState::right ()
inline nodiscard noexcept

Returns the state of the right stick as a helios::math::vec2f.

Returns

A helios::math::vec2f, with the first component being the x-axis, the second component the y-axis.

Definition at line 409 of file GamepadState.ixx.

409 [[nodiscard]] helios::math::vec2f right() const noexcept {
410 if (needsUpdate_) {
411 update();
412 }
413 return right_;
414 }

rightX()

float helios::input::gamepad::GamepadState::rightX ()
inline nodiscard noexcept

Returns the current value of the right stick's x-axis.

Returns

float value in the range [-1, 1]

Definition at line 356 of file GamepadState.ixx.

356 [[nodiscard]] float rightX() const noexcept {
357 return axisRightX_;
358 }

rightY()

float helios::input::gamepad::GamepadState::rightY ()
inline nodiscard noexcept

Returns the current value of the right stick's y-axis.

Returns

float value in the range [-1, 1]

Definition at line 366 of file GamepadState.ixx.

366 [[nodiscard]] float rightY() const noexcept {
367 return axisRightY_;
368 }

trigger()

helios::math::vec2f helios::input::gamepad::GamepadState::trigger ()
inline nodiscard noexcept

Returns the state of the triggers as a helios::math::vec2f.

Returns

A helios::math::vec2f, with the first component being the left trigger-axis, the second component the right trigger-axis.

Definition at line 423 of file GamepadState.ixx.

423 [[nodiscard]] helios::math::vec2f trigger() const noexcept {
424 if (needsUpdate_) {
425 update();
426 }
427 return trigger_;
428 }

triggerLeft()

float helios::input::gamepad::GamepadState::triggerLeft ()
inline nodiscard noexcept

Returns the current value of the left trigger.

Returns

float value in the range [0, 1]

Definition at line 376 of file GamepadState.ixx.

376 [[nodiscard]] float triggerLeft() const noexcept {
377 return triggerLeft_;
378 }

Referenced by GamepadState and updateAxes.

triggerRight()

float helios::input::gamepad::GamepadState::triggerRight ()
inline nodiscard noexcept

Returns the current value of the right trigger.

Returns

float value in the range [0, 1]

Definition at line 386 of file GamepadState.ixx.

386 [[nodiscard]] float triggerRight() const noexcept {
387 return triggerRight_;
388 }

Referenced by GamepadState and updateAxes.

updateAxes()

void helios::input::gamepad::GamepadState::updateAxes (float axisLeftX, float axisLeftY, float axisRightX, float axisRightY, float triggerLeft, float triggerRight, bool buttonA, bool buttonB, bool buttonX, bool buttonY, bool buttonStart, bool buttonBack, bool buttonGuide, bool buttonLeftBumper, bool buttonRightBumper, bool buttonLeftThumb, bool buttonRightThumb, bool buttonDpadUp, bool buttonDpadRight, bool buttonDpadDown, bool buttonDpadLeft)
inline noexcept

Updates the axes and button states of this GamepadState object.

This method updates raw axis and trigger values and stores the boolean state of all standard gamepad buttons. Float parameters are asserted to be in their expected ranges and then clamped.

For the sticks' range [-1, 1] the following holds: -1 means moved all the way left/down, 0 means not moved at all, 1 means moved all the way right/up.

For the triggers' range of [0, 1] the following holds: 0 means not pressed, 1 means fully pressed.

Parameters
axisLeftX

The x-axis of the left stick, expected in [-1, 1].

axisLeftY

The y-axis of the left stick, expected in [-1, 1].

axisRightX

The x-axis of the right stick, expected in [-1, 1].

axisRightY

The y-axis of the right stick, expected in [-1, 1].

triggerLeft

The left trigger value, expected in [0, 1].

triggerRight

The right trigger value, expected in [0, 1].

buttonA

True if the A button is pressed.

buttonB

True if the B button is pressed.

buttonX

True if the X button is pressed.

buttonY

True if the Y button is pressed.

buttonStart

True if the Start button is pressed.

buttonBack

True if the Back button is pressed.

buttonGuide

True if the Guide (platform) button is pressed.

buttonLeftBumper

True if the left bumper is pressed.

buttonRightBumper

True if the right bumper is pressed.

buttonLeftThumb

True if the left thumbstick button is pressed.

buttonRightThumb

True if the right thumbstick button is pressed.

buttonDpadUp

True if the D-pad Up button is pressed.

buttonDpadRight

True if the D-pad Right button is pressed.

buttonDpadDown

True if the D-pad Down button is pressed.

buttonDpadLeft

True if the D-pad Left button is pressed.

Definition at line 273 of file GamepadState.ixx.

274 float axisLeftX, float axisLeftY, float axisRightX, float axisRightY,
275 float triggerLeft, float triggerRight,
276
277 bool buttonA, bool buttonB, bool buttonX, bool buttonY,
278 bool buttonStart, bool buttonBack, bool buttonGuide,
282 ) noexcept {
283
284 #ifdef HELIOS_DEBUG
285 if(axisLeftX < -1.0f || axisLeftX > 1.0f) {
286 logger_.warn("axisLeftX is out of bounds.");
287 }
288 if(axisLeftY < -1.0f || axisLeftY > 1.0f) {
289 logger_.warn("axisLeftY is out of bounds.");
290 }
291 if(axisRightX < -1.0f || axisRightX > 1.0f) {
292 logger_.warn("axisRightX is out of bounds.");
293 }
294 if(axisRightY < -1.0f || axisRightY > 1.0f) {
295 logger_.warn("axisRightY is out of bounds.");
296 }
298 logger_.warn("triggerLeft is out of bounds.");
299 }
301 logger_.warn("triggerRight is out of bounds.");
302 }
303 #endif
304
305 axisLeftX_ = std::clamp(axisLeftX, -1.0f, 1.0f);
306 axisLeftY_ = std::clamp(axisLeftY, -1.0f, 1.0f);
307 axisRightX_ = std::clamp(axisRightX, -1.0f, 1.0f);
308 axisRightY_ = std::clamp(axisRightY, -1.0f, 1.0f);
309 triggerLeft_ = std::clamp(triggerLeft, 0.0f, 1.0f);
310 triggerRight_ = std::clamp(triggerRight, 0.0f, 1.0f);
311
312 buttonA_ = buttonA;
313 buttonB_ = buttonB;
314 buttonX_ = buttonX;
315 buttonY_ = buttonY;
316 buttonStart_ = buttonStart;
317 buttonBack_ = buttonBack;
318 buttonGuide_ = buttonGuide;
319 buttonLeftBumper_ = buttonLeftBumper;
320 buttonRightBumper_ = buttonRightBumper;
321 buttonLeftThumb_ = buttonLeftThumb;
322 buttonRightThumb_ = buttonRightThumb;
323 buttonDpadUp_ = buttonDpadUp;
324 buttonDpadRight_ = buttonDpadRight;
325 buttonDpadDown_ = buttonDpadDown;
326 buttonDpadLeft_ = buttonDpadLeft;
327
328 needsUpdate_ = true;
329 }

References buttonA, buttonB, buttonBack, buttonDpadDown, buttonDpadLeft, buttonDpadRight, buttonDpadUp, buttonGuide, buttonLeftBumper, buttonLeftThumb, buttonRightBumper, buttonRightThumb, buttonStart, buttonX, buttonY, triggerLeft and triggerRight.

Referenced by GamepadState.

Private Member Functions

update()

void helios::input::gamepad::GamepadState::update ()
inline noexcept

Internal method to update the cached vec2f representations. This method should be called when the current values of the axes are queried in vec2f form and `needsUpdate_` evaluates to `true`.

Definition at line 193 of file GamepadState.ixx.

193 void update() const noexcept {
194 left_ = helios::math::vec2f(axisLeftX_, axisLeftY_);
195 right_ = helios::math::vec2f(axisRightX_, axisRightY_);
196 trigger_ = helios::math::vec2f(triggerLeft_, triggerRight_);
197
198 needsUpdate_ = false;
199 }

Private Member Attributes

axisLeftX_

float helios::input::gamepad::GamepadState::axisLeftX_ {}

Raw float value of the left stick's x-axis.

Definition at line 146 of file GamepadState.ixx.

146 float axisLeftX_{};

axisLeftY_

float helios::input::gamepad::GamepadState::axisLeftY_ {}

Raw float value of the left stick's y-axis.

Definition at line 151 of file GamepadState.ixx.

151 float axisLeftY_{};

axisRightX_

float helios::input::gamepad::GamepadState::axisRightX_ {}

Raw float value of the right stick's x-axis.

Definition at line 156 of file GamepadState.ixx.

156 float axisRightX_{};

axisRightY_

float helios::input::gamepad::GamepadState::axisRightY_ {}

Raw float value of the right stick's y-axis.

Definition at line 161 of file GamepadState.ixx.

161 float axisRightY_{};

buttonA_

bool helios::input::gamepad::GamepadState::buttonA_ = false

State of the A button (true if pressed).

Definition at line 66 of file GamepadState.ixx.

66 bool buttonA_ = false;

buttonB_

bool helios::input::gamepad::GamepadState::buttonB_ = false

State of the B button (true if pressed).

Definition at line 71 of file GamepadState.ixx.

71 bool buttonB_ = false;

buttonBack_

bool helios::input::gamepad::GamepadState::buttonBack_ = false

State of the Back button (true if pressed).

Definition at line 91 of file GamepadState.ixx.

91 bool buttonBack_ = false;

buttonDpadDown_

bool helios::input::gamepad::GamepadState::buttonDpadDown_ = false

State of the D-pad down button (true if pressed).

Definition at line 131 of file GamepadState.ixx.

131 bool buttonDpadDown_ = false;

buttonDpadLeft_

bool helios::input::gamepad::GamepadState::buttonDpadLeft_ = false

State of the D-pad left button (true if pressed).

Definition at line 136 of file GamepadState.ixx.

136 bool buttonDpadLeft_ = false;

buttonDpadRight_

bool helios::input::gamepad::GamepadState::buttonDpadRight_ = false

State of the D-pad right button (true if pressed).

Definition at line 126 of file GamepadState.ixx.

126 bool buttonDpadRight_ = false;

buttonDpadUp_

bool helios::input::gamepad::GamepadState::buttonDpadUp_ = false

State of the D-pad up button (true if pressed).

Definition at line 121 of file GamepadState.ixx.

121 bool buttonDpadUp_ = false;

buttonGuide_

bool helios::input::gamepad::GamepadState::buttonGuide_ = false

State of the Guide button (true if pressed).

Definition at line 96 of file GamepadState.ixx.

96 bool buttonGuide_ = false;

buttonLeftBumper_

bool helios::input::gamepad::GamepadState::buttonLeftBumper_ = false

State of the left bumper button (true if pressed).

Definition at line 101 of file GamepadState.ixx.

101 bool buttonLeftBumper_ = false;

buttonLeftThumb_

bool helios::input::gamepad::GamepadState::buttonLeftThumb_ = false

State of the left thumbstick button (true if pressed).

Definition at line 111 of file GamepadState.ixx.

111 bool buttonLeftThumb_ = false;

buttonRightBumper_

bool helios::input::gamepad::GamepadState::buttonRightBumper_ = false

State of the right bumper button (true if pressed).

Definition at line 106 of file GamepadState.ixx.

106 bool buttonRightBumper_ = false;

buttonRightThumb_

bool helios::input::gamepad::GamepadState::buttonRightThumb_ = false

State of the right thumbstick button (true if pressed).

Definition at line 116 of file GamepadState.ixx.

116 bool buttonRightThumb_ = false;

buttonStart_

bool helios::input::gamepad::GamepadState::buttonStart_ = false

State of the Start button (true if pressed).

Definition at line 86 of file GamepadState.ixx.

86 bool buttonStart_ = false;

buttonX_

bool helios::input::gamepad::GamepadState::buttonX_ = false

State of the X button (true if pressed).

Definition at line 76 of file GamepadState.ixx.

76 bool buttonX_ = false;

buttonY_

bool helios::input::gamepad::GamepadState::buttonY_ = false

State of the Y button (true if pressed).

Definition at line 81 of file GamepadState.ixx.

81 bool buttonY_ = false;

left_

helios::math::vec2f helios::input::gamepad::GamepadState::left_
mutable

Cached vec2f representation of the left stick (x, y).

Definition at line 176 of file GamepadState.ixx.

176 mutable helios::math::vec2f left_;

needsUpdate_

bool helios::input::gamepad::GamepadState::needsUpdate_ = true
mutable

Flag to indicate if the cached vec2f members need to be recalculated.

Definition at line 141 of file GamepadState.ixx.

141 mutable bool needsUpdate_ = true;

right_

helios::math::vec2f helios::input::gamepad::GamepadState::right_
mutable

Cached vec2f representation of the right stick (x, y).

Definition at line 181 of file GamepadState.ixx.

181 mutable helios::math::vec2f right_;

trigger_

helios::math::vec2f helios::input::gamepad::GamepadState::trigger_
mutable

Cached vec2f representation of the triggers (left, right).

Definition at line 186 of file GamepadState.ixx.

186 mutable helios::math::vec2f trigger_;

triggerLeft_

float helios::input::gamepad::GamepadState::triggerLeft_ {}

Raw float value of the left trigger.

Definition at line 166 of file GamepadState.ixx.

166 float triggerLeft_{};

triggerRight_

float helios::input::gamepad::GamepadState::triggerRight_ {}

Raw float value of the right trigger.

Definition at line 171 of file GamepadState.ixx.

171 float triggerRight_{};

Private Static Attributes

logger_

const helios::util::log::Logger& helios::input::gamepad::GamepadState::logger_ = helios::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE)
static

Shared logger instance for all GamepadState objects.

Definition at line 60 of file GamepadState.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.