Class XRHandSubsystem
| XR Hands | 1.4.3 (original) (raw)
A subsystem for detecting and tracking hands and their corresponding joint pose data.
Inheritance
XRHandSubsystem
Implements
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.OnStart()
SubsystemWithProvider.OnStop()
Namespace: UnityEngine.XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
public class XRHandSubsystem : SubsystemWithProvider<XRHandSubsystem, XRHandSubsystemDescriptor, XRHandSubsystemProvider>, ISubsystem
Remarks
Constructors
XRHandSubsystem()
Constructs a subsystem. Do not invoke directly.
Declaration
Remarks
Fields
handsUpdated
Declaration
[Obsolete("Use updatedHands instead.")]
public Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> handsUpdated
Field Value
Type | Description |
---|---|
Action<XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> |
preprocessJoints
Declaration
public Action<XRHandSubsystem, XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> preprocessJoints
Field Value
Type | Description |
---|---|
Action<XRHandSubsystem, XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> |
trackingAcquired
A callback invoked when the subsystem begins tracking a hand's root pose and joints.
Declaration
public Action<XRHand> trackingAcquired
Field Value
Type | Description |
---|---|
Action<XRHand> |
Remarks
trackingLost
A callback invoked when the subsystem stops tracking a hand's root pose and joints.
Declaration
public Action<XRHand> trackingLost
Field Value
Type | Description |
---|---|
Action<XRHand> |
Remarks
updatedHands
A callback invoked for each hand update.
Declaration
public Action<XRHandSubsystem, XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> updatedHands
Field Value
Type | Description |
---|---|
Action<XRHandSubsystem, XRHandSubsystem.UpdateSuccessFlags, XRHandSubsystem.UpdateType> |
Remarks
Properties
jointsInLayout
Indicates which joints in the XRHandJointID list are supported by the current hand data provider.
Declaration
public NativeArray<bool> jointsInLayout { get; }
Property Value
Type | Description |
---|---|
NativeArray<bool> |
Remarks
leftHand
Gets the left XRHand that is being tracked by this subsystem.
Declaration
public XRHand leftHand { get; }
Property Value
Type | Description |
---|---|
XRHand |
Remarks
rightHand
Gets the right XRHand that is being tracked by this subsystem.
Declaration
public XRHand rightHand { get; }
Property Value
Type | Description |
---|---|
XRHand |
Remarks
updateSuccessFlags
Describes what data on either hand was updated during the most recent hand update.
Declaration
public XRHandSubsystem.UpdateSuccessFlags updateSuccessFlags { get; protected set; }
Property Value
Type | Description |
---|---|
XRHandSubsystem.UpdateSuccessFlags | The flags for the most recent update. Applies to the leftHandand rightHand properties. |
Remarks
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()
RegisterProcessor(TProcessor)
Registers a processor for hand joint data.
Declaration
public void RegisterProcessor<TProcessor>(TProcessor processor) where TProcessor : class, IXRHandProcessor
Parameters
Type | Name | Description |
---|---|---|
TProcessor | processor | The processor to register for this XRHandSubsystem. |
Type Parameters
Name | Description |
---|---|
TProcessor | The type of the processor to register. |
TryUpdateHands(UpdateType)
Request an update from the hand data provider. Application developers consuming hand tracking data should not call this function.
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
UnregisterProcessor(TProcessor)
Unregisters a processor for hand joint data.
Declaration
public void UnregisterProcessor<TProcessor>(TProcessor processor) where TProcessor : class, IXRHandProcessor
Parameters
Type | Name | Description |
---|---|---|
TProcessor | processor | The processor to unregister from this XRHandSubsystem. |
Type Parameters
Name | Description |
---|---|
TProcessor | The type of the processor to register. |