Docs for Version: 1.0a
Show:
Module: Math

Quaternion class

Constructor

Quaternion

()

Methods

add

(
  • q
)
Quaternion

Parameters:

Returns:

divide

(
  • q
)
Quaternion

Parameters:

Returns:

getMatrix Returns the quaternion matrix

() Matrix

Returns:

getQuaternionFromAxisAngle

(
  • v
)
Quaternion

Parameters:

  • v Vector

    Create quaternion from axis angle in degrees

Returns:

getQuaternionFromAxisAngle

(
  • v
)
Quaternion

Parameters:

  • v Vector

    Create quaternion from axis angle in radians

Returns:

getQuaternionFromEulerAnglesRad

(
  • x
  • y
  • z
)
Quaternion

Parameters:

  • x Float
  • y Float
  • z Float

    Create quaternion from rotation XYZ in Degrees

Returns:

getQuaternionFromEulerAnglesRad

(
  • x
  • y
  • z
)
Quaternion

Parameters:

  • x Float
  • y Float
  • z Float

    Create quaternion from rotation XYZ in Radians

Returns:

getQuaternionFromMatrix

(
  • m
)
Quaternion

Parameters:

  • m Matrix

    Create quaternion from Matrix

Returns:

getQuaternionFromSpherical

(
  • latitude
  • longtitude
  • angle
)
Quaternion

Parameters:

  • latitude Float
  • longtitude Float
  • angle Float

    Create quaternion from spherical coordinates

Returns:

getRotationTo

(
  • fromV
  • toV
)
Quaternion

Parameters:

  • fromV Vector
  • toV Vector

    get Quaternion from rotation from one Vector to another.

Returns:

inverse Returns inverted quaternion

() Quaternion

Returns:

magnitude Returns the length of quaternion

() Float

Returns:

Float:

magnitudeSquared Returns the squared length of quaternion

() Float

Returns:

Float:

multiply

(
  • q
)
Quaternion

Parameters:

Returns:

negative Returns negative quaternion

() Quaternion

Returns:

rotateVector

(
  • v
)
Vector

Parameters:

  • v Vector

    Rotate Vector with quaternion

Returns:

subtract

(
  • q
)
Quaternion

Parameters:

  • q Quaternion

    Subtracts one quaternion from another

Returns: