VideoCommon: Change free-look's middle-mouse action to roll the camera.

This commit is contained in:
Jordan Woyak
2019-03-09 10:25:41 -06:00
parent 5c5e6df038
commit 779e618046
6 changed files with 28 additions and 61 deletions

View File

@ -235,21 +235,19 @@ bool RenderWidget::event(QEvent* event)
void RenderWidget::OnFreeLookMouseMove(QMouseEvent* event)
{
if (event->buttons() & Qt::MidButton)
{
// Mouse Move
VertexShaderManager::TranslateView((event->x() - m_last_mouse[0]) / 50.0f,
(event->y() - m_last_mouse[1]) / 50.0f);
}
else if (event->buttons() & Qt::RightButton)
{
// Mouse Look
VertexShaderManager::RotateView((event->x() - m_last_mouse[0]) / 200.0f,
(event->y() - m_last_mouse[1]) / 200.0f);
}
const auto mouse_move = event->pos() - m_last_mouse;
m_last_mouse = event->pos();
m_last_mouse[0] = event->x();
m_last_mouse[1] = event->y();
if (event->buttons() & Qt::RightButton)
{
// Camera Pitch and Yaw:
VertexShaderManager::RotateView(mouse_move.y() / 200.f, mouse_move.x() / 200.f, 0.f);
}
else if (event->buttons() & Qt::MidButton)
{
// Camera Roll:
VertexShaderManager::RotateView(0.f, 0.f, mouse_move.x() / 200.f);
}
}
void RenderWidget::PassEventToImGui(const QEvent* event)