docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetFrontJointID

    GetFrontJointID(XRHandFingerID)

    Gets the metacarpal XRHandJointID of a given XRHandFingerID.

    Declaration
    public static XRHandJointID GetFrontJointID(this XRHandFingerID fingerId)
    Parameters
    Type Name Description
    XRHandFingerID fingerId

    ID of the finger of which you want the first XRHandJointID.

    Returns
    Type Description
    XRHandJointID

    First XRHandJointID for the given finger in an XRHand object's list of joints.

    Examples

    You can use GetFrontJointID and GetBackJointID(XRHandFingerID) to iterate through the joints of a specific finger:

    for(var i = XRHandFingerID.Thumb.GetFrontJointID().ToIndex(); // metacarpal
            i <= XRHandFingerID.Thumb.GetBackJointID().ToIndex();  // tip
            i++)
    {
        // hand is an XRHand object
        XRHandJoint fingerJoint = hand.GetJoint(XRHandJointIDUtility.FromIndex(i));
        // Use data...
    }
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)