Struct XRHandAimState
XRHandAimState is a cross-platform struct representation of the MetaAimHand class to store all
the state information related to hand aim on a per-frame basis.
Implements
Inherited Members
Namespace: UnityEngine.XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
[Serializable]
public struct XRHandAimState : IEquatable<XRHandAimState>
Properties
handedness
Denotes which hand this XRHandAimState is associated with.
Declaration
public readonly Handedness handedness { get; }
Property Value
| Type | Description |
|---|---|
| Handedness | If this was retrieved from a valid source, such as a successful call to
XRHandCaptureFrame |
indexPressed
Whether the index finger and thumb are currently pressed together.
Declaration
public readonly bool indexPressed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
isTracked
Whether the hand is currently tracked.
Declaration
public readonly bool isTracked { get; }
Property Value
| Type | Description |
|---|---|
| bool |
littlePressed
Whether the little finger and thumb are currently pressed together.
Declaration
public readonly bool littlePressed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
middlePressed
Whether the middle finger and thumb are currently pressed together.
Declaration
public readonly bool middlePressed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
pinchStrengthIndex
The strength of the pinch between the index finger and thumb. Ranges from 0.0 to 1.0.
Declaration
public float pinchStrengthIndex { get; }
Property Value
| Type | Description |
|---|---|
| float |
pinchStrengthLittle
The strength of the pinch between the little finger and thumb. Ranges from 0.0 to 1.0.
Declaration
public float pinchStrengthLittle { get; }
Property Value
| Type | Description |
|---|---|
| float |
pinchStrengthMiddle
The strength of the pinch between the middle finger and thumb. Ranges from 0.0 to 1.0.
Declaration
public float pinchStrengthMiddle { get; }
Property Value
| Type | Description |
|---|---|
| float |
pinchStrengthRing
The strength of the pinch between the ring finger and thumb. Ranges from 0.0 to 1.0.
Declaration
public float pinchStrengthRing { get; }
Property Value
| Type | Description |
|---|---|
| float |
reserved0
Reserved.
Declaration
public readonly int reserved0 { get; }
Property Value
| Type | Description |
|---|---|
| int |
reserved1
Reserved.
Declaration
public readonly int reserved1 { get; }
Property Value
| Type | Description |
|---|---|
| int |
ringPressed
Whether the ring finger and thumb are currently pressed together.
Declaration
public readonly bool ringPressed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
trackingState
Determines which properties of the hand are being tracked as per InputTrackingState.
Declaration
public readonly InputTrackingState trackingState { get; }
Property Value
| Type | Description |
|---|---|
| InputTrackingState |
Methods
Equals(object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |
Overrides
Equals(in XRHandAimState)
Tests for equality.
Declaration
public bool Equals(in XRHandAimState other)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandAimState | other | The XRHandAimState to compare against. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if every field in |
GetHashCode()
Computes a hash code from all fields of this XRHandAimState.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | Returns a hash code of this object. |
Overrides
TryGetAimPose(out Pose)
Attempts to retrieve the aim Pose.
Declaration
public bool TryGetAimPose(out Pose aimPose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | aimPose | If |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the pose was successfully retrieved. Otherwise, this returns false, and you should not use the resulting pose. |
Operators
operator ==(in XRHandAimState, in XRHandAimState)
Tests for equality. Same as Equals(in XRHandAimState).
Declaration
public static bool operator ==(in XRHandAimState lhs, in XRHandAimState rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandAimState | lhs | The left-hand side of the comparison. |
| XRHandAimState | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |
operator !=(in XRHandAimState, in XRHandAimState)
Tests for inequality. Same as !Equals(in XRHandAimState).
Declaration
public static bool operator !=(in XRHandAimState lhs, in XRHandAimState rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandAimState | lhs | The left-hand side of the comparison. |
| XRHandAimState | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |