import { v3_array_displace_in_direction } from "../../vec3/v3_array_displace_in_direction.js";

/**
 *
 * @param {number[]|ArrayLike<number>|Float32Array} output 6 component vector, [origin_x, origin_y, origin_z, direction_x, direction_y, direction_z]
 * @param {number} output_offset
 * @param {number[]|ArrayLike<number>|Float32Array} input 6 component vector, [origin_x, origin_y, origin_z, direction_x, direction_y, direction_z]
 * @param {number} input_offset
 * @param {number} distance
 */
export function ray3_shift_origin_along_direction(
    output, output_offset,
    input, input_offset,
    distance
) {
    const origin_x = input[input_offset + 0];
    const origin_y = input[input_offset + 1];
    const origin_z = input[input_offset + 2];

    const direction_x = input[input_offset + 3];
    const direction_y = input[input_offset + 4];
    const direction_z = input[input_offset + 5];

    v3_array_displace_in_direction(
        output, 0,
        origin_x, origin_y, origin_z,
        direction_x, direction_y, direction_z,
        distance
    );

    output[output_offset + 3] = direction_x;
    output[output_offset + 4] = direction_y;
    output[output_offset + 5] = direction_z;
}

