Helper class that assists Controllers by managing when a stick should be considered pressed or not.
More...
#include <ControllerStick.h>
|
| | ControllerStick () |
| auto | update (float dt, float stickState) -> void |
| auto | reset () -> void |
| auto | isPressed () const -> bool |
| auto | setEvents (std::pair< std::string, std::string > events) -> void |
| auto | getEvent () const -> std::string |
| | Gets the output event corresponding to this stick.
|
Helper class that assists Controllers by managing when a stick should be considered pressed or not.
@ControllerStick.h
◆ ControllerStick()
| ControllerStick::ControllerStick |
( |
| ) |
|
◆ getEvent()
| auto ControllerStick::getEvent |
( |
| ) |
const->std::string |
Gets the output event corresponding to this stick.
Should ideally only be called when currentlyPressed is true.
- Returns
- A string corresponding to either the minimum event or maximum event
◆ isPressed()
| auto ControllerStick::isPressed |
( |
| ) |
const->bool |
◆ reset()
| auto ControllerStick::reset |
( |
| ) |
->void |
◆ setEvents()
| auto ControllerStick::setEvents |
( |
std::pair< std::string, std::string > | events | ) |
->void |
◆ update()
| auto ControllerStick::update |
( |
float | dt, |
|
|
float | stickState )->void |
◆ currentDelay
| float ControllerStick::currentDelay |
|
private |
◆ currentlyPressed
| bool ControllerStick::currentlyPressed = false |
|
private |
Bool representing whether the stick should be considered pressed or not.
◆ fastDelay
| auto ControllerStick::fastDelay = 0.2f |
|
staticconstexprprivate |
◆ initialDelay
| auto ControllerStick::initialDelay = 0.3f |
|
staticconstexprprivate |
◆ isFast
| bool ControllerStick::isFast = false |
|
private |
◆ lastFrameState
| float ControllerStick::lastFrameState = 0.f |
|
private |
◆ maxEvent
| std::string ControllerStick::maxEvent |
|
private |
event for if the stick is pushed to the positive threshold
◆ minEvent
| std::string ControllerStick::minEvent |
|
private |
event for if the stick is pushed to the negative threshold
◆ pressThreshold
| float ControllerStick::pressThreshold = 0.7f |
|
private |
The documentation for this class was generated from the following files: