Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool checkForGap(TuioCursor cur)
- {
- TuioPoint thisFirstPoint = this.path.First();
- TuioPoint thisLastPoint = this.path.Last();
- TuioPoint curFirstPoint = cur.getPath().First();
- TuioPoint curLastPoint = cur.getPath().Last();
- float distanceStartEnd = thisLastPoint.getDistance(curFirstPoint);
- float distanceStartStart = thisFirstPoint.getDistance(curFirstPoint);
- float distanceEndEnd = thisLastPoint.getDistance(curLastPoint);
- long timeDiffStartEnd = Math.Abs(thisLastPoint.getTuioTime().getTotalMilliseconds() - curFirstPoint.getTuioTime().getTotalMilliseconds());
- long timeDiffStartStart = Math.Abs(thisFirstPoint.getTuioTime().getTotalMilliseconds() - curFirstPoint.getTuioTime().getTotalMilliseconds());
- long timeDiffEndEnd = Math.Abs(thisLastPoint.getTuioTime().getTotalMilliseconds() - curLastPoint.getTuioTime().getTotalMilliseconds());
- //Check if Cursor is within timelimit
- //überflüßig wegen ThreadWarteZeit?
- if (timeDiffStartEnd > MAX_TIME && timeDiffStartStart > MAX_TIME && timeDiffEndEnd > MAX_TIME)
- {
- Console.WriteLine("Timeout ID" + this.s_id);
- wait = false;
- }
- else
- {
- if (distanceStartEnd <= MAX_GAP_PIXEL)
- {
- tproc.setGap(cur.getSessionID(), s_id);
- this.maxIDGap = cur.getSessionID() + 5;
- return true;
- }
- else if (distanceStartStart <= MAX_DISTANCE_MULTIGESTURE)
- {
- Console.WriteLine("MultiGesture Start - Start");
- Console.WriteLine(this.s_id + " " + cur.getSessionID());
- multiGesture = true;
- tproc.addMultiGesture(cur.getSessionID(), s_id);
- return true;
- }
- else if (distanceEndEnd <= MAX_DISTANCE_MULTIGESTURE)
- {
- Console.WriteLine("MultiGesture End - End");
- Console.WriteLine(this.s_id + " " + cur.getSessionID());
- multiGesture = true;
- tproc.addMultiGesture(cur.getSessionID(), s_id);
- return true;
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment