@bendyline/molen-tooling 0.0.15 → 0.0.16

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.
Files changed (45) hide show
  1. package/dist/capture/harness.js +736 -400
  2. package/dist/capture/worldgen-preview.js +409 -298
  3. package/dist/docs-src/guide/3d-art-guidelines.md +5 -2
  4. package/dist/docs-src/guide/adaptive-performance.md +50 -23
  5. package/dist/docs-src/guide/aircraft.md +263 -29
  6. package/dist/docs-src/guide/ambient-life.md +36 -9
  7. package/dist/docs-src/guide/building-interiors.md +92 -8
  8. package/dist/docs-src/guide/determinism.md +1 -1
  9. package/dist/docs-src/guide/earth-view.md +198 -16
  10. package/dist/docs-src/guide/entities.md +38 -7
  11. package/dist/docs-src/guide/figures.md +32 -4
  12. package/dist/docs-src/guide/graphics-performance.md +44 -12
  13. package/dist/docs-src/guide/livery-catalog.md +137 -1
  14. package/dist/docs-src/guide/livery-gallery.md +136 -1
  15. package/dist/docs-src/guide/medium-fi.md +194 -10
  16. package/dist/docs-src/guide/night-lighting.md +10 -0
  17. package/dist/docs-src/guide/regional-fleets.md +27 -5
  18. package/dist/docs-src/guide/regional-world.md +19 -1
  19. package/dist/docs-src/guide/rendering-backends.md +23 -2
  20. package/dist/docs-src/guide/sky.md +28 -2
  21. package/dist/docs-src/guide/snow.md +231 -0
  22. package/dist/docs-src/guide/surface-rendering.md +324 -9
  23. package/dist/docs-src/guide/terrain.md +74 -5
  24. package/dist/docs-src/guide/vehicle-interiors.md +6 -0
  25. package/dist/docs-src/guide/vehicles.md +368 -45
  26. package/dist/docs-src/guide/weather.md +7 -1
  27. package/dist/docs-src/guide/worldgen.md +82 -3
  28. package/dist/docs-src/llms.txt +3 -2
  29. package/dist/docs-src/schemas/README.md +1 -0
  30. package/dist/docs-src/schemas/components.md +749 -12
  31. package/dist/docs-src/schemas/figure.md +30 -4
  32. package/dist/docs-src/schemas/interior-catalog.md +56 -3
  33. package/dist/docs-src/schemas/map-overrides.md +658 -0
  34. package/dist/docs-src/schemas/structure-placement-data.md +195 -0
  35. package/dist/docs-src/schemas/structure-placements.md +195 -0
  36. package/dist/docs-src/schemas/worldgen-batch.md +54 -0
  37. package/dist/templates/city-courier/gen/molen-types.ts +113 -4
  38. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +112 -3
  39. package/dist/templates/figures-gallery/test/headless.test.ts +3 -2
  40. package/dist/templates/index.json +17 -17
  41. package/dist/templates/skybound/gen/molen-types.ts +113 -4
  42. package/dist/templates/skybound/scripts/molen-scripts.d.ts +112 -3
  43. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +112 -3
  44. package/dist/templates/top-down-arena/src/gen/molen-types.ts +113 -4
  45. package/package.json +12 -12
@@ -79,7 +79,7 @@ model; scene and tile budgets still control total instances and building vertice
79
79
  | Ordinary tree | 300–2,000 triangles | Fewer crown clusters, then a faceted crown/cone |
80
80
  | Small static building | 1,000–8,000 triangles | Remove furniture and small facade details |
81
81
  | Procedural building | Budgeted per outline | Keep measured envelope, main roof and identity where feasible |
82
- | Human figure | About 7,400 triangles, one vertex-color material | About 2,200 medium tier; 1,100 rigid distant tier |
82
+ | Human figure | About 7,500 triangles (styled at most 8,500), one vertex-color material | About 2,200 medium tier; 1,100–1,200 rigid distant tier |
83
83
  | Animal figure | About 4,100–6,500 triangles, one vertex-color material | About 2,100–2,900 medium; 1,100–1,500 rigid distant tier |
84
84
 
85
85
  Higher budgets need a visible reason and a distance fallback. Repeated street furniture and signs
@@ -95,7 +95,10 @@ unseeded randomness, or locale-dependent sorting to generate geometry.
95
95
 
96
96
  Human figures ([guide](figures.md)) target early open-world polygonal realism: a shaped jaw,
97
97
  cheekbones and nose, inset almond eyes with lids, ears, lips, a shaped hairline, and recognizable
98
- hands and shoes. Keep adult proportions believable and preserve the larger child head. Clothing
98
+ hands and shoes. Keep adult proportions believable and preserve the larger child head: about 7.5
99
+ heads tall, a neck that shows about 6 cm between collar and chin and about 5 cm behind (the
100
+ collar line rises from the throat to the nape), shoulders that fall off the neck before rounding
101
+ over the arm, and a chest narrower than the arms hanging beside it. Clothing
99
102
  needs a waist, shoulders, cuffs, a crotch seam and clear garment boundaries; avoid disconnected
100
103
  capsule limbs or overlapping pelvis shells. Near hands have four gently curled fingers and a
101
104
  tucked thumb; lower levels merge the curved fingers. Resting forearms turn the backs of the
@@ -1,9 +1,10 @@
1
1
  # Adaptive rendering performance
2
2
 
3
- The world explorer defaults to **Auto (device)** quality. It measures frame cadence, CPU frame
4
- work, and asynchronous GPU time when WebGL timer queries or WebGPU timestamps are available.
5
- Six rendering tiers target 60 FPS without changing simulation state. Manual Economy, Balanced,
6
- and High remain available and can be selected without reloading or moving the camera.
3
+ The world explorer defaults to **Auto (device)** quality: one of six rendering tiers, guessed once
4
+ from what the device reports and then kept, without changing simulation state. It measures frame
5
+ cadence, CPU frame work, and asynchronous GPU time when WebGL timer queries or WebGPU timestamps
6
+ are available, and gives a tier up only when the device plainly cannot run it. Manual Economy,
7
+ Balanced, and High remain available and can be selected without reloading or moving the camera.
7
8
 
