API Docs for: 0.5.5
Show:

kick.math.Quat Class

Defined in: kick/math/Quat.js:4
Module: kick.math

Quat - Quaternions

Item Index

Methods

Methods

add

(
  • out
  • a
  • b
)
kick.math.Quat static

Adds two quat's

Parameters:

Returns:

calculateW

(
  • out
  • a
)
kick.math.Quat static

Calculates the W component of a quat from the X, Y, and Z components. Assumes that quaternion is 1 unit in length. Any existing W component will be ignored.

Parameters:

Returns:

clone

(
  • a
)
kick.math.Quat static

Creates a new quat initialized with values from an existing quaternion

Parameters:

Returns:

kick.math.Quat:

a new quaternion

conjugate

(
  • out
  • a
)
kick.math.Quat static

Calculates the conjugate of a quat

Parameters:

Returns:

copy

(
  • out
  • a
)
kick.math.Quat static

Copy the values from one quat to another

Parameters:

Returns:

create

() kick.math.Quat static

Creates a new identity quat

Returns:

kick.math.Quat:

New quat

difference

(
  • out
  • quat
  • quat2
)
kick.math.Quat static

Return rotation that goes from quat to quat2.
It is the same as: quat.multiply(dest, quat.invert(quat,quat),quat2);

Parameters:

Returns:

dot

(
  • q1
  • q2
)
Number static

Returns dot product of q1 and q1

Parameters:

Returns:

Number:

fromMat3

(
  • out
  • m
)
kick.math.Quat static

Creates a quaternion from the given 3x3 rotation matrix.

Parameters:

Returns:

fromValues

(
  • x
  • y
  • z
  • w
)
kick.math.Quat static

Creates a new quat initialized with the given values

Parameters:

  • x Number

    X component

  • y Number

    Y component

  • z Number

    Z component

  • w Number

    W component

Returns:

kick.math.Quat:

a new quaternion

identity

(
  • out
)
kick.math.Quat static

Set a quat to the identity quaternion (0,0,0,1)

Parameters:

Returns:

inverse

(
  • out
  • a
)
kick.math.Quat static

Calculates the inverse of a quat

Parameters:

Returns:

length

(
  • a
)
Number static

Calculates the length of a quat

Parameters:

Returns:

Number:

length of a

lerp

(
  • out
  • a
  • b
  • t
)
kick.math.Quat static

Performs a linear interpolation between two quat's

Parameters:

Returns:

lookAt

(
  • out
  • position
  • target
  • up
)
kick.math.Quat static

Compute the lookAt rotation

Parameters:

Returns:

multiply

(
  • out
  • a
  • b
)
kick.math.Quat static

Multiplies two quat's

Parameters:

Returns:

multiplyVec3

(
  • out
  • quat
  • vec
)
kick.math.Vec3 static

Transforms a vec3 with the given quaternion

Parameters:

Returns:

normalize

(
  • out
  • a
)
kick.math.Quat static

Normalize a quat

Parameters:

Returns:

rotateX

(
  • out
  • a
  • rad
)
kick.math.Quat static

Rotates a quaternion by the given angle around the X axis

Parameters:

Returns:

rotateY

(
  • out
  • a
  • rad
)
kick.math.Quat static

Rotates a quaternion by the given angle around the Y axis

Parameters:

Returns:

rotateZ

(
  • out
  • a
  • rad
)
kick.math.Quat static

Rotates a quaternion by the given angle around the Z axis

Parameters:

Returns:

scale

(
  • out
  • a
  • b
)
kick.math.Quat static

Scales a quat by a scalar number

Parameters:

Returns:

set

(
  • out
  • x
  • y
  • z
  • w
)
kick.math.Quat static

Set the components of a quat to the given values

Parameters:

  • out kick.math.Quat

    the receiving quaternion

  • x Number

    X component

  • y Number

    Y component

  • z Number

    Z component

  • w Number

    W component

Returns:

setAxisAngle

(
  • out
  • axis
  • rad
)
kick.math.Quat static

Sets a quat from the given angle and rotation axis, then returns it.

Parameters:

Returns:

setEuler

(
  • out
  • vec
)
kick.math.Quat static

Set the rotation based on Eulers angles. Pitch->X axis, Yaw->Y axis, Roll->Z axis

Parameters:

Returns:

kick.math.Quat:

dest if specified, a new quat otherwise

setFromRotationMatrix

(
  • out
  • mat
)
kick.math.Quat static

Parameters:

Returns:

slerp

(
  • out
  • a
  • b
  • t
)
kick.math.Quat static

Performs a spherical linear interpolation between two quat

Parameters:

Returns:

squaredLength

(
  • a
)
Number static

Calculates the squared length of a quat

Parameters:

Returns:

Number:

squared length of a

str

(
  • quat
)
String static

Returns a string representation of a quaternion

Parameters:

Returns:

String:

string representation of quat

toEuler

(
  • out
  • quat
)
kick.math.Vec3 static

Calculates a rotation represented in Eulers angles (in degrees) Pitch->X axis, Yaw->Y axis, Roll->Z axis

Parameters:

Returns:

toMat3

(
  • out
  • quat
)
kick.math.Mat3 static

Calculates a 3x3 matrix from the given quat

Parameters:

Returns:

toMat4

(
  • out
  • quat
)
kick.math.Mat4 static

Calculates a 4x4 matrix from the given quat

Parameters:

Returns: