docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XrVector2f

    Two-dimensional vector.

    Implements
    IEquatable<XrVector2f>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.NativeTypes
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public struct XrVector2f : IEquatable<XrVector2f>

    Constructors

    XrVector2f(float, float)

    Constructor for two float values.

    Declaration
    public XrVector2f(float x, float y)
    Parameters
    Type Name Description
    float x

    The x coordinate of the vector.

    float y

    The y coordinate of the vector.

    XrVector2f(Vector2)

    Initializes and returns an instance of XrVector2f with the provided parameters.

    Declaration
    public XrVector2f(Vector2 value)
    Parameters
    Type Name Description
    Vector2 value

    Vector2 struct coming from Unity that is translated into the OpenXR XrVector2f struct.

    Fields

    X

    The x coordinate of the vector.

    Declaration
    public float X
    Field Value
    Type Description
    float

    Y

    The y coordinate of the vector.

    Declaration
    public float Y
    Field Value
    Type Description
    float

    Methods

    AsVector2()

    Convert this instance to a Vector2.

    Declaration
    public Vector2 AsVector2()
    Returns
    Type Description
    Vector2

    The output Vector2.

    Equals(object)

    Compares for equality. Two instances are equal if their bits are exactly identical for the X and Y fields.

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

    The other object.

    Returns
    Type Description
    bool

    true if obj is an XrVector2f and equal to this instance. Otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(XrVector2f)

    Compares for equality. Two instances are equal if their bits are exactly identical for the X and Y fields.

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

    The other instance.

    Returns
    Type Description
    bool

    true if the instances are equal. Otherwise, false.

    GetHashCode()

    Generates a unique hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The hash code.

    Overrides
    ValueType.GetHashCode()

    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)