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

  • new Euler(x?: number, y?: number, z?: number, order?: IOrder): Euler
  • Create a new instance.

    Parameters

    • x: number = 0

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

    • y: number = 0

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

    • z: number = 0

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

    • order: IOrder = Euler.DefaultOrder

      (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 = 'XYZ'
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

  • 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

  • Parameters

    Returns void

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

    Returns number

  • Parameters

    • value: number

    Returns void

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

    Returns number

  • Parameters

    • value: number

    Returns void

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

    Returns number

  • Parameters

    • value: number

    Returns void

Methods

  • [iterator](): IterableIterator<number | IOrder>
  • Returns IterableIterator<number | IOrder>

  • _onChange(callback: (() => void)): Euler
  • Parameters

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

    Returns Euler

  • _onChangeCallback(): void
  • Returns void

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

    Returns

    The new instance.

    Returns Euler

  • Copies value of euler to this euler.

    Returns

    This instance.

    Parameters

    Returns Euler

  • equals(euler: Euler): boolean
  • Checks for strict equality of this euler and euler.

    Returns

    True when equality is determined.

    Parameters

    Returns boolean

  • fromArray(array: [number, number, number, IOrder?]): Euler
  • 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

  • set(x: number, y: number, z: number, order?: IOrder): 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).

    • 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.

    • update: boolean = true

      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

  • toArray(array?: (number | IOrder)[], offset?: number): (number | IOrder)[]
  • Create an array representation of this instance. Returns an array of the form [x, y, z, order ].

    Returns

    The array.

    Parameters

    • array: (number | IOrder)[] = []

      Vector3.

    • offset: number = 0

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

    Returns (number | IOrder)[]

  • Deprecated

    since r138, 02cf0df1cb4575d5842fef9c85bb5a89fe020d53

    Parameters

    Returns Vector3