| 110 | } |
| 111 | |
| 112 | float XboxController::NormalizeTrigger(uint8_t deadzonePercent, uint8_t value) |
| 113 | { |
| 114 | uint8_t deadzone = (UINT8_MAX * deadzonePercent) / 100; |
| 115 | //If the given value is below the trigger zone, save the calc and return 0, otherwise adjust the value to the deadzone |
| 116 | return value < deadzone |
| 117 | ? 0 |
| 118 | : static_cast<float>(value - deadzone) / (UINT8_MAX - deadzone); |
| 119 | } |
| 120 | |
| 121 | void XboxController::NormalizeAxis(int16_t x, |
| 122 | int16_t y, |
nothing calls this directly
no outgoing calls
no test coverage detected