TuioEar can now detect a tap, implemented picking feature. If a selectable node is tapped at that is set as the new focusNode and the camera does a panning to that direction. If not will the camera zoom in towards the focusNode

This commit is contained in:
Jonathan Bosson
2017-03-31 14:39:05 -06:00
parent a5873c3002
commit 7b23c17b10
5 changed files with 69 additions and 15 deletions

View File

@@ -71,8 +71,15 @@ bool TouchModule::gotNewInput() {
) == list.end(); }),
lastProcessed.end());
// Return true if we got new input
// Tap
if (list.size() == 0 && lastProcessed.size() == 0 && ear->tap()) {
TuioCursor c = ear->getTap();
list.push_back(c);
lastProcessed.push_back(std::make_pair(c.getSessionID(), c.getPath().back()));
return true;
}
// Return true if we got new input
if (list.size() == lastProcessed.size() && list.size() > 0) {
bool newInput = true;
for_each(lastProcessed.begin(), lastProcessed.end(), [this, &newInput](Point& p) {