Class enchant.gl.Quat
- Defined in: gl.enchant.js
Constructor Attributes | Constructor Name and Description |
---|---|
enchant.gl.Quat(x, y, z, rad)
Class that easily uses quaternions.
|
Method Summary
Method Attributes | Method Name and Description |
---|---|
multiplyVec3(vector)
Apply quarternion to vector.
|
|
slerp(another, ratio)
Performs spherical linear interpolation between quarternions.
|
|
slerpApply(another, ratio)
Performs spherical linear interpolation between quarternions.
|
|
toMat4(matrix)
Convert quarternion to rotation matrix.
|
Class Detail
enchant.gl.Quat(x, y, z, rad)
Class that easily uses quaternions.
- Parameters:
- {Number} x
- {Number} y
- {Number} z
- {Number} rad
Method Detail
-
{Number[]} multiplyVec3(vector)Apply quarternion to vector.
- Parameters:
- {Number[]} vector
- Returns:
- {Number[]}
-
{enchant.gl.Quat} slerp(another, ratio)Performs spherical linear interpolation between quarternions. Calculates quarternion that supplements rotation between this quarternion and another. Degree of rotation will be expressed in levels from 0 to 1. 0 is the side of this quarternion, 1 is the side of its counterpart. New instance will be returned.
- Parameters:
- {enchant.gl.Quat} another
- Quaternion
- {Number} ratio
- Returns:
- {enchant.gl.Quat}
-
{enchant.gl.Quat} slerpApply(another, ratio)Performs spherical linear interpolation between quarternions. Calculates quarternion that supplements rotation between this quarternion and another. Degree of rotation will be expressed in levels from 0 to 1. 0 is the side of this quarternion, 1 is the side of its counterpart. This side's value will be overwritten.
- Parameters:
- {enchant.gl.Quat} another
- Quaternion
- {Number} ratio
- Returns:
- {enchant.gl.Quat}
-
{Number[]} toMat4(matrix)Convert quarternion to rotation matrix.
- Parameters:
- {Number[]} matrix
- Returns:
- {Number[]}