From 542e4c0fcbbc1911a6770f1af8a26676114b246d Mon Sep 17 00:00:00 2001 From: Jonathan Bosson Date: Fri, 12 May 2017 15:55:20 -0600 Subject: [PATCH] changes during feedback and cleanup --- modules/touch/src/TuioEar.cpp | 14 +++++++++++--- modules/touch/touchmodule.h | 2 +- openspace.cfg | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/touch/src/TuioEar.cpp b/modules/touch/src/TuioEar.cpp index b5b4c0e086..7080859936 100644 --- a/modules/touch/src/TuioEar.cpp +++ b/modules/touch/src/TuioEar.cpp @@ -88,9 +88,17 @@ void TuioEar::updateTuioCursor(TuioCursor *tcur) { void TuioEar::removeTuioCursor(TuioCursor *tcur) { _mx.lock(); _removeList.push_back(tcur->getSessionID()); - if (tcur->getPath().size() < 4 && tcur->getMotionSpeed() < 0.03 && _list.size() == _removeList.size() == 1) { // maybe take away motionspeed - _tapCo = TuioCursor(*tcur); - _tap = true; + + if (!_list.empty()) { + double dist = 0; + for (const TuioPoint& p : tcur->getPath()) { + dist += glm::length(glm::dvec2(p.getX(), p.getY()) - glm::dvec2(tcur->getX(), tcur->getY())); + } + dist /= tcur->getPath().size(); + if (tcur->getPath().size() < 7 && dist < 0.0004 && _list.size() == 1 && _removeList.size() == 1) { + _tapCo = TuioCursor(*tcur); + _tap = true; + } } _mx.unlock(); } diff --git a/modules/touch/touchmodule.h b/modules/touch/touchmodule.h index 763063e88c..4cae20213c 100644 --- a/modules/touch/touchmodule.h +++ b/modules/touch/touchmodule.h @@ -32,8 +32,8 @@ namespace openspace { class TouchModule : public OpenSpaceModule { - public: using Point = std::pair; + public: TouchModule(); private: diff --git a/openspace.cfg b/openspace.cfg index dc126d8a42..27dd3511df 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -87,7 +87,7 @@ return { Type = "html", File = "${DOCUMENTATION}/FactoryDocumentation.html" }, - ShutdownCountdown = 3, + ShutdownCountdown = 0, -- OnScreenTextScaling = "framebuffer", -- PerSceneCache = true, -- DisableRenderingOnMaster = true,