From e70157474bd53c7ae40c85a921b589a79fbd7d7a Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 24 Apr 2021 22:59:35 -0500 Subject: Core / VideoCommon: refactor FreeLookCamera to have the underlying controller handle all the logic (field-of-view, movement, etc) --- Source/Core/VideoCommon/VertexShaderManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp') diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 88c6806326..15e7b8c853 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -356,7 +356,7 @@ void VertexShaderManager::SetConstants() } } - if (bProjectionChanged || g_freelook_camera.IsDirty()) + if (bProjectionChanged || g_freelook_camera.GetController()->IsDirty()) { bProjectionChanged = false; @@ -435,7 +435,7 @@ void VertexShaderManager::SetConstants() memcpy(constants.projection.data(), corrected_matrix.data.data(), 4 * sizeof(float4)); - g_freelook_camera.SetClean(); + g_freelook_camera.GetController()->SetClean(); dirty = true; } -- cgit v1.2.3 From 514475646df7c4c7aa3f8f394bced2a28a22b788 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 8 May 2021 14:36:44 -0500 Subject: VideoCommon: update Free Look camera's 'FieldOfView' function to 'FieldOfViewMultiplier' to better reflect usage --- Source/Core/VideoCommon/VertexShaderManager.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/VertexShaderManager.cpp') diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index 15e7b8c853..1b0bf55de7 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -366,16 +366,21 @@ void VertexShaderManager::SetConstants() { case ProjectionType::Perspective: { - const Common::Vec2 fov = - g_freelook_camera.IsActive() ? g_freelook_camera.GetFieldOfView() : Common::Vec2{1, 1}; - g_fProjectionMatrix[0] = rawProjection[0] * g_ActiveConfig.fAspectRatioHackW * fov.x; + const Common::Vec2 fov_multiplier = g_freelook_camera.IsActive() ? + g_freelook_camera.GetFieldOfViewMultiplier() : + Common::Vec2{1, 1}; + g_fProjectionMatrix[0] = + rawProjection[0] * g_ActiveConfig.fAspectRatioHackW * fov_multiplier.x; g_fProjectionMatrix[1] = 0.0f; - g_fProjectionMatrix[2] = rawProjection[1] * g_ActiveConfig.fAspectRatioHackW * fov.x; + g_fProjectionMatrix[2] = + rawProjection[1] * g_ActiveConfig.fAspectRatioHackW * fov_multiplier.x; g_fProjectionMatrix[3] = 0.0f; g_fProjectionMatrix[4] = 0.0f; - g_fProjectionMatrix[5] = rawProjection[2] * g_ActiveConfig.fAspectRatioHackH * fov.y; - g_fProjectionMatrix[6] = rawProjection[3] * g_ActiveConfig.fAspectRatioHackH * fov.y; + g_fProjectionMatrix[5] = + rawProjection[2] * g_ActiveConfig.fAspectRatioHackH * fov_multiplier.y; + g_fProjectionMatrix[6] = + rawProjection[3] * g_ActiveConfig.fAspectRatioHackH * fov_multiplier.y; g_fProjectionMatrix[7] = 0.0f; g_fProjectionMatrix[8] = 0.0f; -- cgit v1.2.3