diff --git a/Source/Core/Core/FreeLookManager.cpp b/Source/Core/Core/FreeLookManager.cpp index eccfa86a09..13acb58635 100644 --- a/Source/Core/Core/FreeLookManager.cpp +++ b/Source/Core/Core/FreeLookManager.cpp @@ -222,40 +222,40 @@ void FreeLookController::Update() g_freelook_camera.Rotate(gyro_motion_quat); if (m_move_buttons->controls[MoveButtons::Up]->GetState()) - g_freelook_camera.MoveVertical(-g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveVertical(-g_freelook_camera.GetSpeed() * dt); if (m_move_buttons->controls[MoveButtons::Down]->GetState()) - g_freelook_camera.MoveVertical(g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveVertical(g_freelook_camera.GetSpeed() * dt); if (m_move_buttons->controls[MoveButtons::Left]->GetState()) - g_freelook_camera.MoveHorizontal(g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveHorizontal(g_freelook_camera.GetSpeed() * dt); if (m_move_buttons->controls[MoveButtons::Right]->GetState()) - g_freelook_camera.MoveHorizontal(-g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveHorizontal(-g_freelook_camera.GetSpeed() * dt); if (m_move_buttons->controls[MoveButtons::Forward]->GetState()) - g_freelook_camera.MoveForward(g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveForward(g_freelook_camera.GetSpeed() * dt); if (m_move_buttons->controls[MoveButtons::Backward]->GetState()) - g_freelook_camera.MoveForward(-g_freelook_camera.GetSpeed()); + g_freelook_camera.MoveForward(-g_freelook_camera.GetSpeed() * dt); if (m_fov_buttons->controls[FieldOfViewButtons::IncreaseX]->GetState()) - g_freelook_camera.IncreaseFovX(g_freelook_camera.GetFovStepSize()); + g_freelook_camera.IncreaseFovX(g_freelook_camera.GetFovStepSize() * dt); if (m_fov_buttons->controls[FieldOfViewButtons::DecreaseX]->GetState()) - g_freelook_camera.IncreaseFovX(-1.0f * g_freelook_camera.GetFovStepSize()); + g_freelook_camera.IncreaseFovX(-1.0f * g_freelook_camera.GetFovStepSize() * dt); if (m_fov_buttons->controls[FieldOfViewButtons::IncreaseY]->GetState()) - g_freelook_camera.IncreaseFovY(g_freelook_camera.GetFovStepSize()); + g_freelook_camera.IncreaseFovY(g_freelook_camera.GetFovStepSize() * dt); if (m_fov_buttons->controls[FieldOfViewButtons::DecreaseY]->GetState()) - g_freelook_camera.IncreaseFovY(-1.0f * g_freelook_camera.GetFovStepSize()); + g_freelook_camera.IncreaseFovY(-1.0f * g_freelook_camera.GetFovStepSize() * dt); if (m_speed_buttons->controls[SpeedButtons::Decrease]->GetState()) - g_freelook_camera.ModifySpeed(1.0f / 1.1f); + g_freelook_camera.ModifySpeed(g_freelook_camera.GetSpeed() * -0.9 * dt); if (m_speed_buttons->controls[SpeedButtons::Increase]->GetState()) - g_freelook_camera.ModifySpeed(1.1f); + g_freelook_camera.ModifySpeed(g_freelook_camera.GetSpeed() * 1.1 * dt); if (m_speed_buttons->controls[SpeedButtons::Reset]->GetState()) g_freelook_camera.ResetSpeed(); diff --git a/Source/Core/VideoCommon/FreeLookCamera.cpp b/Source/Core/VideoCommon/FreeLookCamera.cpp index 25eb2a7c89..99c504db4d 100644 --- a/Source/Core/VideoCommon/FreeLookCamera.cpp +++ b/Source/Core/VideoCommon/FreeLookCamera.cpp @@ -265,18 +265,18 @@ void FreeLookCamera::Rotate(const Common::Quaternion& amt) void FreeLookCamera::IncreaseFovX(float fov) { m_fov_x += fov; - m_fov_x = std::clamp(m_fov_x, m_fov_step_size, m_fov_x); + m_fov_x = std::clamp(m_fov_x, m_min_fov_multiplier, m_fov_x); } void FreeLookCamera::IncreaseFovY(float fov) { m_fov_y += fov; - m_fov_y = std::clamp(m_fov_y, m_fov_step_size, m_fov_y); + m_fov_y = std::clamp(m_fov_y, m_min_fov_multiplier, m_fov_y); } float FreeLookCamera::GetFovStepSize() const { - return m_fov_step_size; + return 1.5f; } void FreeLookCamera::Reset() @@ -287,14 +287,15 @@ void FreeLookCamera::Reset() m_dirty = true; } -void FreeLookCamera::ModifySpeed(float multiplier) +void FreeLookCamera::ModifySpeed(float amt) { - m_speed *= multiplier; + m_speed += amt; + m_speed = std::clamp(m_speed, 0.0f, m_speed); } void FreeLookCamera::ResetSpeed() { - m_speed = 1.0f; + m_speed = 60.0f; } float FreeLookCamera::GetSpeed() const diff --git a/Source/Core/VideoCommon/FreeLookCamera.h b/Source/Core/VideoCommon/FreeLookCamera.h index 389c4cc5cf..cbd28fb8ca 100644 --- a/Source/Core/VideoCommon/FreeLookCamera.h +++ b/Source/Core/VideoCommon/FreeLookCamera.h @@ -78,8 +78,8 @@ private: std::optional m_current_type; std::unique_ptr m_camera_controller; - float m_fov_step_size = 0.025f; - float m_speed = 1.0f; + float m_min_fov_multiplier = 0.025f; + float m_speed = 60.0f; }; extern FreeLookCamera g_freelook_camera;