docs.unity.cn
    Show / Hide Table of Contents

    Method quaternion

    quaternion(Single, Single, Single, Single)

    Returns a quaternion constructed from four float values.

    Declaration
    public static quaternion quaternion(float x, float y, float z, float w)
    Parameters
    Type Name Description
    Single x

    The x component of the quaternion.

    Single y

    The y component of the quaternion.

    Single z

    The z component of the quaternion.

    Single w

    The w component of the quaternion.

    Returns
    Type Description
    quaternion

    The quaternion constructed from individual components.

    quaternion(float4)

    Returns a quaternion constructed from a float4 vector.

    Declaration
    public static quaternion quaternion(float4 value)
    Parameters
    Type Name Description
    float4 value

    The float4 containing the components of the quaternion.

    Returns
    Type Description
    quaternion

    The quaternion constructed from a float4.

    quaternion(float3x3)

    Returns a unit quaternion constructed from a float3x3 rotation matrix. The matrix must be orthonormal.

    Declaration
    public static quaternion quaternion(float3x3 m)
    Parameters
    Type Name Description
    float3x3 m

    The float3x3 rotation matrix.

    Returns
    Type Description
    quaternion

    The quaternion constructed from a float3x3 matrix.

    quaternion(float4x4)

    Returns a unit quaternion constructed from a float4x4 matrix. The matrix must be orthonormal.

    Declaration
    public static quaternion quaternion(float4x4 m)
    Parameters
    Type Name Description
    float4x4 m

    The float4x4 matrix (must be orthonormal).

    Returns
    Type Description
    quaternion

    The quaternion constructed from a float4x4 matrix.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023