Struct XRFov
Represents a field of view as angles in radians from the center point.
Implements
Inherited Members
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 |
Equals(object)
Compares for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | An |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
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
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 |
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 |