Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

EulerOrder: "xyz" | "yzx" | "zxy" | "xzy" | "yxz" | "zyx"

A string representing the axis order of rotation.

Functions

  • Creates a new set of Euler angles where each axis of rotation is defined by an angle, in radians. If no value is given, then {x: 0, y: 0, z: 0, order: 'xyz'} is returned.

    Parameters

    • value: Partial<Euler> = {}

      The values to populate the Euler angles with.

    Returns Euler

    A set of Euler angles.

  • Creates a new set of Euler angles where each axis of rotation is defined by an angle, in degrees. If no value is given, then {x: 0, y: 0, z: 0, order: 'xyz'} is returned.

    Parameters

    • value: Partial<Euler> = {}

      The values to populate the Euler angles with.

    Returns Euler

    A set of Euler angles.

  • fromJson(json: string): Euler
  • Returns a set of Euler angles that was decoded from a JSON string. Supports either extracting values from an array [x, y, z, order] or object {x, y, z, order}.

    Parameters

    • json: string

      A JSON object.

    Returns Euler

    A set of Euler angles.

  • Creates a set of Euler angles from the rotation components of a 4x4 matrix. The rotation components are represented by the upper 3x3 of the matrix.

    Note that there are two solutions for the Euler angle of the 2nd applied rotation (i.e. y for xyz) because sin(theta) = sin(PI-theta). The returned angle will always be the solution between -PI/2 and PI/2.

    Parameters

    • matrix: Matrix4

      A pure rotation matrix, unscaled.

    • order: EulerOrder = 'xyz'

      The order that the rotations are applied.

    Returns Euler

  • isType(obj: unknown): obj is Euler