added MoveCamera but isn't working well

updated about text,
This commit is contained in:
Anakin
2017-02-04 15:48:10 +01:00
parent 648b805daf
commit 94a2fa59ec
6 changed files with 79 additions and 8 deletions

View File

@@ -235,6 +235,38 @@ void OglViewerWidget::keyPressEvent(QKeyEvent *e)
{
resetView();
}
else if (e->key() == Qt::Key_W)
{
emit m_camera->wheelAction(1);
if (m_light.headlight)
updateLightPosition();
update();
}
else if (e->key() == Qt::Key_S)
{
emit m_camera->wheelAction(-1);
if (m_light.headlight)
updateLightPosition();
update();
}
else if (e->key() == Qt::Key_A)
{
emit m_camera->moveAction(QVector2D(0, -1));
if (m_light.headlight)
updateLightPosition();
update();
}
else if (e->key() == Qt::Key_D)
{
emit m_camera->moveAction(QVector2D(0, 1));
if (m_light.headlight)
updateLightPosition();
update();
}
else if (e->key() == Qt::Key_Escape)
{
parentWidget()->close();