Class XRHandProcessingUtility
Utility methods for processing joints from a XRHandSubsystem.
Inherited Members
Namespace: UnityEngine.XR.Hands.Processing
Assembly: Unity.XR.Hands.dll
Syntax
public static class XRHandProcessingUtility
Methods
GetRawJointArray(XRHand)
Gets the NativeArray of XRHandJoints contained in the invoking hand.
Declaration
public static NativeArray<XRHandJoint> GetRawJointArray(this XRHand hand)
Parameters
Type | Name | Description |
---|---|---|
XRHand | hand | The invoking hand for this extension method. To call this method,
call |
Returns
Type | Description |
---|---|
NativeArray<XRHandJoint> | The raw joint array contained in the supplied hand. |
Remarks
After manipulating data for a particular joint, be sure to assign it back to the array you got it from, as you can only manipulate copies of objects from a NativeArray.
SetAngularVelocity(ref XRHandJoint, Vector3)
Sets the velocity that can be retrieved from TryGetAngularVelocity(out Vector3) and sets the flag for that data to be valid.
Declaration
public static void SetAngularVelocity(this ref XRHandJoint joint, Vector3 angularVelocity)
Parameters
Type | Name | Description |
---|---|---|
XRHandJoint | joint | The invoking joint for this extension method. To call this method,
call |
Vector3 | angularVelocity | The angular velocity to set for the |
Remarks
After manipulating data for a particular joint, be sure to assign it back to the array you got it from, as you can only manipulate copies of objects from a NativeArray.
SetCorrespondingHand(XRHandSubsystem, XRHand)
Sets the subsystem's hand corresponding to hand passed in, which must have been initially retrieved from the XRHandSubsystem's leftHand or rightHand property.
Declaration
public static void SetCorrespondingHand(this XRHandSubsystem subsystem, XRHand hand)
Parameters
Type | Name | Description |
---|---|---|
XRHandSubsystem | subsystem | The invoking subsystem for this extension method. To call this method,
call |
XRHand | hand | The hand to update to on the subsystem. Must have originally been retrieved from that XRHandSubsystem |
SetLinearVelocity(ref XRHandJoint, Vector3)
Sets the velocity that can be retrieved from TryGetLinearVelocity(out Vector3) and sets the flag for that data to be valid.
Declaration
public static void SetLinearVelocity(this ref XRHandJoint joint, Vector3 linearVelocity)
Parameters
Type | Name | Description |
---|---|---|
XRHandJoint | joint | The invoking joint for this extension method. To call this method,
call |
Vector3 | linearVelocity | The linear velocity to set for the |
Remarks
After manipulating data for a particular joint, be sure to assign it back to the array you got it from, as you can only manipulate copies of objects from a NativeArray.
SetPose(ref XRHandJoint, Pose)
Sets the pose that can be retrieved from TryGetPose(out Pose) and sets the flag for that pose to be valid.
Declaration
public static void SetPose(this ref XRHandJoint joint, Pose pose)
Parameters
Type | Name | Description |
---|---|---|
XRHandJoint | joint | The invoking joint for this extension method. To call this method,
call |
Pose | pose | The Pose to set for the |
Remarks
After manipulating data for a particular joint, be sure to assign it back to the array you got it from, as you can only manipulate copies of objects from a NativeArray.
SetRootPose(ref XRHand, Pose)
Declaration
public static void SetRootPose(this ref XRHand hand, Pose rootPose)
Parameters
Type | Name | Description |
---|---|---|
XRHand | hand | The invoking hand for this extension method. To call this method,
call |
Pose | rootPose | The root Pose to set for the |
Remarks
Be sure to follow this with a call to yourHandSubsystem.SetCorrespondingHand(modifiedHand)
,
or you will only update the root pose of a copy of a hand.