Class Euler

A class representing Euler Angles. Euler angles describe a rotational transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order.

Example

const a = new Euler( 0, 1, 1.57, 'XYZ' );
const b = new Vector3( 1, 0, 1 );
b.applyEuler(a);

Hierarchy

  • Base
    • Euler

Constructors

  • Create a new instance.

    Parameters

    • Optional x: number

      (optional) the angle of the x axis in radians. Default is 0.

    • Optional y: number

      (optional) the angle of the y axis in radians. Default is 0.

    • Optional z: number

      (optional) the angle of the z axis in radians. Default is 0.

    • Optional order: IOrder

      (optional) a string representing the order that the rotations are applied, defaults to 'XYZ' (must be upper case).

    Returns Euler

Properties

_order: IOrder

The order in which to apply rotations. Default is 'XYZ', which means that the object will first be rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are: 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.

Three.js 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 local-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).

_x: number
_y: number
_z: number
DefaultOrder: IOrder
RotationOrders: IOrder[]

Accessors

  • get isBox2(): boolean
  • Returns boolean

  • get isBox3(): boolean
  • Returns boolean

  • get isColor(): boolean
  • Returns boolean

  • get isCylindrical(): boolean
  • Returns boolean

  • get isEuler(): boolean
  • Read-only flag to check if a given object is of type Euler.

    Returns boolean

  • get isLine3(): boolean
  • Returns boolean

  • get isMatrix3(): boolean
  • Returns boolean

  • get isMatrix4(): boolean
  • Returns boolean

  • get isPlane(): boolean
  • Returns boolean

  • get isQuaternion(): boolean
  • Returns boolean

  • get isRay(): boolean
  • Returns boolean

  • get isSphere(): boolean
  • Returns boolean

  • get isSpherical(): boolean
  • Returns boolean

  • get isTriangle(): boolean
  • Returns boolean

  • get isVector2(): boolean
  • Returns boolean

  • get isVector3(): boolean
  • Returns boolean

  • get isVector4(): boolean
  • Returns boolean

  • get order(): IOrder
  • The order in which to apply rotations. Default is 'XYZ', which means that the object will first be rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are: 'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.

    Three.js 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 local-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).

    Returns IOrder

  • set order(value: IOrder): void
  • Parameters

    Returns void

  • get x(): number
  • The current value of the x component.

    Returns number

  • set x(value: number): void
  • Parameters

    • value: number

    Returns void

  • get y(): number
  • The current value of the y component.

    Returns number

  • set y(value: number): void
  • Parameters

    • value: number

    Returns void

  • get z(): number
  • The current value of the z component.

    Returns number

  • set z(value: number): void
  • Parameters

    • value: number

    Returns void

Methods

  • Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns Euler

  • Create new Euler with the same parameters as this one.

    Returns

    The new instance.

    Returns Euler

  • Checks for strict equality of this euler and euler.

    Returns

    True when equality is determined.

    Parameters

    Returns boolean

  • Update state from array. Assigns this euler's x angle to array[0]. Assigns this euler's y angle to array[1]. Assigns this euler's z angle to array[2]. Optionally assigns this euler's order to array[3].

    Returns

    This instance.

    Parameters

    • array: [number, number, number, IOrder?]

      array of length 3 or 4. The optional 4th argument corresponds to the order.

    Returns Euler

  • Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order.

    WARNING: this discards revolution information.

    Returns

    Parameters

    Returns Euler

  • Update state.

    Returns

    This instance.

    Parameters

    • x: number

      the angle of the x axis in radians.

    • y: number

      the angle of the y axis in radians.

    • z: number

      the angle of the z axis in radians.

    • Optional order: IOrder

      a string representing the order that the rotations are applied.

    Returns Euler

  • Update state from a quaternion.

    Returns

    This instance.

    Parameters

    • q: Quaternion

      a normalized quaternion.

    • Optional order: IOrder

      (optional) a string representing the order that the rotations are applied. Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.

    • Optional update: boolean

      Call onChange callback

    Returns Euler

  • Update state from rotation matrix.

    Returns

    This instance.

    Parameters

    • m: Matrix4

      a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).

    • Optional order: IOrder

      (optional) a string representing the order that the rotations are applied. Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.

    • Optional update: boolean

      Call onChange callback

    Returns Euler

  • Set state from a vector

    Returns

    This instance.

    Parameters

    • v: Vector3

      Vector3.

    • Optional order: IOrder

      (optional) a string representing the order that the rotations are applied.

    Returns Euler

  • Create an array representation of this instance. Returns an array of the form [x, y, z, order ].

    Returns

    The array.

    Parameters

    • Optional array: (number | IOrder)[]

      Vector3.

    • Optional offset: number

      (optional) a string representing the order that the rotations are applied.

    Returns (number | IOrder)[]