forked from teamnwah/openmw-tes3coop
mouse wheel zooming
This commit is contained in:
parent
b6ae521aa5
commit
b9107addc0
2 changed files with 14 additions and 1 deletions
|
@ -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…
Reference in a new issue