protected void TouchAdded(Tuio2DCursor cur) { lock (m_lock) { this.current.Add(cur.SessionID, cur); } }
void updateSetCursors(Dictionary <int, Tuio2DCursor> sets, List <int> alive) { foreach (int curid in alive) { //Held cursor if (!sets.ContainsKey(curid) && this.current.ContainsKey(curid)) { this.TouchHeld(curid); } else { if (sets.ContainsKey(curid) && this.current.ContainsKey(curid)) { Tuio2DCursor cur = sets[curid]; if (cur.IsEqual(this.current[curid])) { //Call touchheld if same value this.TouchHeld(curid); } else { this.TouchUpdated(cur); } } } } }
protected void TouchUpdated(Tuio2DCursor cur) { lock (m_lock) { this.current[cur.SessionID] = cur; } }
public bool IsEqual(Tuio2DCursor cursor) { return(this.Acceleration == cursor.Acceleration && this.PositionX == cursor.PositionX && this.PositionY == cursor.PositionY && this.SessionID == cursor.SessionID && this.VelocityX == cursor.VelocityX && this.VelocityY == cursor.VelocityY); }
public static Dictionary<int, Tuio2DCursor> GetCursors(OSCBundle pack) { Dictionary<int, Tuio2DCursor> result = new Dictionary<int, Tuio2DCursor>(); List<OSCMessage> cursors = FindByCommand(pack, "/tuio/2Dcur", "set"); foreach (OSCMessage msg in cursors) { Tuio2DCursor cur = new Tuio2DCursor(msg); result.Add(cur.SessionID, cur); } return result; }
public static Dictionary <int, Tuio2DCursor> GetCursors(OSCBundle pack) { Dictionary <int, Tuio2DCursor> result = new Dictionary <int, Tuio2DCursor>(); List <OSCMessage> cursors = FindByCommand(pack, "/tuio/2Dcur", "set"); foreach (OSCMessage msg in cursors) { Tuio2DCursor cur = new Tuio2DCursor(msg); result.Add(cur.SessionID, cur); } return(result); }
Tuio.Touch buildTouch(Tuio2DCursor cursor) { TouchProperties prop; prop.Acceleration = cursor.Acceleration; prop.VelocityX = cursor.VelocityX; prop.VelocityY = cursor.VelocityY; Vector2 p = getScreenPoint(cursor); Vector2 raw = getRawPoint(cursor); Tuio.Touch t = new Tuio.Touch(cursor.SessionID, p, raw); t.Properties = prop; return t; }
void addNewCursor(int id, Tuio2DCursor cursor) { if (!this.current.ContainsKey(id)) { this.TouchAdded(cursor); } }
protected void TouchUpdated(Tuio2DCursor cur) { TuioTrackingComponent.UpdateTouch( cur ); lock(m_lock) { this.current[cur.SessionID] = cur; } }
protected void TouchAdded(Tuio2DCursor cur) { TuioTrackingComponent.NewTouch( cur ); lock(m_lock) { this.current.Add(cur.SessionID, cur); } }
protected void TouchAdded(Tuio2DCursor cur) { lock(m_lock) { this.current.Add(cur.SessionID, cur); } }
protected void TouchUpdated(Tuio2DCursor cur) { lock(m_lock) { this.current[cur.SessionID] = cur; } }
public bool IsEqual(Tuio2DCursor cursor) { return this.Acceleration == cursor.Acceleration && this.PositionX == cursor.PositionX && this.PositionY == cursor.PositionY && this.SessionID == cursor.SessionID && this.VelocityX == cursor.VelocityX && this.VelocityY == cursor.VelocityY; }
Vector2 getRawPoint(Tuio2DCursor data) { Vector2 position = new Vector2(data.PositionX, data.PositionY); return position; }
Vector2 getScreenPoint(Tuio2DCursor data) { Vector2 position = new Vector2(data.PositionX, data.PositionY); float x1 = getScreenPoint(position.x, ScreenWidth, false); float y1 = getScreenPoint(position.y, ScreenHeight, true); Vector2 t = new Vector2(x1, y1); return t; }