@jgengine/core 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/dist/ai/populationDirector.d.ts +103 -0
- package/dist/ai/populationDirector.js +190 -0
- package/dist/ai/pursuit.d.ts +56 -0
- package/dist/ai/pursuit.js +53 -0
- package/dist/authoring.d.ts +1 -1
- package/dist/authoring.js +1 -1
- package/dist/combat/effects.d.ts +11 -4
- package/dist/combat/effects.js +24 -17
- package/dist/combat/magazine.d.ts +13 -0
- package/dist/combat/magazine.js +27 -0
- package/dist/combat/vfxPresets.d.ts +176 -0
- package/dist/combat/vfxPresets.js +74 -0
- package/dist/combat/weaponFire.d.ts +114 -0
- package/dist/combat/weaponFire.js +96 -0
- package/dist/combat.d.ts +5 -2
- package/dist/combat.js +4 -1
- package/dist/devtools/controls.d.ts +38 -0
- package/dist/devtools/controls.js +181 -0
- package/dist/devtools/devtools.d.ts +5 -197
- package/dist/devtools/devtools.js +38 -774
- package/dist/devtools/discover.d.ts +32 -0
- package/dist/devtools/discover.js +240 -0
- package/dist/devtools/fallbackSeams.d.ts +50 -0
- package/dist/devtools/fallbackSeams.js +111 -0
- package/dist/devtools/frame.d.ts +15 -0
- package/dist/devtools/frame.js +247 -0
- package/dist/devtools/logs.d.ts +15 -0
- package/dist/devtools/logs.js +86 -0
- package/dist/devtools/overrides.d.ts +16 -0
- package/dist/devtools/overrides.js +66 -0
- package/dist/devtools/types.d.ts +212 -0
- package/dist/devtools/types.js +1 -0
- package/dist/devtools/urlFlags.d.ts +22 -0
- package/dist/devtools/urlFlags.js +62 -0
- package/dist/economy/auctionBook.d.ts +122 -0
- package/dist/economy/auctionBook.js +213 -0
- package/dist/economy/priceHistory.d.ts +44 -0
- package/dist/economy/priceHistory.js +89 -0
- package/dist/economy/unlockPoints.d.ts +92 -0
- package/dist/economy/unlockPoints.js +103 -0
- package/dist/editor/commandApply.d.ts +5 -0
- package/dist/editor/commandApply.js +755 -0
- package/dist/editor/commands.d.ts +48 -3
- package/dist/editor/commands.js +40 -754
- package/dist/editor/directives.d.ts +94 -0
- package/dist/editor/directives.js +206 -0
- package/dist/editor/document.d.ts +37 -2
- package/dist/editor/document.js +422 -6
- package/dist/editor/entityCatalog.d.ts +42 -0
- package/dist/editor/entityCatalog.js +101 -0
- package/dist/editor/environment.d.ts +74 -0
- package/dist/editor/environment.js +169 -0
- package/dist/editor/index.d.ts +26 -1
- package/dist/editor/index.js +8 -1
- package/dist/editor/minimap.d.ts +31 -0
- package/dist/editor/minimap.js +73 -0
- package/dist/editor/streamer.d.ts +66 -0
- package/dist/editor/streamer.js +68 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/world.d.ts +136 -0
- package/dist/editor/world.js +303 -0
- package/dist/game/breeding.d.ts +161 -0
- package/dist/game/breeding.js +181 -0
- package/dist/game/cameraConfig.d.ts +451 -0
- package/dist/game/cameraConfig.js +1 -0
- package/dist/game/clipRoles.d.ts +51 -0
- package/dist/game/clipRoles.js +142 -0
- package/dist/game/defineGame.d.ts +16 -9
- package/dist/game/defineGame.js +14 -6
- package/dist/game/defineSystem.d.ts +2 -0
- package/dist/game/defineSystem.js +2 -0
- package/dist/game/events.d.ts +28 -0
- package/dist/game/partAnimation.d.ts +78 -0
- package/dist/game/partAnimation.js +147 -0
- package/dist/game/playableGame.d.ts +72 -440
- package/dist/game/playableGame.js +1 -1
- package/dist/game/progression.d.ts +35 -0
- package/dist/game/progression.js +22 -1
- package/dist/game/quest.js +1 -3
- package/dist/game/tribe.d.ts +184 -0
- package/dist/game/tribe.js +432 -0
- package/dist/gameplay.d.ts +3 -1
- package/dist/gameplay.js +3 -1
- package/dist/inventory/encumbrance.d.ts +69 -0
- package/dist/inventory/encumbrance.js +68 -0
- package/dist/inventory/inventoryModel.d.ts +24 -8
- package/dist/inventory/inventoryModel.js +47 -8
- package/dist/item/durability.js +1 -3
- package/dist/meta/changelog.d.ts +1 -1
- package/dist/meta/changelog.js +48 -1
- package/dist/movement/movementModel.d.ts +15 -1
- package/dist/movement/movementModel.js +33 -15
- package/dist/movement/playerMovement.js +102 -2
- package/dist/multiplayer/combatSnapshot.js +13 -8
- package/dist/multiplayer/presenceModel.d.ts +2 -0
- package/dist/multiplayer/presenceModel.js +8 -0
- package/dist/physics/drivableVehicle.d.ts +2 -0
- package/dist/physics/drivableVehicle.js +1 -1
- package/dist/physics/flightDynamics.d.ts +82 -0
- package/dist/physics/flightDynamics.js +165 -0
- package/dist/physics/gravityField.d.ts +25 -0
- package/dist/physics/gravityField.js +41 -0
- package/dist/physics/kinematicVehicle.d.ts +87 -0
- package/dist/physics/kinematicVehicle.js +193 -11
- package/dist/physics/physicsWorld.d.ts +26 -0
- package/dist/physics/physicsWorld.js +109 -117
- package/dist/physics/vehicleObstacles.d.ts +44 -0
- package/dist/physics/vehicleObstacles.js +115 -0
- package/dist/random/rng.d.ts +4 -1
- package/dist/random/rng.js +4 -1
- package/dist/runtime/adapter.d.ts +13 -0
- package/dist/runtime/adapter.js +13 -0
- package/dist/runtime/context/combat.d.ts +51 -0
- package/dist/runtime/context/combat.js +131 -0
- package/dist/runtime/context/combatFx.js +15 -5
- package/dist/runtime/context/deathLoot.d.ts +30 -0
- package/dist/runtime/context/deathLoot.js +39 -0
- package/dist/runtime/context/player.d.ts +48 -0
- package/dist/runtime/context/player.js +125 -0
- package/dist/runtime/context/scene.d.ts +60 -0
- package/dist/runtime/context/scene.js +329 -0
- package/dist/runtime/context/snapshotCodecs.d.ts +12 -0
- package/dist/runtime/context/snapshotCodecs.js +26 -0
- package/dist/runtime/descriptors/baseline.js +26 -3
- package/dist/runtime/descriptors/features.d.ts +5 -0
- package/dist/runtime/descriptors/features.js +20 -2
- package/dist/runtime/gameContext.d.ts +2 -428
- package/dist/runtime/gameContext.js +133 -500
- package/dist/runtime/gameContextTypes.d.ts +500 -0
- package/dist/runtime/gameContextTypes.js +1 -0
- package/dist/runtime/headlessRunner.d.ts +17 -2
- package/dist/runtime/headlessRunner.js +15 -0
- package/dist/runtime/hostPolicy.d.ts +51 -0
- package/dist/runtime/hostPolicy.js +68 -0
- package/dist/runtime/hostedGameRunner.d.ts +3 -1
- package/dist/runtime/hostedGameRunner.js +1 -0
- package/dist/runtime/hostedWorldSession.d.ts +3 -1
- package/dist/runtime/hostedWorldSession.js +1 -0
- package/dist/runtime/worldSnapshot.d.ts +13 -1
- package/dist/runtime/worldSnapshot.js +15 -3
- package/dist/scene/assetCatalog.d.ts +7 -0
- package/dist/scene/assetSpace.js +1 -3
- package/dist/scene/authoredTriggers.d.ts +50 -0
- package/dist/scene/authoredTriggers.js +114 -0
- package/dist/scene/builtinSceneKinds.js +8 -3
- package/dist/scene/colliders.d.ts +79 -0
- package/dist/scene/colliders.js +170 -0
- package/dist/scene/collisionMesh.d.ts +94 -0
- package/dist/scene/collisionMesh.js +699 -0
- package/dist/scene/companion.d.ts +147 -0
- package/dist/scene/companion.js +193 -0
- package/dist/scene/entityStats.d.ts +7 -9
- package/dist/scene/entityStats.js +19 -15
- package/dist/scene/sceneKinds.d.ts +16 -0
- package/dist/scene/sceneKinds.js +4 -0
- package/dist/scene/sceneRaycast.js +15 -0
- package/dist/stats/spawnLevelStats.d.ts +110 -0
- package/dist/stats/spawnLevelStats.js +140 -0
- package/dist/stats/statModifiers.d.ts +16 -0
- package/dist/stats/statModifiers.js +30 -1
- package/dist/stats/statPool.d.ts +70 -0
- package/dist/stats/statPool.js +62 -0
- package/dist/store/changeSignal.d.ts +3 -0
- package/dist/store/changeSignal.js +2 -0
- package/dist/store/observableKeyedStore.d.ts +2 -0
- package/dist/store/observableKeyedStore.js +1 -0
- package/dist/survival/decayMeter.js +1 -3
- package/dist/survival/regionHealth.js +1 -3
- package/dist/ui/hudLayout.d.ts +5 -0
- package/dist/ui/hudLayout.js +17 -1
- package/dist/ui/panelModel.d.ts +120 -0
- package/dist/ui/panelModel.js +168 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.js +1 -0
- package/dist/world/authoredEntities.d.ts +29 -0
- package/dist/world/authoredEntities.js +29 -0
- package/dist/world/authoredObjects.d.ts +15 -1
- package/dist/world/authoredObjects.js +13 -1
- package/dist/world/authoredSpawn.d.ts +39 -0
- package/dist/world/authoredSpawn.js +37 -0
- package/dist/world/buildSockets.d.ts +152 -0
- package/dist/world/buildSockets.js +188 -0
- package/dist/world/buildingLots.d.ts +84 -0
- package/dist/world/buildingLots.js +119 -0
- package/dist/world/buildings.d.ts +6 -0
- package/dist/world/cityBlocks.d.ts +152 -0
- package/dist/world/cityBlocks.js +670 -0
- package/dist/world/cityContent.d.ts +77 -0
- package/dist/world/cityContent.js +261 -0
- package/dist/world/cityGenerator.d.ts +41 -0
- package/dist/world/cityGenerator.js +58 -0
- package/dist/world/cityGeometry.d.ts +114 -0
- package/dist/world/cityGeometry.js +573 -0
- package/dist/world/cityKind.d.ts +314 -0
- package/dist/world/cityKind.js +1578 -0
- package/dist/world/environmentSummary.js +57 -1
- package/dist/world/features.d.ts +53 -5
- package/dist/world/features.js +15 -3
- package/dist/world/grassKind.js +2 -2
- package/dist/world/markers.d.ts +50 -4
- package/dist/world/markers.js +49 -0
- package/dist/world/massing.js +1 -1
- package/dist/world/minimapBake.d.ts +78 -0
- package/dist/world/minimapBake.js +208 -0
- package/dist/world/minimapTrack.d.ts +17 -0
- package/dist/world/minimapTrack.js +22 -0
- package/dist/world/place.d.ts +166 -0
- package/dist/world/place.js +96 -0
- package/dist/world/placeAsset.js +3 -1
- package/dist/world/poleLineKind.d.ts +40 -0
- package/dist/world/poleLineKind.js +97 -0
- package/dist/world/polyline.js +9 -2
- package/dist/world/resourceNode.d.ts +109 -0
- package/dist/world/resourceNode.js +140 -0
- package/dist/world/roads.d.ts +19 -2
- package/dist/world/roads.js +60 -3
- package/dist/world/scatter.js +2 -20
- package/dist/world/streetGenerator.d.ts +159 -0
- package/dist/world/streetGenerator.js +684 -0
- package/dist/world/streets.d.ts +103 -1
- package/dist/world/streets.js +273 -0
- package/dist/world/terraform.js +58 -88
- package/dist/world/terrain.d.ts +65 -1
- package/dist/world/terrain.js +119 -2
- package/dist/world.d.ts +14 -5
- package/dist/world.js +12 -3
- package/package.json +1 -1
- package/skills/game-design/SKILL.md +28 -0
- package/skills/game-design/agents/openai.yaml +4 -0
- package/skills/game-design/references/application-playbook.md +170 -0
- package/skills/game-design/references/field-guide.md +288 -0
- package/skills/jgengine/SKILL.md +8 -4
- package/skills/jgengine/api.md +182 -81
- package/skills/jgengine/capabilities.md +104 -2
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-combat/SKILL.md +19 -1
- package/skills/jgengine-combat/api.md +75 -2
- package/skills/jgengine-combat/capabilities.md +61 -1
- package/skills/jgengine-combat/recipes/portable-damage-effects.md +197 -0
- package/skills/jgengine-combat/recipes/portable-runtime-state.md +154 -0
- package/skills/jgengine-combat/recipes/portable-stat-pools.md +122 -0
- package/skills/jgengine-combat/recipes/portable-weapon-plumbing.md +156 -0
- package/skills/jgengine-combat/recipes/visible-attacks.md +81 -0
- package/skills/jgengine-combat/reference.md +33 -4
- package/skills/jgengine-gameplay/SKILL.md +8 -0
- package/skills/jgengine-gameplay/api.md +182 -26
- package/skills/jgengine-gameplay/capabilities.md +96 -2
- package/skills/jgengine-gameplay/recipes/portable-xp-leveling.md +168 -0
- package/skills/jgengine-gameplay/reference-systems.md +10 -5
- package/skills/jgengine-world/SKILL.md +13 -0
- package/skills/jgengine-world/api.md +453 -21
- package/skills/jgengine-world/capabilities.md +112 -2
- package/skills/jgengine-world/recipes/commanding-entities.md +128 -0
- package/skills/jgengine-world/reference.md +43 -4
- package/skills/jgengine/reference-cartridge.md +0 -72
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { type ParamSchema, type SceneKindObject, type SceneKindResolveContext, type WeightedParamEntry } from "../scene/sceneKinds.js";
|
|
2
|
+
import { type BuildingStyle } from "./buildings.js";
|
|
3
|
+
import { type CityLotClass, type CityLotPiece, type CityTreeSpecies, type CityZoneBand, type CityZoneProfile } from "./cityContent.js";
|
|
4
|
+
import type { RoadPoint } from "./roads.js";
|
|
5
|
+
import { type StreetFeatureKind } from "./streetGenerator.js";
|
|
6
|
+
import { type CityBlockKind } from "./cityBlocks.js";
|
|
7
|
+
/** The editor volume kind marking a box as a procedural city district. */
|
|
8
|
+
export declare const CITY_KIND = "city";
|
|
9
|
+
/** The editor volume kind that locally overrides a city's zone band/mix — a district in a district. */
|
|
10
|
+
export declare const CITY_ZONE_KIND = "cityzone";
|
|
11
|
+
/** Fully-defaulted city params parsed from a volume's `meta`. */
|
|
12
|
+
export interface CityRules {
|
|
13
|
+
/** 1 = strict orthogonal grid (regular spacing, full through-streets); 0 = organic irregular net. */
|
|
14
|
+
gridness: number;
|
|
15
|
+
/** How much individual streets wander sideways. 0 = ruler-straight. */
|
|
16
|
+
curviness: number;
|
|
17
|
+
/** Density of branch lanes forking off the main streets, 0..1. */
|
|
18
|
+
branching: number;
|
|
19
|
+
/** How loopy the network is: 0 = a tree that dead-ends; 1 collapses to one closed circuit (a race
|
|
20
|
+
* track). High loopiness with branching/connectivity near zero is the "race circuit" corner. */
|
|
21
|
+
loopiness: number;
|
|
22
|
+
/** Extra chord edges knitting neighbors together — mesh density. 1 = a dense connected grid. */
|
|
23
|
+
connectivity: number;
|
|
24
|
+
/** Fraction of dangling ends kept as cul-de-sacs (vs reconnected into loops), 0..1. */
|
|
25
|
+
deadEnds: number;
|
|
26
|
+
/** Minimum curve radius (m): caps street wander curvature and corner tightness. */
|
|
27
|
+
minCurveRadius: number;
|
|
28
|
+
/** Shallowest corner (degrees) a street keeps — gentler bends straighten out. */
|
|
29
|
+
minTurnAngle: number;
|
|
30
|
+
/** Sharpest corner (degrees) a street may take — tighter ones are beveled away. */
|
|
31
|
+
maxTurnAngle: number;
|
|
32
|
+
/** Lay parcels + buildings against the streets (city fabric). Off = bare roads/track, no plots. */
|
|
33
|
+
fabric: boolean;
|
|
34
|
+
/** Streets bore through ridges on tunnel decks instead of climbing over them. */
|
|
35
|
+
tunnels: boolean;
|
|
36
|
+
/** Target block size (street spacing) in meters. */
|
|
37
|
+
blockSize: number;
|
|
38
|
+
/** Cross-axis spacing multiplier — 2+ gives long skinny Manhattan blocks with avenue/street rhythm. */
|
|
39
|
+
blockAspect: number;
|
|
40
|
+
/** Fraction of blocks left unbuilt as intentional open space (parks/plazas/fields), 0..1. */
|
|
41
|
+
openSpace: number;
|
|
42
|
+
/** Fraction of every street's frontage that carries a building, 0..1 — the compactness dial. */
|
|
43
|
+
roadsideOccupancy: number;
|
|
44
|
+
/** Chance deep blocks fill their interior with a second row of buildings, 0..1. */
|
|
45
|
+
blockDensity: number;
|
|
46
|
+
/** Base gap from the sidewalk edge to a lot's front, in meters (class factors scale it). */
|
|
47
|
+
buildingRoadSetback: number;
|
|
48
|
+
/** Base side gap between neighboring lots, in meters (rowhouses nearly touch, farms spread). */
|
|
49
|
+
buildingSpacing: number;
|
|
50
|
+
/** How strongly development clumps: junctions grow denser, density drifts in smooth waves, and
|
|
51
|
+
* same-class runs form — 0 is uniform, 1 is strongly clustered. */
|
|
52
|
+
clusterStrength: number;
|
|
53
|
+
/** Main street width in meters (boulevards/avenues render wider, lanes narrower). */
|
|
54
|
+
streetWidth: number;
|
|
55
|
+
/** Share of avenues upgraded to median-divided boulevards, 0..1. */
|
|
56
|
+
boulevards: number;
|
|
57
|
+
/** Branch lanes render as gravel instead of asphalt (rural roads, alleys). */
|
|
58
|
+
gravelLanes: boolean;
|
|
59
|
+
/** District-wide surface: `auto` keeps asphalt mains (+ gravel lanes per `gravelLanes`); `gravel` unpaves everything. */
|
|
60
|
+
surface: "auto" | "gravel";
|
|
61
|
+
/** Zone banding: radial core-out, inverted (wealth at the rim), or spatially uniform mixing. */
|
|
62
|
+
profile: CityZoneProfile;
|
|
63
|
+
/** Fraction of the district radius covered by the core band. */
|
|
64
|
+
coreExtent: number;
|
|
65
|
+
/** Fraction of the district radius where the mid band ends and the edge begins. */
|
|
66
|
+
midExtent: number;
|
|
67
|
+
/** Weighted building-class mix of the core band. */
|
|
68
|
+
coreMix: WeightedParamEntry[];
|
|
69
|
+
/** Weighted building-class mix of the middle band. */
|
|
70
|
+
midMix: WeightedParamEntry[];
|
|
71
|
+
/** Weighted building-class mix of the edge band. */
|
|
72
|
+
edgeMix: WeightedParamEntry[];
|
|
73
|
+
/** Global lot footprint multiplier — estates want 1.5+, dense infill wants <1. */
|
|
74
|
+
lotScale: number;
|
|
75
|
+
/** Minimum building floors (district clamp over the class ranges). */
|
|
76
|
+
floorsMin: number;
|
|
77
|
+
/** Maximum building floors (district clamp over the class ranges). */
|
|
78
|
+
floorsMax: number;
|
|
79
|
+
/** Height of one floor in meters. */
|
|
80
|
+
floorHeight: number;
|
|
81
|
+
/** Street-tree planting density, 0..1. */
|
|
82
|
+
treeDensity: number;
|
|
83
|
+
/** Weighted species mix for street/park trees. */
|
|
84
|
+
treeMix: WeightedParamEntry[];
|
|
85
|
+
/** Street-light density along non-lane streets, 0..1. */
|
|
86
|
+
lightDensity: number;
|
|
87
|
+
/** Ring estate lots (mansions) with perimeter hedges and a gated gap. */
|
|
88
|
+
hedges: boolean;
|
|
89
|
+
/** Connect houses/estates/farms to their street with driveways. */
|
|
90
|
+
driveways: boolean;
|
|
91
|
+
/** Give commercial lots (shops, slabs) a parking pad behind the building. */
|
|
92
|
+
parking: boolean;
|
|
93
|
+
/** Unbuilt non-core blocks become crop-row farm fields instead of parks. */
|
|
94
|
+
fields: boolean;
|
|
95
|
+
/** Steepest ground (rise over run) a lot will build on; steeper slopes stay open cliff/canyon. */
|
|
96
|
+
maxSlope: number;
|
|
97
|
+
/** Lots below this ground height are skipped — keeps buildings out of rivers/lakes/canyons floors. */
|
|
98
|
+
minElevation: number;
|
|
99
|
+
/** Streets crossing ground below `minElevation` span it on a bridge deck instead of clipping. */
|
|
100
|
+
bridges: boolean;
|
|
101
|
+
/** Bridge silhouette: arched deck, overhead truss, or a plain beam span. */
|
|
102
|
+
bridgeStyle: "arch" | "truss" | "beam";
|
|
103
|
+
/** Render sidewalks flanking asphalt streets. */
|
|
104
|
+
sidewalks: boolean;
|
|
105
|
+
/** Sidewalk band width in meters at "street" hierarchy (boulevards scale up, lanes down). */
|
|
106
|
+
sidewalkWidth: number;
|
|
107
|
+
/** Building style palette id (see {@link BUILDING_STYLE_PALETTES}). */
|
|
108
|
+
style: BuildingStyle;
|
|
109
|
+
/** Seed string; same seed reproduces the same city. Empty falls back to the volume id. */
|
|
110
|
+
seed: string;
|
|
111
|
+
}
|
|
112
|
+
/** City defaults: a zoned mixed metropolis — towers downtown, slabs mid-ring, houses at the edge. */
|
|
113
|
+
export declare const CITY_DEFAULTS: CityRules;
|
|
114
|
+
/** The city parameter schema — drives the inspector sliders and `meta` parse via the studio seam. */
|
|
115
|
+
export declare const CITY_SCHEMA: ParamSchema;
|
|
116
|
+
/** Zone-override schema for `cityzone` volumes: pin a band and optionally a bespoke class mix. */
|
|
117
|
+
export declare const CITY_ZONE_SCHEMA: ParamSchema;
|
|
118
|
+
/** Parse a volume's `meta` into fully-defaulted city rules. @internal */
|
|
119
|
+
export declare function readCityRules(meta: Record<string, unknown> | undefined): CityRules;
|
|
120
|
+
/** One synthesized street: a world-space XZ polyline with width, hierarchy level, and surface. */
|
|
121
|
+
export interface CityStreet {
|
|
122
|
+
id: string;
|
|
123
|
+
points: readonly RoadPoint[];
|
|
124
|
+
width: number;
|
|
125
|
+
level: "boulevard" | "avenue" | "street" | "lane";
|
|
126
|
+
surface: "asphalt" | "gravel";
|
|
127
|
+
/** Whether sidewalk ribbons flank this street. */
|
|
128
|
+
sidewalk: boolean;
|
|
129
|
+
/** Cul-de-sac turning bulb at a dangling end, when the lane never reconnected. */
|
|
130
|
+
bulb?: RoadPoint;
|
|
131
|
+
/** Bridge/tunnel spans along this street as `[from, to]` index windows into `points`. */
|
|
132
|
+
features?: readonly {
|
|
133
|
+
kind: StreetFeatureKind;
|
|
134
|
+
from: number;
|
|
135
|
+
to: number;
|
|
136
|
+
bankHeight: number;
|
|
137
|
+
}[];
|
|
138
|
+
}
|
|
139
|
+
/** One crossing of two through streets: patch center/radius plus crosswalk arm directions. */
|
|
140
|
+
export interface CityIntersection {
|
|
141
|
+
id: string;
|
|
142
|
+
x: number;
|
|
143
|
+
z: number;
|
|
144
|
+
/** Patch radius covering the crossing so the two ribbons never z-fight. */
|
|
145
|
+
radius: number;
|
|
146
|
+
level: CityStreet["level"];
|
|
147
|
+
/** Outgoing arm directions (radians) with the crossing road width, for crosswalk stripes. */
|
|
148
|
+
arms: readonly {
|
|
149
|
+
angle: number;
|
|
150
|
+
width: number;
|
|
151
|
+
}[];
|
|
152
|
+
}
|
|
153
|
+
/** One building lot: footprint, zone band, class, seeded floors, massing pieces, street anchor. */
|
|
154
|
+
export interface CityLot {
|
|
155
|
+
id: string;
|
|
156
|
+
center: RoadPoint;
|
|
157
|
+
size: readonly [number, number];
|
|
158
|
+
rotationY: number;
|
|
159
|
+
floors: number;
|
|
160
|
+
jitter: number;
|
|
161
|
+
/** Building class the zone mix picked. */
|
|
162
|
+
class: CityLotClass;
|
|
163
|
+
/** Zone band the lot fell in (after overrides). */
|
|
164
|
+
zone: CityZoneBand;
|
|
165
|
+
/** Frontage point on the street centerline the lot faces. */
|
|
166
|
+
anchor: RoadPoint;
|
|
167
|
+
/** Deterministic massing pieces in lot-local space (see {@link CityLotPiece}). */
|
|
168
|
+
pieces: readonly CityLotPiece[];
|
|
169
|
+
/** Id of the parcel this building stands on. */
|
|
170
|
+
parcel?: string;
|
|
171
|
+
}
|
|
172
|
+
/** One closed city block: a face of the road graph, inset to curb and land boundaries. */
|
|
173
|
+
export interface CityBlock {
|
|
174
|
+
id: string;
|
|
175
|
+
/** How the block is used: buildable, a park/plaza/field open space, or a landscaped buffer sliver. */
|
|
176
|
+
kind: CityBlockKind;
|
|
177
|
+
/** Land polygon behind the sidewalk band (world XZ, closed ring). */
|
|
178
|
+
polygon: readonly RoadPoint[];
|
|
179
|
+
/** Pavement-edge polygon (curb line). The sidewalk band lies between `curb` and `polygon`. */
|
|
180
|
+
curb: readonly RoadPoint[];
|
|
181
|
+
/** Land area in m². */
|
|
182
|
+
area: number;
|
|
183
|
+
}
|
|
184
|
+
/** One street-frontage edge of a parcel. */
|
|
185
|
+
export interface CityParcelFrontageOut {
|
|
186
|
+
/** Street id (`street:N`) the frontage faces. */
|
|
187
|
+
road: string;
|
|
188
|
+
edgeStart: RoadPoint;
|
|
189
|
+
edgeEnd: RoadPoint;
|
|
190
|
+
/** Unit tangent along the frontage chord. */
|
|
191
|
+
tangent: RoadPoint;
|
|
192
|
+
}
|
|
193
|
+
/** One polygonal parcel subdivided from a block's street frontage. */
|
|
194
|
+
export interface CityParcel {
|
|
195
|
+
id: string;
|
|
196
|
+
/** Owning block id. */
|
|
197
|
+
block: string;
|
|
198
|
+
polygon: readonly RoadPoint[];
|
|
199
|
+
/** Buildable polygon after front/side/rear setbacks ([] when setbacks consume the parcel). */
|
|
200
|
+
buildable: readonly RoadPoint[];
|
|
201
|
+
frontage: readonly CityParcelFrontageOut[];
|
|
202
|
+
area: number;
|
|
203
|
+
/** Usable depth from the frontage chord to the parcel rear, meters. */
|
|
204
|
+
depth: number;
|
|
205
|
+
isCorner: boolean;
|
|
206
|
+
/** built = carries a lot; vacant = intentionally unbuilt gap; yard = leftover strip kept green. */
|
|
207
|
+
kind: "built" | "vacant" | "yard";
|
|
208
|
+
}
|
|
209
|
+
/** One bridge deck spanning water: bank-to-bank polyline plus the silhouette style. */
|
|
210
|
+
export interface CityBridge {
|
|
211
|
+
id: string;
|
|
212
|
+
points: readonly RoadPoint[];
|
|
213
|
+
width: number;
|
|
214
|
+
style: CityRules["bridgeStyle"];
|
|
215
|
+
/** Ground height at the banks — the deck reference the renderer drapes to. */
|
|
216
|
+
bankHeight: number;
|
|
217
|
+
}
|
|
218
|
+
/** One tunnel bore piercing a ridge: portal-to-portal polyline held at bank height. */
|
|
219
|
+
export interface CityTunnel {
|
|
220
|
+
id: string;
|
|
221
|
+
points: readonly RoadPoint[];
|
|
222
|
+
width: number;
|
|
223
|
+
/** Ground height at the portals — the road floor stays flat at this height through the ridge. */
|
|
224
|
+
bankHeight: number;
|
|
225
|
+
}
|
|
226
|
+
/** One intentional open space: an unbuilt block, a block-interior courtyard, or a buffer sliver. */
|
|
227
|
+
export interface CityPark {
|
|
228
|
+
id: string;
|
|
229
|
+
center: RoadPoint;
|
|
230
|
+
size: readonly [number, number];
|
|
231
|
+
rotationY: number;
|
|
232
|
+
type: "plaza" | "green" | "meadow" | "field" | "courtyard" | "buffer";
|
|
233
|
+
jitter: number;
|
|
234
|
+
/** Road-derived polygon (world XZ). Present on every block-pipeline park; the rect fields above
|
|
235
|
+
* are its bounding proxy for coarse consumers. */
|
|
236
|
+
polygon?: readonly RoadPoint[];
|
|
237
|
+
/** Crop-row polylines for `field` parks, clipped around farm lots. */
|
|
238
|
+
rows?: readonly (readonly RoadPoint[])[];
|
|
239
|
+
}
|
|
240
|
+
/** One placed tree: world XZ, species, and seeded scale/color jitter. */
|
|
241
|
+
export interface CityTree {
|
|
242
|
+
x: number;
|
|
243
|
+
z: number;
|
|
244
|
+
species: CityTreeSpecies;
|
|
245
|
+
scale: number;
|
|
246
|
+
jitter: number;
|
|
247
|
+
}
|
|
248
|
+
/** One street light: curb position plus the yaw its arm faces (over the road). */
|
|
249
|
+
export interface CityLight {
|
|
250
|
+
x: number;
|
|
251
|
+
z: number;
|
|
252
|
+
/** Yaw facing the road (engine rotationY convention). */
|
|
253
|
+
heading: number;
|
|
254
|
+
}
|
|
255
|
+
/** One hedge run: a thin box strip (estate perimeter). */
|
|
256
|
+
export interface CityHedge {
|
|
257
|
+
center: RoadPoint;
|
|
258
|
+
/** Length along the run and thickness across it. */
|
|
259
|
+
size: readonly [number, number];
|
|
260
|
+
rotationY: number;
|
|
261
|
+
}
|
|
262
|
+
/** One driveway ribbon from a street to a lot. */
|
|
263
|
+
export interface CityDriveway {
|
|
264
|
+
points: readonly RoadPoint[];
|
|
265
|
+
width: number;
|
|
266
|
+
surface: "gravel" | "pavement";
|
|
267
|
+
}
|
|
268
|
+
/** One parking pad behind a commercial lot. */
|
|
269
|
+
export interface CityParking {
|
|
270
|
+
center: RoadPoint;
|
|
271
|
+
size: readonly [number, number];
|
|
272
|
+
rotationY: number;
|
|
273
|
+
}
|
|
274
|
+
/** A resolved city district: world-space network, zoned lots, parks, and furniture. */
|
|
275
|
+
export interface ResolvedCity {
|
|
276
|
+
center: readonly [number, number, number];
|
|
277
|
+
size: readonly [number, number];
|
|
278
|
+
rotationY: number;
|
|
279
|
+
rules: CityRules;
|
|
280
|
+
streets: readonly CityStreet[];
|
|
281
|
+
intersections: readonly CityIntersection[];
|
|
282
|
+
bridges: readonly CityBridge[];
|
|
283
|
+
/** Tunnel bores piercing ridges — path features on continuous streets. */
|
|
284
|
+
tunnels: readonly CityTunnel[];
|
|
285
|
+
/** Closed road-derived block polygons — the land the street network encloses. */
|
|
286
|
+
blocks: readonly CityBlock[];
|
|
287
|
+
/** Polygonal parcels subdivided from block frontage. */
|
|
288
|
+
parcels: readonly CityParcel[];
|
|
289
|
+
lots: readonly CityLot[];
|
|
290
|
+
parks: readonly CityPark[];
|
|
291
|
+
trees: readonly CityTree[];
|
|
292
|
+
lights: readonly CityLight[];
|
|
293
|
+
hedges: readonly CityHedge[];
|
|
294
|
+
driveways: readonly CityDriveway[];
|
|
295
|
+
parkingLots: readonly CityParking[];
|
|
296
|
+
}
|
|
297
|
+
/** Extended resolve context: sibling `cityzone` volumes that override the band/mix locally. */
|
|
298
|
+
export interface CityResolveContext extends SceneKindResolveContext {
|
|
299
|
+
zoneOverrides?: readonly SceneKindObject[];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Synthesize the deterministic city plan for one `city` volume: streets → bridges → parks → zoned
|
|
303
|
+
* frontage lots with massing pieces → furniture, all in the volume's local frame and then
|
|
304
|
+
* rotated/translated into world space. Same volume (id, footprint, meta) over the same terrain
|
|
305
|
+
* always resolves to the identical plan. When `context` provides a ground sampler, lots respect
|
|
306
|
+
* the `maxSlope` cliff rule — hillside and canyon districts keep their steep faces open. When
|
|
307
|
+
* `context.zoneOverrides` carries sibling `cityzone` volumes, lots inside them adopt the override
|
|
308
|
+
* band/mix. Returns null without a usable footprint.
|
|
309
|
+
*
|
|
310
|
+
* @capability city-district resolve a `city` volume into deterministic streets, zoned lots, parks, and furniture
|
|
311
|
+
*/
|
|
312
|
+
export declare function resolveCityObject(object: SceneKindObject, context?: CityResolveContext): ResolvedCity | null;
|
|
313
|
+
/** Registers the `city` + `cityzone` scene kinds (schema + resolver). Called by {@link registerBuiltinSceneKinds}. @internal */
|
|
314
|
+
export declare function registerCityKind(): void;
|