rotation

fun rotation(m: Mat4): Mat4
fun rotation(axis: Float3, angle: Float): Mat4


fun rotation(d: Float3, order: RotationsOrder = RotationsOrder.ZYX): Mat4

Construct a rotation matrix from Euler angles using YPR around a specified order

Uses intrinsic Tait-Bryan angles. This means that rotations are performed with respect to the local coordinate system. That is, for order 'XYZ', the rotation is first around the X axis (which is the same as the world-X axis), then around local-Y (which may now be different from the world Y-axis), then local-Z (which may be different from the world Z-axis)

Return

The rotation matrix

Parameters

d

Per axis Euler angles in degrees Yaw, pitch, roll (YPR) are taken accordingly to the rotations order input.

order

The order in which to apply rotations. Default is RotationsOrder.ZYX which means that the object will first be rotated around its Z axis, then its Y axis and finally its X axis.


fun rotation(yaw: Float = 0.0f, pitch: Float = 0.0f, roll: Float = 0.0f, order: RotationsOrder = RotationsOrder.ZYX): Mat4

Construct a rotation matrix from Euler yaw, pitch, roll around a specified order.

Return

The rotation matrix

Parameters

roll

about 1st rotation axis in radians. Z in case of ZYX order

pitch

about 2nd rotation axis in radians. Y in case of ZYX order

yaw

about 3rd rotation axis in radians. X in case of ZYX order

order

The order in which to apply rotations. Default is RotationsOrder.ZYX which means that the object will first be rotated around its Z axis, then its Y axis and finally its X axis.


fun rotation(quaternion: Quaternion): Mat4

Construct a Quaternion Rotation Matrix following the Hamilton convention

Assume the destination and local coordinate spaces are initially aligned, and the local coordinate space is then rotated counter-clockwise about a unit-length axis, k, by an angle, theta.