/// <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()
    {
        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);
            }
        }
    }
示例#3
0
 public void AddTouch(Tuio.Touch t, RaycastHit hit)
 {
     // This will always keep the most recent touch
     curTouch = t;
     originalPos = new Vector2(
             t.TouchPoint.x / (float)_screenWidth,
             t.TouchPoint.y / (float)_screenHeight);
     origCollider = hit.collider;
 }
	Tuio.Touch buildTouch(WM_Tracking.TOUCHINPUT cursor)
    {
        Vector2 p = getScreenPoint(cursor);
		Vector2 raw = getRawPoint(cursor);

        Tuio.Touch t = new Tuio.Touch(cursor.dwID, p, raw);

        return t;
    }
示例#5
0
    Tuio.Touch buildTouch(WM_Tracking.TOUCHINPUT cursor)
    {
        Vector2 p   = getScreenPoint(cursor);
        Vector2 raw = getRawPoint(cursor);

        Tuio.Touch t = new Tuio.Touch(cursor.dwID, p, raw);

        return(t);
    }
	Tuio.Touch buildTouch(int ID)
    {
        TouchProperties prop;
        prop.Acceleration = 0f;
        prop.VelocityX = 0f;
        prop.VelocityY = 0f;

        Vector2 p = new Vector2(Input.mousePosition.x, Input.mousePosition.y);

        Tuio.Touch t = new Tuio.Touch(ID, p);
        t.Properties = prop;

        return t;
    }
    Tuio.Touch buildTouch(int ID)
    {
        TouchProperties prop;

        prop.Acceleration = 0f;
        prop.VelocityX    = 0f;
        prop.VelocityY    = 0f;

        Vector2 p = new Vector2(Input.mousePosition.x, Input.mousePosition.y);

        Tuio.Touch t = new Tuio.Touch(ID, p);
        t.Properties = prop;

        return(t);
    }
    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);
    }
示例#9
0
    /// <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);
            }
        }
    }
	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;
    }