@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
22 lines (15 loc) • 619 B
JavaScript
import { AABB3 } from "../../../geom/3d/aabb/AABB3.js";
import { aabb3_intersects_aabb3 } from "../../../geom/3d/aabb/aabb3_intersects_aabb3.js";
import { BVHQuery } from "./BVHQuery.js";
const scratch_aabb = new Float32Array(6);
export class BVHQueryIntersectsAABB extends BVHQuery {
region = new AABB3();
evaluate(node, tree) {
tree.node_get_aabb(node, scratch_aabb);
return aabb3_intersects_aabb3(
this.region.x0, this.region.y0, this.region.z0,
this.region.x1, this.region.y1, this.region.z1,
...scratch_aabb
);
}
}