Summary
Methods
- add(a, b, out) → {Quat}
- calculateW(a, out) → {Quat}
- clone(a) → {Quat}
- conjugate(a, out) → {Quat}
- copy(a, out) → {Quat}
- create() → {Quat}
- dot(a, b) → {Number}
- fromMat3(m, out) → {Quat}
- fromValues(x, y, z, w) → {Quat}
- identity(out) → {Quat}
- invert(a, out) → {Quat}
- len()
- length(a) → {Number}
- lerp(a, b, t, out) → {Quat}
- mul()
- multiply(a, b, out) → {Quat}
- normalize(a, out) → {Quat}
- rotateX(a, rad, out) → {Quat}
- rotateY(a, rad, out) → {Quat}
- rotateZ(a, rad, out) → {Quat}
- rotationTo(a, b, out) → {Quat}
- scale(a, b, out) → {Quat}
- set(x, y, z, w, out) → {Quat}
- setAxes(view, right, up) → {Quat}
- setAxisAngle(axis, rad, out) → {Quat}
- slerp(a, b, t, out) → {Quat}
- sqlerp(a, b, c, d, t, out) → {Quat}
- sqrLen()
- squaredLength(a) → {Number}
- str(vec) → {String}
Detailed Description
Methods
add(a, b, out) → {Quat}
calculateW(a, out) → {Quat}
clone(a) → {Quat}
conjugate(a, out) → {Quat}
copy(a, out) → {Quat}
dot(a, b) → {Number}
fromMat3(m, out) → {Quat}
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:
Name | Type | Description |
---|---|---|
m |
Mat3 | rotation matrix |
out |
Quat | the receiving quaternion |
Returns:
out
- Type
- Quat
- Source:
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 |
Returns:
a new quaternion
- Type
- Quat
- Source:
identity(out) → {Quat}
invert(a, out) → {Quat}
len()
Alias for quat.length
- Source:
length(a) → {Number}
Calculates the length of a quat
Parameters:
Name | Type | Description |
---|---|---|
a |
Quat | vector to calculate length of |
Returns:
length of a
- Type
- Number
- Source:
lerp(a, b, t, out) → {Quat}
mul()
Alias for quat.multiply
- Source:
multiply(a, b, out) → {Quat}
normalize(a, out) → {Quat}
rotateX(a, rad, out) → {Quat}
rotateY(a, rad, out) → {Quat}
rotateZ(a, rad, out) → {Quat}
rotationTo(a, b, out) → {Quat}
scale(a, b, out) → {Quat}
set(x, y, z, w, out) → {Quat}
setAxes(view, right, up) → {Quat}
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.
Parameters:
Name | Type | Description |
---|---|---|
view |
Vec3 | the vector representing the viewing direction |
right |
Vec3 | the vector representing the local "right" direction |
up |
Vec3 | the vector representing the local "up" direction |
Returns:
out
- Type
- Quat
- Source:
setAxisAngle(axis, rad, out) → {Quat}
slerp(a, b, t, out) → {Quat}
sqlerp(a, b, c, d, t, out) → {Quat}
sqrLen()
Alias for quat.squaredLength
- Source:
squaredLength(a) → {Number}
Calculates the squared length of a quat
Parameters:
Name | Type | Description |
---|---|---|
a |
Quat | vector to calculate squared length of |
Returns:
squared length of a
- Type
- Number
- Source:
str(vec) → {String}
Returns a string representation of a quatenion
Parameters:
Name | Type | Description |
---|---|---|
vec |
Quat | vector to represent as a string |
Returns:
string representation of the vector
- Type
- String
- Source: