import { array_copy } from "../../../collection/array/array_copy.js";
import { M4_IDENTITY } from "./M4_IDENTITY.js";

/**
 * Create a 4x4 matrix that corresponds to translation transform
 * @param {ArrayLike<number>} output
 * @param {ArrayLike<number>} translation 3d vector
 * @returns {ArrayLike<number>} output parameter
 */
export function m4_make_translation(output, translation) {
    array_copy(M4_IDENTITY, 0, output, 0, 16);

    output[12] = translation[0];
    output[13] = translation[1];
    output[14] = translation[2];

    return output;
}
