import type { Mat4Like, Vec3Like } from './types'; /** * Box3 storage: Float32Array length 6 [minX, minY, minZ, maxX, maxY, maxZ]. * Local brand (not part of the seven-piece SSOT because bounding volumes are * neither linear-algebra primitives nor ECS POD carriers; types.ts SSOT is * reserved for vec/mat/quat/color). */ export type Box3 = Float32Array & { readonly __box3: void; }; /** * Box3 readable input: ArrayLike of length 6 (ordering identical to Box3). */ export type Box3Like = ArrayLike; /** * Create a Box3. Defaults to the "empty" box (min=+Inf, max=-Inf) so the first * `expandByPoint` call collapses to a zero-volume box at the input point. */ export declare function create(minX?: number, minY?: number, minZ?: number, maxX?: number, maxY?: number, maxZ?: number): Box3; /** * out ∪= point: grow min / max so `point` lies inside (boundary inclusive). Returns out. * Works correctly from the default empty box (inverted-infinity) — the first call * collapses both min and max to `point`. */ export declare function expandByPoint(out: Box3, point: Vec3Like): Box3; /** * True when `point` is inside `box` (boundary inclusive). An empty box * (min > max on any axis) contains no points. */ export declare function containsPoint(box: Box3Like, point: Vec3Like): boolean; /** * True when `a` and `b` overlap on every axis (boundary inclusive — touching * faces intersect). Two empty boxes do not intersect. */ export declare function intersectsBox(a: Box3Like, b: Box3Like): boolean; /** * Build the tightest AABB enclosing `points`. Writes to `out` in place and * returns it. Empty `points` leaves `out` as the inverted-infinity empty box. */ export declare function fromPoints(out: Box3, points: readonly Vec3Like[]): Box3; /** * Build the tightest AABB enclosing flattened xyz `positions` (tight-packed, * 3 floats per vertex). Writes to `out` in place and returns it. * * `positions` must have at least 3 elements to produce a non-empty box. * Fewer than 3 elements leaves `out` as the inverted-infinity empty box * (identical to `create()` default). * * Trailing elements beyond the last complete triplet are read verbatim * (undefined → NaN), matching the legacy `aabbFromPositions` behaviour * this function replaces. * * Related: `fromPoints` for `Vec3Like[]` input. */ export declare function fromPositions(out: Box3, positions: ArrayLike): Box3; /** * Transform an AABB by a 4x4 matrix using the conservative 8-corner method. * * Each of the 8 corners (all min/max combinations) is transformed by `m` as a * homogeneous point (w=1), then a new AABB is computed that tightly encloses * all 8 transformed points. This is always conservative — the output AABB is * guaranteed to contain the true transformed volume (no false culling). * * Returns `out`. Aliasing-safe: `box` and `out` may be the same reference. * * @example * ```ts * import { box3, mat4 } from '@forgeax/engine-math'; * const box = box3.create(-1, -1, -1, 1, 1, 1); * const xform = mat4.create(); * mat4.fromTranslation(xform, [5, 0, 0]); * box3.transformBox3(box, box, xform); * ``` */ export declare function transformBox3(out: Box3, box: Box3Like, m: Mat4Like): Box3; //# sourceMappingURL=box3.d.ts.map