示例#1
0
    //Check pinch and grab pose
    public bool IsPinching(Leap.Hand hand)
    {
        if (Hands.GetIndex(hand).IsExtended)
        {
            return(false);
        }
        //return hand.PinchStrength > .9f;
        //first and foremost we need the index to be pinched, if it it is we have a true
        bool pinch = checkPinchOfFinger(hand, "index");

        //if we are in pinch with index check to see if other fingers are not.
        if (pinch)
        {
            string[] fings = { "ring", "pinky" };
            foreach (string f in fings)
            {
                //If any other finger is in pinch return false
                if (checkPinchOfFinger(hand, f))
                {
                    return(false);
                }
            }
        }
        return(pinch);
    }
示例#2
0
 public bool checkFingerGun(Leap.Hand hand)
 {
     if (!checkThumbsUp(hand))
     {
         return(false);
     }
     if (!Hands.GetIndex(hand).IsExtended)
     {
         return(false);
     }
     return(true);
 }
示例#3
0
    //public DebugGrapher grapher = GameObject.Find("HandUtilDebugGrapher").GetComponent<DebugGrapher>();

    //Gets the position of the fingers on a hand
    public Vector3 getIndexPos(Leap.Hand hand)
    {
        return(Hands.GetIndex(hand).TipPosition.ToVector3());
    }