fix to panning speed into direct-manipulation issue

This commit is contained in:
Jonathan Bosson
2017-05-12 16:14:24 -06:00
parent 542e4c0fcb
commit 1b1cbcfdfb
2 changed files with 9 additions and 11 deletions

View File

@@ -129,6 +129,7 @@ void TouchInteraction::updateStateFromInput(const std::vector<TuioCursor>& list,
// evaluates if current frame is in directTouchMode (will if so be used next frame)
if (_currentRadius > _nodeRadiusThreshold && _selected.size() == list.size()) { // needs better definition?
_vel.pan = glm::dvec2(0.0, 0.0);
_directTouchMode = true;
}
else {

View File

@@ -88,17 +88,14 @@ void TuioEar::updateTuioCursor(TuioCursor *tcur) {
void TuioEar::removeTuioCursor(TuioCursor *tcur) {
_mx.lock();
_removeList.push_back(tcur->getSessionID());
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;
}
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();
}