Struct MetaAimHandState
MetaAimHandState represents a snapshot of a hand's worth of
data in a single frame that can be successfully retrieved if the
MetaHandTrackingAim feature
is enabled, or was enabled during capture when producing an
XRHandCaptureSequence asset and retrieving that data from
there.
Implements
Inherited Members
Namespace: UnityEngine.XR.Hands
Assembly: Unity.XR.Hands.dll
Syntax
[Serializable]
public struct MetaAimHandState : IEquatable<MetaAimHandState>
Constructors
MetaAimHandState(in XRHandAimState)
Create the Meta representation of aim data from the given MetaAimHandState.
Declaration
public MetaAimHandState(in XRHandAimState aimState)
Parameters
| Type | Name | Description |
|---|---|---|
| XRHandAimState | aimState | Platform-agnostic representation of aim data to copy from. |
Properties
aimFlags
Mirrors the XrFlags in the XrHandTrackingAimStateFB struct from OpenXR.
Declaration
public readonly MetaAimFlags aimFlags { get; }
Property Value
| Type | Description |
|---|---|
| MetaAimFlags |
handedness
Denotes which hand this MetaAimHandState 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 readonly 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 readonly 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 readonly 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 readonly float pinchStrengthRing { get; }
Property Value
| Type | Description |
|---|---|
| float |
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(MetaAimHandState)
Tests for equality.
Declaration
public bool Equals(MetaAimHandState other)
Parameters
| Type | Name | Description |
|---|---|---|
| MetaAimHandState | other | The MetaAimHandState to compare against. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if every field in |
GetHashCode()
Computes a hash code from all fields of this MetaAimHandState.
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 ==(MetaAimHandState, MetaAimHandState)
Tests for equality. Same as Equals(MetaAimHandState).
Declaration
public static bool operator ==(MetaAimHandState lhs, MetaAimHandState rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| MetaAimHandState | lhs | The left-hand side of the comparison. |
| MetaAimHandState | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |
operator !=(MetaAimHandState, MetaAimHandState)
Tests for inequality. Same as !Equals(MetaAimHandState).
Declaration
public static bool operator !=(MetaAimHandState lhs, MetaAimHandState rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| MetaAimHandState | lhs | The left-hand side of the comparison. |
| MetaAimHandState | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |