Add "Q" / "E" as freelook keybindings
To move the view up and down.
This commit is contained in:
parent
52482115e1
commit
3c7f223aa1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue