import { BVHQuery } from "./BVHQuery.js";

export class BVHQueryAnd extends BVHQuery {
    /**
     * @type {BVHQuery}
     */
    #left;
    /**
     * @type {BVHQuery}
     */
    #right;

    /**
     *
     * @param {BVHQuery} left
     * @param {BVHQuery} right
     */
    constructor(left, right) {
        super();

        this.#left = left;
        this.#right = right;
    }

    evaluate(node, tree) {
        return this.#left.evaluate(node, tree)
            && this.#right.evaluate(node, tree);
    }
}