docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VisionOSHandExtensions

    Defines extension methods for platform-specific hand data.

    Inheritance
    object
    VisionOSHandExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.VisionOS
    Assembly: Unity.XR.VisionOS.dll
    Syntax
    public static class VisionOSHandExtensions

    Methods

    FromIndex(int)

    Call this to get the corresponding VisionOSHandJointID from an index into an array of associated data.

    Declaration
    public static VisionOSHandJointID FromIndex(int index)
    Parameters
    Type Name Description
    int index

    Index to convert to an ID.

    Returns
    Type Description
    VisionOSHandJointID

    The ID matching the index passed in.

    GetVisionOSJoint(XRHand, VisionOSHandJointID)

    Retrieves a visionOS-specific hand joint by its ID.

    Declaration
    public static XRHandJoint GetVisionOSJoint(this XRHand hand, VisionOSHandJointID jointID)
    Parameters
    Type Name Description
    XRHand hand

    The hand this extension method extends. To call this extension method, write it like myHand.GetVisionOSJoint(VisionOSHandJointID.ForearmArm).

    VisionOSHandJointID jointID

    ID of the required joint.

    Returns
    Type Description
    XRHandJoint

    The XRHandJoint corresponding the ID passed in.

    ToIndex(VisionOSHandJointID)

    Call .ToIndex() on a VisionOSHandJointID to get its corresponding index into an array of joint data.

    Declaration
    public static int ToIndex(this VisionOSHandJointID jointId)
    Parameters
    Type Name Description
    VisionOSHandJointID jointId

    ID of the joint to convert to an index.

    Returns
    Type Description
    int

    The index matching the ID passed in.

    TryGetVisionOSRotation(XRHandJoint, out Quaternion)

    Gets the pose of the joint, if available, but without the Unity-defined change to the rotation to make the reported rotation cross-platform.

    Declaration
    public static bool TryGetVisionOSRotation(this XRHandJoint joint, out Quaternion rotation)
    Parameters
    Type Name Description
    XRHandJoint joint

    The joint this extension method extends. To call this extension method, write it like myJoint.TryGetVisionOSRotation(out var rotation).

    Quaternion rotation

    If this method returns true, this will be populated with the Apple-defined rotation for the given joint, but still converted to Unity space.

    Returns
    Type Description
    bool

    true if successful and the rotation was available, false otherwise.

    In This Article
    Back to top
    Copyright © 2024 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)