From 3c7f223aa10412dcd76d6d79f93250c69f96813a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 22 Jul 2013 00:14:42 -0400 Subject: [PATCH] Add "Q" / "E" as freelook keybindings To move the view up and down. --- Source/Core/DolphinWX/Src/Frame.cpp | 6 ++++++ Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 4 ++-- Source/Core/VideoCommon/Src/VertexShaderManager.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 13a181783e..aaa16d80cb 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -936,6 +936,12 @@ void CFrame::OnKeyDown(wxKeyEvent& event) case 'D': VertexShaderManager::TranslateView(-debugSpeed, 0.0f); break; + case 'Q': + VertexShaderManager::TranslateView(0.0f, 0.0f, debugSpeed); + break; + case 'E': + VertexShaderManager::TranslateView(0.0f, 0.0f, -debugSpeed); + break; case 'R': VertexShaderManager::ResetView(); break; diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index ee9fde97f6..c07286d58f 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -619,10 +619,10 @@ void VertexShaderManager::SetMaterialColorChanged(int index) nMaterialsChanged |= (1 << index); } -void VertexShaderManager::TranslateView(float x, float y) +void VertexShaderManager::TranslateView(float x, float y, float z) { float result[3]; - float vector[3] = { x,0,y }; + float vector[3] = { x,z,y }; Matrix33::Multiply(s_viewInvRotationMatrix, vector, result); diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.h b/Source/Core/VideoCommon/Src/VertexShaderManager.h index 8a87f7644f..b4c5d3907c 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.h +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.h @@ -32,7 +32,7 @@ public: static void SetProjectionChanged(); static void SetMaterialColorChanged(int index); - static void TranslateView(float x, float y); + static void TranslateView(float x, float y, float z = 0.0f); static void RotateView(float x, float y); static void ResetView(); };