/// <summary> /// Updates all touches with the latest TUIO received data /// </summary> public override void updateTouches() { int[] mouseButtons = (from i in MOUSE_BUTTONS where Input.GetMouseButton(i) select i ).ToArray(); // Update touches in current collection foreach (int i in mouseButtons) { // Get the touch relating to the key Tuio.Touch t = null; if (TuioTouches.ContainsKey(i)) { // It's not a new one t = TuioTouches[i]; // Update it's position t.SetNewTouchPoint(new Vector2(Input.mousePosition.x, Input.mousePosition.y)); } else { // It's a new one t = buildTouch(i); TuioTouches.Add(i, t); } } }
/// <summary> /// Updates all touches with the latest TUIO received data /// </summary> public override void updateTouches() { Tuio2DCursor[] cursors = tracking.GetTouchArray(); // Update touches in current collection foreach (Tuio2DCursor cursor in cursors) { if (cursor == null) { Debug.LogWarning("CURSOR NULL"); continue; } // Get the touch relating to the key Tuio.Touch t = null; if (TuioTouches.ContainsKey(cursor.SessionID)) { // It's not a new one t = TuioTouches[cursor.SessionID]; // Update it's position t.SetNewTouchPoint(getScreenPoint(cursor), getRawPoint(cursor)); } else { // It's a new one t = buildTouch(cursor); TuioTouches.Add(cursor.SessionID, t); } } }
/// <summary> /// Updates all touches with the latest TUIO received data /// </summary> public override void updateTouches() { WM_Tracking.TOUCHINPUT[] cursors = tracking.GetTouchArray(); // Update touches in current collection foreach (WM_Tracking.TOUCHINPUT cursor in cursors) { // Get the touch relating to the key Tuio.Touch t = null; if (TuioTouches.ContainsKey(cursor.dwID)) { // It's not a new one t = TuioTouches[cursor.dwID]; // Update it's position t.SetNewTouchPoint(getScreenPoint(cursor), getRawPoint(cursor)); } else { // It's a new one t = buildTouch(cursor); TuioTouches.Add(cursor.dwID, t); } } }