Class VisionOSHandExtensions
Defines extension methods for platform-specific hand data.
Inherited Members
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
|
| VisionOSHandJointID | jointID | ID of the required joint. |
Returns
| Type | Description |
|---|---|
| XRHandJoint | The |
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
|
| 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. |