API Docs for: 0.9.16
Show:

Quaternion Class

Defined in: gl-matrix.js:3591
Module: Entity

Item Index

Methods

Methods

(
  • a
  • b
)
Number

Defined in gl-matrix.js:3890

Calculates the dot product of two quat's

Parameters:

  • a Quat

    the first operand

  • b Quat

    the second operand

Returns:

Number:

dot product of a and b

(
  • a
)
Quat

Defined in gl-matrix.js:3684

Creates a new quat initialized with values from an existing quaternion

Parameters:

  • a Quat

    quaternion to clone

Returns:

Quat:

a new quaternion

(
  • out
  • a
)
Quat

Defined in gl-matrix.js:3705

Copy the values from one quat to another

Parameters:

  • out Quat

    the receiving quaternion

  • a Quat

    the source quaternion

Returns:

Quat:

out

(
  • out
  • x
  • y
  • z
  • w
)
Quat

Defined in gl-matrix.js:3715

Set the components of a quat to the given values

Parameters:

Returns:

Quat:

out

(
  • out
  • a
  • b
)
Quat

Defined in gl-matrix.js:3761

Adds two quat's

Parameters:

  • out Quat

    the receiving quaternion

  • a Quat

    the first operand

  • b Quat

    the second operand

Returns:

Quat:

out

()

Defined in gl-matrix.js:3791

Alias for {@link quat.multiply}

(
  • out
  • a
  • b
)
Quat

Defined in gl-matrix.js:3797

Scales a quat by a scalar number

Parameters:

  • out Quat

    the receiving vector

  • a Quat

    the vector to scale

  • b Number

    amount to scale the vector by

Returns:

Quat:

out

(
  • x
  • y
  • z
  • w
)
Quat

Defined in gl-matrix.js:3693

Creates a new quat initialized with the given values

Parameters:

Returns:

Quat:

a new quaternion

(
  • out
  • a
  • b
  • t
)
Quat

Defined in gl-matrix.js:3900

Performs a linear interpolation between two quat's

Parameters:

  • out Quat

    the receiving quaternion

  • a Quat

    the first operand

  • b Quat

    the second operand

  • t Number

    interpolation amount between the two inputs

Returns:

Quat:

out

(
  • a
)
Number

Defined in gl-matrix.js:3999

Calculates the length of a quat

Parameters:

  • a Quat

    vector to calculate length of

Returns:

Number:

length of a

()

Defined in gl-matrix.js:4008

Alias for {@link quat.length}

(
  • a
)
Number

Defined in gl-matrix.js:4014

Calculates the squared length of a quat

Parameters:

  • a Quat

    vector to calculate squared length of

Returns:

Number:

squared length of a

()

Defined in gl-matrix.js:4023

Alias for {@link quat.squaredLength}

(
  • out
  • a
)
Quat

Defined in gl-matrix.js:4029

Normalize a quat

Parameters:

  • out Quat

    the receiving quaternion

  • a Quat

    quaternion to normalize

Returns:

Quat:

out

(
  • out
  • m
)
Quat

Defined in gl-matrix.js:4039

Creates a quaternion from the given 3x3 rotation matrix.

NOTE: The resultant quaternion is not normalized, so you should be sure to renormalize the quaternion yourself where necessary.

Parameters:

  • out Quat

    the receiving quaternion

  • m Mat3

    rotation matrix

Returns:

Quat:

out