docs.unity.cn

XR Hands 1.4.0-pre.1

Search Results for

    Show / Hide Table of Contents

    Class XRHandSubsystem

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

    Inheritance
    object
    SubsystemWithProvider
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>
    XRHandSubsystem
    Implements
    ISubsystem
    Inherited Members
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.OnCreate()
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.OnStart()
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.OnStop()
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.OnDestroy()
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.subsystemDescriptor
    SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>.provider
    SubsystemWithProvider.Start()
    SubsystemWithProvider.OnStart()
    SubsystemWithProvider.Stop()
    SubsystemWithProvider.OnStop()
    SubsystemWithProvider.Destroy()
    SubsystemWithProvider.running
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Hands
    Assembly: solution.dll
    Syntax
    public class XRHandSubsystem : SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>, ISubsystem
    Remarks

    The XRHandSubsystem class is the main entry point for accessing hand tracking data provided by an XR device. A provider implementation that reads tracking data from the user's device and provides updates to this subsystem must also be available. The XR Hands package includes a provider implementation for OpenXR.

    Get an instance for this XRHandSubsystem from the active XR loader, as described in Get the XRHandSubsystem instance.

    For lowest latency, read the tracking data available from the leftHand and rightHand properties in a delegate function assigned to the updatedHands callback. This callback is invoked twice per frame, once near the MonoBehaviour.Update event and once near the UnityEngine.Application.onBeforeRender event. The BeforeRender update provides the lowest latency between hand motion and rendering, but occurs too late to affect physics. In addition, trying to perform too much work during the BeforeRender callback can negatively impact framerate. For best results, update game logic affected by hand tracking in a Dynamic update and perform a final update of hand visuals in a BeforeRender update.

    Refer to Hand tracking data for more information.

    Constructors

    Name Description
    XRHandSubsystem()

    Constructs a subsystem. Do not invoke directly.

    Fields

    Name Description
    handsUpdated

    Obsolete. Use updatedHands instead.

    preprocessJoints

    This is called after the subsystem retrieves joint data from the provider, and before and IXRHandProcessors' ProcessJoints(XRHandSubsystem, UpdateSuccessFlags, UpdateType) are called.

    trackingAcquired

    A callback invoked when the subsystem begins tracking a hand's root pose and joints.

    trackingLost

    A callback invoked when the subsystem stops tracking a hand's root pose and joints.

    updatedHands

    A callback invoked for each hand update.

    Properties

    Name Description
    jointsInLayout

    Indicates which joints in the XRHandJointID list are supported by the current hand data provider.

    leftHand

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

    rightHand

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

    updateSuccessFlags

    Describes what data on either hand was updated during the most recent hand update.

    Methods

    Name Description
    OnCreate()

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

    OnDestroy()

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

    RegisterProcessor<TProcessor>(TProcessor)

    Registers a processor for hand joint data.

    TryUpdateHands(UpdateType)

    Request an update from the hand data provider. Application developers consuming hand tracking data should not call this function.

    UnregisterProcessor<TProcessor>(TProcessor)

    Unregisters a processor for hand joint data.

    Extension Methods

    XRHandProcessingUtility.SetCorrespondingHand(XRHandSubsystem, XRHand)
    In This Article
    • Constructors
    • Fields
    • Properties
    • Methods
    • Extension Methods
    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)