HandModel.GetPalmDirection C# (CSharp) Method

GetPalmDirection() public method

public GetPalmDirection ( ) : Vector3
return Vector3
  public Vector3 GetPalmDirection() {
    if (controller_ != null && hand_ != null) {
      return controller_.transform.TransformDirection(hand_.Direction.ToUnity(mirror_z_axis_));
    }
    if (palm) {
      return palm.forward;
    }
    return Vector3.forward;
  }

Usage Example

    protected override void UpdateTracker()
    {
        previousPosition = Position;
        previousOrientation = Orientation;
        previousGrabbingStrength = currentGrabbingStrength;

        //get the rightmost hand in the frame
        if (handController.GetAllGraphicsHands().Length != 0)
        {
            handModel = handController.GetAllGraphicsHands()[0];
            handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>().enabled = visibleHand;
            hand = handModel.GetLeapHand();
            currentGrabbingStrength = lowPassFilter(hand.GrabStrength, previousGrabbingStrength);

            Position = lowPassFilter(handModel.GetPalmPosition(), previousPosition);
            Orientation = lowPassFilter(handModel.GetPalmDirection(), previousOrientation);
        }

        //mask/display the graphical hand on key down
        if (Input.GetKeyDown(visibleHandKey))
        {
            var smr = handModel.transform.GetComponentInChildren<SkinnedMeshRenderer>();
            visibleHand = !visibleHand;
        }

        Translation = Position - previousPosition;
        Rotation = previousOrientation - Orientation;
    }
All Usage Examples Of HandModel::GetPalmDirection