/// <summary> /// Callback when a hand moved /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnUserHandMove(object sender, HandMoveEventArgs e) { RaisUserHandMove(this, new HandMoveEventArgs { HandType = e.HandType, userID = this.UserID, PositionOnScreen = e.PositionOnScreen, RawPosition = e.RawPosition, IsGrip = e.IsGrip }); }
private void OnUserHandMove(object sender, HandMoveEventArgs e) { // Precondition checking if (m_refIdHandFeedback.ContainsKey(e.userID) == false) { // Unknown user return; } // Raise associated event if (e.HandType == Microsoft.Kinect.Toolkit.Interaction.InteractionHandType.Left) { var handId = m_refIdHandFeedback[e.userID].ElementAt(0); RaiseUserHandMove(handId, (int)(e.PositionOnScreen.X), (int)(e.PositionOnScreen.Y), e.IsGrip); } else if (e.HandType == Microsoft.Kinect.Toolkit.Interaction.InteractionHandType.Right) { var handId = m_refIdHandFeedback[e.userID].ElementAt(1); RaiseUserHandMove(handId, (int)(e.PositionOnScreen.X), (int)(e.PositionOnScreen.Y), e.IsGrip); } }
/// <summary> /// Raise event UserHandMove /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RaisUserHandMove(object sender, HandMoveEventArgs e) { if (UserHandMove != null) { UserHandMove(this, e); } }
/// <summary> /// Raise event HandMove /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RaiseHandMove(object sender, HandMoveEventArgs e) { if (HandMove != null) { HandMove(sender, e); } }