예제 #1
0
 protected void TouchAdded(Tuio2DCursor cur)
 {
     lock (m_lock)
     {
         this.current.Add(cur.SessionID, cur);
     }
 }
예제 #2
0
 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);
                 }
             }
         }
     }
 }
예제 #3
0
 protected void TouchUpdated(Tuio2DCursor cur)
 {
     lock (m_lock)
     {
         this.current[cur.SessionID] = cur;
     }
 }
예제 #4
0
 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);
 }
예제 #5
0
	    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;
	    }
예제 #6
0
        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;
    }
예제 #8
0
파일: TuioTracking.cs 프로젝트: shu1/dfu
 void addNewCursor(int id, Tuio2DCursor cursor)
 {
     if (!this.current.ContainsKey(id)) {
         this.TouchAdded(cursor);
     }
 }
예제 #9
0
파일: TuioTracking.cs 프로젝트: shu1/dfu
        protected void TouchUpdated(Tuio2DCursor cur)
        {
            TuioTrackingComponent.UpdateTouch( cur );

            lock(m_lock)
            {
                this.current[cur.SessionID] = cur;
            }
        }
예제 #10
0
파일: TuioTracking.cs 프로젝트: shu1/dfu
        protected void TouchAdded(Tuio2DCursor cur)
        {
            TuioTrackingComponent.NewTouch( cur );

            lock(m_lock)
            {
                this.current.Add(cur.SessionID, cur);
            }
        }
예제 #11
0
	    protected void TouchAdded(Tuio2DCursor cur)
	    {
			lock(m_lock)
			{
	        	this.current.Add(cur.SessionID, cur);
			}
	    }
예제 #12
0
	    protected void TouchUpdated(Tuio2DCursor cur)
	    {
			lock(m_lock)
			{
	        	this.current[cur.SessionID] = cur;
			}
	    }
예제 #13
0
	    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;
	    }
예제 #14
0
    Vector2 getRawPoint(Tuio2DCursor data)
    {
		Vector2 position = new Vector2(data.PositionX, data.PositionY);
        return position;
    }
예제 #15
0
	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;
    }