From de9305a0d25c077a3ff9befe9bc8c38eadd1794d Mon Sep 17 00:00:00 2001 From: Huon Imberger Date: Mon, 26 Feb 2024 19:36:55 +1100 Subject: [PATCH] Frame rate independent smoothing (#62) --- src/lib.rs | 11 ++++++++--- src/util.rs | 38 ++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e6ae26c..30006ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -262,11 +262,11 @@ impl Default for PanOrbitCamera { is_upside_down: false, allow_upside_down: false, orbit_sensitivity: 1.0, - orbit_smoothness: 0.8, + orbit_smoothness: 0.1, pan_sensitivity: 1.0, - pan_smoothness: 0.6, + pan_smoothness: 0.02, zoom_sensitivity: 1.0, - zoom_smoothness: 0.8, + zoom_smoothness: 0.1, button_orbit: MouseButton::Left, button_pan: MouseButton::Right, modifier_orbit: None, @@ -401,6 +401,7 @@ fn pan_orbit_camera( mouse_key_tracker: Res, touch_tracker: Res, mut orbit_cameras: Query<(Entity, &mut PanOrbitCamera, &mut Transform, &mut Projection)>, + time: Res