8
9
  ## Feedback and budgets
9
10
 
@@ -14,7 +15,15 @@ Memory pressure can also lower detail. Recovery requires stable headroom and mem
14
15
  displayed content. During continuous streaming, both CPU and GPU timings must show spare capacity;
15
16
  without GPU timing, recovery waits for streaming to settle. Failed upward probes increase the
16
17
  recovery delay. Hidden intervals and isolated long pauses reset or bypass measurements instead
17
- of being mistaken for normal rendering.
18
+ of being mistaken for normal rendering. A second pause within a minute of rendering
19
+ (`pauseRepeatMs`) is a stall rather than a tab resume, and lowers detail one level.
20
+
21
+ Frame times cannot show a level that streams more than it can hold: that work runs outside the
22
+ frame. A host reports it as `strained` in each sample (the explorer does when half of the
23
+ tiles built over ten seconds had been evicted and rebuilt, or when the view fills most of a full
24
+ terrain cache). Strain blocks upgrades at once and, sustained for `strainDelayMs` (10 s), lowers
25
+ detail with the reason `'streaming'`. `upgradeWorkFraction` (default 0.9) is the share of the
26
+ target that measured frame work must stay under before a step up.
18
27
  While content streams, slow frames lower detail only when the measured CPU/GPU frame work is itself
19
28
  heavy: streaming work runs outside the frame, and a lower tier would restart it. After a memory
20
29
  step, the controller lets that step's lower-detail replacements load (up to the recovery delay)
@@ -24,19 +33,32 @@ first frames carry one-time work (ground refining under the camera, collision tr
24
33
  each refinement, models and materials arriving), and measured as overload it stepped a fast
25
34
  desktop to the lowest tier before the visitor had moved.
26
35
 
27
- The explorer starts at Balanced and can climb through High to Ultra, using measured performance
28
- rather than the GPU's name. It uses `EARTH_STICKY_QUALITY` timings from the start: down after
29
- 2.5 s of sustained overload, up one tier after 20 s of headroom, and frame-time changes at least
30
- 6 s apart. Measurements use one-second windows, so these are approximate delays. A failed upward
31
- probe doubles the recovery delay, up to 120 s; that history stays with the controller throughout
32
- the session. Selecting a manual preset resets it. Hidden time and startup loading do not earn an
33
- upgrade. Manual presets remain fixed.
34
-
35
- High switches buildings to a more detailed preset, so promotions need sustained headroom and the
36
- explorer applies the resolution, terrain, building, surface and shadow changes over separate
37
- frames. Brief takeoff/streaming stalls do not immediately undo an upgrade. The embeddable Earth
38
- view retains its separate default ceiling of Balanced (`maxQualityLevel: 3`) and its initial
39
- 12 s calibration policy; hosts can explicitly raise that ceiling.
36
+ The explorer's Auto does not follow frame times up and down. It starts at
37
+ `earthInitialQualityLevel()` (Low on touch devices and at 2 GiB or less, Medium at 4 GiB, otherwise
38
+ Balanced) and keeps that tier for the session. What a frame costs depends on where the camera is
39
+ and what it is doing more than on the tier: a piloted aircraft weaving over a city crossed the
40
+ controller's thresholds both ways, Balanced to Medium to Balanced to High in four minutes, each
41
+ step a change of resolution, shadows and terrain detail across the whole view, and a slow takeoff
42
+ roll left a fast laptop at the lowest tiers for the rest of the flight.
43
+
44
+ Three things still lower the tier, one step at a time and for good: displayed content over the
45
+ memory budget, streaming strain, and frames under 30 a second for ten seconds running, which is a
46
+ device the guess was wrong about rather than a busy moment. Slow frames while content loads count
47
+ only when frame work itself is heavy, and long stalls never do. Nothing raises the tier: High is a
48
+ manual preset (Ultra, whose view alone holds most of the terrain cache, is reached only with
49
+ `?tier=5`). Choosing Auto again in the quality menu makes the guess afresh. Manual presets remain
50
+ fixed.
51
+
52
+ The explorer applies a tier's resolution, terrain, building, surface and shadow changes over
53
+ separate frames. The embeddable Earth view keeps its own policy: a default ceiling of Balanced
54
+ (`maxQualityLevel: 3`), which hosts can raise, and an initial 12 s calibration.
55
+
56
+ A level change rebuilds detail across the view, and that burst of work can outlast the controller's
57
+ default cooldown, read as overload, and step down again until the view reaches the lowest level.
58
+ Earth hosts therefore calibrate quickly and then hold: once a level has lasted
59
+ `EARTH_QUALITY_CALIBRATION_MS` (12 s), they replace the controller with one using
60
+ `EARTH_STICKY_QUALITY`, which needs 2.5 s of sustained overload to step down, 20 s of headroom to
61
+ step up, and keeps changes at least 6 s apart.
40
62
 
41
63
  The explorer applies each tier to drawing-buffer resolution, terrain screen-space error and
42
64
  range, selected/resident tile limits, terrain and semantic request concurrency, worldgen cache
@@ -56,6 +78,11 @@ ultrawide displays. CPU caches and resident geometry have separate limits:
56
78
  | High | 2,800,000 | 2.4 px | 96 | 400 MiB | 96 MiB |
57
79
  | Ultra | 4,000,000 | 1.75 px | 128 | 544 MiB | 128 MiB |
58
80
 
81
+ Those are each tier's own limits. Hosts pass them through `earthTerrainBudget` and
82
+ `earthWorldgenCacheBytes`, which raise the resident limits to the device's memory budget and the
83
+ worldgen cache to a quarter of it: one view of a dense city can pass a tier's cap alone, and a cache
84
+ with no room for hidden tiles loses everything the moment it leaves the view.
85
+
59
86
  Each tier also names its sun shadow quality (`EarthPerformanceTier.shadows`): off at Minimum and
60
87
  Low, medium at Medium, and high from Balanced up. On WebGPU the main pass keeps its render bundles
