docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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
    IEquatable<MetaAimHandState>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    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.XRHandCaptureFrame.TryGetAimState, this can only ever be Left or Right.

    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 object to compare against.

    Returns
    Type Description
    bool

    Returns true if obj is of type MetaAimHandState and Equals(MetaAimHandState) also returns true; otherwise returns false.

    Overrides
    ValueType.Equals(object)

    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 other is equal to this XRHandAimState. Returns false otherwise.

    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
    ValueType.GetHashCode()

    TryGetAimPose(out Pose)

    Attempts to retrieve the aim Pose.

    Declaration
    public bool TryGetAimPose(out Pose aimPose)
    Parameters
    Type Name Description
    Pose aimPose

    If TryGetAimPose returns true, this will be filled out with a valid aim Pose.

    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 lhs is equal to rhs, otherwise returns false.

    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 lhs is not equal to rhs, otherwise returns false.

    Implements

    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)