Class: quat

quat

new quat()

Source:

Members

(static) equals

Returns whether or not the quaternions have approximately the same elements in the same position.
Source:

(static) exactEquals

Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)
Source:

(static) rotationTo

Sets a quaternion to represent the shortest rotation from one vector to another. Both vectors are assumed to be unit length.
Source:

(static) setAxes

Sets the specified quaternion with values corresponding to the given axes. Each axis is a vec3 and is expected to be unit length and perpendicular to all other specified axes.
Source:

(static) sqlerp

Performs a spherical linear interpolation with two control points
Source:

Methods

(static) add(out, a, b) → {quat}

Adds two quat's
Parameters:
Name Type Description
out quat the receiving quaternion
a quat the first operand
b quat the second operand
Source:
Returns:
out
Type
quat

(static) clone(a) → {quat}

Creates a new quat initialized with values from an existing quaternion
Parameters:
Name Type Description
a quat quaternion to clone
Source:
Returns:
a new quaternion
Type
quat

(static) copy(out, a) → {quat}

Copy the values from one quat to another
Parameters:
Name Type Description
out quat the receiving quaternion
a quat the source quaternion
Source:
Returns:
out
Type
quat

(static) dot(a, b) → {Number}

Calculates the dot product of two quat's
Parameters:
Name Type Description
a quat the first operand
b quat the second operand
Source:
Returns:
dot product of a and b
Type
Number

(static) fromValues(x, y, z, w) → {quat}

Creates a new quat initialized with the given values
Parameters:
Name Type Description
x Number X component
y Number Y component
z Number Z component
w Number W component
Source:
Returns:
a new quaternion
Type
quat

(static) length()

Alias for quat.len
Source:

(static) lerp(out, a, b, t) → {quat}

Performs a linear interpolation between two quat's
Parameters:
Name Type Description
out quat the receiving quaternion
a quat the first operand
b quat the second operand
t Number interpolation amount between the two inputs
Source:
Returns:
out
Type
quat

(static) mul()

Alias for quat.multiply
Source:

(static) normalize(out, a) → {quat}

Normalize a quat
Parameters:
Name Type Description
out quat the receiving quaternion
a quat quaternion to normalize
Source:
Returns:
out
Type
quat

(static) scale(out, a, b) → {quat}

Scales a quat by a scalar number
Parameters:
Name Type Description
out quat the receiving vector
a quat the vector to scale
b Number amount to scale the vector by
Source:
Returns:
out
Type
quat

(static) set(out, x, y, z, w) → {quat}

Set the components of a quat to the given values
Parameters:
Name Type Description
out quat the receiving quaternion
x Number X component
y Number Y component
z Number Z component
w Number W component
Source:
Returns:
out
Type
quat

(static) sqrLen()

Alias for quat.squaredLength
Source:

(static) squaredLength(a) → {Number}

Calculates the squared length of a quat
Parameters:
Name Type Description
a quat vector to calculate squared length of
Source:
Returns:
squared length of a
Type
Number