Tweaked camera speed

This commit is contained in:
Michaël Lemaire 2015-08-20 19:02:11 +02:00
parent 05d0680210
commit 7dd70e7bca
2 changed files with 4 additions and 4 deletions

View file

@ -56,7 +56,7 @@ void ModelerCameras::processPanning(double xvalue, double yvalue)
void ModelerCameras::timerEvent(QTimerEvent *)
{
current->transitionToAnother(active, 0.3);
current->transitionToAnother(active, 0.5);
parent->getScenery()->keepCameraAboveGround(current);
parent->getRenderer()->setCamera(current);
}

View file

@ -65,7 +65,7 @@ void OpenGLView::wheelEvent(QWheelEvent *event)
}
double factor = getSpeedFactor(event);
window->getCamera()->processZoom(0.1 * factor * (double)event->angleDelta().y());
window->getCamera()->processZoom(0.01 * factor * (double)event->angleDelta().y());
}
void OpenGLView::mousePressEvent(QMouseEvent *event)
@ -100,11 +100,11 @@ void OpenGLView::mouseMoveEvent(QMouseEvent *event)
QPointF diff = event->windowPos() - mouse_pos;
if (mouse_button == Qt::LeftButton)
{
window->getCamera()->processPanning(0.006 * factor * diff.x(), 0.002 * factor * diff.y());
window->getCamera()->processPanning(0.002 * factor * diff.x(), 0.001 * factor * diff.y());
}
else if (mouse_button == Qt::RightButton)
{
window->getCamera()->processScroll(-0.1 * factor * diff.x(), 0.1 * factor * diff.y());
window->getCamera()->processScroll(-0.02 * factor * diff.x(), 0.02 * factor * diff.y());
}
mouse_pos = event->windowPos();
}