Your browser does not support HTML5 canvas. Fork me on GitHub

Available Packages:

Quaternion

Source

quat IDENTITYQ

Source

quat ZEROQ

Source

function quat.assertEquals(quat expected)

Source

function quat.conj() returns quat

Source

Represents the same rotation in opposite direction.

function quat.cross(quat q) returns quat

Source

Represents the composition of two rotations.

function quat.dot(quat q) returns real

Source

function eulerToQuat(real yaw, real pitch, real roll) returns quat

Source

function quat.exp(real alpha) returns quat

Source

Quaternion to power of alpha.

function quat.getGimbalPole() returns int

Source

Gimbal lock detection. Returns 1 for north, -1 for south, 0 if no gimbal lock.

function quat.getX() returns vec3

Source

Extracts X-axis from a quaternion that represents rotation.

function quat.getY() returns vec3

Source

Extracts Y-axis as a vector from a quaternion that represents rotation.

function quat.getZ() returns vec3

Source

Extracts Z-axis as a vector from a quaternion that represents rotation.

function quat.length() returns real

Source

function quat.lerp(quat q, real p) returns quat

Source

Linear interpolation. q - targeted quaternion. p - progress from 0 to 1.

function quat.lerpLong(quat q, real p) returns quat

Source

Linear interpolation. Always chooses the LONGEST way between rotations. q - targeted quaternion. p - progress from 0 to 1.

function quat.lerpShort(quat q, real p) returns quat

Source

Linear interpolation. Always chooses the SHORTEST way between rotations. q - targeted quaternion. p - progress from 0 to 1.

function quat.nlerp(quat q, real p) returns quat

Source

Normalized linear interpolation. q - targeted quaternion. p - progress from 0 to 1.

function quat.nlerpLong(quat q, real p) returns quat

Source

Normalized linear interpolation. Always chooses the LONGEST way between rotations. q - targeted quaternion. p - progress from 0 to 1.

function quat.nlerpShort(quat q, real p) returns quat

Source

Normalized linear interpolation. Always chooses the SHORTEST way between rotations. q - targeted quaternion. p - progress from 0 to 1.

function quat.norm() returns quat

Source

Returns zero quaternion if lenght is zero.

function quat.op_minus(quat q) returns quat

Source

function quat.op_minus(real scalar) returns quat

Source

function quat.op_mult(real scalar) returns quat

Source

function real.op_mult(quat q) returns quat

Source

function quat.op_plus(quat q) returns quat

Source

function quat.op_plus(real scalar) returns quat

Source

function real.op_plus(quat q) returns quat

Source

function quat(real x, real y, real z, real w) returns quat

Source

function vec3.rotate(quat q) returns vec3

Source

Rotates a vector by a quaternion.

function quat.slerp(quat q, real p) returns quat

Source

Spherical linear interpolation. Interpolates between two rotations. q - targeted quaternion. p - progress from 0 to 1. Slerp is the least efficient approach in performance so try to avoid using it, unless you need constant angular velocity. Nlerp is better solution in most cases.

function quat.slerpLong(quat q, real p) returns quat

Source

Spherical linear interpolation. Interpolates between two rotations. Always chooses the LONGEST way between rotations. q - targeted quaternion. p - progress from 0 to 1. Slerp is the least efficient approach in performance so try to avoid using it, unless you need constant angular velocity. Nlerp is better solution in most cases.

function quat.slerpShort(quat q, real p) returns quat

Source

Spherical linear interpolation. Interpolates between two rotations. Always chooses the SHORTEST way between rotations. q - targeted quaternion. p - progress from 0 to 1. Slerp is the least efficient approach in performance so try to avoid using it, unless you need constant angular velocity. Nlerp is better solution in most cases.

function quat.toEuler() returns vec3

Source

Extracts Euler-angles (Tait-Bryan) in radians from a quaternion. Order of the result is Z-Y-X (Yaw-Pitch-Roll).

function quat.toMatrix() returns mat3

Source

function vec3.toQuat(angle angl) returns quat

Source

Creates a quaternion from rotation axis and angle.

function angle.toQuat(vec3 axis) returns quat

Source

Creates a quaternion from rotation axis and angle.

function mat3.toQuat() returns quat

Source

Extracts quaternion from a rotation matrix.

function quat.toString() returns string

Source