mouse wheel zooming

actorid
Marc Zinnschlag 11 years ago
parent b6ae521aa5
commit b9107addc0

@ -164,6 +164,17 @@ namespace CSVRender
}
}
void SceneWidget::wheelEvent (QWheelEvent *event)
{
if (int delta = event->delta())
{
int factor = mFast ? 4 : 1; /// \todo make this configurable
/// \todo make mouse sensitivity configurable (the factor 2)
mCamera->move ((factor * mCamera->getDirection() * delta)/2);
mUpdate = true;
}
}
void SceneWidget::focusOutEvent (QFocusEvent *event)
{
mKeyForward = false;
@ -177,7 +188,7 @@ namespace CSVRender
void SceneWidget::update()
{
int factor = mFast ? 4 : 1;
int factor = mFast ? 4 : 1; /// \todo make this configurable
if (mKeyForward && !mKeyBackward)
{

@ -39,6 +39,8 @@ namespace CSVRender
void focusOutEvent (QFocusEvent *event);
void wheelEvent (QWheelEvent *event);
void updateOgreWindow();
Ogre::Camera* mCamera;

Loading…
Cancel
Save