Home Reference Source
import {Euler} from 'math-ds'
public class | source

Euler

Euler angles.

Static Member Summary

Static Public Members
public static get

The default rotation order.

Constructor Summary

Public Constructor
public

Constructs a new set of Euler angles.

Member Summary

Public Members
public

The rotation order.

public

The rotation around the X-axis.

public

The rotation around the Y-axis.

public

The rotation around the Z-axis.

Method Summary

Public Methods
public

Clones this set of Euler angles.

public

Copies the values of another set of Euler angles.

public

Checks if this set of Euler angles equals the given one.

public

fromArray(array: Number[], offset: Number): Euler

Copies angles and the rotation order from an array.

public

Reorder the rotation angles.

public

set(x: Number, y: Number, z: Number, order: Number): Euler

Sets the Euler angles and rotation order.

public

Copies the rotation from a given quaternion.

public

Copies the rotation from a given matrix.

public

Copies the rotation from a given vector.

public

toArray(array: Array, offset: Number): Number[]

Stores this set of Euler angles and the rotation order in an array.

public

Stores this set of Euler angles in a vector.

Static Public Members

public static get defaultOrder: RotationOrder source

The default rotation order.

Public Constructors

public constructor(x: Number, y: Number, z: Number) source

Constructs a new set of Euler angles.

Params:

NameTypeAttributeDescription
x Number
  • optional
  • default: 0

The rotation around the X-axis.

y Number
  • optional
  • default: 0

The rotation around the Y-axis.

z Number
  • optional
  • default: 0

The rotation around the Z-axis.

Public Members

public order: RotationOrder source

The rotation order.

public x: Number source

The rotation around the X-axis.

public y: Number source

The rotation around the Y-axis.

public z: Number source

The rotation around the Z-axis.

Public Methods

public clone(): Euler source

Clones this set of Euler angles.

Return:

Euler

A clone of this set of Euler angles.

public copy(e: Euler): Euler source

Copies the values of another set of Euler angles.

Params:

NameTypeAttributeDescription
e Euler

A set of Euler angles.

Return:

Euler

This set of Euler angles.

public equals(e: Euler): Boolean source

Checks if this set of Euler angles equals the given one.

Params:

NameTypeAttributeDescription
e Euler

Euler angles.

Return:

Boolean

Whether this set of Euler angles equals the given one.

public fromArray(array: Number[], offset: Number): Euler source

Copies angles and the rotation order from an array.

Params:

NameTypeAttributeDescription
array Number[]

An array.

offset Number

An offset.

Return:

Euler

This set of Euler angles.

public reorder(newOrder: RotationOrder): Euler source

Reorder the rotation angles.

WARNING: this operation discards revolution information!

Params:

NameTypeAttributeDescription
newOrder RotationOrder

The new rotation order.

Return:

Euler

This set of Euler angles.

public set(x: Number, y: Number, z: Number, order: Number): Euler source

Sets the Euler angles and rotation order.

Params:

NameTypeAttributeDescription
x Number

The rotation around the X-axis.

y Number

The rotation around the Y-axis.

z Number

The rotation around the Z-axis.

order Number

The rotation order.

Return:

Euler

This set of Euler angles.

public setFromQuaternion(q: Matrix4, order: RotationOrder): Euler source

Copies the rotation from a given quaternion.

Params:

NameTypeAttributeDescription
q Matrix4

A quaternion.

order RotationOrder
  • optional

An override rotation order.

Return:

Euler

This set of Euler angles.

public setFromRotationMatrix(m: Matrix4, order: RotationOrder): Euler source

Copies the rotation from a given matrix.

Params:

NameTypeAttributeDescription
m Matrix4

A rotation matrix. The upper 3x3 is assumed to be a pure rotation matrix (i.e. unscaled).

order RotationOrder
  • optional

An override rotation order.

Return:

Euler

This set of Euler angles.

public setFromVector3(v: Matrix4, order: RotationOrder): Euler source

Copies the rotation from a given vector.

Params:

NameTypeAttributeDescription
v Matrix4

A vector.

order RotationOrder
  • optional

A rotation order.

Return:

Euler

This set of Euler angles.

public toArray(array: Array, offset: Number): Number[] source

Stores this set of Euler angles and the rotation order in an array.

Params:

NameTypeAttributeDescription
array Array
  • optional

A target array.

offset Number

An offset.

Return:

Number[]

The array.

public toVector3(vector: Vector3): Vector3 source

Stores this set of Euler angles in a vector.

Params:

NameTypeAttributeDescription
vector Vector3
  • optional

A target vector. If none is provided, a new one will be created.

Return:

Vector3

The vector.