Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
An input combo that whose value is recorded and mapped to an (axis of an) action value of some kind. More...
#include <input_data.hpp>
Public Types | |
enum | Trigger : uint8_t { ON_PRESS , ON_RELEASE , ON_CHANGE , ON_BUTTON_PRESS , ON_BUTTON_RELEASE , ON_BUTTON_CHANGE } |
The action on the main control (provided any modifiers are active) that activates this combo. | |
Public Member Functions | |
operator bool () const | |
An explicit definition for what set of InputCombo values are considered truthy and which ones are falsey. | |
bool | operator== (const InputCombo &other) const |
Compares to InputCombos for equality, for use in certain containers like maps. | |
bool | operator< (const InputCombo &other) const |
Mainly supports the equality operator, and allows sorting for InputCombos to work. | |
Public Attributes | |
InputFilter | mMainControl {} |
Axis value corresponding to this combo may be sampled from this control. | |
InputFilter | mModifier1 {} |
A single axis of a single input source that must be considered active in order for this combo to be considered active. | |
InputFilter | mModifier2 {} |
A single axis of a single input source that must be considered active in order for this combo to be considered active. | |
Trigger | mTrigger { ON_CHANGE } |
The actual event on the main control that causes the value mapped to this InputCombo to change. | |
double | mDeadzone { 0.f } |
Some device controls, like analog sticks, wear out over time producing false positives for input events. Adjusting this value helps to filter out such false positives. | |
double | mThreshold { .7f } |
The threshold (on a main control that produces continuous values, like analog sticks and triggers) beyond which the control is considered pressed, and below which it is considered released. | |
An input combo that whose value is recorded and mapped to an (axis of an) action value of some kind.
These objects are used to inform the InputManager what inputs are being listened for, how these inputs relate to each other, and what event should trigger an Action update.
At the time of writing, each combo supports one "main control" and two "modifier controls", each of which is taken to be one axis of one control of one device.
After conversion, input from any InputCombo is ultimately mapped to a value between 0 and 1.
|
inline |
An explicit definition for what set of InputCombo values are considered truthy and which ones are falsey.
true | An input combo corresponding to a real input source; |
false | An input combo which is invalid, and therefore "falsey"; |
|
inline |
Mainly supports the equality operator, and allows sorting for InputCombos to work.
other | The combo this one is being compared to. |
true | The combos are equivalent; |
false | The combos are not equivalent; |
|
inline |
Compares to InputCombos for equality, for use in certain containers like maps.
other | The combo this one is being compared to. |
true | The combos are equivalent. |
false | The combos are not equivalent. |
InputFilter ToyMaker::InputCombo::mModifier1 {} |
A single axis of a single input source that must be considered active in order for this combo to be considered active.
Falsey InputFilters are always considered active.
InputFilter ToyMaker::InputCombo::mModifier2 {} |
A single axis of a single input source that must be considered active in order for this combo to be considered active.
Falsey InputFilters are always considered active.