Module

GLMatrix.Mat4.Mix

Package
purescript-gl-matrix
Repository
dirkz/purescript-gl-matrix

#fromQuatSource

fromQuat :: Quat -> Mat4

Calculates a 4x4 matrix from the given quaternion

#fromVec4Source

fromVec4 :: Vec4 -> Vec4 -> Vec4 -> Vec4 -> Mat4

#fromRotationTranslationSource

fromRotationTranslation :: Quat -> Vec3 -> Mat4

Creates a matrix from a quaternion rotation and vector translation This is equivalent to (but much faster than): mat4.identity(dest); mat4.translate(dest, vec); let quatMat = mat4.create(); quat4.toMat4(quat, quatMat); mat4.multiply(dest, quatMat);

#fromRotationTranslationScaleSource

fromRotationTranslationScale :: Quat -> Vec3 -> Vec3 -> Mat4

Creates a matrix from a quaternion rotation, vector translation and vector scale This is equivalent to (but much faster than): mat4.identity(dest); mat4.translate(dest, vec); let quatMat = mat4.create(); quat4.toMat4(quat, quatMat); mat4.multiply(dest, quatMat); mat4.scale(dest, scale)

#fromRotationTranslationScaleOriginSource

fromRotationTranslationScaleOrigin :: Quat -> Vec3 -> Vec3 -> Vec3 -> Mat4

Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than): mat4.identity(dest); mat4.translate(dest, vec); mat4.translate(dest, origin); let quatMat = mat4.create(); quat4.toMat4(quat, quatMat); mat4.multiply(dest, quatMat); mat4.scale(dest, scale) mat4.translate(dest, negativeOrigin);

#getRotationSource

getRotation :: Mat4 -> Quat

Returns a quaternion representing the rotational component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned quaternion will be the same as the quaternion originally supplied.