docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRHandCaptureFrame

    A single frame of captured hand data.

    Implements
    IEquatable<XRHandCaptureFrame>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Hands.Capture
    Assembly: Unity.XR.Hands.dll
    Syntax
    [Serializable]
    public struct XRHandCaptureFrame : IEquatable<XRHandCaptureFrame>

    Properties

    containingAsset

    The captured tracking data that this frame is a part of and comes from.

    Declaration
    public XRHandCaptureSequence containingAsset { get; }
    Property Value
    Type Description
    XRHandCaptureSequence

    frameIndexInContainingAsset

    The index into the containingAsset's XRHandCaptureSequence.frames that this XRHandCaptureFrame is a part of and comes from.

    Declaration
    public int frameIndexInContainingAsset { get; }
    Property Value
    Type Description
    int

    timestamp

    The timestamp of this captured frame in seconds since the start of the recording.

    Declaration
    public float timestamp { get; }
    Property Value
    Type Description
    float

    The time at which this frame was captured.

    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 XRHandCaptureFrame and Equals(XRHandCaptureFrame) also returns true; otherwise returns false.

    Overrides
    ValueType.Equals(object)

    Equals(XRHandCaptureFrame)

    Tests for equality.

    Declaration
    public bool Equals(XRHandCaptureFrame other)
    Parameters
    Type Name Description
    XRHandCaptureFrame other

    The XRHandCaptureFrame to compare against.

    Returns
    Type Description
    bool

    Returns true if every field in other is equal to this XRHandCaptureFrame. Returns false otherwise.

    GetHashCode()

    Computes a hash code from all fields of XRHandCaptureFrame.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Returns a hash code of this object.

    Overrides
    ValueType.GetHashCode()

    GetUpdateSuccessFlags(UpdateType)

    Reports the XRHandSubsystem.UpdateSuccessFlags that XRHandSubsystem reported during capture this frame for the given XRHandSubsystem.UpdateType.

    Declaration
    public XRHandSubsystem.UpdateSuccessFlags GetUpdateSuccessFlags(XRHandSubsystem.UpdateType updateType = UpdateType.Dynamic)
    Parameters
    Type Name Description
    XRHandSubsystem.UpdateType updateType

    The XRHandSubsystem.UpdateType you wish to obtain captured tracking data for.

    Returns
    Type Description
    XRHandSubsystem.UpdateSuccessFlags

    The XRHandSubsystem.UpdateSuccessFlags that XRHandSubsystem reported. If AlsoCaptureBeforeRender option was disabled when the tracking data was captured, GetUpdateSuccessFlags will always return XRHandSubsystem.UpdateSuccessFlags.None.

    IsHandTracked(Handedness)

    Checks whether the corresponding XRHand.isTracked reported as true when the data was captured.

    Declaration
    public bool IsHandTracked(Handedness handedness)
    Parameters
    Type Name Description
    Handedness handedness

    Denotes which hand you wish to get tracking data for. Must be either Left or Right if IsHandTracked to have a chance to succeed.

    Returns
    Type Description
    bool

    Returns what the corresponding XRHand.isTracked reported when the tracking data was captured.

    Remarks

    Will be the same as what isTracked reports Handedness and XRHandSubsystem.UpdateType passed to IsHandTracked on the same XRHandCaptureFrame if you pass you same Handedness to TryGetHandSnapshot(Handedness, out XRHandCaptureSnapshot) and the same XRHandSubsystem.UpdateType to the resulting XRHandCaptureSnapshot.TryGetHand(Allocator, out XRHand), assuming both of the latter calls were to succeed (if either were to fail, IsHandTracked would return false).

    IsHandTracked(Handedness, UpdateType)

    Checks whether the corresponding XRHand.isTracked reported as true when the data was captured.

    Declaration
    public bool IsHandTracked(Handedness handedness, XRHandSubsystem.UpdateType updateType)
    Parameters
    Type Name Description
    Handedness handedness

    Denotes which hand you wish to get tracking data for. Must be either Left or Right if IsHandTracked to have a chance to succeed.

    XRHandSubsystem.UpdateType updateType

    The update type passed to XRHandSubsystem.TryUpdateHands(UpdateType) you wish to query for captured per-XRHandSubsystem.UpdateType tracking data. If a value of BeforeRender is supplied but sourceCaptureSequence's optionsRecordedWith does not have XRHandRecordingOptions.AlsoCaptureBeforeRender enabled, IsHandTracked will always fail.

    Returns
    Type Description
    bool

    Returns what the corresponding XRHand.isTracked reported when the tracking data was captured.

    Remarks

    Will be the same as what isTracked reports Handedness and XRHandSubsystem.UpdateType passed to IsHandTracked on the same XRHandCaptureFrame if you pass you same Handedness to TryGetHandSnapshot(Handedness, out XRHandCaptureSnapshot) and the same XRHandSubsystem.UpdateType to the resulting XRHandCaptureSnapshot.TryGetHand(Allocator, out XRHand), assuming both of the latter calls were to succeed (if either were to fail, IsHandTracked would return false).

    TryGetAimState(Handedness, out XRHandAimState)

    Attempts to retrieve the XRHandAimState data available this frame during capture for the given Handedness.

    Declaration
    public bool TryGetAimState(Handedness handedness, out XRHandAimState aimState)
    Parameters
    Type Name Description
    Handedness handedness

    Denotes which hand you wish to get tracking data for. Must be either Left or Right if TryGetAimState to have a chance to succeed.

    XRHandAimState aimState

    If TryGetAimState returns true, this will be filled out with the data required to ask for corresponding XRHandAimState data available this frame during capture for the given Handedness.

    Returns
    Type Description
    bool

    Returns true if the XRHandAimState was successfully retrieved and can be successfully queried for captured tracking data.

    TryGetHeadPose(out Pose)

    Attempt to get the pose of the center eye pose from the frame of capture. Useful for lining up the scene camera or offseting it from something related to where the HMD was positioned or oriented during capture.

    Declaration
    public InputTrackingState TryGetHeadPose(out Pose headPose)
    Parameters
    Type Name Description
    Pose headPose

    If TryGetHeadPose returns an InputTrackingState with Position set, position will be filled out with a valid center eye position from the time of capture. If TryGetHeadPose returns an InputTrackingState with Rotation set, rotation will be filled out with a valid rotation of the center eye rotation from the time of capture.

    Returns
    Type Description
    InputTrackingState

    If valid, position and rotation may independently be from the Dynamic or BeforeRender step, depending on whether the data was available during the Dynamic step and if the XRHandRecordingOptions.AlsoCaptureBeforeRender option was enabled during capture.

    TryGetJoint(out XRHandJoint, Handedness, XRHandJointID)

    Attempts to retrieve a joint from the captured hand data for the Dynamic update step.

    Declaration
    public bool TryGetJoint(out XRHandJoint joint, Handedness handedness, XRHandJointID id)
    Parameters
    Type Name Description
    XRHandJoint joint

    The retrieved joint if this returns true.

    Handedness handedness

    The handedness of the hand to retrieve the joint from.

    XRHandJointID id

    The ID of the joint to retrieve.

    Returns
    Type Description
    bool

    Returns true if the joint was successfully retrieved.

    Remarks

    Use TryGetHandSnapshot(Handedness, out XRHandCaptureSnapshot) and TryGetHand(Allocator, out XRHand) to access joint data for a specific XRHandSubsystem.UpdateType.

    Operators

    operator ==(XRHandCaptureFrame, XRHandCaptureFrame)

    Tests for equality. Same as Equals(XRHandCaptureFrame).

    Declaration
    public static bool operator ==(XRHandCaptureFrame lhs, XRHandCaptureFrame rhs)
    Parameters
    Type Name Description
    XRHandCaptureFrame lhs

    The left-hand side of the comparison.

    XRHandCaptureFrame rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    bool

    Returns true if lhs is equal to rhs, otherwise returns false.

    operator !=(XRHandCaptureFrame, XRHandCaptureFrame)

    Tests for inequality. Same as !Equals(XRHandCaptureFrame).

    Declaration
    public static bool operator !=(XRHandCaptureFrame lhs, XRHandCaptureFrame rhs)
    Parameters
    Type Name Description
    XRHandCaptureFrame lhs

    The left-hand side of the comparison.

    XRHandCaptureFrame 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)