|
|
|
@ -16,7 +16,7 @@ namespace CSVRender
|
|
|
|
|
, mWindow(NULL)
|
|
|
|
|
, mCamera(NULL)
|
|
|
|
|
, mSceneMgr(NULL), mNavigationMode (NavigationMode_Free), mUpdate (false)
|
|
|
|
|
, mKeyForward (false), mKeyBackward (false)
|
|
|
|
|
, mKeyForward (false), mKeyBackward (false), mFast (false)
|
|
|
|
|
{
|
|
|
|
|
setAttribute(Qt::WA_PaintOnScreen);
|
|
|
|
|
setAttribute(Qt::WA_NoSystemBackground);
|
|
|
|
@ -143,6 +143,7 @@ namespace CSVRender
|
|
|
|
|
{
|
|
|
|
|
case Qt::Key_W: mKeyForward = true; break;
|
|
|
|
|
case Qt::Key_S: mKeyBackward = true; break;
|
|
|
|
|
case Qt::Key_Shift: mFast = true; break;
|
|
|
|
|
default: QWidget::keyPressEvent (event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -153,6 +154,7 @@ namespace CSVRender
|
|
|
|
|
{
|
|
|
|
|
case Qt::Key_W: mKeyForward = false; break;
|
|
|
|
|
case Qt::Key_S: mKeyBackward = false; break;
|
|
|
|
|
case Qt::Key_Shift: mFast = false; break;
|
|
|
|
|
default: QWidget::keyReleaseEvent (event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -161,6 +163,7 @@ namespace CSVRender
|
|
|
|
|
{
|
|
|
|
|
mKeyForward = false;
|
|
|
|
|
mKeyBackward = false;
|
|
|
|
|
mFast = false;
|
|
|
|
|
|
|
|
|
|
QWidget::focusOutEvent (event);
|
|
|
|
|
}
|
|
|
|
@ -169,13 +172,15 @@ namespace CSVRender
|
|
|
|
|
{
|
|
|
|
|
if (mKeyForward && !mKeyBackward)
|
|
|
|
|
{
|
|
|
|
|
mCamera->move (mCamera->getDirection());
|
|
|
|
|
int factor = mFast ? 4 : 1;
|
|
|
|
|
mCamera->move (factor * mCamera->getDirection());
|
|
|
|
|
mUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!mKeyForward && mKeyBackward)
|
|
|
|
|
{
|
|
|
|
|
mCamera->move (-mCamera->getDirection());
|
|
|
|
|
int factor = mFast ? 4 : 1;
|
|
|
|
|
mCamera->move (factor * -mCamera->getDirection());
|
|
|
|
|
mUpdate = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|