import { overlap1D } from "../../../math/interval/overlap1D.js";

/**
 *
 * @param {number} ax0
 * @param {number} ay0
 * @param {number} ax1
 * @param {number} ay1
 * @param {number} bx0
 * @param {number} by0
 * @param {number} bx1
 * @param {number} by1
 * @returns {boolean} true if overlap exists, false if no overlap
 */
export function aabb2_overlap_exists(
    ax0, ay0, ax1, ay1,
    bx0, by0, bx1, by1
) {
    return overlap1D(ax0, ax1, bx0, bx1)
        && overlap1D(ay0, ay1, by0, by1);
}
