docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XROcclusionFrame

    Represents a frame captured by the device camera with included metadata.

    Implements
    IEquatable<XROcclusionFrame>
    IDisposable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public struct XROcclusionFrame : IEquatable<XROcclusionFrame>, IDisposable

    Constructors

    XROcclusionFrame(XROcclusionFrameProperties, long, XRNearFarPlanes, NativeArray<Pose>, NativeArray<XRFov>)

    Constructor.

    Declaration
    public XROcclusionFrame(XROcclusionFrameProperties properties, long timestamp, XRNearFarPlanes nearFarPlanes, NativeArray<Pose> poses, NativeArray<XRFov> fovs)
    Parameters
    Type Name Description
    XROcclusionFrameProperties properties

    The properties that are included in the frame.

    long timestamp

    The timestamp of the frame, in nanoseconds.

    XRNearFarPlanes nearFarPlanes

    The near and far planes.

    NativeArray<Pose> poses

    The poses from which the frame was rendered.

    NativeArray<XRFov> fovs

    The fields of view for the frame.

    Properties

    properties

    The properties that are included in the frame.

    Declaration
    public XROcclusionFrameProperties properties { get; }
    Property Value
    Type Description
    XROcclusionFrameProperties

    The included properties.

    Methods

    Dispose()

    Dispose native resources associated with this frame, including the native array of display matrices.

    Declaration
    public void Dispose()

    Equals(object)

    Compares for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    An object to compare against.

    Returns
    Type Description
    bool

    true if obj is an XROcclusionFrame and Equals(XROcclusionFrame) is also true. Otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(XROcclusionFrame)

    Compares for equality.

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

    The other XROcclusionFrame to compare against.

    Returns
    Type Description
    bool

    true if the XROcclusionFrame represents the same object. Otherwise, false.

    GetHashCode()

    Generates a hash code suitable for use in HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash of this XROcclusionFrame.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Generates a string representation of this instance suitable for debugging purposes.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The string.

    Overrides
    ValueType.ToString()

    TryGetFovs(out NativeArray<XRFov>)

    Get an array of fields of view for the frame if possible.

    Declaration
    public bool TryGetFovs(out NativeArray<XRFov> fovs)
    Parameters
    Type Name Description
    NativeArray<XRFov> fovs

    The output array of fields of view, if this method returns true.

    Returns
    Type Description
    bool

    true if the frame has fields of view that were output to fovs. Otherwise, false.

    TryGetNearFarPlanes(out XRNearFarPlanes)

    Get the near and far planes for the frame, if possible.

    Declaration
    public bool TryGetNearFarPlanes(out XRNearFarPlanes nearFarPlanes)
    Parameters
    Type Name Description
    XRNearFarPlanes nearFarPlanes

    The near and far planes, if this method returns true.

    Returns
    Type Description
    bool

    true if the frame has near and far planes that were output to nearFarPlanes. Otherwise, false.

    TryGetPoses(out NativeArray<Pose>)

    Get an array of poses from which the frame was rendered, if possible. Poses are in Unity world space.

    Declaration
    public bool TryGetPoses(out NativeArray<Pose> poses)
    Parameters
    Type Name Description
    NativeArray<Pose> poses

    The output array of poses, if this method returns true.

    Returns
    Type Description
    bool

    true if the frame has poses that were output to poses. Otherwise, false.

    TryGetTimestamp(out long)

    Get the timestamp of the frame, if possible.

    Declaration
    public bool TryGetTimestamp(out long timestampNs)
    Parameters
    Type Name Description
    long timestampNs

    The timestamp of the camera frame, in nanoseconds.

    Returns
    Type Description
    bool

    true if the frame has a timestamp that was output to timestampNs. Otherwise, false.

    Operators

    operator ==(XROcclusionFrame, XROcclusionFrame)

    Compares lhs and rhs for equality using Equals(XROcclusionFrame).

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

    The left-hand-side XROcclusionFrame of the comparison.

    XROcclusionFrame rhs

    The right-hand-side XROcclusionFrame of the comparison.

    Returns
    Type Description
    bool

    true if lhs compares equal to rhs. Otherwise, false.

    operator !=(XROcclusionFrame, XROcclusionFrame)

    Compares lhs and rhs for inequality using Equals(XROcclusionFrame).

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

    The left-hand-side XROcclusionFrame of the comparison.

    XROcclusionFrame rhs

    The right-hand-side XROcclusionFrame of the comparison.

    Returns
    Type Description
    bool

    false if lhs compares equal to rhs. Otherwise, true.

    Implements

    IEquatable<T>
    IDisposable
    In This Article
    Back to top
    Copyright © 2025 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)