(&self, raw: RawStick)
| 85 | } |
| 86 | |
| 87 | pub(super) fn normalize(&self, raw: RawStick) -> SignedUnitVector2 { |
| 88 | let x = calibrated_axis(raw.x, self.center_x, self.min_x, self.max_x); |
| 89 | let y = calibrated_axis(raw.y, self.center_y, self.min_y, self.max_y); |
| 90 | SignedUnitVector2::new(normalize_stick_axis(x), normalize_stick_axis(y)) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | fn calibrated_axis(raw: u16, center: u16, min_val: u16, max_val: u16) -> f32 { |
no test coverage detected