Quaternion

fun Quaternion()

Creates an identity quaternion (no rotation).

This represents no rotation from the original orientation, equivalent to Euler angles (0, 0, 0).

fun Quaternion(data: Quaternion)

Creates a copy of another quaternion.

Parameters

data

The quaternion to copy

fun Quaternion(x: Float, y: Float, z: Float, w: Float)

Creates a quaternion with specific component values.

Note: For most use cases, you should use normalized quaternions for representing rotations. This constructor doesn't automatically normalize the values.

Parameters

x

The x component of the quaternion (vector part)

y

The y component of the quaternion (vector part)

z

The z component of the quaternion (vector part)

w

The w component of the quaternion (scalar part)