import { Box3, Ray } from "../math/index.js";
export class Raycaster {
    intersectBounds(ray, targets) {
        return targets
            .map((target) => ({ target, distance: ray.intersectBox(target.bounds)?.distanceTo(ray.origin) ?? Number.POSITIVE_INFINITY }))
            .filter((hit) => Number.isFinite(hit.distance))
            .sort((left, right) => left.distance - right.distance);
    }
}
//# sourceMappingURL=Raycaster.js.map