Quat
quat
If you’re feeling brave, watch this.
module quat
Creates a quaternion from an angle and axis.
fromAngleAxis(
angle: float,axis: float3
) -> float4
Rotates a vector by a quaternion and returns the rotated vector.
rotate(
quaternion: float4,vector: float3
) -> float3
Returns the conjugate of the input quaternion.
The conjugate of a quaternion number is a quaternion with the same magnitudes but with the sign of the imaginary parts changed
conjugate(
quaternion: float4
) -> float4
Returns the inverse of the input quaternion.
inverse(
quaternion: float4
) -> float4
Generates a quaternion that rotates from one direction to another via the shortest path.
fromToRotation(
from: float3,to: float3
) -> float4
diff(
a: float4,b: float4
) -> float4
Generates lookAt quaternion.
lookAt(
forward: float3,up: float3
) -> float4
Smooth interpolation between two quaternions.
slerp(
a: float4,b: float4,t: float
) -> float4
Converts quaternion to matrix.
toMatrix(
quaternion: float4
) -> float4x4
fromEulerAngles(
angles: float3
) -> float4
clone(
) -> quat