Struct XRHand
Represents a hand from an XRHandSubsystem. Do not create this yourself - get hand objects from the leftHand and rightHand properties of the XRHandSubsystem.
Inherited Members
Namespace: UnityEngine.XR.Hands
Syntax
public struct XRHand : IEquatable<XRHand>
Remarks
See Hand tracking for a description of the hand data model and how to access the tracking data.
Properties
handedness
Represents which hand this is.
Declaration
public readonly Handedness handedness { get; }
Property Value
Type | Description |
---|---|
Handedness | Right, left, or invalid. |
isTracked
Whether the subsystem is currently tracking this hand's root pose and joints.
Declaration
public bool isTracked { readonly get; }
Property Value
Type | Description |
---|---|
Boolean | Indicates the tracking status as of the last hand data update. |
rootPose
Root pose for the hand.
Declaration
public readonly Pose rootPose { get; }
Property Value
Type | Description |
---|---|
Pose | Located at the wrist joint, the forward vector of the hand points in the direction of the fingers. |
Methods
Equals(Object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | An Object to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns true if |
Overrides
Equals(XRHand)
Tests for equality.
Declaration
public bool Equals(XRHand other)
Parameters
Type | Name | Description |
---|---|---|
XRHand | other | The XRHand to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the underlying native pointers are the same. Returns false otherwise. |
Implements
GetHashCode()
Computes a hash code from all fields of XRHand.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Returns a hash code of this object. |
Overrides
GetJoint(XRHandJointID)
Retrieves an XRHandJoint by its ID.
Declaration
public XRHandJoint GetJoint(XRHandJointID id)
Parameters
Type | Name | Description |
---|---|---|
XRHandJointID | id | ID of the required joint. |
Returns
Type | Description |
---|---|
XRHandJoint | The XRHandJoint corresponding the ID passed in. |
Remarks
The joint data is stored in an internal native array that isn't copied if you
make a shallow copy of an XRHand
object. This native array is modified each time
A hand update occurs. Calling this function from a
copied XRHand
retrieves the latest hand data, not the data from when the
hand object was copied. To take a snapshot of the joint data for use later, you must
copy each individual XRHandJoint object.
ToString()
Returns a string representation of the XRHand.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | String representation of the value. |
Overrides
Operators
Equality(XRHand, XRHand)
Tests for equality. Same as Equals(XRHand).
Declaration
public static bool operator ==(XRHand lhs, XRHand rhs)
Parameters
Type | Name | Description |
---|---|---|
XRHand | lhs | The left-hand side of the comparison. |
XRHand | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean | Returns the same value as Equals(XRHand). |
Inequality(XRHand, XRHand)
Tests for inequality. Same as !Equals(XRHand)
Declaration
public static bool operator !=(XRHand lhs, XRHand rhs)
Parameters
Type | Name | Description |
---|---|---|
XRHand | lhs | The left-hand side of the comparison. |
XRHand | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
Boolean | Returns the negation of Equals(XRHand). |