diff --git a/crates/fj-viewer/src/input/mod.rs b/crates/fj-viewer/src/input/mod.rs index b01530a57..ac945f120 100644 --- a/crates/fj-viewer/src/input/mod.rs +++ b/crates/fj-viewer/src/input/mod.rs @@ -13,3 +13,21 @@ pub enum MouseButton { /// # The right mouse button Right, } + +/// # Sensitivity of camera zoom, given scroll wheel input in lines +/// +/// Given a specific input, smaller values mean that the camera moves less, +/// larger values mean it moves more. +pub const CAMERA_ZOOM_SENSITIVITY_LINE: f64 = 0.075; + +/// # Sensitivity of camera zoom, given scroll wheel input in pixels +/// +/// Given a specific input, smaller values mean that the camera moves less, +/// larger values mean it moves more. +pub const CAMERA_ZOOM_SENSITIVITY_PIXEL: f64 = 0.005; + +/// # Sensitivity of camera rotation +/// +/// Given a specific input, smaller values mean that the camera rotates less, +/// larger values mean it rotates more. +pub const CAMERA_ROTATION_SENSITIVITY: f64 = 5.; diff --git a/crates/fj-viewer/src/lib.rs b/crates/fj-viewer/src/lib.rs index 13e0da023..99cc02e8a 100644 --- a/crates/fj-viewer/src/lib.rs +++ b/crates/fj-viewer/src/lib.rs @@ -18,7 +18,10 @@ mod viewer; pub use self::{ graphics::{DeviceError, RendererInitError}, input::InputEvent, - input::MouseButton, + input::{ + MouseButton, CAMERA_ROTATION_SENSITIVITY, CAMERA_ZOOM_SENSITIVITY_LINE, + CAMERA_ZOOM_SENSITIVITY_PIXEL, + }, screen::{NormalizedScreenPosition, Screen, ScreenSize}, viewer::Viewer, }; diff --git a/crates/fj-window/src/display.rs b/crates/fj-window/src/display.rs index f204a3cf1..b7811241b 100644 --- a/crates/fj-window/src/display.rs +++ b/crates/fj-window/src/display.rs @@ -1,7 +1,8 @@ use fj_interop::Model; use fj_viewer::{ InputEvent, NormalizedScreenPosition, RendererInitError, Screen, - ScreenSize, Viewer, + ScreenSize, Viewer, CAMERA_ROTATION_SENSITIVITY, + CAMERA_ZOOM_SENSITIVITY_LINE, CAMERA_ZOOM_SENSITIVITY_PIXEL, }; use futures::executor::block_on; use winit::{ @@ -225,21 +226,3 @@ fn input_event( _ => None, } } - -/// # Sensitivity of camera zoom, given scroll wheel input in lines -/// -/// Given a specific input, smaller values mean that the camera moves less, -/// larger values mean it moves more. -const CAMERA_ZOOM_SENSITIVITY_LINE: f64 = 0.075; - -/// # Sensitivity of camera zoom, given scroll wheel input in pixels -/// -/// Given a specific input, smaller values mean that the camera moves less, -/// larger values mean it moves more. -const CAMERA_ZOOM_SENSITIVITY_PIXEL: f64 = 0.005; - -/// # Sensitivity of camera rotation -/// -/// Given a specific input, smaller values mean that the camera rotates less, -/// larger values mean it rotates more. -const CAMERA_ROTATION_SENSITIVITY: f64 = 5.;