Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add "Q" / "E" as freelook keybindings
To move the view up and down.
  • Loading branch information
magcius committed Jul 22, 2013
1 parent 5248211 commit 3c7f223
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/Src/VertexShaderManager.cpp
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/Src/VertexShaderManager.h
Expand Up @@ -32,7 +32,7 @@ class VertexShaderManager
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();
};
Expand Down

0 comments on commit 3c7f223

Please sign in to comment.