class Euler extends MathArray extends Array
A class to handle Euler rotation. More information on rotation using a Euler vector can be found here. Generally speaking the three components of the Euler object represents the roll, pitch and yaw angles and the rotation is applied according to a specific rotation order.
import {Euler} from '@math.gl/core';
Euler.ZYX
Euler.YXZ
Euler.XZY
Euler.ZXY
Euler.YZX
Euler.XYZ
Euler.RollPitchYaw
Euler.DefaultOrder
(= Euler.ZYX
)
Euler.RotationOrders
= ['ZYX', 'YXZ', 'XZY', 'ZXY', 'YZX', 'XYZ']
;
x, y, z angle notation (note: only corresponds to axis in XYZ orientation)
roll, pitch, yaw angle notation
alpha, beta, gamma angle notation
phi, theta, psi angle notation
rotation order in all notations
(x = 0, y = 0, z = 0, order = Euler.DefaultOrder)
Common ZYX rotation order
euler.fromRollPitchYaw(roll, pitch, yaw)
euler.fromRotationMatrix(m, order = Euler.DefaultOrder)
euler.fromQuaternion(q, order)
If copied array does contain fourth element, preserves currently set order.
euler.copy(array)
Sets the three angles, and optionally sets the rotation order. If order is not specified, preserves currently set order.
euler.set(x = 0, y = 0, z = 0, order)
Does not copy the orientation element
euler.toArray(array = [], offset = 0)
Copies the orientation element
euler.toArray4(array = [], offset = 0)
euler.toVector3(optionalResult)
euler.fromVector3(v, order)
euler.fromArray(array, offset = 0)
euler.getRotationMatrix(m = new Matrix4())
Returns Matrix4
- a rotation matrix corresponding to rotations per the specified euler angles
euler.getQuaternion()
THREE.Euler
class