From d429de6a282ce17f04bacfa3a0c855fc0682851b Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sun, 30 May 2021 00:30:43 +0800 Subject: Control the 3D viewport in a more sane way. No more random viewport resets for real this time. --- visualization/SMELT | 2 +- visualization/qmpvisualization.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/visualization/SMELT b/visualization/SMELT index b83fb43..d572329 160000 --- a/visualization/SMELT +++ b/visualization/SMELT @@ -1 +1 @@ -Subproject commit b83fb431fdff9329dc3cf9457f1934b6156eedfa +Subproject commit d57232938d0c538922154e9223bf994e78c6b069 diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp index 763ab4f..3dc0324 100644 --- a/visualization/qmpvisualization.cpp +++ b/visualization/qmpvisualization.cpp @@ -186,6 +186,7 @@ void qmpVisualization::showThread() debug = false; ctk = api->getCurrentTimeStamp(); lst = std::chrono::steady_clock::now(); + sm->smSetMouseGrab(false); sm->smMainLoop(); sm->smFinale(); } @@ -327,8 +328,10 @@ void qmpVisualization::updateVisualization3D() { float x, y; sm->smGetMouse2f(&x, &y); - rot[1] -= (y - lasty) * 0.01; - rot[2] += (x - lastx) * 0.01; + rot[1] -= (y - lasty) * 0.1; + rot[2] += (x - lastx) * 0.1; + lastx = x; + lasty = y; while (rot[1] > 360) rot[1] -= 360; while (rot[1] < 0) -- cgit v1.2.3