/**
 *
 * @param {number[]} result
 * @param {number[]} input
 * @param {number[]} mat4
 */
export function v4_multiply_mat4(result, input, mat4) {
    const a0 = mat4[0];
    const a1 = mat4[1];
    const a2 = mat4[2];
    const a3 = mat4[3];

    const b0 = mat4[4];
    const b1 = mat4[5];
    const b2 = mat4[6];
    const b3 = mat4[7];

    const c0 = mat4[8];
    const c1 = mat4[9];
    const c2 = mat4[10];
    const c3 = mat4[11];

    const d0 = mat4[12];
    const d1 = mat4[13];
    const d2 = mat4[14];
    const d3 = mat4[15];

    const _x = input[0];
    const _y = input[1];
    const _z = input[2];
    const _w = input[3];

    const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
    const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
    const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
    const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;

    result[0] = x;
    result[1] = y;
    result[2] = z;
    result[3] = w;
}