Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        UpdateThreshold();
        new_state = MultiClonageState.NEUTRAL_STATE;
        if (kmc.isTracked)
        {
            right_hand_position     = kmc.Hand_Right.transform.position;
            right_elbow_position    = kmc.Elbow_Right.transform.position;
            left_hand_position      = kmc.Hand_Left.transform.position;
            left_elbow_position     = kmc.Elbow_Left.transform.position;
            right_shoulder_position = kmc.Shoulder_Right.transform.position;
            left_shoulder_position  = kmc.Shoulder_Left.transform.position;

            //Update des distances
            x_DistanceBetweenRightElbowToRightHand    = Mathf.Abs(right_elbow_position.x - right_hand_position.x);
            y_DistanceBetweenLeftElbowToLeftHand      = Mathf.Abs(left_elbow_position.y - left_hand_position.y);
            x_DistanceBetweenRightHandToLeftHand      = Mathf.Abs(right_hand_position.x - left_hand_position.x);
            y_DistanceBetweenRightHandToLeftHand      = Mathf.Abs(right_hand_position.y - left_hand_position.y);
            y_DistanceBetweenRightHandToRightShoulder = Mathf.Abs(right_hand_position.y - right_shoulder_position.y);
            y_DistanceBetweenLeftHandToLeftShoulder   = Mathf.Abs(left_hand_position.y - left_shoulder_position.y);

            //à affiner selon le transform que l'on mettra
            //right_hand_position = kmc.transform.position;
            NewStateUpdate();
            StateTransition();
        }
        else
        {
            b1 = false;
        }
    }
Ejemplo n.º 2
0
 override protected void NewStateUpdate()
 {
     if (x_DistanceBetweenRightElbowToRightHand < marge &&
         y_DistanceBetweenLeftElbowToLeftHand < marge &&
         x_DistanceBetweenRightHandToLeftHand < marge &&
         y_DistanceBetweenRightHandToLeftHand < marge &&
         left_hand_position.z < right_hand_position.z &&
         y_DistanceBetweenRightHandToRightShoulder < marge &&
         y_DistanceBetweenLeftHandToLeftShoulder < marge
         )
     {
         new_state = MultiClonageState.KAGE_BUNCHIN_STATE;
     }
     else
     {
     }
     b1 = false;
 }