Sha256: f6aa6b17b5a11d710753165b40be232c31c4e92bb4a1d00b025dd50c09aec790
Contents?: true
Size: 733 Bytes
Versions: 13
Compression:
Stored size: 733 Bytes
Contents
/** * mat3.multiplyVec3(matrix, vec[, dest]) -> vec3 * - matrix (mat3): the 3x3 matrix to multiply against * - vec (vec3): the vector to multiply * - dest (vec3): an optional receiving vector. If not given, vec is used. * * Transforms the vec3 according to this rotation matrix. Returns +dest+. * * (Note: this is a Jax-specific extension. It does not appear by default * in the glMatrix library.) **/ mat3.multiplyVec3 = function(matrix, vec, dest) { if (!dest) dest = vec; dest[0] = vec[0] * matrix[0] + vec[1] * matrix[3] + vec[2] * matrix[6]; dest[1] = vec[0] * matrix[1] + vec[1] * matrix[4] + vec[2] * matrix[7]; dest[2] = vec[0] * matrix[2] + vec[1] * matrix[5] + vec[2] * matrix[8]; return dest; };
Version data entries
13 entries across 13 versions & 1 rubygems