@jgengine/shell 0.15.0-next.0 → 0.16.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 +49 -0
- package/dist/Shell3dPresentation.js +1 -1
- package/dist/audio/synthEngine.js +12 -2
- package/dist/environment/EnvironmentScene.js +1 -1
- package/dist/presentationResolve.d.ts +2 -0
- package/dist/presentationResolve.js +1 -0
- package/dist/render/modelLoad.d.ts +24 -0
- package/dist/render/modelLoad.js +46 -0
- package/dist/scene/CityRenderer.js +28 -54
- package/dist/structures/BuildingKitBatch.d.ts +13 -0
- package/dist/structures/BuildingKitBatch.js +78 -0
- package/dist/structures/GeneratedBuilding.d.ts +19 -3
- package/dist/structures/GeneratedBuilding.js +13 -81
- package/dist/structures/buildingKitFit.d.ts +59 -0
- package/dist/structures/buildingKitFit.js +188 -0
- package/dist/structures/buildingKitRegistry.d.ts +9 -0
- package/dist/structures/buildingKitRegistry.js +26 -0
- package/dist/weather/DustField.d.ts +41 -0
- package/dist/weather/DustField.js +129 -0
- package/dist/weather/WeatherLayer.d.ts +8 -2
- package/dist/weather/WeatherLayer.js +5 -2
- package/dist/weather/index.d.ts +1 -0
- package/dist/weather/index.js +1 -0
- package/dist/weather/weatherMath.d.ts +4 -0
- package/dist/weather/weatherMath.js +4 -0
- package/dist/world/WorldHud.d.ts +6 -2
- package/dist/world/WorldHud.js +4 -4
- package/dist/world/worldBarSamples.d.ts +15 -3
- package/dist/world/worldBarSamples.js +34 -3
- package/package.json +4 -4
- package/skills/jgengine/api.md +15 -3
- package/skills/jgengine/capabilities.md +12 -0
- package/skills/jgengine-ui/api.md +33 -12
- package/skills/jgengine-ui/capabilities.md +12 -0
- package/skills/jgengine-world/SKILL.md +5 -0
- package/skills/jgengine-world/api.md +40 -2
- package/skills/jgengine-world/capabilities.md +16 -0
- package/skills/jgengine-world/recipes/building-kit.md +78 -0
|
@@ -122,6 +122,18 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
122
122
|
|
|
123
123
|
- `createBuildSocketCatalog` (function) · `import { createBuildSocketCatalog } from "@jgengine/core/world/buildSockets"`
|
|
124
124
|
|
|
125
|
+
## building-generator — generate seeded buildings as placed facade parts — bays, floors, roof, decor
|
|
126
|
+
|
|
127
|
+
- `createBuildingConfig` (function) · `import { createBuildingConfig } from "@jgengine/core/world/buildings"`
|
|
128
|
+
- `generateBuilding` (function) · `import { generateBuilding } from "@jgengine/core/world/buildings"`
|
|
129
|
+
- `generateBuildingDistrict` (function) · `import { generateBuildingDistrict } from "@jgengine/core/world/buildings"`
|
|
130
|
+
|
|
131
|
+
## building-kit — bind generated facade part slots to real models instead of untextured blocks
|
|
132
|
+
|
|
133
|
+
- `buildingKitVariantCounts` (function) · `import { buildingKitVariantCounts } from "@jgengine/core/world/buildingKit"`
|
|
134
|
+
- `defineBuildingKit` (function) · `import { defineBuildingKit } from "@jgengine/core/world/buildingKit"`
|
|
135
|
+
- `resolveBuildingKitPart` (function) · `import { resolveBuildingKitPart } from "@jgengine/core/world/buildingKit"`
|
|
136
|
+
|
|
125
137
|
## building-lots — derive street-facing building lots from road frontage
|
|
126
138
|
|
|
127
139
|
- `deriveBuildingLots` (function) · `import { deriveBuildingLots } from "@jgengine/core/world/buildingLots"`
|
|
@@ -354,6 +366,10 @@ Reach for these before hand-rolling. Each row is *the thing you need* → *the p
|
|
|
354
366
|
|
|
355
367
|
- `defineMoveOrder` (function) · `import { defineMoveOrder } from "@jgengine/core/world"`
|
|
356
368
|
|
|
369
|
+
## object-slot-inventory — placed objects hold validated per-instance container contents that replicate and save with the placement
|
|
370
|
+
|
|
371
|
+
- `SceneObjectSlots` (interface) · `import { SceneObjectSlots } from "@jgengine/core/world"`
|
|
372
|
+
|
|
357
373
|
## order-queue — serializable per-entity command queue with lifecycle, preemption, and pluggable order kinds
|
|
358
374
|
|
|
359
375
|
- `createOrderQueue` (function) · `import { createOrderQueue } from "@jgengine/core/world"`
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Recipe — dressing generated buildings with a model kit
|
|
2
|
+
|
|
3
|
+
**What this wires:** the facade generator already emits every part slot a
|
|
4
|
+
building needs — walls, windows, storefronts, awnings, roof clutter. A
|
|
5
|
+
`BuildingKit` binds those slots to real GLBs, so the same massing renders as
|
|
6
|
+
untextured blocks, as a clean prefab town, or as a ruin, purely by swapping the
|
|
7
|
+
bound art.
|
|
8
|
+
|
|
9
|
+
## Bind a pack to slots
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { defineBuildingKit } from "@jgengine/core/world/buildingKit";
|
|
13
|
+
|
|
14
|
+
const kit = defineBuildingKit({
|
|
15
|
+
id: "settlement-clean",
|
|
16
|
+
parts: {
|
|
17
|
+
wall: ["/models/pack/Wall_Straight.glb", "/models/pack/Wall_Flat.glb"],
|
|
18
|
+
window: ["/models/pack/Wall_Window.glb"],
|
|
19
|
+
storefront: ["/models/pack/Door_Metal.glb"],
|
|
20
|
+
airConditioner: [{ model: "/models/pack/Vent_Big.glb", fit: "contain" }],
|
|
21
|
+
},
|
|
22
|
+
omit: ["clothesline"],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
A bare string is shorthand for `{ model }`. `fit` decides how the model meets
|
|
27
|
+
its slot box: `stretch` (default) fills the bay — right for tiling panels;
|
|
28
|
+
`contain` keeps a prop's proportions. `defineBuildingKit` throws on an empty
|
|
29
|
+
variant list, so a typo fails at authoring time instead of rendering nothing.
|
|
30
|
+
|
|
31
|
+
Resolve `model` through your game's asset catalog rather than typing URLs, and a
|
|
32
|
+
missing id fails at boot:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const url = assets.resolve("pack/Wall_Straight")?.url;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Hand it to the world
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { building } from "@jgengine/core/world/features";
|
|
42
|
+
|
|
43
|
+
building({ position: [0, 0], count: 8, style: "desert", kit });
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Kinds the kit leaves unbound keep the engine's untextured block, so a partial
|
|
47
|
+
kit is a valid kit — bind walls and windows first, add roof clutter later.
|
|
48
|
+
Kinds listed in `omit` render nothing at all: use it for parts the setting
|
|
49
|
+
rejects, not for parts you have not got around to.
|
|
50
|
+
|
|
51
|
+
## Two kits, one generator
|
|
52
|
+
|
|
53
|
+
Bind a second kit with broken panels and welded-shut doors, pass it to the
|
|
54
|
+
zones that should read as derelict, and the generator, seeds, and layout stay
|
|
55
|
+
identical. That split is the point of the seam — style is art binding, not a
|
|
56
|
+
second code path.
|
|
57
|
+
|
|
58
|
+
## Spread the seeded picks
|
|
59
|
+
|
|
60
|
+
The generator's `variants` counts decide which slot index each bay asks for. If
|
|
61
|
+
a kit binds a different number of models than the config assumes, picks wrap
|
|
62
|
+
unevenly and one wall model dominates. When you drive the generator directly,
|
|
63
|
+
feed the kit's own counts back in:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { buildingKitVariantCounts } from "@jgengine/core/world/buildingKit";
|
|
67
|
+
import { generateBuilding } from "@jgengine/core/world/buildings";
|
|
68
|
+
|
|
69
|
+
generateBuilding({ seed: "town-1", variants: buildingKitVariantCounts(kit) });
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Common traps
|
|
73
|
+
|
|
74
|
+
- Do not bind `roof` to a wall-sized plate; the roof slot is one slab spanning
|
|
75
|
+
the whole footprint, not a tiling bay.
|
|
76
|
+
- `contain` for anything that must not distort (vents, crates, signs);
|
|
77
|
+
`stretch` for panels authored to fill a bay.
|
|
78
|
+
- `omit` and "unbound" are different outcomes — unbound still draws a block.
|