61
88
  while shadows are on. In a replayed bundle that has not changed since it was recorded, only the
@@ -89,10 +116,10 @@ bytes over the fixed device budget (`earthMemoryBudget()`, as Earth view does),
89
116
  reclaimable warm cache does not prevent recovery. It does not measure them against the tier's own
90
117
  resident cap: each step down shrinks that cap, so a dense city's buildings would cascade every
91
118
  step to the lowest tier while the view stayed the same. Total resident bytes
92
- still control eviction. After asynchronous surface replacements settle, `refreshMemoryUsage()`
93
- updates the cached estimates; the explorer passes `'displayed'`, re-counting only tiles on
94
- screen, where surface detail changes in place. Its HUD shows displayed bytes ("shown") beside the
95
- resident total. Existing surface grids keep their resolution
119
+ still control eviction, farthest tiles first. After asynchronous surface replacements settle,
120
+ `refreshMemoryUsage()` updates the cached estimates; the explorer passes `'displayed'`,
121
+ re-counting only tiles on screen, where surface detail changes in place. Its HUD shows displayed
122
+ bytes ("shown") beside the resident total. Existing surface grids keep their resolution
96
123
  to preserve drape alignment; newly admitted terrain uses the current cap.
97
124
 
98
125
  ## Object detail and visibility
@@ -137,7 +164,7 @@ Call `dispose()` when the renderer is destroyed. Frame-time adaptation works wit
137
164
  The separate performance HUD shows Auto's active tier/change reason, frame average/max/p90,
138
165
  CPU/GPU timing, actual draw/triangle counts, drawing-buffer dimensions and resident buffer budget.
139
166
  These measurements are distinct from cumulative generation counters. Use `?quality=auto` for
140
- adaptation; explicit `quality=economy|balanced|high` fixes a preset. `?worker=0` and
167
+ Auto; explicit `quality=economy|balanced|high` fixes a preset. `?worker=0` and
141
168
  `?surfaceWorker=0` are diagnostic fallbacks. Fixed-grid `?level=N` uses manual quality.
142
169
 
143
170
  The approach follows screen-space refinement and memory budgeting described in
@@ -1,11 +1,11 @@
1
1
  # Aircraft in the world explorer
2
2
 
3
- The world explorer includes 53 aircraft: the P-51D Mustang, OH-6 interpretation, Bendy Small Airliner
4
- and fifty additional real-type interpretations. Each has an editable GLB, reusable entity type,
3
+ The world explorer includes 54 aircraft: the P-51D Mustang, OH-6 interpretation, Bendy Small Airliner
4
+ and fifty-one additional real-type interpretations. Each has an editable GLB, reusable entity type,
5
5
  flight physics, an instrumented cockpit and a chase camera. The additions include ten helicopters,
6
- ten general aviation aircraft, ten fighters, five cargo transports, the MV-22B Osprey, AV-8B Harrier
7
- and thirteen utility, regional, historic and business aircraft. All use clean configurations without
8
- external weapons.
6
+ ten general aviation aircraft, ten fighters, five cargo transports, the MV-22B Osprey, AV-8B Harrier,
7
+ thirteen utility, regional, historic and business aircraft, and the OV-10A Bronco twin-boom
8
+ observation aircraft. All use clean configurations without external weapons.
9
9
 
10
10
  Compare national markings and camouflage in the [livery gallery](livery-gallery.md), then
