Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.quaternion

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static quaternion quaternion(float x, float y, float z, float w);

Parameters

Parameter Description
x The x component of the quaternion.
y The y component of the quaternion.
z The z component of the quaternion.
w The w component of the quaternion.

Returns

quaternion The quaternion constructed from individual components.

Description

Returns a quaternion constructed from four float values.


Declaration

public static quaternion quaternion(float4 value);

Parameters

Parameter Description
value The float4 containing the components of the quaternion.

Returns

quaternion The quaternion constructed from a float4.

Description

Returns a quaternion constructed from a float4 vector.


Declaration

public static quaternion quaternion(float3x3 m);

Parameters

Parameter Description
m The float3x3 rotation matrix.

Returns

quaternion The quaternion constructed from a float3x3 matrix.

Description

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


Declaration

public static quaternion quaternion(float4x4 m);

Parameters

Parameter Description
m The float4x4 matrix (must be orthonormal).

Returns

quaternion The quaternion constructed from a float4x4 matrix.

Description

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