UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

31 lines (26 loc) 687 B
/** * Create a 4x4 matrix that corresponds to scaling transform * * @param {ArrayLike<number>} output 4x4 matrix output will be written here * @param {ArrayLike<number>} scale 3d vector * @returns {ArrayLike<number>} `output` parameter returned for convenience */ export function m4_make_scale(output, scale) { output[0] = scale[0] output[1] = 0 output[2] = 0 output[3] = 0 output[4] = 0 output[5] = scale[1] output[6] = 0 output[7] = 0 output[8] = 0 output[9] = 0 output[10] = scale[2] output[11] = 0 output[12] = 0 output[13] = 0 output[14] = 0 output[15] = 1 return output; }