Exemple #1
0
        static public void AddMobileGesture(MobileGesture receivedGesture)
        {
            Console.WriteLine($"{DateTime.Now.ToString("h:mm:ss tt")}: MOBILE: {receivedGesture.Type} {receivedGesture.Direction}");
            if (paused)
            {
                return;
            }
            Logger.CurrentLogger.AddNewMobileGesture(receivedGesture);
            if (receivedGesture.Type == typeContext)
            {
                switch (receivedGesture.Type)
                {
                case GestureType.Swipe: {
                    if (receivedGesture.Direction != GetDirectionContext())
                    {
                        return;
                    }
                    ClearGestures();
                    AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                }
                break;

                case GestureType.Tilt: {
                    ClearGestures();
                    AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                }
                break;

                case GestureType.Pinch: {
                    if (directionContext == receivedGesture.Direction)
                    {
                        if (directionContext == GestureDirection.Push)
                        {
                            if (waitingKinectGesture?.Direction == GestureDirection.Pull)
                            {
                                KinectGesture gesture = waitingKinectGesture;
                                ClearGestures();
                                AwaitingGesture = gesture;
                            }
                            else
                            {
                                ClearGestures();
                                waitingMobileGesture = receivedGesture;
                            }
                        }
                        else
                        {
                            if (waitingKinectGesture != null)
                            {
                                KinectGesture gesture = waitingKinectGesture;
                                ClearGestures();
                                AwaitingGesture = gesture;
                            }
                        }
                    }
                }
                break;

                case GestureType.Throw:
                    if (waitingKinectGesture?.Type == GestureType.Throw)
                    {
                        ClearGestures();
                        AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                    }
                    else
                    {
                        ClearGestures();
                        waitingMobileGesture = receivedGesture;
                    }
                    break;
                }
            }
        }
 public static void ClearGestures()
 {
     waitingKinectGesture = null;
     waitingMobileGesture = null;
     awaitingGesture = null;
 }
Exemple #3
0
 static public void ClearGestures()
 {
     waitingKinectGesture = null;
     waitingMobileGesture = null;
     awaitingGesture      = null;
 }
 public static void AddMobileGesture(MobileGesture receivedGesture)
 {
     Console.WriteLine($"{DateTime.Now.ToString("h:mm:ss tt")}: MOBILE: {receivedGesture.Type} {receivedGesture.Direction}");
     if (paused) return;
     Logger.CurrentLogger.AddNewMobileGesture(receivedGesture);
     if (receivedGesture.Type == typeContext) {
         switch (receivedGesture.Type) {
             case GestureType.Swipe: {
                     if (receivedGesture.Direction != GetDirectionContext()) return;
                     ClearGestures();
                     AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                 }
                 break;
             case GestureType.Tilt: {
                     ClearGestures();
                     AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                 }
                 break;
             case GestureType.Pinch: {
                     if (directionContext == receivedGesture.Direction) {
                         if (directionContext == GestureDirection.Push) {
                             if (waitingKinectGesture?.Direction == GestureDirection.Pull) {
                                 KinectGesture gesture = waitingKinectGesture;
                                 ClearGestures();
                                 AwaitingGesture = gesture;
                             } else {
                                 ClearGestures();
                                 waitingMobileGesture = receivedGesture;
                             }
                         } else {
                             if(waitingKinectGesture != null) {
                                 KinectGesture gesture = waitingKinectGesture;
                                 ClearGestures();
                                 AwaitingGesture = gesture;
                             }
                         }
                     }
                 }
                 break;
             case GestureType.Throw:
                 if (waitingKinectGesture?.Type == GestureType.Throw) {
                     ClearGestures();
                     AwaitingGesture = new KinectGesture(receivedGesture.Shape);
                 } else {
                     ClearGestures();
                     waitingMobileGesture = receivedGesture;
                 }
                 break;
         }
     }
 }