Cleanup of TouchInteraction, selected can now only have one node per id

This commit is contained in:
Jonathan Bosson
2017-03-30 13:05:10 -06:00
parent 15450d9a9c
commit 55157ab429
3 changed files with 96 additions and 73 deletions
+3 -1
View File
@@ -76,7 +76,9 @@ bool TouchModule::gotNewInput() {
if (list.size() == lastProcessed.size() && list.size() > 0) {
bool newInput = true;
for_each(lastProcessed.begin(), lastProcessed.end(), [this, &newInput](Point& p) {
if (p.second.getTuioTime().getTotalMilliseconds() == find_if(list.begin(), list.end(), [&p](const TuioCursor& c) { return c.getSessionID() == p.first; })->getPath().back().getTuioTime().getTotalMilliseconds())
std::vector<TuioCursor>::iterator cursor = find_if(list.begin(), list.end(), [&p](const TuioCursor& c) { return c.getSessionID() == p.first; });
double now = cursor->getPath().back().getTuioTime().getTotalMilliseconds();
if (p.second.getTuioTime().getTotalMilliseconds() == now || !cursor->isMoving())
newInput = false;
});
return newInput;