import type { Box3Like } from './box3'; import type { Mat4Like, Vec3Like } from './types'; /** * Frustum storage: Float32Array(24) — 6 planes × 4 floats each (nx, ny, nz, d). * Local brand (not part of the seven-piece SSOT; same rationale as Box3). */ export type Frustum = Float32Array & { readonly __frustum: void; }; /** Allocate a new Frustum (zero-initialized 6 planes). */ export declare function create(): Frustum; /** * Extract 6 frustum planes (left, right, bottom, top, lower-Z, upper-Z) from a * combined WebGPU [0,1] view-projection matrix (column-major, right-handed). * * Uses Gribb/Hartmann method: each plane = sum or difference of VP rows, * then normalized so (nx, ny, nz) is a unit vector and d is the signed * distance from origin. Plane inside-half-space is nx*x + ny*y + nz*z + d > 0. * * Writes to `out` and returns it. * * @example * ```ts * const view = mat4.lookAt(mat4.create(), [0, 0, 5], [0, 0, 0], [0, 1, 0]); * const proj = mat4.perspective(mat4.create(), Math.PI / 2, 1, 0.1, 100); * const vp = mat4.create(); * mat4.multiply(vp, proj, view); * const f = frustum.fromViewProjection(frustum.create(), vp); * ``` */ export declare function fromViewProjection(out: Frustum, vp: Mat4Like): Frustum; /** * Test whether an AABB intersects the frustum. Conservative: returns `true` when * the box straddles a plane boundary, even if partially outside. * * For each plane, the signed distance of both the positive-most corner (p-vertex) * and negative-most corner (n-vertex) are tested. The box is outside only when * the p-vertex is on the negative side of any plane. */ export declare function intersectsBox(f: Frustum, box: Box3Like): boolean; /** * Test whether a sphere intersects the frustum. Conservative: returns `true` * when the sphere straddles a plane boundary. * * Computes signed distance from the sphere center to each plane; * outside when distance < -radius. */ export declare function intersectsSphere(f: Frustum, center: Vec3Like, radius: number): boolean; //# sourceMappingURL=frustum.d.ts.map