diff --git a/examples/tools/scene_viewer/camera_controller_plugin.rs b/examples/tools/scene_viewer/camera_controller_plugin.rs index 3ee15c06fb..5ebbc43dd6 100644 --- a/examples/tools/scene_viewer/camera_controller_plugin.rs +++ b/examples/tools/scene_viewer/camera_controller_plugin.rs @@ -3,11 +3,17 @@ //! - Copy the code for the `CameraControllerPlugin` and add the plugin to your App. //! - Attach the `CameraController` component to an entity with a `Camera3dBundle`. +use bevy::window::CursorGrabMode; use bevy::{input::mouse::MouseMotion, prelude::*}; use std::f32::consts::*; use std::fmt; +/// Based on Valorant's default sensitivity, not entirely sure why it is exactly 1.0 / 180.0, +/// but I'm guessing it is a misunderstanding between degrees/radians and then sticking with +/// it because it felt nice. +pub const RADIANS_PER_DOT: f32 = 1.0 / 180.0; + #[derive(Component)] pub struct CameraController { pub enabled: bool, @@ -35,7 +41,7 @@ impl Default for CameraController { Self { enabled: true, initialized: false, - sensitivity: 0.5, + sensitivity: 1.0, key_forward: KeyCode::W, key_back: KeyCode::S, key_left: KeyCode::A, @@ -91,12 +97,14 @@ impl Plugin for CameraControllerPlugin { fn camera_controller( time: Res