Move input tuning constants into fj-viewer

This commit is contained in:
Hanno Braun 2024-11-18 20:06:46 +01:00
parent d275399de0
commit d729087b7a
3 changed files with 24 additions and 20 deletions

View File

@ -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.;

View File

@ -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,
};

View File

@ -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.;