API Documentation

for 0.0.1
Show:

Quaternion Class

Represents a Quaternion, a way to describe a spatial rotation that is less susceptible to gimbal lock.

This class extends the one from Three.js, API available here : http://threejs.org/docs/#Reference/Math/Quaternion

Methods

clone

()

Returns:

Quaternion

conjugate

()

Returns:

Quaternion

copy

(
  • q
)

Parameters:

Returns:

Quaternion

equals

(
  • v
)

Compares each component of v to each component of this quaternion to determine if they represent the same rotation.

Parameters:

Returns:

Boolean

fromArray

(
  • array
)

Sets this quaternion's component values from an array.

Parameters:

  • array Array

Returns:

Quaternion

inverse

()

Returns:

Quaternion

length

()

Returns:

Float

lengthSq

()

Returns:

Float

multiply

(
  • b
)

Parameters:

Returns:

Quaternion

multiplyQuaternions

(
  • a
  • b
)

Parameters:

Returns:

Quaternion

multiplyVector3

(
  • vector
  • dest
)

Parameters:

Returns:

Quaternion

normalize

()

Returns:

Quaternion

set

(
  • x
  • y
  • z
  • w
)

Parameters:

  • x Float
  • y Float
  • z Float
  • w Float

Returns:

Quaternion

setFromAxisAngle

(
  • axis
  • angle
)

Parameters:

Returns:

Quaternion

setFromEuler

(
  • euler
)

Parameters:

Returns:

Quaternion

setFromRotationMatrix

(
  • m
)

Parameters:

Returns:

Quaternion

setFromUnitVectors

(
  • vFrom
  • vTo
)

Parameters:

Returns:

Quaternion

slerp

(
  • quaternionB
  • t
)

Handles the spherical linear interpolation between quaternions. t represents the amount of rotation between this quaternion (where t is 0) and quaternionB (where t is 1). This quaternion is set to the result. Also see the static version of the slerp below.

Parameters:

Returns:

Quaternion

toArray

(
  • array
)

Returns the numerical elements of this quaternion in an array of format (x, y, z, w).

Parameters:

  • array Array

Returns:

Array