private void onHandCaptured(HandEvent e) { Hand h = new Hand(e.ID, new Point3D(e.PositionTable2D.x, e.PositionTable2D.y, e.PositionTable2D.z)); hands.Add(h.ID, h); if (HandCaptured != null) { HandCaptured(this, new HandEventArgs(h, this)); } Trace.WriteLine("Hand captured: " + h.ID + ", " + h.Position.ToString()); }
private void onHandMove(HandEvent e) { Hand h = hands[e.ID]; //it won't be null h.Position = new Point3D(e.PositionTable2D.x, e.PositionTable2D.y, e.PositionTable2D.z); if (HandMove != null) { HandMove(this, new HandEventArgs(h, this)); } //Trace.WriteLine("Hand move: " + h.ID + ", " + h.Position.ToString()); }
private void onHandLost(HandEvent e) { if (!hands.ContainsKey(e.ID)) { return; //TODO: it shouldn't goes here } Hand h = hands[e.ID]; //it won't be null h.Position = new Point3D(e.PositionTable2D.x, e.PositionTable2D.y, e.PositionTable2D.z); hands.Remove(e.ID); if (HandLost != null) { HandLost(this, new HandEventArgs(h, this)); } Trace.WriteLine("Hand lost: " + h.ID + ", " + h.Position.ToString()); }