Documentation

Unity Engine

Download Unity

Unity Engine

quaternion4

Creates a quaternion4 from four vectors that hold the components of the four quaternions.
Read time 2 minutesLast updated 4 hours ago

Definition

quaternion4(float4, float4, float4, float4)

Creates a quaternion4 from four vectors that hold the components of the four quaternions.
public quaternion4(float4 x, float4 y, float4 z, float4 w)

Parameters

The x components of the four quaternions, one in each lane.

The y components of the four quaternions, one in each lane.

The z components of the four quaternions, one in each lane.

The w components of the four quaternions, one in each lane.

Remarks

Lane 0 of each parameter holds a component of the first quaternion, lane 1 holds a component of the second quaternion, and so on. The constructor doesn't normalize the values. To build a quaternion4 from four separate quaternions, use the constructor that takes four
quaternion
values.

quaternion4(quaternion, quaternion, quaternion, quaternion)

Creates a quaternion4 from four quaternions.
public quaternion4(quaternion q0, quaternion q1, quaternion q2, quaternion q3)

Parameters

The quaternion to store in lane 0 of the new quaternion4.

The quaternion to store in lane 1 of the new quaternion4.

The quaternion to store in lane 2 of the new quaternion4.

The quaternion to store in lane 3 of the new quaternion4.

Remarks

The constructor stores each quaternion in its own lane: the components of
q0
go to lane 0 of x, y, z, and w, the components of
q1
go to lane 1, and so on. The constructor doesn't normalize the quaternions.

quaternion4(float4x4)

Creates a quaternion4 from the four columns of a matrix.
public quaternion4(float4x4 m)

Parameters

The matrix whose columns hold the x, y, z, and w components of the four quaternions.

Remarks

The columns of the matrix become the fields quaternion4.x, quaternion4.y, quaternion4.z, and quaternion4.w. This constructor doesn't convert a rotation matrix into quaternions.