import type { HelixSceneV2, SceneNode } from '@hypersoniclabs/helix-manifest'; import type { Box3 } from './glbBounds'; export declare const COLLIDER_CHILD_ID = "scene.city.building-colliders"; export interface BuildingColliderOptions { /** Metres around the player within which colliders are resident (the child's `streamRadiusM`). */ streamRadiusM: number; /** Buildings per spatial block (one collision set, one stream group). Raised when the city would need more than `maxSets`. */ buildingsPerBlock: number; maxSets: number; /** Models smaller than this (footprint m2, or height m) are props, not buildings, and are left non-solid. */ minFootprintM2: number; minHeightM: number; /** Collider sets the root may still take (see `inline`); the child Scene itself is capped by `maxSets`. */ inline?: boolean; adapters: HelixSceneV2['adapters']; title?: string; /** Skip instances whose resource id starts with one of these (e.g. trees) - rarely needed; models carry the filter in their bounds. */ skipResource?: (resourceId: string) => boolean; } export declare const DEFAULT_BUILDING_COLLIDER_OPTIONS: Readonly<{ streamRadiusM: 120; buildingsPerBlock: 60; maxSets: 240; /** Put the building collision sets in the root document instead of a mounted child Scene (a document near its memory cap cannot afford another mount). */ inline: false; minFootprintM2: 4; minHeightM: 2; }>; export interface PlannedBox { id: string; position: [number, number, number]; rotation: [number, number, number, number]; scale: [number, number, number]; /** World AABB of the oriented box. */ min: [number, number, number]; max: [number, number, number]; source: string; } export interface BoxPlanStats { instances: number; boxes: number; skippedSmall: number; skippedNoBounds: number; sets: number; maxPerSet: number; } /** The box of one placed model: the node's transform applied to the model's local AABB. */ export declare function boxOfNode(node: SceneNode, bounds: Box3, id: string): PlannedBox; /** The scene perf gate (P05) refuses a streamed cell wider than 1,024 m, so a block never spans more than one cell of this grid. */ export declare const BLOCK_CELL_M = 800; /** What a block's boxes (their whole extent, not their centres) may span. */ export declare const MAX_BLOCK_EXTENT_M = 1000; /** Buckets the boxes into a 1 km grid (so no block is wider than the gate allows, however sparse the land), then median-splits each bucket on its longer side until each block holds at most `perBlock`. */ export declare function splitBlocks(boxes: readonly PlannedBox[], perBlock: number): PlannedBox[][]; export declare function planBuildingBoxes(parts: ReadonlyArray<{ part: HelixSceneV2; bounds: ReadonlyMap; }>, options: Pick): { boxes: PlannedBox[]; stats: Pick; }; /** A block's merged GLB, addressed by the path it is written under (relative to the folder that holds the Scene document). */ export interface BlockFile { uri: string; bytes: Uint8Array; sha256: string; } export declare function buildColliderScene(boxes: readonly PlannedBox[], options: BuildingColliderOptions): { scene: HelixSceneV2; stats: BoxPlanStats; files: BlockFile[]; }; /** The sealing order every Scene v2 builder uses: revision = first 16 hex of the digest with revision and integrity zeroed. */ export declare function sealScene(scene: T): T; /** * Mounts the collider child in a root document: the mount definition, the node that places it in the root's eager city group * (so it is resident whenever the city is), and the group's declared memory. Returns a new, resealed root. */ export declare function mountColliderChild(root: HelixSceneV2, child: HelixSceneV2, budgetMiB?: number): HelixSceneV2; /** * The same collision sets, nodes and groups as `mountColliderChild`, but written into the root document itself: no mount, so no * 32 MiB mount commitment (a phone document sits within 20 MiB of its 192 MiB cap). The unit box rides in the root's own folder. * Throws when the root's collision sets plus the child's would pass the 256-set document cap. */ export declare function inlineColliderChild(root: HelixSceneV2, child: HelixSceneV2): HelixSceneV2;