Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Quaternion

Quaternion which is 4-dimensional complex number. See Wikipedia.

Hierarchy

  • Quaternion

Index

Constructors

constructor

  • new Quaternion(x: number, y: number, z: number, w: number): Quaternion

Properties

Protected _values

_values: Float32Array

Accessors

magnitude

  • get magnitude(): number

norm

  • get norm(): number
  • Calc norm of the quaternion. An alias for magnitude.

    Returns number

values

  • get values(): Float32Array

w

  • get w(): number
  • set w(value: number): void

x

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

y

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

z

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

Methods

add

dot

mulByScalar

  • Multiplies the quaternion by scalar and returns the product.

    This method does not mutate the quaternion.

    Parameters

    • scalar: number

    Returns Quaternion

normalize

slerp

  • Calculates spherical linear interpolation(also known as Slerp) and returns new Quaternion between the quaternion and the other.

    Parameters

    • other: Quaternion
    • t: number

      0.0 <= t <= 1.0

    • options: { chooseShorterAngle: boolean } = ...

      Does not work currently. slerp chooses shorter angle regardless of this value.

      • chooseShorterAngle: boolean

    Returns Quaternion

toRotationMatrix4

toString

  • toString(): string

Static rotationAround

Generated using TypeDoc