rotation

fun rotation(m: Mat4): Mat4

Extracts and returns the rotation-only Mat4 from m by normalizing its basis vectors.


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

Returns a rotation Mat4 from Euler angles (in degrees) in the specified order.

Return

the rotation matrix

Parameters

d

per-axis Euler angles in degrees

order

the rotation order; defaults to RotationsOrder.ZYX


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

Returns a rotation Mat4 from individual Euler angles in radians in the specified order.

Return

the rotation matrix

Parameters

yaw

rotation around the first axis in radians

pitch

rotation around the second axis in radians

roll

rotation around the third axis in radians

order

the rotation order; defaults to RotationsOrder.ZYX


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

Returns a rotation Mat4 around axis by angle degrees.

Return

the rotation matrix

Parameters

axis

the rotation axis (need not be normalized)

angle

the rotation angle in degrees


fun rotation(quaternion: Quaternion): Mat4

Returns a rotation Mat4 from the given quaternion (normalized internally).

Return

the rotation matrix

Parameters

quaternion

the source rotation; need not be normalized