mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
Removed temporary mouse_user_sensitivity variable
This commit is contained in:
@@ -85,7 +85,6 @@ pub struct CameraController {
|
||||
pitch: f32,
|
||||
pub z_offset: f32,
|
||||
mouse_control_mode: MouseControlMode,
|
||||
mouse_user_sensitivity: f32,
|
||||
move_left: bool,
|
||||
move_right: bool,
|
||||
move_forward: bool,
|
||||
@@ -180,7 +179,6 @@ impl CameraController {
|
||||
yaw: settings.yaw,
|
||||
pitch: settings.pitch,
|
||||
mouse_control_mode: MouseControlMode::None,
|
||||
mouse_user_sensitivity: 1.0,
|
||||
z_offset: DEFAULT_Z_OFFSET,
|
||||
move_left: false,
|
||||
move_right: false,
|
||||
@@ -311,13 +309,14 @@ impl CameraController {
|
||||
mouse_position: Vector2<f32>,
|
||||
screen_size: Vector2<f32>,
|
||||
delta: Vector2<f32>,
|
||||
settings: &Settings,
|
||||
) {
|
||||
match self.mouse_control_mode {
|
||||
MouseControlMode::None => {}
|
||||
MouseControlMode::CenteredRotation { .. } | MouseControlMode::OrbitalRotation => {
|
||||
const MAX_ANGLE_RAD: f32 = 90.0f32.to_radians();
|
||||
const GLOBAL_MOUSE_SENSITIVITY: f32 = 0.01f32;
|
||||
let mouse_sensitivity = GLOBAL_MOUSE_SENSITIVITY * self.mouse_user_sensitivity;
|
||||
let mouse_sensitivity = GLOBAL_MOUSE_SENSITIVITY * settings.camera.sensitivity;
|
||||
self.yaw -= delta.x * mouse_sensitivity;
|
||||
self.pitch += delta.y * mouse_sensitivity;
|
||||
self.pitch = clamp(self.pitch, -MAX_ANGLE_RAD, MAX_ANGLE_RAD);
|
||||
@@ -559,8 +558,6 @@ impl CameraController {
|
||||
// Keep screen size in-sync.
|
||||
self.screen_size = screen_size;
|
||||
|
||||
self.mouse_user_sensitivity = settings.camera.sensitivity;
|
||||
|
||||
let camera = graph[self.camera].as_camera_mut();
|
||||
|
||||
match camera.projection_value() {
|
||||
|
||||
@@ -523,6 +523,7 @@ impl SceneController for GameScene {
|
||||
pos,
|
||||
_screen_bounds.size,
|
||||
offset,
|
||||
_settings,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user