import { type HelixSceneV2 } from '@hypersoniclabs/helix-manifest'; import type { Cs2PhoneSignLayer } from './streetFurniture'; export declare const FURNITURE_CHILD_ID = "scene.city.street-furniture"; export declare const FURNITURE_MOUNT_ID = "mount.city.street-furniture"; /** * The child's stream radius, metres: a 4 m lamp is 10 px tall at 150 m on a phone, and a sign plate is a few pixels. With 512 m * cells a camera admits at most four (the corner of four cells), usually one or two. */ export declare const FURNITURE_STREAM_RADIUS_M = 160; export interface FurnitureCellFile { id: string; glb: Uint8Array; bounds: { min: [number, number, number]; max: [number, number, number]; }; } /** A texture every cell may sample (the sign atlas), named by the cells by its bare file name and kept beside them in `furniture/`. */ export interface FurnitureTextureFile { name: string; bytes: Uint8Array; } /** GPU memory of a KTX2 the engine transcodes to a block format (one byte a texel) with its mips, MiB. */ export declare function furnitureTextureMiB(width: number, height: number): number; /** Decoded memory of one cell (the GLB plus its accessors twice, as the scene compose bills a model), MiB. */ export declare function furnitureCellMiB(glb: Uint8Array): number; /** * The mount's memory commitment: the heaviest 2 x 2 block of cells (what a camera at a corner of four cells holds), rounded up. * Cells are keyed by their grid ids (`harbourCellId`: `e3.s5`), so neighbours are found from the cell's own bounds. */ export declare function furnitureBudgetMiB(cells: ReadonlyArray<{ bounds: FurnitureCellFile['bounds']; miB: number; }>, cellM: number): number; /** Pure: the child Scene of the street-furniture cells (unsealed), with the files it names relative to its own folder. */ export declare function buildFurnitureScene(cells: readonly FurnitureCellFile[], adapters: HelixSceneV2['adapters'], budgetMiB: number, textures?: ReadonlyArray): { scene: HelixSceneV2; files: Array<{ uri: string; bytes: Uint8Array; }>; }; /** * Mounts the child in a root: the mount, the node that places it in the root's group that already places mounts (the building * parts', resident whenever the city is; else `stream.root`), and that group's declared memory. Returns a new, resealed root. */ export declare function mountFurnitureChild(root: HelixSceneV2, child: HelixSceneV2, budgetMiB: number): HelixSceneV2; /** * The publish step: reads `/objects.json`, mounts the child in each named root that `admit` lets carry it (rewriting the * root and its `pin.json`), and writes the child Scene and its GLBs under `//` when any root took it. * Null when the capture has no street furniture. A mount commits at least 32 MiB (the Scene v2 floor) whatever the cells need, so * a tier already near its memory cap near the roads (Pacifica's phone: 21.4 MiB of headroom at its worst road cell) is refused * rather than pushed over. Such a root gets the phone's sign subset inline instead (`inlinePhoneSigns`) when the layer has one and * `admit` lets that through; otherwise it keeps what it drew before. */ export declare function applyStreetFurniture(objectsDir: string, sceneDir: string, roots: readonly string[], /** Refuses a root whose memory cannot carry the mount (a reason) or admits it (null). The root then stays as it was. */ admit?: (name: string, mounted: HelixSceneV2) => string | null): { childSha256: string; cells: number; triangles: number; bytes: number; budgetMiB: number; mounted: string[]; refused: Array<{ root: string; reason: string; }>; phoneSigns: Array<{ root: string; placed: number; hosts: number; addedMiB: number; dropped: string[]; triangles: number; }>; phoneRefused: Array<{ root: string; reason: string; }>; } | null; /** Where a tier's ground tiles stream: the root's distance groups the phone signs ride in (`inlinePhoneSigns`). */ export declare const PHONE_SIGN_HOST_PREFIX = "stream.terrain."; /** * Pure: `root` with the phone's sign subset (`Cs2PhoneSignLayer`) drawn inline, for a tier that cannot carry the layer's mount (a mount * commits at least the Scene v2 floor of 32 MiB, and Pacifica's phone has 8.4 MiB to spare at its worst point). Each 1,024 m sign * cell becomes one node in the root's ground-tile group whose cell holds the sign cell's centre, so the root gains no stream group and * the signs stream with the ground under them (the phone's 300 m radius). The group bills the cell's decoded memory plus the textures * it samples (a shared texture loads with whichever cell comes first, so every carrying group bills it), rounded up. A sign cell with no * ground tile under it is dropped. Files are relative to the root's folder; the result is unsealed. */ export declare function inlinePhoneSigns(root: HelixSceneV2, phone: Cs2PhoneSignLayer, cells: ReadonlyArray<{ id: string; glb: Uint8Array; }>, textures: readonly FurnitureTextureFile[]): { root: HelixSceneV2; files: Array<{ uri: string; bytes: Uint8Array; }>; placed: number; dropped: string[]; addedMiB: number; hosts: number; };