コード例 #1
0
ファイル: GestureListener.cs プロジェクト: aapaulng/exergames
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        //		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        //		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeDown);
        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseLeftHand);
        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseRightHand);

        //Extra
        //manager.DetectGesture(userId, KinectGestures.Gestures.FlyLeft);
        //manager.DetectGesture(userId, KinectGestures.Gestures.FlyRight);
        //manager.DetectGesture(userId, KinectGestures.Gestures.FlyMiddle);
        manager.DetectGesture(userId, KinectGestures.Gestures.Flap);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "";
        }
        if (GestureInfo2 != null)
        {
            GestureInfo2.text = "Gesture : ";
        }
    }
コード例 #2
0
ファイル: ModelGestureListener.cs プロジェクト: Bebebop/Us
    /// <summary>
    /// Determines whether the user has raised his left or right hand.
    /// </summary>
    /// <returns><c>true</c> if the user has raised his left or right hand; otherwise, <c>false</c>.</returns>

    /* public bool IsRaiseHand()
     * {
     *      if(raiseHand)
     *      {
     *              raiseHand = false;
     *              return true;
     *      }
     *
     *      return false;
     * } */


    /// <summary>
    /// Invoked when a new user is detected. Here you can start gesture tracking by invoking KinectManager.DetectGesture()-function.
    /// </summary>
    /// <param name="userId">User ID</param>
    /// <param name="userIndex">User index</param>
    public void UserDetected(long userId, int userIndex)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;

        if (!manager || (userId != manager.GetPrimaryUserID()))
        {
            return;
        }

        // detect these user specific gestures
        //manager.DetectGesture(userId, KinectGestures.Gestures.ZoomOut);
        //manager.DetectGesture(userId, KinectGestures.Gestures.ZoomIn);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Wheel);
        manager.DetectGesture(userId, KinectGestures.Gestures.Bow);
        manager.DetectGesture(userId, KinectGestures.Gestures.Pull);

        //manager.DetectGesture(userId, KinectGestures.Gestures.RaiseLeftHand);
        //manager.DetectGesture(userId, KinectGestures.Gestures.RaiseRightHand);

        if (gestureInfo != null)
        {
            gestureInfo.GetComponent <Text>().text = "Zoom-in, zoom-out or wheel to rotate the model. Raise hand to reset it.";
        }
    }
コード例 #3
0
    /// <summary>
    /// Invoked when a new user is detected. Here you can start gesture tracking by invoking KinectManager.DetectGesture()-function.
    /// </summary>
    /// <param name="userId">User ID</param>
    /// <param name="userIndex">User index</param>
    public void UserDetected(long userId, int userIndex)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;

        if (!manager || (userId != manager.GetPrimaryUserID()))
        {
            return;
        }

        // detect these user specific gestures

        manager.DetectGesture(userId, KinectGestures.Gestures.ButtomRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.DoubleHandRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.DoubleHandLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeftHandDownRight);
        manager.DeleteGesture(userId, KinectGestures.Gestures.DoubleHandPullBack);



        if (gestureInfo != null)
        {
            gestureInfo.GetComponent <GUIText>().text = "Swipe left, right or up to change the slides.";
        }
    }
コード例 #4
0
    public void UserDetected(uint userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

//      manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
//      manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

        manager.DetectGesture(userId, KinectGestures.Gestures.Walk);
        manager.DetectGesture(userId, KinectGestures.Gestures.Circle);

        manager.DetectGesture(userId, KinectGestures.Gestures.LeanLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeanRight);

        manager.DetectGesture(userId, KinectGestures.Gestures.Run);

        //		manager.DetectGesture(userId, KinectGestures.Gestures.Push);
        //		manager.DetectGesture(userId, KinectGestures.Gestures.Pull);

        //		manager.DetectGesture(userId, KinectWrapper.Gestures.SwipeUp);
        //		manager.DetectGesture(userId, KinectWrapper.Gestures.SwipeDown);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "";
        }
    }
コード例 #5
0
    public void UserDetected(long userId, int userIndex)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;

        if (!manager || (userId != manager.GetPrimaryUserID()))
        {
            return;
        }

        // detect these user specific gestures
        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

//		manager.DetectGesture(userId, KinectGestures.Gestures.Push);
//		manager.DetectGesture(userId, KinectGestures.Gestures.Pull);

//		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
//		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeDown);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "SwipeLeft, SwipeRight, Jump or Squat.";
        }
    }
コード例 #6
0
    public void UserDetected(uint userId, int userIndex)
    {
        KinectManager manager = KinectManager.Instance;

        players.Add(userId);
        if (players.Count > 1)
        {
            if (DefenderManager.defendersOffline.Length > 0)
            {
                manager.Player1Avatars = new List <GameObject>(new GameObject[] { DefenderManager.defendersOffline[0], DefenderManager.defendersOffline[1] });
                manager.Player2Avatars = new List <GameObject>(new GameObject[] { DefenderManager.defendersOffline[2], DefenderManager.defendersOffline[3] });
            }
            else if (DefenderManager.defenders.Length > 0)
            {
                manager.Player1Avatars = new List <GameObject>(new GameObject[] { DefenderManager.defenders[0].gameObject, DefenderManager.defenders[1].gameObject });
                manager.Player2Avatars = new List <GameObject>(new GameObject[] { DefenderManager.defenders[2].gameObject, DefenderManager.defenders[3].gameObject });
            }
            manager.ResetAvatarControllers();
        }
        else
        {
            manager.Player2Avatars = new List <GameObject>();
            manager.ResetAvatarControllers();
        }
        DefenderManager.ResetDebugTracker();
        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

        if (GestureInfo != null)
        {
            GestureInfo.text = "Jump or Squat.";
        }
    }
