Esempio n. 1
0
 void UpdateGestureFrame( VisualGestureBuilderFrame gestureFrame )
 {
     bool tracked;
     tracked = gestureFrame.IsTrackingIdValid;
     if ( !tracked ) {
         return;
     }
     foreach ( var g in gestures ) {
         result( gestureFrame, g );
     }
 }
Esempio n. 2
0
 int GetIndexofGestureReader( VisualGestureBuilderFrame gestureFrame )
 {
     for ( int index =0; index<BODY_COUNT; index++ ) {
         if ( gestureFrame.TrackingId
             == gestureFrameReaders[index].VisualGestureBuilderFrameSource.TrackingId ) {
             return index;
         }
     }
     return -1;
 }
Esempio n. 3
0
        void result( VisualGestureBuilderFrame gestureFrame, Gesture gesture )
        {
            int count = GetIndexofGestureReader( gestureFrame );
            GestureType gestureType;
            gestureType = gesture.GestureType;
            switch ( gestureType ) {
            case GestureType.Discrete:
                DiscreteGestureResult dGestureResult;
                dGestureResult = gestureFrame.DiscreteGestureResults[gesture];

                bool detected;
                detected = dGestureResult.Detected;
                if ( !detected ) {
                    break;
                }

                float confidence = dGestureResult.Confidence;
                string discrete = gesture2string( gesture )
                        + " : Detected (" + confidence.ToString() + ")";
                GetTextBlock( count ).Text = discrete;//WPFのTextBlockに表示
                break;

            case GestureType.Continuous:
                ContinuousGestureResult cGestureResult;
                cGestureResult = gestureFrame.ContinuousGestureResults[gesture];

                float progress;
                progress = cGestureResult.Progress;
                string continuous = gesture2string( gesture )
                        + " : Progress " + progress.ToString();
                GetTextBlock( count ).Text = continuous;//WPFのTextBlockに表示
                break;
            default:
                break;
            }
        }