import type { Cs2Backdrop } from '../../cs2/backdrop'; import type { CitySource } from '../source'; import { type MarginMesh } from './margin'; /** * Lattice spacing (metres): the world map's own 28 m bundle posting. At twice that (56 m) the shoreline between a sea vertex and a land * vertex fell on the midpoint of every lattice edge and the sand band with it: a staircase from the air at 60 m (owner check 2026-10-26). */ export declare const BACKDROP_CELL_M = 28; /** * The city's border ground and the world map differ by up to a few metres where they meet. The world map's own shape carries on past * the border and that difference (the border row's ground less the world map there) fades out over this distance, so the surround * keeps the slopes the game draws instead of flattening onto the border's height first (which stood a crease along the border: the * pale ridge line on Pacifica's north peninsula). */ export declare const BACKDROP_BLEND_M = 512; /** Impostor trees carry the border's own density this far past it, thinning over the outer half (a ruled colour step beside a forested border otherwise). */ export declare const BACKDROP_TREE_REACH_M = 2000; /** The shore sand fades out over this height above the sea (a continuous weight, so the sand edge follows the shoreline). */ export declare const BACKDROP_SAND_BAND_M = 1.6; /** Below the sea by more than this, the floor is flat (nothing is seen through it). */ export declare const BACKDROP_FLOOR_M = 30; /** * Simplification: absolute error (metres, splat weights counted as `BACKDROP_SPLAT_WEIGHT_M` metres per unit) and triangle cap. The * surround is eager (a streamed group may not span the map, P05), so it is part of the phone's first playable: the cap keeps it within * the bytes of the synthetic surround it replaces (40k triangles, ~360 KB; Pacifica's was 370 KB). */ export declare const BACKDROP_ERROR_M = 2; export declare const BACKDROP_SPLAT_WEIGHT_M = 6; export declare const BACKDROP_MAX_TRIANGLES = 40000; /** * Lattice cells the shoreline crosses keep all four posts out to this distance from the border: the simplifier's 2 m height error is 40 m * of shoreline on a beach that rises 5 cm a metre, so a coast it simplified stood as stair steps of whole triangles (blind check * 2026-10-27, poses S4 and Q2). Kept at the world map's own posting the water line is the surface's own linear contour, which is * smooth to the eye. Past this the coast is under the haze and simplifies freely. */ export declare const BACKDROP_SHORE_REACH_M = 12000; export interface BackdropLandOptions { coreHeightAt: (x: number, z: number) => number; seaLevelY: number; /** The scene's terrain material layer for each `OUTER_LAND_SPLAT_ROLES` role (see `outerLand.ts`). */ splatLayers?: readonly [number, number, number, number]; cellM?: number; errorM?: number; maxTriangles?: number; } /** Lattice lines along one axis: the world map's edge to the border, across the bounds, the border to the far edge; the borders are lines. */ export declare function backdropAxis(w0: number, b0: number, b1: number, w1: number, cell: number): number[]; /** * The ground classes at a point as `OUTER_LAND_SPLAT_ROLES` weights (grass, sand/dirt, rock, pavement), summing to 1. Sand is a * continuous weight of the height above the sea, not a flag on the vertices under it: a flag blended across a triangle puts the sand * edge on the midpoint of the lattice edge whatever the true shoreline does (the sawtooth coast), where a height ramp interpolates * to the contour of the surface itself. */ export declare function backdropSplat(above: number, slope: number): [number, number, number, number]; /** * The surface as drawn (the simplified triangles), a plan point's height on them: the impostor trees stand on this, not on the smooth * height field the lattice was sampled from, which sits metres off the triangles where the simplifier took posts away. Triangles are * bucketed in 128 m cells over the band `reachM` past the bounds; a point outside the band or on no triangle answers `fallback`. */ export declare function drawnSurface(pos: ArrayLike, indices: ArrayLike, bounds: [[number, number], [number, number]], reachM: number, fallback: (x: number, z: number) => number): (x: number, z: number) => number; /** The surround from the game's world map, or null when the world map does not reach past the city's bounds. */ export declare function buildBackdropLandMesh(source: CitySource, backdrop: Cs2Backdrop, options: BackdropLandOptions): Promise<(MarginMesh & { extentM: number; drawnAt: (x: number, z: number) => number; }) | null>;