コード例 #7
0
    public void UserDetected(long userId, int userIndex)
    {
        KinectManager kinectManager = KinectManager.Instance;

        if (!kinectManager || (userId != kinectManager.GetPrimaryUserID()))
        {
            return;
        }


        kinectManager.DetectGesture(userId, KinectGestures.Gestures.PunchLeft);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.PunchRight);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.Defend);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.KickHitRight);

        kinectManager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        //kinectManager.DetectGesture(userId,KinectGestures.Gestures.Squat);
        //kinectManager.DeleteGesture (userId, KinectGestures.Gestures.StandUp);

        kinectManager.DetectGesture(userId, KinectGestures.Gestures.WalkForwardRight);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.WalkForwardLeft);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.WalkBackwardRight);
        kinectManager.DetectGesture(userId, KinectGestures.Gestures.WalkBackwardLeft);

        kinectManager.DetectGesture(userId, KinectGestures.Gestures.SmashHit);
    }
コード例 #8
0
    public void UserDetected(long userId, int userIndex)
    {
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseLeftHand);
        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseRightHand);
    }
コード例 #9
0
    public void UserDetected(uint userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        //DetectしたいGestureをDetectGestureの引数に突っ込んで呼ぶようです
        KinectManager manager = KinectManager.Instance;

        //デフォルトのやつ(足元のやつ)
        this.GenerateFootParticle();

        //manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

        manager.DetectGesture(userId, KinectGestures.Gestures.Push);
//		manager.DetectGesture(userId, KinectGestures.Gestures.Pull);

        manager.DetectGesture(userId, KinectGestures.Gestures.Psi);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        manager.DeleteGesture(userId, KinectGestures.Gestures.RaiseRightHand);
        manager.DeleteGesture(userId, KinectGestures.Gestures.RaiseLeftHand);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "User detected";
        }
    }
コード例 #10
0
    public void UserDetected(uint userId, int userIndex)
    {
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeDown);
        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
    }
コード例 #11
0
ファイル: GestureListener.cs プロジェクト: iChant/FruitNinja
    public void UserDetected(long userId, int userIndex)
    {
        KinectManager manager = KinectManager.Instance;

        messageDispatcher = MessageDispatcher.Instance;
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.Push);
    }
コード例 #12
0
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);

        Debug.Log("Hello");
    }
コード例 #13
0
    public void UserDetected(uint userId, int userIndex)
    {
        //intancia um gerenciador que irá capturar os gestos do player em questão.
        KinectManager gereciador = KinectManager.Instance;

        //Diz ao gerenciador quais saos os movimentos que devem ser capturados desse determinador usuário, baseado no ENUM de gestos
        // da classe KinectGesture
        gereciador.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        gereciador.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        gereciador.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        gereciador.DetectGesture(userId, KinectGestures.Gestures.SwipeDown);
    }
コード例 #14
0
    public void UserDetected(uint userId, int userIndex)
    {
        FindObjectOfType <CC_SceneManager>().OpenGameScene();

        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Wave);
        manager.DetectGesture(userId, KinectGestures.Gestures.Click);
        manager.DetectGesture(userId, KinectGestures.Gestures.Tpose);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
    }
コード例 #15
0
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);

        //if(GestureInfo != null)
        //{
        //	GestureInfo.GetComponent<GUIText>().text = "Swipe left or right to change the slides.";
        //}
    }
コード例 #16
0
    public void UserDetected(uint userId, int userIndex)
    {
        Debug.Log("USER DETECTED!!!");
        // detect these user specific gestures


        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Click);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);
        manager.DetectGesture(userId, KinectGestures.Gestures.Tpose);
    }
コード例 #17
0
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);

        if (GestureInfo != null)
        {
            GestureInfo.guiText.text = "Swipe left or right to change the slides.";
        }
    }
コード例 #18
0
    public void UserDetected(uint userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

//		manager.DetectGesture(userId, KinectGestures.Gestures.Push);
//		manager.DetectGesture(userId, KinectGestures.Gestures.Pull);

//		manager.DetectGesture(userId, KinectWrapper.Gestures.SwipeUp);
//		manager.DetectGesture(userId, KinectWrapper.Gestures.SwipeDown);
    }
コード例 #19
0
    public void UserDetected(uint userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);
        manager.DetectGesture(userId, KinectGestures.Gestures.Tpose);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "SwipeLeft, SwipeRight, Jump, Squat or T-pose.";
        }
    }
