Add "Q" / "E" as freelook keybindings

To move the view up and down.
This commit is contained in:
Jasper St. Pierre 2013-07-22 00:14:42 -04:00
parent 52482115e1
commit 3c7f223aa1
3 changed files with 9 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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();
};