kick.math.Quat Class
Quat - Quaternions
Item Index
Methods
- add static
- calculateW static
- clone static
- conjugate static
- copy static
- create static
- difference static
- dot static
- fromMat3 static
- fromValues static
- identity static
- inverse static
- length static
- lerp static
- lookAt static
- multiply static
- multiplyVec3 static
- normalize static
- rotateX static
- rotateY static
- rotateZ static
- scale static
- set static
- setAxisAngle static
- setEuler static
- setFromRotationMatrix static
- slerp static
- squaredLength static
- str static
- toEuler static
- toMat3 static
- toMat4 static
Methods
add
-
out
-
a
-
b
Adds two quat's
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatthe first operand
-
b
kick.math.Quatthe second operand
Returns:
out
calculateW
-
out
-
a
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:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatquat to calculate W component of
Returns:
out
clone
-
a
Creates a new quat initialized with values from an existing quaternion
Parameters:
-
a
kick.math.Quatquaternion to clone
Returns:
a new quaternion
conjugate
-
out
-
a
Calculates the conjugate of a quat
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatquat to calculate conjugate of
Returns:
out
copy
-
out
-
a
Copy the values from one quat to another
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatthe source quaternion
Returns:
out
difference
-
out
-
quat
-
quat2
Return rotation that goes from quat to quat2.
It is the same as: quat.multiply(dest, quat.invert(quat,quat),quat2);
Parameters:
-
out
kick.math.Quat -
quat
kick.math.Quatfrom rotation
-
quat2
kick.math.Quatto rotation
Returns:
out
dot
-
q1
-
q2
Returns dot product of q1 and q1
Parameters:
-
q1
kick.math.Quat -
q2
kick.math.Quat
Returns:
fromMat3
-
out
-
m
Creates a quaternion from the given 3x3 rotation matrix.
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
m
kick.math.Mat3rotation matrix
Returns:
out
fromValues
-
x
-
y
-
z
-
w
Creates a new quat initialized with the given values
Parameters:
-
x
NumberX component
-
y
NumberY component
-
z
NumberZ component
-
w
NumberW component
Returns:
a new quaternion
identity
-
out
Set a quat to the identity quaternion (0,0,0,1)
Parameters:
-
out
kick.math.Quatquat to set the identity to
Returns:
out
inverse
-
out
-
a
Calculates the inverse of a quat
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatquat to calculate inverse of
Returns:
out
length
-
a
Calculates the length of a quat
Parameters:
-
a
kick.math.Quatvector to calculate length of
Returns:
length of a
lerp
-
out
-
a
-
b
-
t
Performs a linear interpolation between two quat's
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatthe first operand
-
b
kick.math.Quatthe second operand
-
t
Numberinterpolation amount between the two inputs
Returns:
out
lookAt
-
out
-
position
-
target
-
up
Compute the lookAt rotation
Parameters:
-
out
kick.math.Quat -
position
kick.math.Vec3 -
target
kick.math.Vec3 -
up
kick.math.Vec3
Returns:
out
multiply
-
out
-
a
-
b
Multiplies two quat's
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatthe first operand
-
b
kick.math.Quatthe second operand
Returns:
out
multiplyVec3
-
out
-
quat
-
vec
Transforms a vec3 with the given quaternion
Parameters:
-
out
kick.math.Vec3vec3 receiving operation result
-
quat
kick.math.Quatquat to transform the vector with
-
vec
kick.math.Vec3vec3 to transform
Returns:
out
normalize
-
out
-
a
Normalize a quat
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatquaternion to normalize
Returns:
out
rotateX
-
out
-
a
-
rad
Rotates a quaternion by the given angle around the X axis
Parameters:
-
out
kick.math.Quatquat receiving operation result
-
a
kick.math.Quatquat to rotate
-
rad
Numberangle (in radians) to rotate
Returns:
out
rotateY
-
out
-
a
-
rad
Rotates a quaternion by the given angle around the Y axis
Parameters:
-
out
kick.math.Quatquat receiving operation result
-
a
kick.math.Quatquat to rotate
-
rad
Numberangle (in radians) to rotate
Returns:
out
rotateZ
-
out
-
a
-
rad
Rotates a quaternion by the given angle around the Z axis
Parameters:
-
out
kick.math.Quatquat receiving operation result
-
a
kick.math.Quatquat to rotate
-
rad
Numberangle (in radians) to rotate
Returns:
out
scale
-
out
-
a
-
b
Scales a quat by a scalar number
Parameters:
-
out
kick.math.Quatthe receiving vector
-
a
kick.math.Quatthe vector to scale
-
b
Numberamount to scale the vector by
Returns:
out
set
-
out
-
x
-
y
-
z
-
w
Set the components of a quat to the given values
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
x
NumberX component
-
y
NumberY component
-
z
NumberZ component
-
w
NumberW component
Returns:
out
setAxisAngle
-
out
-
axis
-
rad
Sets a quat from the given angle and rotation axis, then returns it.
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
axis
kick.math.Vec3the axis around which to rotate
-
rad
Numberthe angle in radians
Returns:
out
setEuler
-
out
-
vec
Set the rotation based on Eulers angles. Pitch->X axis, Yaw->Y axis, Roll->Z axis
Parameters:
-
out
kick.math.Quatquat receiving operation result
-
vec
kick.math.Vec3vec3 eulers angles (degrees)
Returns:
dest if specified, a new quat otherwise
setFromRotationMatrix
-
out
-
mat
Parameters:
-
out
kick.math.Quat -
mat
kick.math.Mat4
Returns:
slerp
-
out
-
a
-
b
-
t
Performs a spherical linear interpolation between two quat
Parameters:
-
out
kick.math.Quatthe receiving quaternion
-
a
kick.math.Quatthe first operand
-
b
kick.math.Quatthe second operand
-
t
Numberinterpolation amount between the two inputs
Returns:
out
squaredLength
-
a
Calculates the squared length of a quat
Parameters:
-
a
kick.math.Quatvector to calculate squared length of
Returns:
squared length of a
str
-
quat
Returns a string representation of a quaternion
Parameters:
-
quat
kick.math.Quatquat to represent as a string
Returns:
string representation of quat
toEuler
-
out
-
quat
Calculates a rotation represented in Eulers angles (in degrees) Pitch->X axis, Yaw->Y axis, Roll->Z axis
Parameters:
-
out
kick.math.Vec3vec3 receiving operation result
-
quat
kick.math.Quatquat to create matrix from
Returns:
out
toMat3
-
out
-
quat
Calculates a 3x3 matrix from the given quat
Parameters:
-
out
kick.math.Mat3mat3 receiving operation result
-
quat
kick.math.Quatquat to create matrix from
Returns:
out
toMat4
-
out
-
quat
Calculates a 4x4 matrix from the given quat
Parameters:
-
out
kick.math.Mat4mat4 receiving operation result
-
quat
kick.math.Quatquat to create matrix from
Returns:
out