コード例 #20
0
    public void UserDetected(long userId, int userIndex)
    {
        if (userIndex != playerIndex)
        {
            return;
        }

        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.Sit);
        manager.DetectGesture(userId, KinectGestures.Gestures.Stand);
        manager.DetectGesture(userId, KinectGestures.Gestures.Surrender);
        manager.DetectGesture(userId, KinectGestures.Gestures.ArmExtend);
        manager.DetectGesture(userId, KinectGestures.Gestures.FeetTogetherStand);
        manager.DetectGesture(userId, KinectGestures.Gestures.Bobath);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeftLegStand);
        manager.DetectGesture(userId, KinectGestures.Gestures.RightLegStand);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Sit2Stand);

        if (gestureInfo != null)
        {
            gestureInfo.text = "No Gesture";
        }
    }
コード例 #21
0
    public void UserDetected(uint userId, int userIndex)
    {
        print("usuario detectado");
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);

        if (gestos != null)
        {
            gestos.text = "Swipe left or right to change the slides.";
        }
    }
コード例 #22
0
    /**
     * When an user enters the screen, apply gesture listener
     */
    public void onUserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance; // alias gesture listener

        manager.DetectGesture(userId, KinectGestures.Gestures.CrossHands);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.PullBothHands);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "Swipe left or right to change the slides.";
        }
    }
コード例 #23
0
    public void UserDetected(long userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.Jump);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);
        manager.DetectGesture(userId, KinectGestures.Gestures.ZoomOut);
        manager.DetectGesture(userId, KinectGestures.Gestures.ZoomIn);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "Swipe, Jump, Squat or Zoom.";
        }
    }
コード例 #24
0
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeDown);

        if (GestureInfo != null)
        {
            GestureInfo.GetComponent <GUIText>().text = "Swipe to control the character!";
        }
    }
コード例 #25
0
    public void UserDetected(long userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.StandUp);
        manager.DetectGesture(userId, KinectGestures.Gestures.Squat);

        StateManager.Instance.StartTimer();

        if (GestureInfo != null)
        {
            GestureInfo.guiText.text = "Sit and stand to move the cart!";
        }
    }
コード例 #26
0
    public void UserDetected(long userId, int userIndex)
    {
        // as an example - detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseRightHand);
    }
コード例 #27
0
    public void UserDetected(long userId, int userIndex)
    {
        //throw new NotImplementedException();
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
    }
コード例 #28
0
    public void UserDetected(long userId, int userIndex)
    {
        if (userIndex != playerIndex)
        {
            return;
        }

        // get manager
        KinectManager manager = KinectManager.Instance;

        // create body data
        PlayerManager.BodyData newData =
            new PlayerManager.BodyData(userId, PlayerManager.Instance.playerHandedness);
        // save in manager
        PlayerManager.Instance.AddPlayer(playerIndex, newData);

        // add all gestures that are being tracked
        foreach (KinectGestures.Gestures gesture in detectedGestures)
        {
            manager.DetectGesture(userId, gesture);
        }

        // fire event that a user was added
        if (PlayerDetectedEvent != null)
        {
            PlayerDetectedEvent(userId);
        }
    }
コード例 #29
0
    public void UserDetected(uint userId, int userIndex)
    {
        // detect these user specific gestures
        KinectManager manager = KinectManager.Instance;

        manager.DetectGesture(userId, KinectGestures.Gestures.SwingForward);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwingBackward);
        manager.DetectGesture(userId, KinectGestures.Gestures.SwingTopdown);  // 구현이 아직 안되었다.
        manager.DetectGesture(userId, KinectGestures.Gestures.RaiseLeftHand); // 기본제스쳐 사용. 이후 수정이 있으면 수정.

        if (GestureInfo != null)
        {
            Debug.Log("Swipe left or right to change the slides.");
            GestureInfo.GetComponent <GUIText>().text = "Swipe left or right to change the slides.";
        }
    }
コード例 #30
0
    /// <summary>
    /// Invoked when a new user is detected. Here you can start gesture tracking by invoking KinectManager.DetectGesture()-function.
    /// </summary>
    /// <param name="userId">User ID</param>
    /// <param name="userIndex">User index</param>
    public void UserDetected(long userId, int userIndex)
    {
        // the gestures are allowed for the primary user only
        KinectManager manager = KinectManager.Instance;

        if (!manager || (userIndex != playerIndex))
        {
            return;
        }

        // detect these user specific gestures
        //manager.DetectGesture(userId, KinectGestures.Gestures.ZoomOut);
        //manager.DetectGesture(userId, KinectGestures.Gestures.ZoomIn);
        //manager.DetectGesture(userId, KinectGestures.Gestures.Wheel);

        //manager.DetectGesture(userId, KinectGestures.Gestures.RaiseLeftHand);
        //manager.DetectGesture(userId, KinectGestures.Gestures.RaiseRightHand);

        //manager.DetectGesture(userId, KinectGestures.Gestures.Run);
        manager.DetectGesture(userId, KinectGestures.Gestures.Move);

        if (gestureInfo != null)
        {
            gestureInfo.text = "Realiza el movimiento";
            Debug.Log("Realiza el movimiento");
        }
    }