11
11
  find every aircraft’s choices and reference evidence in the [livery catalog](livery-catalog.md#aircraft).
@@ -14,11 +14,11 @@ Use the **P-51 Mustang**, **OH-6** or **Bendy Small Airliner** buttons to visit
14
14
  board. The aircraft buttons also work from the example hub's world view. A direct link can use
15
15
  `?aircraft=p51d`, `?aircraft=oh6` or `?aircraft=airliner`. The **Aircraft catalog** selector visits
16
16
  the additional models; direct links also accept suffixes such as `?aircraft=uh_1h`,
17
- `?aircraft=f_16b`, `?aircraft=c_17a` and `?aircraft=mv_22b`.
17
+ `?aircraft=f_16b`, `?aircraft=c_17a`, `?aircraft=mv_22b` and `?aircraft=ov_10`.
18
18
  The three original practice models load initially. Additional GLBs load on selection, with one
19
19
  additional request in flight and intermediate selections coalesced. Replacing a selection releases
20
20
  its model and ECS entity; an occupied aircraft is retained. The host's content-pack byte cache
21
- still follows its own cache budget. The catalog does not download all fifty new models on entry.
21
+ still follows its own cache budget. The catalog does not download all fifty-one new models on entry.
22
22
  See [Vehicle interiors and instruments](vehicle-interiors.md)
23
23
  for cockpit source files, per-model instrument bindings and the shared exterior/seated GLB
24
24
  contract.
@@ -42,6 +42,7 @@ streaming and floating-origin changes. Reloading starts a fresh session.
42
42
  | G | Retract/extend airplane gear while airborne |
43
43
  | F | Toggle airplane flaps |
44
44
  | J | Cycle powered-lift lever: forward, 22.5°, 45°, 67.5°, vertical; Osprey/Harrier only |
45
+ | M | Helicopter cyclic: assisted (bounded tilt, levels itself) or direct (full authority) |
45
46
  | V | Cockpit / chase |
46
47
  | Mouse | Look around the cockpit |
47
48
  | R | Recover at the airfield after an impact |
@@ -53,24 +54,48 @@ Rotate around 85–100 knots and release the pitch key once the nose is about 10
53
54
  airplane keeps the attitude it lifted off at. At climb power the propeller's torque rolls it
54
55
  slowly left, so tap right bank (D) as needed. Retract gear and flaps after climbing. Reduce
55
56
  throttle on approach, lower gear and flaps, and land with wings level and a gentle descent.
57
+ Arrive firmly and the gear gives part of it back: the airplane skips into the air again, more
58
+ so the Mustang, whose main wheels sit ahead of its center of mass and pitch the nose up as they
59
+ touch. Ease the stick forward and let it settle. The wheel brakes do little until the wing has
60
+ stopped flying, and braking hard lifts the Mustang's tail.
56
61
  Gear-up and hard landings register an impact. To accelerate, ease the nose down toward level
57
62
  flight after cleaning up; holding the takeoff attitude spends engine power on climbing. During a
58
63
  stall, lower the nose, add power and gently level the wings. Let airspeed rebuild before pulling
59
64
  out; hauling back immediately can stall the wing again, and rudder in a stall drops a wing. A
60
- stall recovery requires altitude.
65
+ stall recovery requires altitude. The stall announces itself: a few degrees before it the
66
+ airflow starts to break away and the cockpit view shakes, harder the closer you get.
61
67
 
62
68
  There are no attitude limits: hold A or D to roll through inverted, hold S at speed to loop.
63
69
  Releasing the stick holds the flight path the airplane is on; a brief tap of W or S changes it
64
- by a degree or so. Above about 250 knots full back stick stops at 6 g. In a bank the wing's lift
70
+ by a degree or so. Above about 250 knots full back stick stops at 6 g. Hold a hard pull and
71
+ the pilot feels it: after a few seconds above 4.5 g (6.5 g in the fighters, whose pilots wear
72
+ g-suits) the edges of the view dim, then the middle; ease off and it clears in a few seconds.
73
+ Sustained negative g reddens the view. In a bank the wing's lift
65
74
  no longer holds the airplane up, so add back pressure to keep a turn level. Gusts and turbulence
66
75
  from the Weather setting bump, roll and yaw the airplane, more so near the ground on windy days.
67
76
 
68
77
  OH-6: start the engine and allow roughly six simulation seconds to reach full rotor speed. Raise
69
78
  collective gradually toward 50%; exact hover power varies with altitude and ground effect. Small
70
79
  cyclic inputs tilt rotor thrust to travel. Lower collective gently to land. Switch off the engine
71
- and wait for the rotor to stop before exiting. An aircraft cannot be exited or switched to free
80
+ and wait for the rotor to stop before exiting. If the engine stops in flight (press I to try
81
+ it), lower the collective at once: the air rising through the rotor keeps it turning, and the
82
+ helicopter comes down steadily at about 2,000 feet a minute instead of falling. Keep some
83
+ forward speed, and just above the ground raise the collective to spend the rotor's speed on a
84
+ soft touchdown. Hold the collective up instead and the rotor slows, the HUD warns of low rotor
85
+ RPM, and the lift goes with it. An aircraft cannot be exited or switched to free
72
86
  flight while airborne. After an impact, R resets its aircraft state and places it on the airfield.
73
87
 
88
+ The helicopter's cyclic starts assisted: W/S and A/D ask for a tilt of up to about 30°, and the
89
+ helicopter levels itself when you let go. Press M for direct cyclic. The stick then sets how
90
+ fast the nose pitches and the fuselage rolls, there are no attitude limits, and releasing it holds
91
+ whatever attitude you are in, level or not: in a hover you keep it level yourself. With 45 m/s
92
+ and high collective, holding S loops the OH-6 in about six seconds for a hundred-odd meters of
93
+ height; hold W to point it straight down. Keep the rotor loaded. Control comes from the rotor's
94
+ thrust, so with the collective down, or pushing over into weightlessness, the stick does far less,
95
+ and an inverted rotor drives the helicopter toward the ground. Press M again in any attitude to
96
+ hand back to the assisted cyclic, which rolls the helicopter upright and levels it. On the ground
97
+ both modes behave as assisted.
98
+
74
99
  Bendy Small Airliner: the generic 39-meter twin uses the same airplane controls, with slower
75
100
  responses and a lower load-factor limit than the Mustang. Its two independently named engines
76
101
  use the jet thrust model, calibrated to a representative Mach 0.78 cruise. It is a fictional
@@ -89,14 +114,18 @@ down regardless of G. Cargo aircraft have larger clearance and runway requiremen
89
114
 
90
115
  Cockpit needles show airspeed, altitude, heading, vertical speed and RPM; the artificial horizon
91
116
  banks with the aircraft. The HUD supplies precise knot/feet/feet-per-minute readings, AGL height,
92
- g load, power, engine/gear/flap state, stall alerts and terrain waiting status. It distinguishes
117
+ g load, power, fuel remaining, engine/gear/flap state, stall, buffet, low-rotor-RPM, low-fuel
118
+ and greyout alerts and terrain waiting status. It distinguishes
93
119
  KTAS from equivalent airspeed (KEAS), shows local Mach and afterburner percentage, and flags
94
120
  airframe/surface overspeed and developed departures. KEAS is not calibrated indicated airspeed.
95
121
  Propellers, both helicopter
96
- rotors, controls, gear, flaps, ailerons, elevators and rudder animate from simulation state. The
97
- Mustang's gear takes 12 seconds: its inner wheel doors open, each main leg swings inboard into a
98
- well in the wing root, the tail wheel folds forward into the fuselage, and the doors close behind
99
- them. Its flaps take 13 seconds to run down to 50°.
122
+ rotors, controls, gear, flaps, ailerons, elevators and rudder animate from simulation state. A
123
+ rotor turning too fast for a display to sample fades from blades into a translucent disc, so a
124
+ propeller at full power cannot alias into looking stopped; the hub stays solid, and the disc's size
125
+ comes from the model (see the blur details below). The Mustang's gear takes 12 seconds: its inner
126
+ wheel doors open, each main leg swings inboard into a well in the wing root, the tail wheel folds
127
+ forward into the fuselage, and the doors close behind them. Its flaps take 13 seconds to run down
128
+ to 50°.
100
129
 
101
130
  ## Collisions and breakable sections
102
131
 
@@ -156,7 +185,7 @@ keyframes; `crashed` means damage requiring recovery and no longer freezes motio
156
185
 
157
186
  ## Reuse in another experience
158
187
 
159
- All 53 aircraft are registered in the `molen.entities` content pack, with their type documents and models.
188
+ All 54 aircraft are registered in the `molen.entities` content pack, with their type documents and models.
160
189
  `npx molen pack fetch https://molen.dev/packs/index.json molen.entities` downloads it and lists it
161
190
  in your project.json `packs`, and the CLI then resolves the types; in a browser, open it with `openPack` from `@bendyline/molen-pack` and pass
162
191
  `createPackSet([pack]).assetProvider()` as the client's asset provider. The entity type IDs and
@@ -204,8 +233,9 @@ Its size and radial colors come from the blade geometry and materials; separate
204
233
  This render-only effect needs no model changes and works with WebGL and WebGPU. Fading blades use
205
234
  transparent copies of their materials, listed in `userData.materialVariants`: a preparing renderer
206
235
  builds them on request, and the blades stay solid until they are built rather than stalling the
207
- frame the engine starts. Helicopter
208
- rotors and enclosed jet fans retain their existing animation.
236
+ frame the engine starts. Every other rotor (helicopter main and tail rotors, and fans a jet model
237
+ binds as rotors) blurs between 35 and 78 rad/s instead: its blades fade into a faint disc with a
238
+ slightly darker tip ring, sized from the model, and its hub stays solid.
209
239
 
210
240
  For powered lift, declare `spec.poweredLift` with positive `transitTime`, `controlFadeSpeed`,
211
241
  `pitchAuthority`, `rollAuthority`, `yawAuthority` and `damping`, and mark the participating
@@ -234,7 +264,7 @@ power for propellers and dry/reheat thrust for jets, with a transient RPM spool
234
264
 
235
265
  ### Propulsion, altitude and performance
236
266
 
237
- All 53 shipped aircraft have separate performance profiles. `engine.propulsion: 'propeller'`
267
+ All 54 shipped aircraft have separate performance profiles. `engine.propulsion: 'propeller'`
238
268
  uses shaft power, propeller efficiency and an altitude lapse, with `ratedDensityRatio` representing
239
269
  supercharging or flat rating. `'jet'` uses `dryThrust` in newtons, density lapse and a Mach-dependent
240
270
  ram term. `afterburnerThrust` is total augmented thrust per engine. The last 15% of throttle
@@ -260,13 +290,72 @@ printed pages 126–127, supports these mechanisms; it does not supply a validat
260
290
  coefficient set. This model does not reproduce the F-14A's TF30 compressor stalls, the later
261
291
  digital flight-control system, or automatic variable wing sweep aerodynamics.
262
292
 
263
- Helicopters retain assisted cyclic and collective controls. An actuator-disc power budget limits
293
+ Helicopters keep an assisted collective and, unless [direct cyclic](#direct-cyclic) is selected,
294
+ an assisted cyclic. An actuator-disc power budget limits
264
295
  lift by installed shaft power, induced power, rotor profile losses and parasitic drag power;
265
296
  increasing payload cannot create extra engine power. Their calibrated parasitic drag,
266
297
  density-dependent lift, ground effect and translational lift are supplemented by optional
267
298
  vortex-ring lift loss in powered, slow descent and retreating-blade lift loss above an authored
268
- equivalent speed. These are qualitative approximations, not blade-element models or an
269
- autorotation training model. Powered-lift conversion has the separate limitations described above.
299
+ equivalent speed. These are qualitative approximations, not blade-element models.
300
+ Powered-lift conversion has the separate limitations described above.
301
+
302
+ In forward flight the tail fin weathervanes the nose into the relative wind, so banking with the
303
+ cyclic turns the nose along with the track rather than crabbing. The nose aligns at
304
+ `helicopter.directionalStability × airspeed / length` rad/s per radian of sideslip (default 1;
305
+ 0 turns it off). In a full-cyclic turn without pedal the OH-6's nose trails its track by about
306
+ 4° at 25 m/s and about 1° at 50 m/s; right pedal coordinates the turn. The effect fades out
307
+ below about a fifth of `translationalLiftSpeed`, where the tail sits in the rotor wake, so in a
308
+ hover the pedals alone set the heading and a strong wind slowly turns the nose into it. Pedal
309
+ authority does not change, so at cruise speed the pedals hold only a few degrees of sideslip
310
+ against the fin: turn with the cyclic. Drag is the same in every direction, so a sideslip
311
+ adds no side force.
312
+
313
+ ### Direct cyclic
314
+
315
+ `aircraftInput.cyclicMode` selects the helicopter cyclic. `assisted` (the default) commands a
316
+ tilt of `cyclicTilt × stick`, bounded by `maxTilt`, that springs back to level, and keeps the
317
+ attitude as Euler angles. `direct` commands body pitch and roll rates and integrates the attitude
318
+ as a quaternion, as the airplanes do, so loops, rolls and vertical dives are possible:
319
+
320
+ - Full stick gives `helicopter.cyclicRate` rad/s (default `cyclicResponse / 4`, 1 rad/s in the
321
+ OH-6) with the rotor carrying the weight, reached with the rotor's damping
322
+ (`cyclicDamping`). Released, the rates die out and the attitude holds. There is no
323
+ self-levelling, speed stability or pitch weathervaning, so it flies as a rate-command,
324
+ attitude-hold helicopter, not one that drifts by itself.
325
+ - Control power scales with rotor thrust over weight, clamped to 0..1.5. The share set by
326
+ `helicopter.hubStiffness` (0..1, default 0.25) comes from the blade hinges and remains at
327
+ zero g; the rest fades as the rotor unloads. Mast bumping in a teetering rotor is not modelled.
328
+ - The rotor's heave damping, vortex ring, autorotation and climb power act on the climb or
329
+ descent through the disc, and translational lift, retreating-blade stall and parasite drag act
330
+ on the flow across it. With the disc level these are the vertical and horizontal airspeed,
331
+ exactly as in the assisted model; with the disc vertical in a dive, the whole descent runs
332
+ across the disc. Rotor thrust cannot reverse, so an inverted rotor pushes toward the ground.
333
+ - The tail-fin weathervane works in the fuselage's own frame, so a helicopter banked past 90°
334
+ sideslips nose-first toward the ground. Pedals command a yaw rate the tail rotor reaches in
335
+ about an eighth of a second.
336
+
337
+ On the skids both modes behave as assisted. Switching back to assisted in an unusual attitude
338
+ does not snap: beyond `maxTilt` the limit lets the tilt shrink but not grow, and the cyclic's
339
+ spring flies the helicopter back to level, rolling it upright from inverted in about a second
340
+ and a half.
341
+
342
+ ### Autorotation
343
+
344
+ With its engine out in flight a helicopter's rotor freewheels, and its speed follows an energy
345
+ balance instead of running down: the rotor holds `helicopter.rotorInertiaTime` seconds of hover
346
+ power at full speed (default 2), spends it on the lift the collective asks for and on its own
347
+ drag, and gets power back from the air it descends through. That rising air also meets the
348
+ blades at a steeper angle, as more collective would (about a third of the lever at 10 m/s), so
349
+ the collective goes down and the descent settles at a steady rate: the OH-6 comes down at about
350
+ 10 m/s at 50 knots with the collective nearly closed and the rotor at full speed. Pulling the
351
+ collective near the ground spends rotor speed on a cushion, a second or two of it; a heavy
352
+ rotor (the UH-1H's 3.5 s) forgives a late or early pull, a light one (the R44's 1.6 s, the
353
+ OH-6's 1.5 s) does not. Held too high, the collective drags the rotor down and the lift with
354
+ it. Rotor speed never exceeds its governed value. On the ground the rotor runs down as before,
355
+ and a restart in flight spools it back up. This needs `powerLimitedRotor`, which every shipped
356
+ helicopter has. It is a momentum-theory approximation for learning the shape of the manoeuvre,
357
+ not a blade-element model: there is no blade stall at low rotor speed and no height-velocity
358
+ curve.
270
359
 
271
360
  ### Headless fleet experiments
272
361
 
@@ -290,8 +379,31 @@ Published cruise, maximum and operating speeds are different quantities. Where a
290
379
  not specify weight, altitude or throttle, the test condition is explicitly estimated. Some
291
380
  aircraft still have engineering-estimate anchors. Passing a fitted anchor establishes internal
292
381
  consistency, not independent real-world validation. All polar, lapse and high-alpha coefficients
293
- remain approximations. Fuel burn, stores, continuous CG changes, detailed engine maps, icing,
294
- fatigue, load-induced structural failures and certified flight-control laws are not modeled.
382
+ remain approximations. Stores, a center of gravity that moves as fuel burns, detailed engine
383
+ maps, icing, fatigue, load-induced structural failures and certified flight-control laws are not
384
+ modeled.
385
+
386
+ ### Fuel and weight
387
+
388
+ An aircraft with a `spec.fuel` block carries fuel: `capacity` is the usable load in kg, and
389
+ `spec.mass` is the aircraft with full tanks. `aircraftState.fuel` starts full and burns with
390
+ the power in use, the aircraft flies lighter as it goes (it climbs and turns a little better on
391
+ empty tanks), and when the tanks are dry every engine stops: an airplane becomes a glider and a
392
+ helicopter autorotates. A propeller or rotor engine burns by the shaft work it delivers
393
+ (`engine.fuelConsumption` in kg per joule; default 7.5e-8 with a manual mixture, about 0.27
394
+ kg/kWh, and 9.5e-8 otherwise), a jet by its thrust (kg per newton-second; default 2e-5), and
395
+ `afterburnerFuelConsumption` (default 5.4e-5, per newton of total thrust at full reheat) is why
396
+ the afterburner is for moments: an F-16 that flies over half an hour at military power
397
+ empties its tanks in about eight minutes with the burner lit. Engines never burn less than an idle
398
+ flow. All 54 shipped aircraft carry fuel, sized by class as a share of their mass (13–17% for
399
+ propeller aircraft, 22% for airliners and transports, 28% for fighters and small jets, 14% for
400
+ helicopters): estimates, not flight-manual capacities. Recovering (R) starts a fresh aircraft
401
+ with full tanks, and so does boarding one that is parked: the Earth view and the world explorer
402
+ call `refuelAircraft(world, id)`, which fills the tanks of an aircraft standing on the ground
403
+ with its engines stopped. Without a `fuel` block, fuel is unlimited and the mass constant, as before.
404
+
405
+ `aircraftFuelFlow(engine, engineState)` from `kernel/aircraft` returns an engine's burn in
406
+ kg/s for a fuel-flow gauge or a range estimate.
295
407
 
296
408
  Flight assistance is limited to the pitch axis, so a keyboard can fly it. The stick moves an
297
409
  elevator (deflecting at `pitchResponse` per second and springing back four times faster) that
@@ -311,6 +423,115 @@ tires let go, so crosswind weathervaning and propeller swing grow through the ta
311
423
  drift persists after touchdown. The gear holds the wings level and the nose at its resting
312
424
  attitude until the elevator lifts it, up to `maxGroundPitch`.
313
425
 
426
+ ### Landing gear
427
+
428
+ The gear works by the weight on it. Wheel brakes (`brakeDeceleration`) and rolling drag scale
429
+ with the share of the weight the wheels carry, from a fifth with the wing flying to all of it
430
+ at a walk, so braking right after touchdown does little until the airplane has slowed, and
431
+ braking tips it forward on its struts: a nosewheel airplane dips its nose, a taildragger lifts
432
+ its tail. Struts and tires give back part of a firm touchdown: `gearRebound` (default 0.45) of
433
+ the sink speed beyond a gentle 0.6 m/s, so a greased landing stays down and a firm one skips,
434
+ further the more of its weight the wing still carries. `airplane.tailwheel: true` puts the main
435
+ wheels ahead of the center of mass: touching down on them with the tail still up pitches the
436
+ nose up, into more lift and a bigger bounce, where a nosewheel airplane pitches down onto its
437
+ nose gear and stays. The Mustang, Beaver, Porter, Beech 18 and DC-3 are taildraggers. A sink
438
+ rate beyond `hardLandingSpeed` is still damage, not a bounce. There are no individual struts
439
+ or tires: the airframe does not sink on its gear, and there is no ground loop.
440
+
441
+ ### Buffet and the pilot under g
442
+
443
+ `aircraftState.buffet` (0–1) rises from 0.07 rad (4°) before the stall angle to 1 at the stall
444
+ and stays there in separated flow, scaled down where the air is too slow to shake anything. It
445
+ is a cue, not a force: the flight path is unchanged. `aircraftCameraPose` takes
446
+ `shake: { amount, time }` and shakes the seated view by it (the Earth view and the world
447
+ explorer pass the buffet), and the world explorer's HUD warns.
448
+
449
+ `aircraftState.greyout` and `redout` (0–1) are the pilot's accumulated strain. Above
450
+ `airplane.pilotGTolerance` (default 4.5 g, or 6.5 g where `maxLoadFactor` is 7.5 or more: a
451
+ g-suit), `greyout` builds at a twentieth of the excess g per second, so 9 g in a fighter dims
452
+ the view after about three seconds and takes it away in eight; a g below the tolerance and it
453
+ recovers in four. Below -1.5 g, `redout` builds a sixth of the excess per second. The controls
454
+ keep working throughout: this is what the pilot sees, for a host to draw (the world explorer
455
+ narrows the view to a tunnel, then darkens it, and tints it red), not a loss of consciousness.
456
+ `view.vehicleStatus()` reports `buffet`, `greyout`, `redout`, and `fuel` with `fuelCapacity`.
457
+
458
+ ### The pilot's body in the seat
459
+
460
+ `PilotMotion` from `@bendyline/molen-client/aircraft` moves the cockpit camera the way a load
461
+ moves someone strapped into the seat. Like the buffet shake it is a cue for the view: it reads the
462
+ aircraft's motion and never changes the flight.
463
+
464
+ - **Heave.** In a pull the eye sinks into the seat and the chin drops; unloaded, the pilot floats
465
+ up against the straps.
466
+ - **Surge.** Thrust presses the pilot into the seat back; braking throws them forward onto the
467
+ straps and nods the head.
468
+ - **Sway.** A skid, or a turn on the ground, throws them to the outside and tilts the head with
469
+ the body.
470
+ - **Lag.** The head is left behind for a moment when a roll, pitch or yaw starts quickly.
471
+ - **Horizon lean.** In a bank the head tilts toward the horizon, as pilots do.
472
+ - **Bracing.** The body gives way when a load arrives, then the pilot recovers part of the travel
473
+ over about a second, and is left leaning the other way for a moment when the load comes off.
474
+
475
+ What the pilot feels is the specific force in the seat's own axes: the aircraft's acceleration
476
+ less gravity, which is 1 g straight up through the seat when parked or in level flight. The model
477
+ takes it from the change in the aircraft's velocity between simulation ticks, so it works for
478
+ every airplane and helicopter, on the ground and in the air, with no change to the flight model.
479
+ The body is three damped springs driven by how far that load is from 1 g up, and the head three
480
+ more. It runs in simulation time: a paused world holds the pilot still.
481
+
482
+ ```ts
483
+ import {
484
+ aircraftCameraPose,
485
+ PilotMotion,
486
+ pilotMotionSample,
487
+ } from '@bendyline/molen-client/aircraft';
488
+
489
+ const pilot = new PilotMotion();
490
+
491
+ // Each frame, with the flown aircraft's transform and aircraftState:
492
+ const motion = pilot.update(pilotMotionSample(world.tick * world.dt, transform, state));
493
+ const pose = aircraftCameraPose(transform, spec, { view: 'cockpit', motion });
494
+ ```
495
+
496
+ Call `update` in every view, so the body is already settled when the cockpit view returns, and
497
+ `reset()` when the pilot changes aircraft. A teleport or a respawn is recognized (the aircraft
498
+ moved farther than its speed carries it) and starts the pilot settled in the seat; an impact is
499
+ felt as a jolt. Chase views ignore `motion`. `pilot.load` is the load last felt, in g, as
500
+ `[left, up, forward]`, for a HUD.
501
+
502
+ The defaults are sized to be felt more than seen. Flown through the flight model: a 6 g pull in
503
+ the P-51D lowers the eye 3 cm, presses it a centimeter back and drops the chin 1.5°; full brakes
504
+ throw the pilot nearly 3 cm forward, half of which they recover as they brace; a 60° bank tilts
505
+ the head 3°. `pilot.tuning` holds every number and is live, so a host can adjust it while flying:
506
+
507
+ | Tuning | Default | Meaning |
508
+ |---|---|---|
509
+ | `enabled` | `true` | The switch: off, the eye stays at the authored `pilotEye`. |
510
+ | `intensity` | `1` | Scales every displacement and rotation before its limit. |
511
+ | `maxLoad` | `12` | Loads beyond this many g on an axis are clipped: an impact jolts, it does not launch. |
512
+ | `braceTime` | `1.2` | Seconds the pilot takes to brace against a sustained load. |
513
+ | `heave`, `surge`, `sway` | | One body axis each: `travel` (meters per g), `limit` (meters, `[negative, positive]`, approached softly), `frequency` (Hz), `damping` (ratio) and `brace` (share of a sustained load recovered, 0–1). |
514
+ | `head.nod` | `0.006` | Chin drop per g above 1, radians. |
515
+ | `head.surgeNod` | `0.04` | Chin drop per g of deceleration, radians. Pressed back, the head meets the headrest. |
516
+ | `head.swayTilt` | `0.05` | Head roll per g of sideways load, radians. |
517
+ | `head.lag` | `0.004` | Radians of lag per rad/s² of airframe angular acceleration. |
518
+ | `head.horizonLean` | `0.12` | Radians of tilt per radian of bank at small angles; it peaks at 45° and is gone at knife-edge and inverted. |
519
+ | `head.limit` | `0.1` | Largest head rotation about one axis, radians, approached softly. |
520
+ | `head.neck` | `0.12` | Height of the eyes above the neck's pivot, meters: a tilted head also moves the eye. |
521
+ | `head.frequency`, `head.damping` | `2.4`, `0.6` | The head's spring. |
522
+
523
+ `new PilotMotion(false)` or `pilot.configure(false)` switches the whole effect off;
524
+ `pilot.configure({ heave: { travel: 0.012 } })` changes the fields it names. In an Earth view the
525
+ effect is on by default: mount with `pilotMotion: false` (or a partial tuning), and call
526
+ `view.setPilotMotion(...)` to change it while flying. World Explorer has a "Pilot feels g"
527
+ checkbox; `?pilotMotion=0` starts with it off and `?pilotMotion=3` exaggerates it threefold to
528
+ show what moves.
529
+
530
+ > [!NOTE]
531
+ > An Earth view's cockpit camera keeps a level horizon, so the head's roll (the horizon lean and
532
+ > the lag of a roll) does not show there; the eye's travel and the nod do. Hosts that apply the
533
+ > pose's `rotation`, as World Explorer does, show all of it.
534
+
314
535
  The gear and flaps travel rather than switch. `aircraftInput.gear` and `flaps` select a position,
315
536
  and `aircraftState.gearPosition` and `flapPosition` (0 up, 1 down) move toward it over
316
537
  `airplane.gearTransitTime` seconds for a full gear cycle, doors included, and `flapTransitTime`
@@ -461,8 +682,8 @@ collides with terrain. Do not add a second physics body that also writes the air
461
682
 
462
683
  This is a game flight model with recognizable polygonal aircraft, not a full aircraft systems
463
684
  simulation or a calibrated replica of any airplane's handling. Rotor blade-element aerodynamics,
464
- autorotation, a quantitatively validated spin model, fuel, automatic engine damage, detailed
465
- avionics and weapons are outside this implementation. Primary cockpit controls operate the simulated
685
+ a quantitatively validated spin model, fuel tanks and their selection, a moving center of
686
+ gravity, automatic engine damage, detailed avionics and weapons are outside this implementation. Primary cockpit controls operate the simulated
466
687
  systems as described below; switches for unsupported systems remain decorative. Collision uses coarse airframe probes and resident world
467
688
  geometry; it does not model deformation or distant unloaded obstacles.
468
689
 
@@ -474,7 +695,7 @@ and also center on release. Drag a throttle or collective upward to increase its
474
695
  Modeled gear selectors toggle on click; flap and thrust-vector levers accept intermediate positions.
475
696
  Solid panel geometry blocks clicks behind it. Dragging empty space still looks around.
476
697
 
477
- All 53 bundled cockpits have physical controls for their supported systems, including engine
698
+ All 54 bundled cockpits have physical controls for their supported systems, including engine
478
699
  master switches, individual engine switches and throttles for airplanes with named engine banks,
479
700
  parking brakes, and applicable gear, flap and nozzle controls. Supplemental labeled modules fill
480
701
  gaps in the original models; their layout approximates the aircraft rather than reproducing every
@@ -508,7 +729,8 @@ propeller rotation, torque and thrust all follow these inputs. This follows the
508
729
  throttle, mixture and governed RPM in the [FAA engine-controls overview](https://www.faasafety.gov/gslac/ALC/libview_printerfriendly.aspx?id=6849).
509
730
 
510
731
  These are estimated simulation curves, not aircraft performance tables or operating procedures.
511
- There is no fuel consumption, EGT/CHT, detonation, feathering, reverse thrust or blade-element model.
732
+ There is no EGT/CHT, detonation, feathering, reverse thrust or blade-element model, and
733
+ leaning does not change the fuel burn.
512
734
  Fixed-pitch Cessna 172S and Cherokee aircraft expose mixture without a propeller lever; the DA42
513
735
  and PC-12 NGX retain automatic scheduling. Turboprops have no piston mixture. Combined condition
514
736
  levers used for propeller RPM currently cover the governed range; engine cutoff remains a separate
@@ -532,6 +754,18 @@ world explorer also prepare an aircraft's shaders before its model joins the sce
532
754
 
533
755
  Double-sided transparent materials (canopies, windscreens, instrument covers) draw in one pass:
534
756
  three otherwise draws each such pane twice and builds a program before each face, every frame.
757
+ Glass casts no sun shadow: a mesh whose materials all blend at less than full opacity, or whose
758
+ name contains `canopy` or `bubble`. Three's shadow pass draws a pane as solid, so a windscreen
759
+ shaded its whole cockpit.
760
+
761
+ For the aircraft a view follows (flown or watched), hosts also pass `renderer.shadowTexelSize`
762
+ to `visual.updateShadows(texel)` each frame, and `undefined` for every other aircraft. Over a
763
+ wide view the sun's shadow map coarsens (on High, 0.2 m texels 100 m above the ground, 1.6 m in
764
+ cruise at 2,500 ft). It then cannot resolve the aircraft's own canopy frame and seat, and their
765
+ shadows on the cockpit jumped from frame to frame as the aircraft crossed the map's texel grid.
766
+ Coarser than 0.15 m, the aircraft casts no sun shadow; at 0.12 m or finer it casts again. It
767
+ still receives shadows from terrain, buildings and clouds. The Earth view and the world explorer
768
+ do this for the mounted aircraft.
535
769
 
536
770
  `createAircraftVisual` exposes `cockpit`, a mesh picker and control inventory derived from the
537
771
  interior's authored primary-input bindings and glTF node `extras.aircraftControl` metadata.
@@ -548,7 +782,7 @@ through `flyAircraft`, and mix `AircraftPointerAxes` with their keyboard/gamepad
548
782
  release must clear transient axes. The binder cancels drags on exit, view change, blur and pointer
549
783
  cancellation; it does not write simulation components directly.
550
784
 
551
- In the engine repository, build the client and kernel, then run a local live review of all 53 bundled aircraft:
785
+ In the engine repository, build the client and kernel, then run a local live review of all 54 bundled aircraft:
552
786
 
553
787
  ```sh
554
788
  pnpm --filter @bendyline/molen-examples-world-explorer exec vite --config ../../packages/entities/scripts/cockpit-controls-vite.mjs