From d9ab57ba12031264693f79db3bf6978172459197 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 27 Jan 2023 22:27:48 +0100 Subject: [PATCH] Mouse sensitivity is now affected by delta time --- src/fly_controller.rs | 5 +++-- src/settings.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fly_controller.rs b/src/fly_controller.rs index 4da9593..a8972ea 100644 --- a/src/fly_controller.rs +++ b/src/fly_controller.rs @@ -19,9 +19,10 @@ fn update_look( controllers: View, mut transforms: ViewMut, inputs: UniqueView, - settings: UniqueView + settings: UniqueView, + dt: UniqueView, ) { - let look = inputs.look * settings.mouse_sensitivity; + let look = inputs.look * settings.mouse_sensitivity * dt.0.as_secs_f32(); if look == Vec2::ZERO { return } for (_, mut transform) in (&controllers, &mut transforms).iter() { let (scale, mut rotation, translation) = transform.0.to_scale_rotation_translation(); diff --git a/src/settings.rs b/src/settings.rs index 0588cf8..5e80b67 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -10,7 +10,7 @@ impl Default for GameSettings { fn default() -> Self { Self { render_distance: 5, - mouse_sensitivity: 0.01, + mouse_sensitivity: 1., } } }