docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OpenXRHandProvider

    Hand tracking provider for the OpenXR platform.

    Inheritance
    object
    SubsystemProvider
    SubsystemProvider<XRHandSubsystem>
    XRHandSubsystemProvider
    OpenXRHandProvider
    Inherited Members
    XRHandSubsystemProvider.GetFingerShapeConfiguration(XRHandFingerID)
    SubsystemProvider<XRHandSubsystem>.TryInitialize()
    SubsystemProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Hands.OpenXR
    Assembly: Unity.XR.Hands.dll
    Syntax
    public class OpenXRHandProvider : XRHandSubsystemProvider

    Properties

    canSurfaceCommonPoseData

    Whether the provider is currently able to surface data from any of TryGetAimPose(Handedness, out Pose), TryGetAimActivateValue(Handedness, out float), TryGetGraspValue(Handedness, out float), TryGetGripPose(Handedness, out Pose), TryGetPinchPose(Handedness, out Pose), TryGetPinchValue(Handedness, out float), or TryGetPinchPose(Handedness, out Pose).

    Declaration
    public override bool canSurfaceCommonPoseData { get; }
    Property Value
    Type Description
    bool
    Overrides
    XRHandSubsystemProvider.canSurfaceCommonPoseData

    detectedHandMeshLayout

    Describes which version of authored hand meshes is detected for use.

    Declaration
    public override XRDetectedHandMeshLayout detectedHandMeshLayout { get; }
    Property Value
    Type Description
    XRDetectedHandMeshLayout
    Overrides
    XRHandSubsystemProvider.detectedHandMeshLayout

    handMeshDataSupplier

    The OpenXRHandProvider calls into this when TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) is called.

    Declaration
    public IOpenXRHandMeshDataSupplier handMeshDataSupplier { get; set; }
    Property Value
    Type Description
    IOpenXRHandMeshDataSupplier

    This is only useful for developers exposing hand mesh data for their platform. If you are a user making a game or app, you do not need to worry about this.

    Methods

    Destroy()

    See UnityEngine.SubsystemsImplementation.SubsystemProvider<TSubsystem>.Destroy().

    Declaration
    public override void Destroy()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.Hands.XRHandSubsystem>.Destroy()

    GetHandLayout(NativeArray<bool>)

    Gets the layout of hand joints for this provider, by having the provider mark each index corresponding to a XRHandJointID get marked as true if the provider attempts to track that joint.

    Declaration
    public override void GetHandLayout(NativeArray<bool> handJointsInLayout)
    Parameters
    Type Name Description
    NativeArray<bool> handJointsInLayout

    Each index corresponds to a XRHandJointID. For each joint that the provider will attempt to track, mark that spot as true by calling .ToIndex() on that ID.

    Overrides
    XRHandSubsystemProvider.GetHandLayout(NativeArray<bool>)
    Remarks

    Called once on creation so that before the subsystem is even started, the user can immediately create a valid hierarchical structure as soon as they get a reference to the subsystem without even needing to start it. This is called before any call to GetFingerShapeConfiguration(XRHandFingerID).

    Start()

    See UnityEngine.SubsystemsImplementation.SubsystemProvider<TSubsystem>.Start().

    Declaration
    public override void Start()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.Hands.XRHandSubsystem>.Start()

    Stop()

    See UnityEngine.SubsystemsImplementation.SubsystemProvider<TSubsystem>.Stop().

    Declaration
    public override void Stop()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemProvider<UnityEngine.XR.Hands.XRHandSubsystem>.Stop()

    TryGetAimActivateValue(Handedness, out float)

    Gets the aim activate value. Will only be called if supportsAimActivateValue is enabled.

    Declaration
    public override bool TryGetAimActivateValue(Handedness handedness, out float aimActivateValue)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    float aimActivateValue

    The aim activate value, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the aim activate value was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetAimActivateValue(Handedness, out float)

    TryGetAimPose(Handedness, out Pose)

    Gets the aim pose. Will only be called if supportsAimPose is enabled.

    Declaration
    public override bool TryGetAimPose(Handedness handedness, out Pose aimPose)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    Pose aimPose

    The pose to update the aim pose to, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the aim pose was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetAimPose(Handedness, out Pose)

    TryGetGraspValue(Handedness, out float)

    Gets the grasp value. Will only be called if supportsGraspValue is enabled.

    Declaration
    public override bool TryGetGraspValue(Handedness handedness, out float graspValue)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    float graspValue

    The grasp value, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the grasp value was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetGraspValue(Handedness, out float)

    TryGetGripPose(Handedness, out Pose)

    Gets the grip pose. Will only be called if supportsGripPose is enabled.

    Declaration
    public override bool TryGetGripPose(Handedness handedness, out Pose gripPose)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    Pose gripPose

    The pose to update the aim pose to, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the grip pose was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetGripPose(Handedness, out Pose)

    TryGetMeshData(ref XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams)

    Attempt to retrieve hand mesh data from the platform. Only called when TryGetMeshData(out XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams) is called.

    Declaration
    public override bool TryGetMeshData(ref XRHandMeshDataQueryResult result, ref XRHandMeshDataQueryParams queryParams)
    Parameters
    Type Name Description
    XRHandMeshDataQueryResult result

    Output data for hand meshes.

    XRHandMeshDataQueryParams queryParams

    Input data for hand meshes.

    Returns
    Type Description
    bool

    Returns true if successful and either hand has valid data. Otherwise, returns false.

    Overrides
    XRHandSubsystemProvider.TryGetMeshData(ref XRHandMeshDataQueryResult, ref XRHandMeshDataQueryParams)

    TryGetPinchPose(Handedness, out Pose)

    Gets the pinch pose. Will only be called if supportsPinchPose is enabled.

    Declaration
    public override bool TryGetPinchPose(Handedness handedness, out Pose pinchPose)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    Pose pinchPose

    The pose to update the pinch pose to, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the pinch pose was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetPinchPose(Handedness, out Pose)

    TryGetPinchValue(Handedness, out float)

    Gets the pinch value. Will only be called if supportsPinchValue is enabled.

    Declaration
    public override bool TryGetPinchValue(Handedness handedness, out float pinchValue)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    float pinchValue

    The pinch value, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the grasp value was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetPinchValue(Handedness, out float)

    TryGetPokePose(Handedness, out Pose)

    Gets the poke pose. Will only be called if supportsPokePose is enabled.

    Declaration
    public override bool TryGetPokePose(Handedness handedness, out Pose pokePose)
    Parameters
    Type Name Description
    Handedness handedness

    Which hand to retrieve data for.

    Pose pokePose

    The pose to update the poke pose to, if available. Will not be used if false is returned.

    Returns
    Type Description
    bool

    Returns true if successful and the poke pose was filled out, returns false otherwise.

    Overrides
    XRHandSubsystemProvider.TryGetPokePose(Handedness, out Pose)

    TryUpdateHands(UpdateType, ref Pose, NativeArray<XRHandJoint>, ref Pose, NativeArray<XRHandJoint>)

    Attempts to retrieve current hand-tracking data from the provider.

    Declaration
    public override XRHandSubsystem.UpdateSuccessFlags TryUpdateHands(XRHandSubsystem.UpdateType updateType, ref Pose leftHandRootPose, NativeArray<XRHandJoint> leftHandJoints, ref Pose rightHandRootPose, NativeArray<XRHandJoint> rightHandJoints)
    Parameters
    Type Name Description
    XRHandSubsystem.UpdateType updateType

    Informs the provider which kind of timing the update is being requested under.

    Pose leftHandRootPose

    Update this and include XRHandSubsystem.UpdateSuccessFlags.LeftHandRootPose in the return value to update the left hand's root pose.

    NativeArray<XRHandJoint> leftHandJoints

    Array of hand joints to fill out for the left hand. These are initialized with a copy of the current joint data for the left hand, so if the last known tracking data for a particular joint is still fine, you don't need to fill out that data again. If you update these, include XRHandSubsystem.UpdateSuccessFlags.LeftHandJoints in the return value to have the changes reflected in the subsystem.

    Pose rightHandRootPose

    Update this and include XRHandSubsystem.UpdateSuccessFlags.RightHandRootPose in the return value to update the right hand's root pose.

    NativeArray<XRHandJoint> rightHandJoints

    Array of hand joints to fill out for the right hand. These are initialized with a copy of the current joint data for the right hand, so if the last known tracking data for a particular joint is still fine, you don't need to fill out that data again. If you update these, include XRHandSubsystem.UpdateSuccessFlags.RightHandJoints in the return value to have the changes reflected in the subsystem.

    Returns
    Type Description
    XRHandSubsystem.UpdateSuccessFlags

    Returns XRHandSubsystem.UpdateSuccessFlags to describe which tracking data was successfully updated.

    Overrides
    XRHandSubsystemProvider.TryUpdateHands(XRHandSubsystem.UpdateType, ref Pose, NativeArray<XRHandJoint>, ref Pose, NativeArray<XRHandJoint>)
    In This Article
    Back to top
    Copyright © 2025 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)