import type { Cs2Placements } from './placements'; import type { Cs2MeshDirectory } from './csm2'; import type { Cs2MaterialBundle } from './materials'; import { type HarbourPrototype } from './harbour'; export declare const CS2_STREET_FURNITURE_SCHEMA: "helix.cs2-street-furniture/1"; export type FurnitureKind = 'street_lamp' | 'traffic_light' | 'road_sign' | 'bench' | 'bin' | 'hydrant' | 'bollard' | 'mailbox' | 'bike_rack' | 'transit_stop' | 'utility_box' | 'power_pole' | 'road_arrow' | 'road_text'; /** * What the layer takes, by model name (`basePrefab`). Street furniture a pedestrian walks past; not people, vehicles, lot lights on * walls and roofs, rooftop plant, planters and bushes (their leaves are alpha-tested cards a vertex colour cannot draw) or decals. */ export declare const FURNITURE_PREFAB: ReadonlyArray; /** * Kinds drawn with their own faces from the layer's sign atlas (`signFaces.ts`), not per-vertex colour: a sign is read by its face. */ export declare const FURNITURE_TEXTURED_KINDS: ReadonlySet; /** Kinds drawn from a decal's opacity as flat paint on the road, not from a mesh (`buildDecalPrototype`). */ export declare const FURNITURE_DECAL_KINDS: ReadonlySet; export declare function furnitureKind(prefab: string): FurnitureKind | null; /** Simplifier error per kind, metres: a pole keeps its round section and its arm, a sign its plate, a bench its slats as a slab. */ export declare const FURNITURE_ERROR_M: Readonly>; /** * Paint is lifted this far over the decal's origin (the game puts a road decal's origin on the carriageway it paints, and the road bake * is the game's own surface): clear of the asphalt's depth at a street's distances, too thin to see from the side. */ export declare const DECAL_LIFT_M = 0.03; /** Cells across a decal's long side when its opacity is traced (an arrow 5 m long keeps 8 cm steps). */ export declare const DECAL_GRID = 64; /** * Triangles per prototype, by kind, after the error pass: the simplifier goes on towards this many while its error stays within * `FURNITURE_MAX_ERROR_M`. A lamp keeps its pole, arm and head; a bin or a mailbox is a box with a lid; a bollard a post. */ export declare const FURNITURE_TRIANGLE_CAP: Readonly>; /** The furthest the triangle cap may move a surface, metres. */ export declare const FURNITURE_MAX_ERROR_M = 0.1; /** * Instances are merged per square of this size, by origin. Each square is one cell of the layer's own child Scene * (`streetFurnitureScene.ts`), streamed within `FURNITURE_STREAM_RADIUS_M`: a camera holds at most four. */ export declare const FURNITURE_CELL_M = 512; /** * Triangles one cell may hold: a quarter of what four resident cells may add to a phone frame. A denser cell sheds kinds in * `FURNITURE_SHED_ORDER` until it fits. */ export declare const FURNITURE_MAX_TRIANGLES = 120000; /** * What a dense cell sheds first, least seen first: a bike rack or a utility box is knee-high clutter, a bin or a bench a pedestrian's * detail. Lamps, signals, signs, stops and road paint are what a street reads by from a car, so they are never shed. */ /** The scene contract's own cell cap (P05): a cell whose never-shed kinds alone pass it fails the stage. */ export declare const FURNITURE_HARD_TRIANGLES = 300000; export declare const FURNITURE_SHED_ORDER: readonly FurnitureKind[]; /** Box-filter edge for colour sampling: a vertex reads its part's colour (a sign's plate, a lamp's head), not the lettering. */ export declare const FURNITURE_TEXEL_EDGE = 64; export interface FurnitureInstance { prefab: string; kind: FurnitureKind; /** Scene frame: x, y above the sea, z. */ position: [number, number, number]; quaternion: [number, number, number, number]; } /** Pure: the furniture of a capture, from its props and attached objects, exact repeats dropped. */ export declare function selectFurniture(placements: Cs2Placements, seaLevelMetres: number, hasMesh: (prefab: string) => boolean): { instances: FurnitureInstance[]; noMesh: Record; duplicates: number; }; /** * Pure: the road nodes the game controls already (the root owner of an attached traffic light, yield or stop sign) and the poles * standing in the street (lamps, signals, signs, hydrants, bollards, utility boxes), scene frame before the sea shift. The rule signs * (`roadSigns.ts`) skip the first and keep clear of the second. */ export declare function signControls(placements: Cs2Placements): { controlledNodes: Set; poles: Array<[number, number, number]>; }; /** Pure: rule signs (`roadSigns.ts`) as furniture instances (sea-shifted), dropping any whose prefab has no mesh in the capture. */ export declare function ruleSignInstances(signs: ReadonlyArray<{ prefab: string; position: readonly number[]; quaternion: readonly number[]; }>, seaLevelMetres: number, hasMesh: (prefab: string) => boolean): FurnitureInstance[]; export declare function furnitureCells(instances: readonly FurnitureInstance[], cellM?: number): Map; export interface Cs2FurnitureGroup { id: string; /** Relative to the objects folder. */ file: string; bounds: { min: [number, number, number]; max: [number, number, number]; }; triangles: number; instances: number; /** Kinds this cell left out to stay within `FURNITURE_MAX_TRIANGLES`, in shed order. */ shed?: FurnitureKind[]; } export interface Cs2FurnitureLayer { schema: typeof CS2_STREET_FURNITURE_SCHEMA; /** The square each group was cut on (its id is `harbourCellId` of that grid). */ cellM: number; groups: Cs2FurnitureGroup[]; prefabs: Array<{ prefab: string; kind: FurnitureKind; instances: number; trianglesBefore: number; triangles: number; }>; byKind: Partial>; /** Instances left out by kind, over every dense cell. */ shed: Partial>; /** * The textures the cells sample (relative to the objects folder): the sign atlas (absent when no sign is textured) and the exit * gantries' atlas. `size` in texels; absent means `SIGN_ATLAS_SIZE`. */ textures?: Array<{ file: string; sha256: string; bytes: number; size?: [number, number]; }>; /** Prefabs drawn with their own faces from the atlas. */ signFaces?: string[]; /** The phone's subset (`buildPhoneSigns`): the traffic signs alone, for a tier that cannot carry the layer's mount. */ phone?: Cs2PhoneSignLayer; } /** * The signs a phone keeps when it cannot carry the whole layer, by model name: the ones a driver reads (stop, yield, speed limits, * the motorway's own and its wrong-way sign). Street names, parking, turn bans and every non-sign kind are a desktop's. */ export declare const PHONE_SIGN_PREFAB: RegExp; /** * The phone's sign cells, metres: a city's ground tiles (`terrain.tile`, 1,024 m on the grid's origin), so each cell rides in the * tile group that streams the ground under it and the root gains no stream group. */ export declare const PHONE_SIGN_CELL_M = 1024; export interface Cs2PhoneSignLayer { cellM: number; /** Each with its grid cell [ix, iz] on `cellM` and the textures (bare file names) its GLB samples. */ groups: Array; /** * The phone's own atlas (`PHONE_SIGN_ATLAS`) and the exit gantries' at `PHONE_HIGHWAY_SIGN_TEXTURE_EDGE`, relative to the objects * folder. `size` in texels; absent means `PHONE_SIGN_ATLAS.size`. */ textures: Array<{ file: string; sha256: string; bytes: number; size?: [number, number]; }>; prefabs: Array<{ prefab: string; instances: number; triangles: number; }>; /** Instances of `PHONE_SIGN_PREFAB` left off because their sheet is not in the phone atlas. */ unfaced: number; } /** The exit gantries' atlas edge on a phone, texels (0.17 MiB with its mips). */ export declare const PHONE_HIGHWAY_SIGN_TEXTURE_EDGE = 512; /** * Builds `/furniture/phone/.glb`: the instances of `PHONE_SIGN_PREFAB`, whole, with their faces from the phone's atlas, and * the exit gantries (`highwaySigns.ts`) with theirs at a quarter of the desktop's texels, in 1,024 m cells. Null when there are none * to draw. */ export declare function buildPhoneSigns(out: string, instances: readonly FurnitureInstance[], shared: { meshes: Cs2MeshDirectory; materials: Cs2MaterialBundle; materialsDir: string; }): Promise; /** * Pure: a cell's instances within `budget` triangles, shedding whole kinds in `FURNITURE_SHED_ORDER` (one kind at a time, so a street * keeps all its benches or none, never every other one). When the kinds that are never shed are over the budget on their own, every * sheddable kind is shed and the rest kept (the caller holds that to the contract's own cap). */ export declare function shedToBudget(members: readonly T[], triangles: (prefab: string) => number, budget: number): { members: T[]; shed: FurnitureKind[]; triangles: number; }; /** The exit gantries' atlas edge on the GPU, texels (the pack's 2048 x 1024 at half size: 0.67 MiB with its mips). */ export declare const HIGHWAY_SIGN_TEXTURE_EDGE = 1024; /** Builds `/furniture/.glb` for a capture's street furniture; null when it has none. */ export declare function buildCs2StreetFurniture(out: string, instances: readonly FurnitureInstance[], shared: { meshes: Cs2MeshDirectory; materials: Cs2MaterialBundle; materialsDir: string; }): Promise; /** True when the objects stage wrote a street-furniture layer into `/objects.json` (the land plan then drops generated street life). */ export declare function objectsHaveFurniture(objects: string): boolean; /** * The up-facing face of a decal's box as an affine map from texture to the decal's own frame: x = a0 + a1 u + a2 v, z = b0 + b1 u + b2 v, * fitted by least squares over that face's vertices, plus its UV rectangle. Null when the mesh has no such face. */ export declare function decalFace(positions: Float32Array, normals: Float32Array, uvs: Float32Array): { x: [number, number, number]; z: [number, number, number]; u: [number, number]; v: [number, number]; } | null; /** * Paint as rectangles: the opaque cells of a `cols` x `rows` grid (row-major, true = paint), merged along rows and then down columns * where a run repeats, so an arrow's shaft is one quad. Each rectangle is [col0, row0, col1, row1), exclusive ends. */ export declare function paintRectangles(cells: readonly boolean[], cols: number, rows: number): Array<[number, number, number, number]>; /** * A road decal (an arrow, a painted speed limit) as flat paint: the opacity of its base map, read over the UV rectangle of its box's top * face on a `DECAL_GRID` grid, becomes merged rectangles at `DECAL_LIFT_M` over its origin, coloured with the mean of its painted texels. */ export declare function buildDecalPrototype(prefab: string, meshes: Cs2MeshDirectory, materials: Cs2MaterialBundle, materialsDir: string, images?: Map>): Promise;