docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XrVector3f

    Represents a three-dimensional vector in OpenXR coordinates.

    Implements
    IEquatable<XrVector3f>
    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 XrVector3f : IEquatable<XrVector3f>

    Constructors

    XrVector3f(float, float, float)

    Construct an instance from the given Unity coordinates.

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

    The x coordinate from Unity's coordinate system.

    float y

    The y coordinate from Unity's coordinate system.

    float z

    The z coordinate from Unity's coordinate system.

    Remarks
    Important

    This constructor negates the z value to convert from Unity's left-handed coordinate system to the right-handed system used by OpenXR.

    XrVector3f(Vector3)

    Construct an instance from the given Vector3.

    Declaration
    public XrVector3f(Vector3 value)
    Parameters
    Type Name Description
    Vector3 value

    The input Vector3 from Unity's coordinate system.

    Remarks
    Important

    This constructor negates the z value of the input Vector3 to convert from Unity's left-handed coordinate system to the right-handed system used by OpenXR.

    Fields

    X

    The x coordinate of the vector, in OpenXR coordinates.

    Declaration
    public float X
    Field Value
    Type Description
    float

    Y

    The y coordinate of the vector, in OpenXR coordinates.

    Declaration
    public float Y
    Field Value
    Type Description
    float

    Z

    The z coordinate of the vector, in OpenXR coordinates.

    Declaration
    public float Z
    Field Value
    Type Description
    float

    Methods

    AsVector3()

    Convert this instance in OpenXR coordinates to a Vector3 in Unity coordinates.

    Declaration
    public Vector3 AsVector3()
    Returns
    Type Description
    Vector3

    The output Vector3.

    Remarks
    Important

    This method negates the Z value to convert from OpenXR's right-handed coordinate system to the left-handed system used by Unity.

    Equals(object)

    Compares for equality. Two instances are equal if their bits are identical for the X, Y, and Z 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 XrVector3f and equal to this instance. Otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(XrVector3f)

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

    Declaration
    public bool Equals(XrVector3f other)
    Parameters
    Type Name Description
    XrVector3f 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)