docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class QuaternionExtensions

    Extension methods for Quaternion structs.

    Inheritance
    object
    QuaternionExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CoreUtils
    Assembly: Unity.XR.CoreUtils.dll
    Syntax
    public static class QuaternionExtensions

    Methods

    ConstrainYaw(Quaternion)

    Returns a rotation that only contains the yaw component of the specified rotation. The resulting rotation is not normalized.

    Declaration
    public static Quaternion ConstrainYaw(this Quaternion rotation)
    Parameters
    Type Name Description
    Quaternion rotation

    The source rotation.

    Returns
    Type Description
    Quaternion

    A yaw-only rotation that matches the input rotation's yaw.

    ConstrainYawNormalized(Quaternion)

    Returns a normalized rotation that only contains the yaw component of the specified rotation.

    Declaration
    public static Quaternion ConstrainYawNormalized(this Quaternion rotation)
    Parameters
    Type Name Description
    Quaternion rotation

    The source rotation.

    Returns
    Type Description
    Quaternion

    A yaw-only rotation that matches the input rotation's yaw.

    ConstrainYawPitchNormalized(Quaternion)

    Returns a normalized rotation that only contains the yaw and pitch components of the specified rotation

    Declaration
    public static Quaternion ConstrainYawPitchNormalized(this Quaternion rotation)
    Parameters
    Type Name Description
    Quaternion rotation

    The source rotation.

    Returns
    Type Description
    Quaternion

    A yaw- and pitch-only rotation that matches the input rotation's yaw and pitch.

    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)