diff options
Diffstat (limited to 'engine/src/camera/fly.rs')
-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)] |