fromEuler

fun fromEuler(d: Float3, order: RotationsOrder = RotationsOrder.ZYX): Quaternion(source)

Construct a Quaternion 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)

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 fromEuler(yaw: Float = 0.0f, pitch: Float = 0.0f, roll: Float = 0.0f, order: RotationsOrder = RotationsOrder.ZYX): Quaternion(source)

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

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.