diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-18 16:57:03 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-18 16:57:03 +0200 |
commit | d139e19bd287ba340b923136c266a77367b83990 (patch) | |
tree | 4d8e469ea2ebf9445236c0a2b3d9b392460282f5 /engine/src/camera | |
parent | d7675fd0119afe5e9cc872ce8bbb2977a16f0b26 (diff) |
refactor(engine): fix clippy lints
Diffstat (limited to 'engine/src/camera')
-rw-r--r-- | engine/src/camera/fly.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/engine/src/camera/fly.rs b/engine/src/camera/fly.rs index 7fa435b..3f5a0c2 100644 --- a/engine/src/camera/fly.rs +++ b/engine/src/camera/fly.rs @@ -73,11 +73,7 @@ fn update( cursor_state.current_yaw += x_offset; cursor_state.current_pitch += y_offset; - if cursor_state.current_pitch > 89.0 { - cursor_state.current_pitch = 89.0; - } else if cursor_state.current_pitch < -89.0 { - cursor_state.current_pitch = -89.0; - } + cursor_state.current_pitch = cursor_state.current_pitch.clamp(-89.0, 89.0); // TODO: This casting to a f32 from a f64 is horrible. fix it #[allow(clippy::cast_possible_truncation)] |