import { type Cs2Placements } from './placements'; import { type Cs2RoadBins } from './roads'; import { stopSignsByRule } from './roadSigns'; import type { PropRecipe } from './props'; import { type Cs2LandmarkLayer } from './landmarks'; import { type Cs2HarbourLayer } from './harbour'; import { type Cs2FurnitureLayer } from './streetFurniture'; export declare const CS2_OBJECTS_SCHEMA: "helix.cs2-objects/1"; /** A parked car's origin lies this close to its parking lane's curve, in plan, metres. */ export declare const PARKED_REACH_M = 1; /** ...and this close in height (a car on a deck is not parked on the street under it). */ export declare const PARKED_RISE_M = 1.5; export type Cs2ObjectClass = 'parked-car' | 'vessel' | 'landmark'; /** Personal cars, vans and motorbikes the game parks on street parking lanes. */ export declare const PARKED_CAR_PREFAB: RegExp; /** Ships and boats: hulls only, never their deck furniture (chairs, parasols, sofas) or the containers a cargo ship's mesh already carries. */ export declare const VESSEL_PREFAB: RegExp; /** Towers, pylons and bases of the named landmark bridges. Generic bridges keep the generated piers. */ export declare const LANDMARK_PREFAB: RegExp; /** * CS2 names a vehicle placed as a static object `Prop_` (a lot's parked cars `Prop_Car04`, a quay's moored liner `Prop_ShipPassenger01`, * the marina's `Prop_BoatFishing01`): the same model as the bare prefab, standing where the map maker put it. A capture names a prefab * one way or the other by session (Pacifica's first capture held these as `Entity__1` or the bare name, its recapture as `Prop_*`), so * every name rule here reads the model name (`basePrefab`), never the raw one. */ export declare const STATIC_PROP_PREFIX = "Prop_"; /** The model a prefab name draws: `Prop_Car04` -> `Car04`; any other name as it is. */ export declare function basePrefab(prefab: string): string; /** True for a static `Prop_` placement: never traffic and never a household car kept in a garage. */ export declare function isStaticProp(prefab: string): boolean; /** * The prefab whose mesh draws a placement: the bare model when the bundle has its mesh (one prototype for `Car04` and `Prop_Car04`, * the same geometry and material), else the name's own mesh. Null when the bundle has neither. */ export declare function meshPrefab(prefab: string, hasMesh: (prefab: string) => boolean): string | null; export declare function objectClass(prefab: string): Cs2ObjectClass | null; /** One recipe per prefab: the captured mesh and colour as they are, front unturned, a box to bump into (a landmark tower spans the road, so it gets none). */ /** A vessel's finest level keeps this share of its source triangles (`PropRecipe.lod0Share`); the phone spawn sits by a marina. */ export declare const VESSEL_LOD0_SHARE = 0.5; /** * A parked car's finest level reads its 2048 px capture at 1024 px (`PropRecipe.lod0TextureEdge`): at the street kit's 512 a player two * metres away saw a smeared grille and lamps. Its coarser levels keep 256 and 128, and only a car within a few metres draws LOD0. */ export declare const CAR_LOD0_TEXTURE_EDGE = 1024; /** A car body is lacquer, not the street kit's matte 0.85, which read as dusty grey at arm's length (pacifica owner check 3). */ export declare const CAR_PAINT_ROUGHNESS = 0.45; /** * `paint` (sRGB) colours a car's body through its captured control mask (`PropRecipe.controlTint`). The capture's UVs are already * top-left, so no captured object flips V (`PropRecipe.flipV`). */ export declare function objectRecipe(prefab: string, cls: Cs2ObjectClass, paint?: string): PropRecipe; /** * Street car paints, most common first (white, black, grey and silver are most of any real street; CS2's parked cars in the reference * shots add red, blue and yellow). CS2 picks one of a prefab's colour variations per car; the capture holds neither, and a placement * record carries no colour, so each car prototype takes one paint and the street's variety comes from its mix of models. */ export declare const CAR_PAINTS: readonly string[]; /** * One paint per car prefab, in presence order, so the prototypes the city keeps (`OBJECT_PROTOTYPE_CAPS`) each wear a different one. */ export declare function carPaints(cars: ReadonlyArray<{ prefab: string; instances: number; size: readonly number[]; }>): Map; export interface Cs2ObjectPlacement { prefab: string; cls: Cs2ObjectClass; /** Scene frame: x, y above the sea, z. */ position: [number, number, number]; quaternion: [number, number, number, number]; } export interface Cs2ObjectSelection { placements: Cs2ObjectPlacement[]; counts: { candidates: Record; selected: Record; carsStacked: number; carsOffParking: number; noMesh: number; duplicates: number; }; } /** A flat 2 m grid over the parking-lane curve samples: the nearest sample to a point within `PARKED_REACH_M`. */ export declare class ParkingIndex { private readonly cells; private readonly points; constructor(bins: Cs2RoadBins); private key; /** True when a lane sample lies within the reach in plan and the rise in height. */ holds(x: number, y: number, z: number): boolean; } /** Pure: the placements to draw, from the capture's props and attached objects. `seaLevelMetres` is the frame's (CS2 absolute). */ export declare function selectCs2Objects(placements: Cs2Placements, parking: ParkingIndex, seaLevelMetres: number, hasMesh: (prefab: string) => boolean): Cs2ObjectSelection; /** * Prototypes each class may add to the city's ONE placements inventory, which the manifest caps at 32 together with the trees and * the street-props kit (Pacifica S1: 2 trees + 4 street props). The rest of a class is drawn with its nearest kept prefab by size. */ export declare const OBJECT_PROTOTYPE_CAPS: Readonly>; /** * Which kept prefab draws each prefab: per class, the `cap` with the most presence (placements x largest extent, so three cargo * ships outrank a dozen dinghies) are kept and every other prefab takes the kept one of its class whose sorted bounding extents * are nearest its own (a hatchback stays a hatchback, a fishing boat a boat, a liner a ship). */ export declare function consolidatePrototypes(prototypes: ReadonlyArray<{ prefab: string; cls: Cs2ObjectClass; instances: number; size: readonly number[]; }>, caps?: Readonly>): Map; export interface Cs2ObjectsFile { schema: typeof CS2_OBJECTS_SCHEMA; /** One per prefab: the street-prop build folder (relative) holding lod.glb and prop.json. */ prototypes: Array<{ id: string; prefab: string; cls: Cs2ObjectClass; dir: string; lods: number; triangles: number[]; pivotShift: [number, number, number]; instances: number; size: [number, number, number]; drawsAlso?: string[]; }>; /** Instanced records: prototype id, scene position of the prototype's origin and the rotation about it. */ records: Array<{ id: string; prototype: string; position: [number, number, number]; rotation: [number, number, number, number]; }>; counts: Cs2ObjectSelection['counts']; /** The painted landmark bridges, drawn whole and eagerly (`landmarks.ts`); their towers are not among `records`. */ landmarks?: Cs2LandmarkLayer; /** The harbour's container stacks and cargo cranes, merged per square kilometre and streamed in by distance (`harbour.ts`). */ harbour?: Cs2HarbourLayer; /** The street lamps, traffic lights, signs, benches, bins and the rest, merged per cell and streamed in by distance (`streetFurniture.ts`). */ furniture?: Cs2FurnitureLayer; } /** q * v for a unit quaternion [x, y, z, w]. */ export declare function rotate(q: readonly number[], v: readonly number[]): [number, number, number]; /** * The records for a selection, given each prototype's pivot shift (the builder drops a mesh's base to y 0: kit point = source point + shift). * The source mesh sits at the captured transform, so the kit origin goes to position - q * shift. */ export declare function objectRecords(selection: readonly Cs2ObjectPlacement[], prototypeOf: (prefab: string) => { id: string; pivotShift: [number, number, number]; }): Cs2ObjectsFile['records']; /** The rule signs of a capture (`roadSigns.ts`: stop signs; `highwaySigns.ts`: exit gantries) from its road graph; none when the bundle has no road nodes. */ export declare function cs2RuleSigns(bundle: string, placements: Cs2Placements, bins: Cs2RoadBins): Promise>; /** Reads the bundle, selects, builds one prototype per prefab and writes `/objects.json`. */ export declare function buildCs2Objects(bundle: string, out: string, options: { seaLevelMetres: number; log?: (line: string) => void; }): Promise;