Exemplo n.º 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;
 }
Exemplo n.º 2
0
 void sessionManager_SessionStart(ref xn.Point3D position)
 {
 }
Exemplo n.º 3
0
 void pointControl_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D pnt)
 {
     primaryHand = context;
 }
Exemplo n.º 4
0
 void selectableSlider_PrimaryPointCreate(ref xnv.HandPointContext context, ref xn.Point3D ptFocus)
 {
     this.SliderArea.BackColor = Color.Red;
 }
Exemplo n.º 5
0
 void sessionManager_SessionStart(ref xn.Point3D position)
 {
     this.flowRouter.SetActive(this.selectableSlider);
 }
Exemplo n.º 6
0
 private void ResetValues()
 {
     _pushDetecting = false;
     _startPoint = new xn.Point3D();
     _startTime = 0;
 }