예제 #1
0
 protected override void CheckStatus()
 {
     //Get the last postion and time
     xn.Point3D lastPosition = _traceHistory.Values[_traceHistory.Values.Count - 1];
     float lastTime = _traceHistory.Keys[_traceHistory.Values.Count - 1];
     //Initiate push detection if needed
     if (!_pushDetecting && _traceHistory.Values.Count >= 2)
     {
         //Detect if there is push. This is the case if the hand is moving towards the kinect.
         if (lastPosition.Z < _previousPoint.Z)
         {
             _startPoint = _previousPoint;
             _startTime = _previousTime;
             _pushDetecting = true;
         }
     }
     else
     {
         //Check if the detecting push is still valid
         if (lastPosition.Z < _previousPoint.Z)
         {
             float change = _startPoint.Z - lastPosition.Z;
             float duration = lastTime - _startTime;
             System.Diagnostics.Debug.WriteLine("Last Z:" + lastPosition.Z + " - previous Z:" + _previousPoint.Z + " - change" + change);
             //Check if the swip is completed.
             //This is true if the treshold is passed.
             CheckPushCompleted(lastPosition, duration, change, Gestures.Push);
         }
         else
         {
             ResetValues();
         }
     }
     _previousPoint = lastPosition;
     _previousTime = lastTime;
 }
예제 #2
0
파일: Main.cs 프로젝트: hooface/as3_openni
 void sessionManager_SessionStart(ref xn.Point3D position)
 {
 }
예제 #3
0
파일: Main.cs 프로젝트: hooface/as3_openni
 void pointControl_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D pnt)
 {
     primaryHand = context;
 }
예제 #4
0
파일: Boxes.cs 프로젝트: martindale/nestk
 void selectableSlider_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D ptFocus)
 {
     this.SliderArea.BackColor = Color.Red;
 }
예제 #5
0
파일: Boxes.cs 프로젝트: martindale/nestk
 void sessionManager_SessionStart(ref xn.Point3D position)
 {
     this.flowRouter.SetActive(this.selectableSlider);
 }
예제 #6
0
 private void ResetValues()
 {
     _pushDetecting = false;
     _startPoint = new xn.Point3D();
     _startTime = 0;
 }