docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRFov

    Represents a field of view as angles in radians from the center point.

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

    This struct is a C# representation of the OpenXR XrFovf struct. Refer to the Open XR specification.

    Constructors

    XRFov(float, float, float, float)

    Constructor.

    Declaration
    public XRFov(float left, float right, float up, float down)
    Parameters
    Type Name Description
    float left

    The angle in radians between the left edge and center of the frame.

    float right

    The angle in radians between the right edge and center of the frame.

    float up

    The angle in radians between the upper edge and center of the frame.

    float down

    The angle in radians between the lower edge and center of the frame.

    Properties

    angleDown

    Gets the angle in radians between the lower edge and center of the frame.

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

    The angle in radians between the lower edge and center of the frame.

    angleLeft

    Gets the angle in radians between the left edge and center of the frame.

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

    The angle in radians between the left edge and center of the frame.

    angleRight

    Gets the angle in radians between the right edge and center of the frame.

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

    The angle in radians between the right edge and center of the frame.

    angleUp

    Gets the angle in radians between the upper edge and center of the frame.

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

    The angle in radians between the upper edge and center of the frame.

    Methods

    AsVector4()

    Returns this instance as a Vector4 with the following field mappings: x | angleLeft y | angleRight z | angleUp w | angleDown

    Declaration
    public Vector4 AsVector4()
    Returns
    Type Description
    Vector4

    This XRFov as a Vector4.

    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 XRFov and Equals(XRFov) is also true. Otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(XRFov)

    Compares for equality.

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

    The other XRFov to compare against.

    Returns
    Type Description
    bool

    true if the XRFov 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 XRFov.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The string.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(XRFov, XRFov)

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

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

    The left-hand-side XRFov of the comparison.

    XRFov rhs

    The right-hand-side XRFov of the comparison.

    Returns
    Type Description
    bool

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

    operator !=(XRFov, XRFov)

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

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

    The left-hand-side XRFov of the comparison.

    XRFov rhs

    The right-hand-side XRFov of the comparison.

    Returns
    Type Description
    bool

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

    Implements

    IEquatable<T>
    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)