import { aabb3_compute_from_triangle } from "../../../../../core/geom/3d/triangle/aabb3_compute_from_triangle.js";

/**
 *
 * @param {BinaryUint32BVH} bvh
 * @param {number} triangle_index
 * @param {number[]|Float32Array} vertices
 * @param {number} a_index
 * @param {number} b_index
 * @param {number} c_index
 */
export function bvh32_set_leaf_from_triangle(bvh, triangle_index, vertices, a_index, b_index, c_index) {

    const address = bvh.getLeafAddress(triangle_index);
    aabb3_compute_from_triangle(bvh.__data_float32, address, vertices, a_index, b_index, c_index);
    bvh.__data_uint32[address + 6] = triangle_index;

}

