dot big bang

Developer API
Menu

Class Euler

All
  • Public
  • Public/Protected
  • All

Hierarchy

  • Euler

Index

Constructors

constructor

  • new Euler(x?: number, y?: number, z?: number, order?: EulerOrder): Euler
  • Creates an Euler object from the provided components and order.

    Parameters

    • Optional x: number

      [[Float]] the angle of the x axis in radians. Default is 0.

    • Optional y: number

      [[Float]] the angle of the y axis in radians. Default is 0.

    • Optional z: number

      [[Float]] the angle of the z axis in radians. Default is 0.

    • Optional order: EulerOrder

      [[EulerOrder]] A string representing the order that the rotations are applied, defaults to 'XYZ'.

    Returns Euler

Accessors

order

  • get order(): EulerOrder
  • set order(value: EulerOrder): void
  • The order in which to apply the 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'. This class 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 EulerOrder

  • The order in which to apply the 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'. This class 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).

    Parameters

    • value: EulerOrder

    Returns void

x

  • get x(): number
  • set x(value: number): void
  • The angle, in radians, around the x axis.

    Returns number

  • The angle, in radians, around the x axis.

    Parameters

    • value: number

    Returns void

y

  • get y(): number
  • set y(value: number): void
  • The angle, in radians, around the y axis.

    Returns number

  • The angle, in radians, around the y axis.

    Parameters

    • value: number

    Returns void

z

  • get z(): number
  • set z(value: number): void
  • The angle, in radians, around the z axis.

    Returns number

  • The angle, in radians, around the z axis.

    Parameters

    • value: number

    Returns void

Methods

clone

  • Returns a new euler with the same parameters as this one.

    Returns Euler

copy

  • Copies the value of euler into this euler.

    Parameters

    Returns Euler

equals

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

    Parameters

    • euler: Euler

      The other euler to compare this one against.

    Returns boolean

fromArray

  • fromArray(array: any[], offset?: number): void
  • Assigns this euler's x angle to array[0], y angle to array[1], z angle to array[2]. Optionally assigns this euler's order to array[3].

    Parameters

    • array: any[]

      An [[Array]] of length 3 or 4. The optional 4th argument corresponds to the order.

    • Optional offset: number

      (optional) The offset in the array from which to start reading the euler.

    Returns void

reorder

  • reorder(newOrder: EulerOrder): Euler
  • Resets this euler transform to a new angle order by creating a quaternion from this euler and then setting this euler with the quaternion and the new order. This opertion discards revolution information.

    Parameters

    • newOrder: EulerOrder

      The order of axes.

    Returns Euler

set

  • set(x: number, y: number, z: number, order?: EulerOrder): Euler
  • Sets the angles of this euler transform and optionally its order.

    Parameters

    • x: number

      [[Float]] Angle in x axis in radians.

    • y: number

      [[Float]] Angle in y axis in radians.

    • z: number

      [[Float]] Angle in z axis in radians.

    • Optional order: EulerOrder

      The order of axes, defaults to 'XYZ'.

    Returns Euler

setFromQuaternion

  • Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.

    Parameters

    • q: Quaternion

      The Quaternion to set this euler from.

    • Optional order: EulerOrder

      The order of axes, defaults to the current order of this euler.

    Returns Euler

setFromRotationMatrix

  • setFromRotationMatrix(m: Matrix4, order?: EulerOrder): Euler
  • Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.

    Parameters

    • m: Matrix4

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

    • Optional order: EulerOrder

      The order of axes, defaults to the current order of this euler.

    Returns Euler

setFromVector3

  • Sets the x, y and z of this euler from vector, and optionally updates its order.

    Parameters

    • v: Vector3
    • Optional order: EulerOrder

      The order of axes, defaults to the current order of this euler.

    Returns Euler

toArray

  • toArray(array?: any[], offset?: number): any[]
  • Returns an array of the form [x, y, z, order]

    Parameters

    • Optional array: any[]

      (optional) An [[Array]] to store the euler in.

    • Optional offset: number

      (optional) The offset in the array from which to start writing the euler.

    Returns any[]

toVector3

  • Returns the Euler's x, y and z properties as a Vector3.

    Parameters

    • Optional optionalResult: Vector3

      (optional) If specified, the result will be copied into this [[Vector]], otherwise a new one will be created.

    Returns Vector3