improvement to tap interpretation by time instead of path size

This commit is contained in:
Jonathan Bosson
2017-06-21 11:30:16 -06:00
parent 7f39ebb49c
commit f94d58d738
+2 -1
View File
@@ -94,7 +94,8 @@ void TuioEar::removeTuioCursor(TuioCursor *tcur) {
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) {
double heldTime = tcur->getPath().back().getTuioTime().getTotalMilliseconds() - tcur->getPath().front().getTuioTime().getTotalMilliseconds();
if (heldTime < 180 && dist < 0.0004 && _list.size() == 1 && _removeList.size() == 1) {
_tapCo = TuioCursor(*tcur);
_tap = true;
}