Beispiel #1
0
    public Vector3 HandPointerPos(InteractionHand hand)
    {
        switch (pointerMode)
        {
        case PointerMode.OverridePointer when !hand.isTracked:
            return(Vector3.positiveInfinity);

        case PointerMode.OverridePointer:
            return(hand.isLeft ? pointerOverrideL.position : pointerOverrideR.position);

        case PointerMode.IndexTip:
            return(hand.indexPos());

        case PointerMode.PinchPosition:
            return(hand.pinchPos());

        default:
            return(hand.leapHand.PalmPosition.ToVector3());
        }
    }
Beispiel #2
0
 public static float pinchSqrWidth(this InteractionHand hand, float maxWidth = 0.06f)
 {
     return(!hand.isTracked ? maxWidth : hand.indexPos().sqrDist(hand.leapHand.GetThumb().TipPosition.ToVector3()));
 }
Beispiel #3
0
 public static Vector3 pinchPos(this InteractionHand hand)
 {
     return((hand.indexPos() + hand.thumbPos()) / 2);
 }