docs.unity3d.com
    Show / Hide Table of Contents

    Class XRHandSubsystem

    A subystem for detecting and tracking hands and their corresponding joint pose data.

    Inheritance
    Object
    SubsystemWithProvider
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>
    XRHandSubsystem
    Inherited Members
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnCreate()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnStart()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnStop()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnDestroy()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.subsystemDescriptor
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.provider
    SubsystemWithProvider.Start()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider.OnStart()
    SubsystemWithProvider.Stop()
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider.OnStop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.running
    Namespace: UnityEngine.XR.Hands
    Syntax
    public class XRHandSubsystem : SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>, ISubsystem

    Constructors

    XRHandSubsystem()

    Constructs a subsystem. Do not invoke directly; call Create on the XRHandSubsystemDescriptor instead.

    Declaration
    public XRHandSubsystem()

    Fields

    handsUpdated

    A callback for when hands a call to TryUpdateHands(XRHandSubsystem.UpdateType) completes. Use this if you don't own the subsystem, but want to be made aware of changes, such as if you are driving visuals.

    Declaration
    public Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> handsUpdated
    Field Value
    Type Description
    Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType>

    Properties

    jointsInLayout

    Gets a layout array that is marked true for each joint that will ever by tracked by the provider attached to this subsystem. To retrieve the matching index, call .ToIndex() on the XRHandJointID in question.

    Declaration
    public NativeArray<bool> jointsInLayout { get; }
    Property Value
    Type Description
    NativeArray<Boolean>
    Remarks

    This array will already be valid as soon as you have a reference to a subsystem (in other words, it's filled out before the subsystem is returned by a call to XRHandSubsystemDescriptor.Create).

    leftHand

    Gets the left XRHand that is being tracked by this subsystem.

    Declaration
    public XRHand leftHand { get; }
    Property Value
    Type Description
    XRHand

    rightHand

    Gets the right XRHand that is being tracked by this subsystem.

    Declaration
    public XRHand rightHand { get; }
    Property Value
    Type Description
    XRHand

    Methods

    OnCreate()

    Called by Unity before the subsystem is returned from a call to XRHandSubsystemDescriptor.Create.

    Declaration
    protected override void OnCreate()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnCreate()

    OnDestroy()

    Called by Unity before the subsystem is fully destroyed during a call to XRHandSubsystem.Destroy.

    Declaration
    protected override void OnDestroy()
    Overrides
    UnityEngine.SubsystemsImplementation.SubsystemWithProvider<UnityEngine.XR.Hands.XRHandSubsystem, UnityEngine.XR.Hands.XRHandSubsystemDescriptor, UnityEngine.XR.Hands.ProviderImplementation.XRHandSubsystemProvider>.OnDestroy()

    TryUpdateHands(XRHandSubsystem.UpdateType)

    Call this to have the subsystem retrieve changes from the provider. Changes will be reflected in leftHand and rightHand.

    Declaration
    public virtual XRHandSubsystem.UpdateSuccessFlags TryUpdateHands(XRHandSubsystem.UpdateType updateType)
    Parameters
    Type Name Description
    XRHandSubsystem.UpdateType updateType

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

    Returns
    Type Description
    XRHandSubsystem.UpdateSuccessFlags

    Returns XRHandSubsystem.UpdateSuccessFlags to describe what data was updated successfully.

    Remarks

    If overriding this method in a derived type, it is expected that you call base.TryUpdateHands(updateType) and return what it returns.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023