MCPcopy Create free account
hub / github.com/PerroEngine/Perro / normalize

Method normalize

perro_source/render_stack/perro_app/src/input/joycon/shared.rs:87–91  ·  view source on GitHub ↗
(&self, raw: RawStick)

Source from the content-addressed store, hash-verified

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
94fn calibrated_axis(raw: u16, center: u16, min_val: u16, max_val: u16) -> f32 {

Callers 14

parse_euler_degrees_quatFunction · 0.45
water_camera_view_projFunction · 0.45
compute_view_proj_matFunction · 0.45
camera_rotationFunction · 0.45
compute_view_projFunction · 0.45
apply_reportFunction · 0.45
parse_euler_degrees_quatFunction · 0.45
predict_rotation_3dFunction · 0.45

Calls 2

calibrated_axisFunction · 0.85
normalize_stick_axisFunction · 0.85

Tested by

no test coverage detected