import { type HeightGrid } from '../../terrain'; import { type Cs2MarkingSeating } from './markings'; import type { Cs2TerrainConversion } from './terrain'; import { type SurfaceHeightIndex, type TerrainConformStats } from './terrainConform'; export declare const CS2_MESH_CELLS_SCHEMA = "helix.mesh-cells/1"; export declare const CS2_ROAD_NETWORK_SCHEMA = "helix.cs2-road-network/1"; export declare const CS2_COLLIDER_MAX_TRIANGLES = 60000; export declare const CS2_COLLIDER_ERROR_METRES = 0.05; /** `_WorldspaceUVScale` is 0.2 on every slot that ships a worldspace set. */ export declare const CS2_WORLDSPACE_TILE_METRES = 5; export declare const CS2_MARKING_ROUGHNESS = 0.6; export declare const CS2_MARKING_ALPHA_CUTOFF = 0.5; /** The engine's shared-texture convention: content-addressed, and the GLB names it by bare file name. */ export declare const CS2_TEXTURE_HASH_CHARS = 24; export type Cs2MarkingVariant = 'a' | 'b'; export interface Cs2MeshCellBounds { min: [number, number, number]; max: [number, number, number]; } export interface Cs2MeshCellFile { cx: number; cz: number; file: string; bytes: number; sha256: string; triangles: number; bounds: Cs2MeshCellBounds; } export interface Cs2MeshRenderCellFile extends Cs2MeshCellFile { materials: number; } export interface Cs2MeshTextureFile { file: string; bytes: number; sha256: string; } export interface Cs2MeshCellIndex { schema: typeof CS2_MESH_CELLS_SCHEMA; id: string; cellSizeM: number; originX: number; originZ: number; lighting: { giContribute: boolean; }; textures: Cs2MeshTextureFile[]; render: Cs2MeshRenderCellFile[]; collision: Cs2MeshCellFile[]; variants: { markings: Partial>; }; stats: { instances: number; outsideGrid: number; /** Marker compositions left out (`CS2_MARKER_SLOT`): the game's invisible paths and airplane lanes. */ markers?: number; /** Node pieces whose sync targets were welded onto a full-span neighbour's corner and kerb before the bake. */ weldedNodeSeams: number; trianglesByFamily: Record; markingLanes: number; /** Retained area records; these contribute no render geometry, collision or terrain conformance. */ areaRecords: number; /** Summed over every marking variant baked, so both spikes count their own rails. */ markings: Cs2MarkingSeating; /** Absent when the bake was told not to conform the terrain. */ terrainConform?: TerrainConformStats; }; } export interface Cs2ColliderReport { cx: number; cz: number; trianglesBefore: number; trianglesAfter: number; errorMetres: number; } /** The numbers the index does not carry. Pass one in to receive them; the bake fills it as it goes. */ export interface Cs2RoadBakeTelemetry { collider: Cs2ColliderReport[]; timingsMs: Record; } export interface Cs2RoadBakeOptions { cellSizeM?: number; colliderMaxTriangles?: number; colliderErrorM?: number; /** Which marking spike to write; default both, so the two can be compared in a browser. */ markings?: Cs2MarkingVariant | 'both'; /** Flatten the terrain grid to the baked road surfaces; default true. */ conformTerrain?: boolean; /** Bake the raised tops a composition draws in the carriageway's own slot as sidewalk (see `Cs2RoadCellOptions.sidewalkFromElevation`); default false. */ sidewalkFromElevation?: boolean; telemetry?: Cs2RoadBakeTelemetry; /** * Receives the deck-surface index (every road and parking top, all cells) once it is built — the same one the * markings are seated on. A caller authoring anything that stands ON the roads (the spawn) asks it for the deck * height, because the conformed terrain sits UNDER the slab, not at its top. */ onDeckSurfaces?: (deck: SurfaceHeightIndex) => void; } /** Either the whole terrain conversion or just the two things roads need from it. */ export type Cs2RoadBakeTerrain = Cs2TerrainConversion | { grid: HeightGrid; seaLevelMetres: number; }; /** * `outDir` is the folder that receives `mesh-cells.json` itself, and every `file` in the index is relative to it. * Every CS2 Y is shifted by the terrain's sea level. With `conformTerrain` (default) the decks keep CS2's own heights * and the pass MUTATES `terrain.grid` to sit under the surfaces the cells baked, so the terrain source folder must be * written AFTER this returns, not before; with it off, each composition instead takes the reference renderer's rigid * shift onto the grid as given. */ export declare function bakeCs2Roads(bundleRoot: string, terrain: Cs2RoadBakeTerrain, outDir: string, options?: Cs2RoadBakeOptions): Promise;