Struct XRHandCaptureFrame
A single frame of captured hand data.
Implements
Inherited Members
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 |
Returns
| Type | Description |
|---|---|
| bool | Returns true if |
Overrides
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 |
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
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, |
IsHandTracked(Handedness)
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 |
Returns
| Type | Description |
|---|---|
| bool | Returns what the corresponding XRHand |
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)
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 |
| XRHandSubsystem.UpdateType | updateType | The update type passed to XRHandSubsystem |
Returns
| Type | Description |
|---|---|
| bool | Returns what the corresponding XRHand |
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 |
| XRHandAimState | aimState | If |
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 |
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 |
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 |
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 |