diff --git a/src/definition/TextureLayerDefinition.cpp b/src/definition/TextureLayerDefinition.cpp index 655d4bb..9eb143a 100644 --- a/src/definition/TextureLayerDefinition.cpp +++ b/src/definition/TextureLayerDefinition.cpp @@ -152,8 +152,8 @@ void TextureLayerDefinition::applyPreset(TextureLayerPreset preset) displacement_height = 0.1; displacement_scaling = 1.0; displacement_offset = 0.0; - material->base = colorToHSL(Color(1.0, 1.0, 1.0, 1.0)); - material->reflection = 0.25; + material->base = colorToHSL(Color(5.0, 5.0, 5.0, 1.0)); + material->reflection = 0.02; material->shininess = 0.6; break; default: diff --git a/src/interface/modeler/quickapp/OpenGLView.cpp b/src/interface/modeler/quickapp/OpenGLView.cpp index 1b94a41..af64bf4 100644 --- a/src/interface/modeler/quickapp/OpenGLView.cpp +++ b/src/interface/modeler/quickapp/OpenGLView.cpp @@ -59,7 +59,8 @@ void OpenGLView::paint() void OpenGLView::wheelEvent(QWheelEvent *event) { - window->getCamera()->processZoom(0.1 * (double)event->angleDelta().y()); + double factor = getSpeedFactor(event); + window->getCamera()->processZoom(0.1 * factor * (double)event->angleDelta().y()); } void OpenGLView::mousePressEvent(QMouseEvent *event) @@ -75,14 +76,15 @@ void OpenGLView::mouseReleaseEvent(QMouseEvent *) void OpenGLView::mouseMoveEvent(QMouseEvent *event) { + double factor = getSpeedFactor(event); QPointF diff = event->windowPos() - mouse_pos; if (mouse_button == Qt::LeftButton) { - window->getCamera()->processScroll(-0.1 * diff.x(), 0.1 * diff.y()); + window->getCamera()->processPanning(0.006 * factor * diff.x(), 0.002 * factor * diff.y()); } else if (mouse_button == Qt::RightButton) { - window->getCamera()->processPanning(0.006 * diff.x(), 0.002 * diff.y()); + window->getCamera()->processScroll(-0.1 * factor * diff.x(), 0.1 * factor * diff.y()); } mouse_pos = event->windowPos(); } @@ -94,3 +96,19 @@ void OpenGLView::timerEvent(QTimerEvent *) window->update(); } } + +double OpenGLView::getSpeedFactor(QInputEvent *event) +{ + if (event->modifiers() & Qt::ControlModifier) + { + return 0.2; + } + else if (event->modifiers() & Qt::ShiftModifier) + { + return 3.0; + } + else + { + return 1.0; + } +} diff --git a/src/interface/modeler/quickapp/OpenGLView.h b/src/interface/modeler/quickapp/OpenGLView.h index 31fcc5c..7f8d1b0 100644 --- a/src/interface/modeler/quickapp/OpenGLView.h +++ b/src/interface/modeler/quickapp/OpenGLView.h @@ -25,6 +25,9 @@ protected: virtual void mouseMoveEvent(QMouseEvent *event) override; virtual void timerEvent(QTimerEvent *event) override; +private: + double getSpeedFactor(QInputEvent *event); + private: bool initialized; MainModelerWindow *window;