/** * Small, dependency-free 4x4 maths for the scene splitter. Column-major, the * layout glTF and three.js share, in float64 so a long chain of parent * transforms does not drift before the final float32 cast. */ export type Vec3 = [number, number, number]; export type Quat = [number, number, number, number]; export type Mat4 = number[]; export type Bounds = { min: Vec3; max: Vec3; }; export declare const IDENTITY: Mat4; export declare function multiply(a: Mat4, b: Mat4): Mat4; export declare function fromTrs(t: Vec3, q: Quat, s: Vec3): Mat4; /** Determinant of the upper-left 3x3, whose sign says whether the transform mirrors. */ export declare function determinant3(m: Mat4): number; /** * TRS decomposition. Throws on shear: a node cannot carry it, and baking it * silently into a node would change what the world looks like. */ export declare function decompose(m: Mat4, label: string): { t: Vec3; q: Quat; s: Vec3; }; export declare function transformPoint(m: Mat4, p: readonly number[]): Vec3; /** Direction transform by the inverse transpose of the 3x3, so normals survive non-uniform scale. */ export declare function normalMatrix(m: Mat4): number[]; export declare function applyLinear(n: readonly number[], v: readonly number[]): Vec3; export declare function emptyBounds(): Bounds; export declare function expandBounds(bounds: Bounds, p: readonly number[]): void; export declare function unionBounds(a: Bounds, b: Bounds): Bounds; export declare function boundsValid(bounds: Bounds): boolean; /** World AABB of a local AABB pushed through a transform (corner-transformed, re-tightened). */ export declare function transformBounds(m: Mat4, local: Bounds): Bounds; /** Horizontal (XZ) distance from a point to a box, zero inside. */ export declare function distanceXzToBounds(point: readonly number[], bounds: Bounds): number; /** 3D distance from a point to a box, zero inside. */ export declare function distanceToBounds(point: readonly number[], bounds: Bounds): number; /** Round to a fixed number of decimals so emitted bounds are stable text, not float noise. */ export declare function roundTo(value: number, decimals?: number): number; /** * Bounds as the Scene document writes them: rounded, and never flat. The * validator requires min < max on every axis, and a cell holding only a floor * (or only a wall) is exactly flat on one, so a flat axis is widened to 2 cm. */ export declare function sceneBounds(bounds: Bounds, decimals?: number): Bounds;