コード例 #1
0
		public void UpdateTuioCursor(TuioCursor tuioCursor)
		{
			_refreshTimer.Stop();

			int pid = tuioCursor.getCursorID();

			int i = _pointerTouchInfos.FindIndex(pti => pti.PointerInfo.PointerId == pid);
			if (i != -1)
			{
				int x = (int)((tuioCursor.getX() * (_screenRect.Width + _calibrationBuffer.Width)) + _calibrationBuffer.Left + _screenRect.Left);
				int y = (int)((tuioCursor.getY() * (_screenRect.Height + _calibrationBuffer.Height)) + _calibrationBuffer.Top + _screenRect.Top);

				PointerTouchInfo pointerTouchInfo = _pointerTouchInfos[i];
				pointerTouchInfo.PointerInfo.PointerFlags = PointerFlags.UPDATE | PointerFlags.INRANGE | ((this.IsContactEnabled) ? PointerFlags.INCONTACT : PointerFlags.NONE);
				pointerTouchInfo.PointerInfo.PtPixelLocation = new PointerTouchPoint { X = x, Y = y };
				pointerTouchInfo.ContactArea = new ContactArea
				{
					Left = x - CONTACT_AREA_RADIUS,
					Right = x + CONTACT_AREA_RADIUS,
					Top = y - CONTACT_AREA_RADIUS,
					Bottom = y + CONTACT_AREA_RADIUS
				};
				_pointerTouchInfos[i] = pointerTouchInfo;

				Trace.WriteLine(string.Format("set cur {0} ({1}) {2} {3} {4} {5}", pid, tuioCursor.getSessionID(), x, y, tuioCursor.getMotionSpeed(), tuioCursor.getMotionAccel()), "TUIO");
			}	
		}
コード例 #2
0
 public void updateTuioCursor(TuioCursor c)
 {
     if (verbose) Console.WriteLine("set cur " + c.getCursorID() + " (" + c.getSessionID() + ") " + c.getX() + " " + c.getY() + " " + c.getMotionSpeed() + " " + c.getMotionAccel());
     mainGrid.checkCursor((c.getX() * TuioDemo.width), (c.getY() * TuioDemo.height), c.getCursorID(), code);
 }
コード例 #3
0
ファイル: TuioDemo.cs プロジェクト: tasku12/TUIO
 public void updateTuioCursor(TuioCursor c)
 {
     if (verbose) Console.WriteLine("set cur "+c.getCursorID() + " ("+c.getSessionID()+") "+c.getX()+" "+c.getY()+" "+c.getMotionSpeed()+" "+c.getMotionAccel());
 }
コード例 #4
0
ファイル: TuioDump.cs プロジェクト: tasku12/TUIO
 public void updateTuioCursor(TuioCursor tcur)
 {
     Console.WriteLine("set cur "+tcur.getCursorID() + " ("+tcur.getSessionID()+") "+tcur.getX()+" "+tcur.getY()+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel());
 }