threedog 2.2.0 → 2.3.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 +36 -0
- package/README.md +4 -4
- package/core/assets/Animator.js +66 -12
- package/core/assets/ik.js +144 -18
- package/core/assets/maskLayer.js +377 -0
- package/core/assets/rootMotion.js +148 -0
- package/core/audio/Audio.js +100 -4
- package/core/base/errorCodes.js +6 -369
- package/core/base/errorCodesModules.js +378 -0
- package/core/engine/Engine.js +8 -5
- package/core/engine/Loading.js +8 -4
- package/core/engine/copies.js +1 -1
- package/core/engine/headlessLoad.js +15 -4
- package/core/engine/lifecycle.js +1 -0
- package/core/engine/loop.js +23 -3
- package/core/engine/moduleSlots.js +3 -7
- package/core/engine/modules.js +30 -58
- package/core/engine/startup.js +3 -3
- package/core/input/Input.js +7 -3
- package/core/input/inputContext.js +3 -2
- package/core/input/inputSeat.js +1 -1
- package/core/inspect/DebugOverrides.js +1 -1
- package/core/inspect/Describe.js +7 -2
- package/core/inspect/describeRender.js +4 -1
- package/core/inspect/describeText.js +2 -2
- package/core/inspect/metadata.generated.js +380 -74
- package/core/inspect/pictureMenu.js +2 -0
- package/core/inspect/pictureWriters.js +4 -3
- package/core/ops/Ops.js +9 -3
- package/core/ops/actor.js +10 -0
- package/core/ops/control.js +17 -6
- package/core/ops/holds.js +1 -1
- package/core/ops/opsAtomic.js +6 -1
- package/core/ops/opsGuard.js +2 -2
- package/core/ops/owned.js +37 -11
- package/core/ops/sharedPoint.js +5 -1
- package/core/ops/stacks.js +30 -7
- package/core/saves/Saves.js +0 -2
- package/core/saves/saveApply.js +7 -7
- package/core/saves/session.js +6 -3
- package/core/saves/stateReplace.js +71 -41
- package/core/scene/Rays.js +74 -26
- package/core/scene/canvasBox.js +9 -0
- package/core/scene/gameLights.js +19 -11
- package/core/scene/sceneDelta.js +8 -4
- package/core/scene/sceneMethods.js +2 -1
- package/core/stream/chunkStream.js +21 -0
- package/core/stream/dirtyWatch.js +37 -0
- package/core/time/skip.js +9 -6
- package/core/time/time.js +72 -18
- package/docs/AI.md +22 -21
- package/docs/API.md +5 -4
- package/docs/CODEMAP.md +16 -10
- package/docs/COMMANDS.md +5 -5
- package/docs/CONVENTIONS.md +9 -25
- package/docs/api/ambience.md +1 -0
- package/docs/api/assets.md +10 -3
- package/docs/api/audio.md +5 -3
- package/docs/api/decals.md +16 -0
- package/docs/api/engine.md +1 -0
- package/docs/api/tools.md +3 -1
- package/docs/api/water.md +3 -0
- package/docs/recipes/09-materials-lights-models.md +15 -1
- package/docs/recipes/13-animation.md +51 -10
- package/docs/recipes/16-dev-bridge.md +4 -4
- package/docs/recipes/31-audio.md +15 -9
- package/docs/recipes/34-environment-lighting.md +11 -1
- package/docs/recipes/44-water-weather-hooks.md +1 -0
- package/examples/action/.threedog/content-index.json +1 -0
- package/examples/perf-island/.threedog/content-index.json +1 -0
- package/examples/plain-picture/.threedog/content-index.json +1 -0
- package/examples/rc2d/.threedog/content-index.json +1 -0
- package/examples/styletest/.threedog/content-index.json +1 -0
- package/examples/techniques/outlines-and-rim/main.js +1 -1
- package/examples/techniques/procedural-surface/main.js +1 -1
- package/examples/techniques/stylized-shading/main.js +1 -1
- package/examples/webgpu-tsl/.threedog/content-index.json +1 -0
- package/examples/world/.threedog/content-index.json +1 -0
- package/index.d.ts +6 -2
- package/index.js +3 -2
- package/llms.txt +11 -10
- package/modules/ambience/Ambience.js +97 -15
- package/modules/camera/common.js +18 -12
- package/modules/characters/Character.js +30 -3
- package/modules/characters/NPC.js +2 -5
- package/modules/characters/astar.js +45 -14
- package/modules/characters/movers/rapier.js +53 -41
- package/modules/characters/movers/simple.js +37 -24
- package/modules/characters/npcView.js +2 -2
- package/modules/characters/pathAsync.js +3 -3
- package/modules/collision/contract.js +2 -2
- package/modules/content/index.js +3 -0
- package/modules/content/models.js +11 -4
- package/modules/content/templates.js +11 -11
- package/modules/debug/DebugPanel.js +1 -0
- package/modules/decals/Decals.js +393 -0
- package/modules/decals/index.js +1 -0
- package/modules/gameplay/Container.js +2 -0
- package/modules/gameplay/Containers.js +17 -3
- package/modules/gameplay/Dialogue.js +1 -1
- package/modules/gameplay/Interactions.js +7 -6
- package/modules/gameplay/Inventory.js +5 -1
- package/modules/gameplay/Quests.js +4 -3
- package/modules/gameplay/inventoryOps.js +2 -2
- package/modules/gameplay/pickups.js +32 -12
- package/modules/gameplay/questSave.js +2 -2
- package/modules/grid/index.js +8 -2
- package/modules/hud/index.js +1 -1
- package/modules/level/heightfield.js +1 -0
- package/modules/level/index.js +3 -2
- package/modules/level/nodes.js +2 -1
- package/modules/lights/index.js +27 -4
- package/modules/lights/slots.js +33 -16
- package/modules/nav/contract.js +4 -4
- package/modules/nav/index.js +6 -2
- package/modules/net/Client.js +24 -11
- package/modules/net/Host.js +73 -20
- package/modules/net/index.js +33 -21
- package/modules/net/sync.js +38 -8
- package/modules/net/transports.js +7 -3
- package/modules/particles/Particles.js +11 -4
- package/modules/particles/contract.js +6 -6
- package/modules/particles/effect.js +0 -1
- package/modules/rigid/RigidBodies.js +69 -57
- package/modules/rigid/Vehicles.js +8 -7
- package/modules/rigid/ragdoll.js +4 -6
- package/modules/rigid/rapierCompat.js +90 -0
- package/modules/rigid/sync.js +2 -5
- package/modules/settings/Settings.js +10 -4
- package/modules/sky/Sky.js +10 -2
- package/modules/sky/environment.js +29 -13
- package/modules/sky/frame.js +2 -2
- package/modules/sky/shader.js +5 -2
- package/modules/sky/skyModule.js +2 -2
- package/modules/swarm/Swarm.js +3 -2
- package/modules/swarm/grid.js +12 -7
- package/modules/terrain/ChunkManager.js +16 -26
- package/modules/triggers/index.js +5 -6
- package/modules/vegetation/draw.js +62 -26
- package/modules/vegetation/groundChunks.js +8 -22
- package/modules/water/Water.js +152 -24
- package/modules/water/surface.js +43 -20
- package/modules/weather/weatherDraw.js +4 -1
- package/modules/world/World.js +21 -2
- package/modules/world/index.js +5 -0
- package/modules/world/persist.js +1 -0
- package/modules/world/records.js +3 -1
- package/modules/world/sim.js +3 -2
- package/modules/world/simFar.js +4 -2
- package/modules/world/state.js +7 -1
- package/package.json +2 -2
- package/presets.js +30 -0
- package/render/PostFX.js +24 -17
- package/render/backend.js +72 -31
- package/render/cascades.js +25 -14
- package/render/cascades.tsl.js +32 -21
- package/render/fogLook.js +2 -1
- package/render/fx/detail.tsl.js +3 -0
- package/render/fx/library.tsl.js +1 -1
- package/render/fx/particles.tsl.js +4 -18
- package/render/fx/pcss.tsl.js +2 -2
- package/render/fx/postWebGPU.tsl.js +47 -25
- package/render/fx/sky.tsl.js +6 -18
- package/render/fx/uniforms.tsl.js +16 -0
- package/render/fx/water.tsl.js +24 -5
- package/render/fxNumbers.js +2 -0
- package/render/impostor.tsl.js +10 -6
- package/render/lights.js +6 -6
- package/render/occlusion.js +17 -6
- package/render/patches.js +40 -28
- package/render/postWebGL.js +6 -4
- package/render/reflectionProbes.js +302 -0
- package/render/shaderErrors.js +18 -8
- package/render/shadowCache.tsl.js +10 -5
- package/render/shadows.js +70 -49
- package/render/threeCompat.js +166 -0
- package/types/core.d.ts +33 -3
- package/types/gameplay.d.ts +80 -0
- package/types/generated/core/audio/Audio.d.ts +18 -1
- package/types/generated/core/ops/Ops.d.ts +2 -1
- package/types/generated/core/ops/control.d.ts +7 -3
- package/types/generated/core/saves/session.d.ts +4 -1
- package/types/generated/modules/ambience/Ambience.d.ts +6 -0
- package/types/generated/modules/debug/DebugPanel.d.ts +1 -0
- package/types/generated/modules/grid/index.d.ts +27 -3
- package/types/generated/modules/net/index.d.ts +8 -3
- package/types/generated/modules/sky/Sky.d.ts +1 -0
- package/types/generated/modules/water/Water.d.ts +15 -0
- package/types/generated/modules/world/index.d.ts +5 -0
- package/types/generated/render/patches.d.ts +5 -0
- package/types/physics.d.ts +66 -9
- package/types/tsl.d.ts +2 -0
- package/types/world.d.ts +2 -0
- package/ui/Parts.js +3 -2
- package/docs/MIGRATING-0.7.md +0 -39
- package/docs/MIGRATING-0.8.md +0 -171
- package/modules/rigid/refresh.js +0 -10
|
@@ -53,6 +53,126 @@ export const sectionHomes = {
|
|
|
53
53
|
};
|
|
54
54
|
/** Modules, content sections, contracts and placement fields of the engine */
|
|
55
55
|
export const metadata = {
|
|
56
|
+
"core": {
|
|
57
|
+
"params": {
|
|
58
|
+
"adaptiveResolution": {
|
|
59
|
+
"docType": "boolean",
|
|
60
|
+
"desc": "Automatically lower quality when frames cost too much (resolution, and post effects that declare a cheaper or skippable form; engine.adaptive.steps), default true. Never silent: a dev warning once, and engine.budget.notice()"
|
|
61
|
+
},
|
|
62
|
+
"antialias": {
|
|
63
|
+
"docType": "boolean",
|
|
64
|
+
"desc": "MSAA anti-aliasing (kept with post effects on), default on for desktop and off for low-tier devices; with a renderer of your own, its own antialias. It is fixed with the canvas: a player's settings row changes it at the next launch"
|
|
65
|
+
},
|
|
66
|
+
"audio": {
|
|
67
|
+
"docType": "AudioConfig",
|
|
68
|
+
"desc": "Volume of each channel, 0–1"
|
|
69
|
+
},
|
|
70
|
+
"batching": {
|
|
71
|
+
"docType": "false | BatchingOptions",
|
|
72
|
+
"desc": "Automatic instancing of repeated static models the engine places (engine.batching; your own meshes opt in with userData.batch = true): false turns it off; default { minCount: 8, cell: 4 * engine.stream.cellSize }"
|
|
73
|
+
},
|
|
74
|
+
"bindings": {
|
|
75
|
+
"docType": "Readonly<Record<string, string | readonly string[]>>",
|
|
76
|
+
"desc": "The game's keys per action (keyboard, 'Mouse0', gamepad 'PadA' in one list), owner 'game': replaces the basics (move / confirm / cancel / UI cursor) and binds every other action, e.g. { interact: ['KeyE', 'PadX'], ...presets.bindings.dialogNumbers }. Same as engine.input.bind(map)"
|
|
77
|
+
},
|
|
78
|
+
"blockBrowserKeys": {
|
|
79
|
+
"docType": "boolean",
|
|
80
|
+
"desc": "While playing (no menu, not paused), keys the game binds do not reach the browser, e.g. Ctrl+S; true by default. In dev builds F5, Ctrl+R, F12 stay the browser's (recipe 58)"
|
|
81
|
+
},
|
|
82
|
+
"budget": {
|
|
83
|
+
"docType": "BudgetLimits",
|
|
84
|
+
"desc": "Performance budget limits, e.g. { drawCalls: 250, fps: 55 }; only the given categories are checked; off by default"
|
|
85
|
+
},
|
|
86
|
+
"canvas": {
|
|
87
|
+
"docType": "HTMLCanvasElement | HTMLElement",
|
|
88
|
+
"desc": "Canvas element (required unless renderer is given), e.g. document.getElementById('view')"
|
|
89
|
+
},
|
|
90
|
+
"decoders": {
|
|
91
|
+
"docType": "string",
|
|
92
|
+
"desc": "(experimental) Directory of Draco/KTX2 decoders (a URL containing draco/ and basis/), for when they live on a CDN. Normally not needed: the decoders bundled with three are packed by vite automatically"
|
|
93
|
+
},
|
|
94
|
+
"fallback": {
|
|
95
|
+
"docType": "'webgl2' | 'webgl' | 'error'",
|
|
96
|
+
"desc": "WebGPU route only: what start() does when the browser gives no WebGPU. 'webgl2' (default): the same WebGPURenderer on its WebGL2 backend, TSL keeps working; 'webgl': a WebGLRenderer instead (faster, but NodeMaterials cannot draw: start() fails if the scene has one); 'error': start() rejects."
|
|
97
|
+
},
|
|
98
|
+
"fov": {
|
|
99
|
+
"docType": "number",
|
|
100
|
+
"desc": "Camera field of view (degrees), default 55"
|
|
101
|
+
},
|
|
102
|
+
"headless": {
|
|
103
|
+
"docType": "boolean",
|
|
104
|
+
"desc": "Headless mode: no real-time loop and no per-frame rendering, advances only on step() (for tests and screenshots). Adding ?threedog-headless to the URL also turns it on"
|
|
105
|
+
},
|
|
106
|
+
"joystick": {
|
|
107
|
+
"docType": "'auto' | boolean",
|
|
108
|
+
"desc": "On-screen joystick: 'auto' (only on touch devices) / true / false"
|
|
109
|
+
},
|
|
110
|
+
"lights": {
|
|
111
|
+
"docType": "boolean",
|
|
112
|
+
"desc": "false: no default lights in the scene at all (engine.lights.sun / hemi still exist, detached, so sky and describe never see undefined); the game adds its own. No light of the engine's reaches the picture. Default true"
|
|
113
|
+
},
|
|
114
|
+
"locale": {
|
|
115
|
+
"docType": "string",
|
|
116
|
+
"desc": "UI language: 'auto' (default) follows the browser (a language starting with zh gives 'zh-CN', anything else 'en'); or force 'zh-CN' / 'en' / your own. Matched by language: 'zh' / 'zh-Hans' give 'zh-CN', 'en-US' gives 'en'; a language with no strings warns once"
|
|
117
|
+
},
|
|
118
|
+
"movement": {
|
|
119
|
+
"docType": "Partial<MovementProfile>",
|
|
120
|
+
"desc": "Shared \"can walk there\" parameters (meters / degrees): collision, the Rapier capsule, navigation and level steps all read them by default. Default { radius: 0.4, height: 1.8, maxSlope: 48, stepHeight: 0.45 }"
|
|
121
|
+
},
|
|
122
|
+
"near": {
|
|
123
|
+
"docType": "number",
|
|
124
|
+
"desc": "Camera near clipping plane (meters), default 0.3"
|
|
125
|
+
},
|
|
126
|
+
"pauseOnBlur": {
|
|
127
|
+
"docType": "boolean",
|
|
128
|
+
"desc": "Gameplay waits while the window is in the background or the tab is hidden; default true (engine.page)"
|
|
129
|
+
},
|
|
130
|
+
"pixelRatio": {
|
|
131
|
+
"docType": "number",
|
|
132
|
+
"desc": "Render resolution, default min(device pixel ratio, 1.5); the low tier uses at least 0.75 x device pixel ratio (never below 1). describe().render.scale reports it"
|
|
133
|
+
},
|
|
134
|
+
"pixelSize": {
|
|
135
|
+
"docType": "number",
|
|
136
|
+
"desc": "Real screen pixels per art pixel, a whole number from 1 up: art pixels of exactly one size at any display scale, through page zoom and moves to another display. Sets image-rendering: pixelated, antialias defaults to off, adaptive resolution stops, and the last few real pixels (fewer than k) at the right and bottom stay empty. Example: `createEngine({ canvas, pixelSize: 3 })`"
|
|
137
|
+
},
|
|
138
|
+
"renderer": {
|
|
139
|
+
"docType": "'webgl' | 'webgpu' | EngineRenderer",
|
|
140
|
+
"desc": "'webgl' (default): the engine builds a WebGLRenderer. 'webgpu': it builds three's WebGPURenderer (needs import 'threedog/tsl' first) and start() awaits its init(). Or a ready three.js renderer (WebGLRenderer or WebGPURenderer) used as is; canvas then defaults to renderer.domElement."
|
|
141
|
+
},
|
|
142
|
+
"saveKey": {
|
|
143
|
+
"docType": "string",
|
|
144
|
+
"desc": "Save name prefix; must differ when several games share one site, default 'game'"
|
|
145
|
+
},
|
|
146
|
+
"seed": {
|
|
147
|
+
"docType": "number",
|
|
148
|
+
"desc": "Seed for engine.random; default 1 in headless mode (reproducible), the current time for live runs (different every game)"
|
|
149
|
+
},
|
|
150
|
+
"strings": {
|
|
151
|
+
"docType": "StringTables",
|
|
152
|
+
"desc": "Override / add UI strings: { 'zh-CN': { key: text } }"
|
|
153
|
+
},
|
|
154
|
+
"targetFps": {
|
|
155
|
+
"docType": "number",
|
|
156
|
+
"desc": "Target frame rate for automatic resolution lowering, default 55"
|
|
157
|
+
},
|
|
158
|
+
"threads": {
|
|
159
|
+
"docType": "'auto' | number | false",
|
|
160
|
+
"desc": "(experimental) Worker pool size for engine.threads: 'auto' (default: cores - 1, at most 4), a worker count, or false (all on the main thread, same results, no workers created)"
|
|
161
|
+
},
|
|
162
|
+
"ui": {
|
|
163
|
+
"docType": "UIOptions",
|
|
164
|
+
"desc": "All screen UI: replace or turn off any part (loading, toast, title, hud.marker, hud.counter, hud.bar, hud.button; the default title screen is off), and the look of the default parts (theme, css, fonts, templates). Example: `createEngine({ canvas, ui: { loading: { title: 'My Game' }, title: { title: 'My Game' }, toast: false } })`"
|
|
165
|
+
},
|
|
166
|
+
"urlState": {
|
|
167
|
+
"docType": "boolean",
|
|
168
|
+
"desc": "(experimental) Set up a scenario from URL parameters (?time=18:30&weather=rain&pos=40,-20), default on only in development"
|
|
169
|
+
},
|
|
170
|
+
"validate": {
|
|
171
|
+
"docType": "boolean",
|
|
172
|
+
"desc": "(experimental) Check parameter names at runtime and warn on misspelled names (the console prints \"did you mean xxx\"), default true; a release build can write false to turn it off"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
56
176
|
"modules": {
|
|
57
177
|
"ambience": {
|
|
58
178
|
"call": "ambience",
|
|
@@ -85,6 +205,7 @@ export const metadata = {
|
|
|
85
205
|
"documented": true,
|
|
86
206
|
"names": [
|
|
87
207
|
"add",
|
|
208
|
+
"stop",
|
|
88
209
|
"rules",
|
|
89
210
|
"nearWater",
|
|
90
211
|
"position"
|
|
@@ -226,7 +347,7 @@ export const metadata = {
|
|
|
226
347
|
],
|
|
227
348
|
"params": null,
|
|
228
349
|
"page": true,
|
|
229
|
-
"documented":
|
|
350
|
+
"documented": true,
|
|
230
351
|
"names": [
|
|
231
352
|
"follow",
|
|
232
353
|
"forward",
|
|
@@ -532,11 +653,12 @@ export const metadata = {
|
|
|
532
653
|
"params": {
|
|
533
654
|
"open": {
|
|
534
655
|
"type": "any",
|
|
535
|
-
"optional": true
|
|
656
|
+
"optional": true,
|
|
657
|
+
"desc": "true shows it at start"
|
|
536
658
|
}
|
|
537
659
|
},
|
|
538
660
|
"page": false,
|
|
539
|
-
"documented":
|
|
661
|
+
"documented": true,
|
|
540
662
|
"names": [],
|
|
541
663
|
"sections": [],
|
|
542
664
|
"saves": [],
|
|
@@ -548,6 +670,55 @@ export const metadata = {
|
|
|
548
670
|
]
|
|
549
671
|
}
|
|
550
672
|
},
|
|
673
|
+
"decals": {
|
|
674
|
+
"call": "decals",
|
|
675
|
+
"file": "packages/engine/modules/decals/Decals.js",
|
|
676
|
+
"label": "Decals",
|
|
677
|
+
"needs": [],
|
|
678
|
+
"type": "picture",
|
|
679
|
+
"provides": [],
|
|
680
|
+
"requires": [],
|
|
681
|
+
"handRolled": "none: a single plane or DecalGeometry of its own is plain three.js",
|
|
682
|
+
"stage": "late",
|
|
683
|
+
"before": [],
|
|
684
|
+
"after": [],
|
|
685
|
+
"optional": [],
|
|
686
|
+
"params": {
|
|
687
|
+
"max": {
|
|
688
|
+
"type": "int",
|
|
689
|
+
"optional": true,
|
|
690
|
+
"min": 1,
|
|
691
|
+
"desc": "global live decal cap (default 128, 64 on low tier)"
|
|
692
|
+
},
|
|
693
|
+
"effects": {
|
|
694
|
+
"type": "object",
|
|
695
|
+
"optional": true,
|
|
696
|
+
"desc": "named decal kinds defined at install"
|
|
697
|
+
},
|
|
698
|
+
"default": {
|
|
699
|
+
"type": "object",
|
|
700
|
+
"optional": true,
|
|
701
|
+
"desc": "base options every decal inherits"
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
"page": true,
|
|
705
|
+
"documented": true,
|
|
706
|
+
"names": [
|
|
707
|
+
"define",
|
|
708
|
+
"add",
|
|
709
|
+
"remove",
|
|
710
|
+
"count",
|
|
711
|
+
"material"
|
|
712
|
+
],
|
|
713
|
+
"sections": [],
|
|
714
|
+
"saves": [],
|
|
715
|
+
"time": {
|
|
716
|
+
"kind": "none",
|
|
717
|
+
"hooks": [
|
|
718
|
+
"frame"
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
},
|
|
551
722
|
"dialogue": {
|
|
552
723
|
"call": "dialogue",
|
|
553
724
|
"file": "packages/engine/modules/gameplay/Dialogue.js",
|
|
@@ -684,13 +855,15 @@ export const metadata = {
|
|
|
684
855
|
"type": "any",
|
|
685
856
|
"optional": true,
|
|
686
857
|
"default": 14737632,
|
|
687
|
-
"desc": "preview color where it can be placed"
|
|
858
|
+
"desc": "preview color where it can be placed",
|
|
859
|
+
"docType": "any"
|
|
688
860
|
},
|
|
689
861
|
"bad": {
|
|
690
862
|
"type": "any",
|
|
691
863
|
"optional": true,
|
|
692
864
|
"default": 3815994,
|
|
693
|
-
"desc": "preview color where it cannot be placed"
|
|
865
|
+
"desc": "preview color where it cannot be placed",
|
|
866
|
+
"docType": "any"
|
|
694
867
|
},
|
|
695
868
|
"previewOpacity": {
|
|
696
869
|
"type": "number",
|
|
@@ -711,7 +884,8 @@ export const metadata = {
|
|
|
711
884
|
"type": "any",
|
|
712
885
|
"optional": true,
|
|
713
886
|
"default": {},
|
|
714
|
-
"desc": "tile colors by layer name: { layer: { field: color } }, first truthy field of a cell wins; a layer named here draws tiles"
|
|
887
|
+
"desc": "tile colors by layer name: { layer: { field: color } }, first truthy field of a cell wins; a layer named here draws tiles",
|
|
888
|
+
"docType": "Record<string, Record<string, any>>"
|
|
715
889
|
},
|
|
716
890
|
"tileLift": {
|
|
717
891
|
"type": "number",
|
|
@@ -721,7 +895,7 @@ export const metadata = {
|
|
|
721
895
|
}
|
|
722
896
|
},
|
|
723
897
|
"page": true,
|
|
724
|
-
"documented":
|
|
898
|
+
"documented": true,
|
|
725
899
|
"names": [
|
|
726
900
|
"add",
|
|
727
901
|
"get",
|
|
@@ -820,7 +994,9 @@ export const metadata = {
|
|
|
820
994
|
"type": "ui",
|
|
821
995
|
"provides": [],
|
|
822
996
|
"requires": [],
|
|
823
|
-
"handRolled":
|
|
997
|
+
"handRolled": [
|
|
998
|
+
"hud"
|
|
999
|
+
],
|
|
824
1000
|
"stage": "effects",
|
|
825
1001
|
"before": [],
|
|
826
1002
|
"after": [
|
|
@@ -932,7 +1108,8 @@ export const metadata = {
|
|
|
932
1108
|
"kind": "none",
|
|
933
1109
|
"hooks": [
|
|
934
1110
|
"fixed",
|
|
935
|
-
"frame"
|
|
1111
|
+
"frame",
|
|
1112
|
+
"sessionEnd"
|
|
936
1113
|
],
|
|
937
1114
|
"noSkip": "input and prompt state only"
|
|
938
1115
|
}
|
|
@@ -1452,71 +1629,87 @@ export const metadata = {
|
|
|
1452
1629
|
"params": {
|
|
1453
1630
|
"role": {
|
|
1454
1631
|
"type": "any",
|
|
1455
|
-
"optional": true
|
|
1632
|
+
"optional": true,
|
|
1633
|
+
"desc": "host (owns the game) or client (mirrors the host)"
|
|
1456
1634
|
},
|
|
1457
1635
|
"transport": {
|
|
1458
1636
|
"type": "any",
|
|
1459
|
-
"optional": true
|
|
1637
|
+
"optional": true,
|
|
1638
|
+
"desc": "message transport such as webSocket(url) or fakeNetwork()"
|
|
1460
1639
|
},
|
|
1461
1640
|
"sync": {
|
|
1462
1641
|
"type": "any",
|
|
1463
|
-
"optional": true
|
|
1642
|
+
"optional": true,
|
|
1643
|
+
"desc": "save parts to sync (auto syncs world, containers, vars and other save parts except random, level and rigid)"
|
|
1464
1644
|
},
|
|
1465
1645
|
"syncEvery": {
|
|
1466
1646
|
"type": "any",
|
|
1467
|
-
"optional": true
|
|
1647
|
+
"optional": true,
|
|
1648
|
+
"desc": "fixed steps between state diffs (default 3)"
|
|
1468
1649
|
},
|
|
1469
1650
|
"keepAlive": {
|
|
1470
1651
|
"type": "any",
|
|
1471
|
-
"optional": true
|
|
1652
|
+
"optional": true,
|
|
1653
|
+
"desc": "fixed steps between idle heartbeat messages (default 60)"
|
|
1472
1654
|
},
|
|
1473
1655
|
"rate": {
|
|
1474
1656
|
"type": "any",
|
|
1475
|
-
"optional": true
|
|
1657
|
+
"optional": true,
|
|
1658
|
+
"desc": "per-peer op requests per second and burst allowance (default 20)"
|
|
1476
1659
|
},
|
|
1477
1660
|
"burst": {
|
|
1478
1661
|
"type": "any",
|
|
1479
|
-
"optional": true
|
|
1662
|
+
"optional": true,
|
|
1663
|
+
"desc": "per-peer op requests per second and burst allowance (default 20)"
|
|
1480
1664
|
},
|
|
1481
1665
|
"maxSpeed": {
|
|
1482
1666
|
"type": "any",
|
|
1483
|
-
"optional": true
|
|
1667
|
+
"optional": true,
|
|
1668
|
+
"desc": "maximum avatar movement speed in m/s accepted from a client (default 15)"
|
|
1484
1669
|
},
|
|
1485
1670
|
"posEvery": {
|
|
1486
1671
|
"type": "any",
|
|
1487
|
-
"optional": true
|
|
1672
|
+
"optional": true,
|
|
1673
|
+
"desc": "fixed steps between client position updates (default 3)"
|
|
1488
1674
|
},
|
|
1489
1675
|
"actorFor": {
|
|
1490
1676
|
"type": "any",
|
|
1491
|
-
"optional": true
|
|
1677
|
+
"optional": true,
|
|
1678
|
+
"desc": "maps a numeric peer id to its actor id (default guest-<id>)"
|
|
1492
1679
|
},
|
|
1493
1680
|
"actorFields": {
|
|
1494
1681
|
"type": "any",
|
|
1495
|
-
"optional": true
|
|
1682
|
+
"optional": true,
|
|
1683
|
+
"desc": "record fields holding actor ids to remap per peer (default owner)"
|
|
1496
1684
|
},
|
|
1497
1685
|
"avatarFields": {
|
|
1498
1686
|
"type": "any",
|
|
1499
|
-
"optional": true
|
|
1687
|
+
"optional": true,
|
|
1688
|
+
"desc": "own-avatar record fields sent with client position updates"
|
|
1500
1689
|
},
|
|
1501
1690
|
"interpolate": {
|
|
1502
1691
|
"type": "any",
|
|
1503
|
-
"optional": true
|
|
1692
|
+
"optional": true,
|
|
1693
|
+
"desc": "record kinds smoothed on clients between diffs (default player)"
|
|
1504
1694
|
},
|
|
1505
1695
|
"avatar": {
|
|
1506
1696
|
"type": "any",
|
|
1507
|
-
"optional": true
|
|
1697
|
+
"optional": true,
|
|
1698
|
+
"desc": "automatically create a player world record and bag per joining peer (default true)"
|
|
1508
1699
|
},
|
|
1509
1700
|
"onJoin": {
|
|
1510
1701
|
"type": "any",
|
|
1511
|
-
"optional": true
|
|
1702
|
+
"optional": true,
|
|
1703
|
+
"desc": "host callback fired after a peer joins"
|
|
1512
1704
|
},
|
|
1513
1705
|
"onLeave": {
|
|
1514
1706
|
"type": "any",
|
|
1515
|
-
"optional": true
|
|
1707
|
+
"optional": true,
|
|
1708
|
+
"desc": "host callback fired before a peer leaves"
|
|
1516
1709
|
}
|
|
1517
1710
|
},
|
|
1518
1711
|
"page": true,
|
|
1519
|
-
"documented":
|
|
1712
|
+
"documented": true,
|
|
1520
1713
|
"names": [
|
|
1521
1714
|
"reconnect",
|
|
1522
1715
|
"role",
|
|
@@ -2446,112 +2639,158 @@ export const metadata = {
|
|
|
2446
2639
|
"viewChunks": {
|
|
2447
2640
|
"type": "any",
|
|
2448
2641
|
"optional": true,
|
|
2449
|
-
"default": 4
|
|
2642
|
+
"default": 4,
|
|
2643
|
+
"docType": "number",
|
|
2644
|
+
"desc": "View distance (in chunks), default 4"
|
|
2450
2645
|
},
|
|
2451
2646
|
"density": {
|
|
2452
2647
|
"type": "any",
|
|
2453
2648
|
"optional": true,
|
|
2454
|
-
"default": 1
|
|
2649
|
+
"default": 1,
|
|
2650
|
+
"docType": "number",
|
|
2651
|
+
"desc": "Vegetation density multiplier, default 1"
|
|
2455
2652
|
},
|
|
2456
2653
|
"material": {
|
|
2457
2654
|
"type": "any",
|
|
2458
|
-
"optional": true
|
|
2655
|
+
"optional": true,
|
|
2656
|
+
"docType": "Material | ((engine: Engine) => Material)",
|
|
2657
|
+
"desc": "Ground material (default neutral gray with vertex colors); chunks have position, normal, color and uv = world xz / chunk size. Cloud shadows, season tint and detail are added"
|
|
2459
2658
|
},
|
|
2460
2659
|
"effects": {
|
|
2461
2660
|
"type": "any",
|
|
2462
|
-
"optional": true
|
|
2661
|
+
"optional": true,
|
|
2662
|
+
"docType": "boolean",
|
|
2663
|
+
"desc": "With material: false = draw it exactly as given, no cloud shadow / season / detail patch"
|
|
2463
2664
|
},
|
|
2464
2665
|
"detail": {
|
|
2465
2666
|
"type": "any",
|
|
2466
|
-
"optional": true
|
|
2667
|
+
"optional": true,
|
|
2668
|
+
"docType": "MaterialDetail | null",
|
|
2669
|
+
"desc": "Detail layer over the ground: a noise, a texture asset name or your own glsl; defaults scale 0.25, strength 0.35, top-down world projection, multiply. Change it with engine.terrain.recolor({ detail })"
|
|
2467
2670
|
},
|
|
2468
2671
|
"variation": {
|
|
2469
2672
|
"type": "any",
|
|
2470
|
-
"optional": true
|
|
2673
|
+
"optional": true,
|
|
2674
|
+
"docType": "TerrainVariation",
|
|
2675
|
+
"desc": "Ground color noise, baked into the chunks"
|
|
2471
2676
|
},
|
|
2472
2677
|
"viewFog": {
|
|
2473
2678
|
"type": "any",
|
|
2474
2679
|
"optional": true,
|
|
2475
|
-
"default": false
|
|
2680
|
+
"default": false,
|
|
2681
|
+
"docType": "boolean",
|
|
2682
|
+
"desc": "true: the signal engine.uniforms.uViewDistance follows the view distance, so a game's fog can read it and fade the far chunk edge out (openWorld() sets true)"
|
|
2476
2683
|
},
|
|
2477
2684
|
"part": {
|
|
2478
2685
|
"type": "any",
|
|
2479
|
-
"optional": true
|
|
2686
|
+
"optional": true,
|
|
2687
|
+
"docType": "boolean",
|
|
2688
|
+
"desc": "true: do not take the ground slot; compositeGround({ parts: [{ of: 'terrain' }] }) does and reads terrain.ground (so a terrain and a level can both run)"
|
|
2480
2689
|
},
|
|
2481
2690
|
"seed": {
|
|
2482
2691
|
"type": "any",
|
|
2483
2692
|
"optional": true,
|
|
2484
|
-
"default": 1337
|
|
2693
|
+
"default": 1337,
|
|
2694
|
+
"docType": "number",
|
|
2695
|
+
"desc": "Random seed; the same seed gives the same terrain"
|
|
2485
2696
|
},
|
|
2486
2697
|
"chunkSize": {
|
|
2487
2698
|
"type": "any",
|
|
2488
2699
|
"optional": true,
|
|
2489
|
-
"default": 64
|
|
2700
|
+
"default": 64,
|
|
2701
|
+
"docType": "number",
|
|
2702
|
+
"desc": "Chunk edge length (meters), default 64"
|
|
2490
2703
|
},
|
|
2491
2704
|
"resolution": {
|
|
2492
2705
|
"type": "any",
|
|
2493
2706
|
"optional": true,
|
|
2494
|
-
"default": 16
|
|
2707
|
+
"default": 16,
|
|
2708
|
+
"docType": "number",
|
|
2709
|
+
"desc": "Cells per chunk; smaller is more \"low poly\", default 16"
|
|
2495
2710
|
},
|
|
2496
2711
|
"waterLevel": {
|
|
2497
2712
|
"type": "any",
|
|
2498
2713
|
"optional": true,
|
|
2499
|
-
"default": null
|
|
2714
|
+
"default": null,
|
|
2715
|
+
"docType": "number",
|
|
2716
|
+
"desc": "Water level (meters), default -Infinity = no water (terrainPreset() from"
|
|
2500
2717
|
},
|
|
2501
2718
|
"flatten": {
|
|
2502
2719
|
"type": "any",
|
|
2503
2720
|
"optional": true,
|
|
2504
|
-
"default": []
|
|
2721
|
+
"default": [],
|
|
2722
|
+
"docType": "FlattenZone[]",
|
|
2723
|
+
"desc": "Flattened plots"
|
|
2505
2724
|
},
|
|
2506
2725
|
"heightmap": {
|
|
2507
2726
|
"type": "any",
|
|
2508
2727
|
"optional": true,
|
|
2509
|
-
"default": null
|
|
2728
|
+
"default": null,
|
|
2729
|
+
"docType": "{ url?, size?, min?, max?, center?, outside?, … } | null",
|
|
2730
|
+
"desc": "Heightmap (used when there is no height function): url grayscale image, size [width m, length m], min/max height (meters), center [x, z]"
|
|
2510
2731
|
},
|
|
2511
2732
|
"height": {
|
|
2512
2733
|
"type": "any",
|
|
2513
2734
|
"optional": true,
|
|
2514
|
-
"default": null
|
|
2735
|
+
"default": null,
|
|
2736
|
+
"docType": "((x, z, n) => number) | string | null",
|
|
2737
|
+
"desc": "Height generator: (x, z, n) => meters. Without one (and without a heightmap) the ground is flat at y = 0, a placeholder (dev warning). Runs in workers, so it must be pure (only its parameters and globals like Math); an outside variable throws at terrain() naming it. n = { fbm(x, z, octaves?), noise(x, z), hash(x, z, salt?), seed, waterLevel, params }. Example: `terrain({ height: (x, z, n) => 4 + 12 * n.fbm(x * 0.01, z * 0.01) })`"
|
|
2515
2738
|
},
|
|
2516
2739
|
"groundType": {
|
|
2517
2740
|
"type": "any",
|
|
2518
2741
|
"optional": true,
|
|
2519
|
-
"default": null
|
|
2742
|
+
"default": null,
|
|
2743
|
+
"docType": "((x, z, h, slope, n) => string | null) | string | null",
|
|
2744
|
+
"desc": "Ground type: (x, z, h, slope, n) => type name (null = 'default'). Pure, like height. Colors come from biomeColors[type]; vegetation rules and footsteps match by name. Example: `terrain({ groundType: (x, z, h, slope) => slope > 0.7 ? 'rock' : h < 2 ? 'beach' : 'grass' })`"
|
|
2520
2745
|
},
|
|
2521
2746
|
"params": {
|
|
2522
2747
|
"type": "any",
|
|
2523
2748
|
"optional": true,
|
|
2524
|
-
"default": null
|
|
2749
|
+
"default": null,
|
|
2750
|
+
"docType": "Record<string, any> | null",
|
|
2751
|
+
"desc": "Plain data handed to height / groundType as n.params (a preset's settings); must be serializable"
|
|
2525
2752
|
},
|
|
2526
2753
|
"shading": {
|
|
2527
2754
|
"type": "any",
|
|
2528
2755
|
"optional": true,
|
|
2529
|
-
"default": "smooth"
|
|
2756
|
+
"default": "smooth",
|
|
2757
|
+
"docType": "'flat' | 'smooth' | 'texture'",
|
|
2758
|
+
"desc": "How the ground gets its color: 'smooth' (default) blended per grid point / 'flat' one color and normal per triangle (low poly) / 'texture' per-chunk color map sampled per pixel, so color borders (a river bank) are not confined to triangle edges and the mesh can stay coarse. See recipes/53-ground-up-close.md."
|
|
2530
2759
|
},
|
|
2531
2760
|
"colorResolution": {
|
|
2532
2761
|
"type": "any",
|
|
2533
2762
|
"optional": true,
|
|
2534
|
-
"default": 128
|
|
2763
|
+
"default": 128,
|
|
2764
|
+
"docType": "number",
|
|
2765
|
+
"desc": "Texture shading: color map pixels per chunk edge (default 128, 64 on low-tier devices; independent of `resolution`)"
|
|
2535
2766
|
},
|
|
2536
2767
|
"normals": {
|
|
2537
2768
|
"type": "any",
|
|
2538
2769
|
"optional": true,
|
|
2539
|
-
"default": null
|
|
2770
|
+
"default": null,
|
|
2771
|
+
"docType": "'smooth' | 'flat' | null",
|
|
2772
|
+
"desc": "Texture shading only: lighting normals 'smooth' (default) / 'flat'"
|
|
2540
2773
|
},
|
|
2541
2774
|
"normalFn": {
|
|
2542
2775
|
"type": "any",
|
|
2543
2776
|
"optional": true,
|
|
2544
|
-
"default": null
|
|
2777
|
+
"default": null,
|
|
2778
|
+
"docType": "((i, j, h, cell) => number[]) | string | null",
|
|
2779
|
+
"desc": "Replace the smooth normal at grid point (i, j): (i, j, h, cell) => [nx, ny, nz] (any length; the engine normalizes). h(i, j) is a grid-point height, cell the grid spacing in meters. Pure, like height (workers get its source). Default: central difference of the neighbors. Example: `terrain({ normalFn: (i, j, h, cell) => [(h(i - 1, j) - h(i + 1, j)) / (2 * cell), 2, (h(i, j - 1) - h(i, j + 1)) / (2 * cell)] }) // flatter lighting`"
|
|
2545
2780
|
},
|
|
2546
2781
|
"diagonal": {
|
|
2547
2782
|
"type": "any",
|
|
2548
2783
|
"optional": true,
|
|
2549
|
-
"default": "fixed"
|
|
2784
|
+
"default": "fixed",
|
|
2785
|
+
"docType": "'fixed' | 'adaptive' | 'alternate'",
|
|
2786
|
+
"desc": "How each cell is cut into two triangles: 'fixed' (default, the same diagonal everywhere) / 'adaptive' (along the diagonal with the smaller height difference, fewer zigzag ridges on slopes) / 'alternate' (flips every other cell). It is shape: engine.surface follows it"
|
|
2550
2787
|
},
|
|
2551
2788
|
"shape": {
|
|
2552
2789
|
"type": "any",
|
|
2553
2790
|
"optional": true,
|
|
2554
|
-
"default": null
|
|
2791
|
+
"default": null,
|
|
2792
|
+
"docType": "TerrainShape | null",
|
|
2793
|
+
"desc": "World outline (default null = ground everywhere): an island, a floating rock, a coastline that ends"
|
|
2555
2794
|
},
|
|
2556
2795
|
"boundsPad": {
|
|
2557
2796
|
"type": "any",
|
|
@@ -2559,26 +2798,34 @@ export const metadata = {
|
|
|
2559
2798
|
"default": {
|
|
2560
2799
|
"up": 3,
|
|
2561
2800
|
"radius": 8
|
|
2562
|
-
}
|
|
2801
|
+
},
|
|
2802
|
+
"docType": "{ up?: number; radius?: number }",
|
|
2803
|
+
"desc": "Chunk bounding sphere margin in meters (default { up: 3, radius: 8 }): center raised by `up`, radius grown by `radius`. Raise it when a shader moves vertices far"
|
|
2563
2804
|
},
|
|
2564
2805
|
"colors": {
|
|
2565
2806
|
"type": "any",
|
|
2566
2807
|
"optional": true,
|
|
2567
|
-
"default": {}
|
|
2808
|
+
"default": {},
|
|
2809
|
+
"docType": "Record<string, ColorLike>",
|
|
2810
|
+
"desc": "Palette: color name → color"
|
|
2568
2811
|
},
|
|
2569
2812
|
"biomeColors": {
|
|
2570
2813
|
"type": "any",
|
|
2571
2814
|
"optional": true,
|
|
2572
|
-
"default": {}
|
|
2815
|
+
"default": {},
|
|
2816
|
+
"docType": "Record<string, string[]>",
|
|
2817
|
+
"desc": "Ground type → palette color names (two are blended by noise); a type left out is neutral gray"
|
|
2573
2818
|
},
|
|
2574
2819
|
"steep": {
|
|
2575
2820
|
"type": "any",
|
|
2576
2821
|
"optional": true,
|
|
2577
|
-
"default": []
|
|
2822
|
+
"default": [],
|
|
2823
|
+
"docType": "SteepRule[]",
|
|
2824
|
+
"desc": "Steep-slope color rule"
|
|
2578
2825
|
}
|
|
2579
2826
|
},
|
|
2580
2827
|
"page": true,
|
|
2581
|
-
"documented":
|
|
2828
|
+
"documented": true,
|
|
2582
2829
|
"names": [
|
|
2583
2830
|
"recolor",
|
|
2584
2831
|
"material",
|
|
@@ -2805,30 +3052,40 @@ export const metadata = {
|
|
|
2805
3052
|
"chunkSize": {
|
|
2806
3053
|
"type": "any",
|
|
2807
3054
|
"optional": true,
|
|
2808
|
-
"default": 32
|
|
3055
|
+
"default": 32,
|
|
3056
|
+
"docType": "number",
|
|
3057
|
+
"desc": "Chunk edge (meters), default 32"
|
|
2809
3058
|
},
|
|
2810
3059
|
"viewChunks": {
|
|
2811
3060
|
"type": "any",
|
|
2812
3061
|
"optional": true,
|
|
2813
|
-
"default": 3
|
|
3062
|
+
"default": 3,
|
|
3063
|
+
"docType": "number",
|
|
3064
|
+
"desc": "Rings of chunks drawn around each stream source, default 3"
|
|
2814
3065
|
},
|
|
2815
3066
|
"density": {
|
|
2816
3067
|
"type": "any",
|
|
2817
3068
|
"optional": true,
|
|
2818
|
-
"default": 1
|
|
3069
|
+
"default": 1,
|
|
3070
|
+
"docType": "number",
|
|
3071
|
+
"desc": "Placement attempts multiplier, default 1"
|
|
2819
3072
|
},
|
|
2820
3073
|
"area": {
|
|
2821
3074
|
"type": "any",
|
|
2822
|
-
"optional": true
|
|
3075
|
+
"optional": true,
|
|
3076
|
+
"docType": "{ min: number[]; max: number[] } | null",
|
|
3077
|
+
"desc": "Where it may grow: { min: [x, z], max: [x, z] }; default anywhere the ground is"
|
|
2823
3078
|
},
|
|
2824
3079
|
"seed": {
|
|
2825
3080
|
"type": "any",
|
|
2826
3081
|
"optional": true,
|
|
2827
|
-
"default": 1
|
|
3082
|
+
"default": 1,
|
|
3083
|
+
"docType": "number",
|
|
3084
|
+
"desc": "Placement seed, default 1"
|
|
2828
3085
|
}
|
|
2829
3086
|
},
|
|
2830
3087
|
"page": true,
|
|
2831
|
-
"documented":
|
|
3088
|
+
"documented": true,
|
|
2832
3089
|
"names": [
|
|
2833
3090
|
"mesh",
|
|
2834
3091
|
"kind",
|
|
@@ -2858,7 +3115,8 @@ export const metadata = {
|
|
|
2858
3115
|
"before": [],
|
|
2859
3116
|
"after": [],
|
|
2860
3117
|
"optional": [
|
|
2861
|
-
"sky"
|
|
3118
|
+
"sky",
|
|
3119
|
+
"world"
|
|
2862
3120
|
],
|
|
2863
3121
|
"params": {
|
|
2864
3122
|
"sea": {
|
|
@@ -2883,18 +3141,24 @@ export const metadata = {
|
|
|
2883
3141
|
"type": "number",
|
|
2884
3142
|
"optional": true,
|
|
2885
3143
|
"min": 5e-324,
|
|
2886
|
-
"desc": "
|
|
3144
|
+
"desc": "edge length of the global sea plane in meters"
|
|
2887
3145
|
},
|
|
2888
3146
|
"segments": {
|
|
2889
3147
|
"type": "int",
|
|
2890
3148
|
"optional": true,
|
|
2891
3149
|
"min": 1,
|
|
2892
|
-
"desc": "
|
|
3150
|
+
"desc": "mesh subdivisions per side of the global sea"
|
|
3151
|
+
},
|
|
3152
|
+
"ripples": {
|
|
3153
|
+
"type": "bool",
|
|
3154
|
+
"optional": true,
|
|
3155
|
+
"desc": "automatic wading wakes and raindrop rings (default true)"
|
|
2893
3156
|
}
|
|
2894
3157
|
},
|
|
2895
3158
|
"page": true,
|
|
2896
3159
|
"documented": true,
|
|
2897
3160
|
"names": [
|
|
3161
|
+
"ripple",
|
|
2898
3162
|
"shader",
|
|
2899
3163
|
"normalMap",
|
|
2900
3164
|
"normalTexture",
|
|
@@ -2902,6 +3166,7 @@ export const metadata = {
|
|
|
2902
3166
|
"uniforms",
|
|
2903
3167
|
"bodies",
|
|
2904
3168
|
"sea",
|
|
3169
|
+
"activeRipples",
|
|
2905
3170
|
"material"
|
|
2906
3171
|
],
|
|
2907
3172
|
"sections": [],
|
|
@@ -3082,23 +3347,31 @@ export const metadata = {
|
|
|
3082
3347
|
"params": {
|
|
3083
3348
|
"particles": {
|
|
3084
3349
|
"type": "any",
|
|
3085
|
-
"optional": true
|
|
3350
|
+
"optional": true,
|
|
3351
|
+
"docType": "number",
|
|
3352
|
+
"desc": "Rain / snow particle count, default 6000"
|
|
3086
3353
|
},
|
|
3087
3354
|
"area": {
|
|
3088
3355
|
"type": "any",
|
|
3089
|
-
"optional": true
|
|
3356
|
+
"optional": true,
|
|
3357
|
+
"docType": "number",
|
|
3358
|
+
"desc": "Rain / snow coverage (meters)"
|
|
3090
3359
|
},
|
|
3091
3360
|
"rain": {
|
|
3092
3361
|
"type": "any",
|
|
3093
|
-
"optional": true
|
|
3362
|
+
"optional": true,
|
|
3363
|
+
"docType": "WeatherParticles",
|
|
3364
|
+
"desc": "Rain particles (default streaks: color 0xc8c8c8, opacity 0.55, length 0.7 m, speed 22 m/s, slant 1); a texture or a sprite shape draws drops"
|
|
3094
3365
|
},
|
|
3095
3366
|
"snow": {
|
|
3096
3367
|
"type": "any",
|
|
3097
|
-
"optional": true
|
|
3368
|
+
"optional": true,
|
|
3369
|
+
"docType": "WeatherParticles & { cover?: SnowCover }",
|
|
3370
|
+
"desc": "Snow particles (default round sprites: color 0xffffff, opacity 0.9, size 20, maxSize 5 px, speed 1.6 m/s, sway 1.5 m), plus the cover it leaves"
|
|
3098
3371
|
}
|
|
3099
3372
|
},
|
|
3100
3373
|
"page": true,
|
|
3101
|
-
"documented":
|
|
3374
|
+
"documented": true,
|
|
3102
3375
|
"names": [
|
|
3103
3376
|
"flash",
|
|
3104
3377
|
"particles",
|
|
@@ -3134,27 +3407,32 @@ export const metadata = {
|
|
|
3134
3407
|
"params": {
|
|
3135
3408
|
"cellSize": {
|
|
3136
3409
|
"type": "any",
|
|
3137
|
-
"optional": true
|
|
3410
|
+
"optional": true,
|
|
3411
|
+
"desc": "spatial hash cell size in meters (default 32)"
|
|
3138
3412
|
},
|
|
3139
3413
|
"radius": {
|
|
3140
3414
|
"type": "any",
|
|
3141
|
-
"optional": true
|
|
3415
|
+
"optional": true,
|
|
3416
|
+
"desc": "distance in meters around the stream source for presenting models and running near simulation (default 60)"
|
|
3142
3417
|
},
|
|
3143
3418
|
"farEvery": {
|
|
3144
3419
|
"type": "any",
|
|
3145
|
-
"optional": true
|
|
3420
|
+
"optional": true,
|
|
3421
|
+
"desc": "seconds between far-record simulation ticks (default 1)"
|
|
3146
3422
|
},
|
|
3147
3423
|
"farMaxPerTick": {
|
|
3148
3424
|
"type": "any",
|
|
3149
|
-
"optional": true
|
|
3425
|
+
"optional": true,
|
|
3426
|
+
"desc": "maximum far records updated per simulation tick (default 128)"
|
|
3150
3427
|
},
|
|
3151
3428
|
"buildPerFrame": {
|
|
3152
3429
|
"type": "any",
|
|
3153
|
-
"optional": true
|
|
3430
|
+
"optional": true,
|
|
3431
|
+
"desc": "maximum new view models built per frame (default 4)"
|
|
3154
3432
|
}
|
|
3155
3433
|
},
|
|
3156
3434
|
"page": true,
|
|
3157
|
-
"documented":
|
|
3435
|
+
"documented": true,
|
|
3158
3436
|
"names": [
|
|
3159
3437
|
"add",
|
|
3160
3438
|
"origin",
|
|
@@ -4019,6 +4297,15 @@ export const metadata = {
|
|
|
4019
4297
|
"code": "/\\bmaster\\??\\.disconnect\\s*\\(/",
|
|
4020
4298
|
"file": "packages/engine/core/audio/Audio.js"
|
|
4021
4299
|
},
|
|
4300
|
+
"bump": {
|
|
4301
|
+
"kind": "bump",
|
|
4302
|
+
"docRef": "recipes/56-webgpu-tsl.md §\"The engine\"",
|
|
4303
|
+
"seen": "a bumpMap() call (it does nothing for a height computed in the shader)",
|
|
4304
|
+
"use": "detailBump(positionView, normal, height, strength, faceDirection) from 'threedog/tsl' turns a procedural height node into a bumped normal; bumpMap stays right for a real texture",
|
|
4305
|
+
"quiet": "/\\bdetailBump\\b/",
|
|
4306
|
+
"code": "/\\bbumpMap\\s*\\(/",
|
|
4307
|
+
"file": "packages/engine/render/fx/detail.tsl.js"
|
|
4308
|
+
},
|
|
4022
4309
|
"collision": {
|
|
4023
4310
|
"kind": "collision",
|
|
4024
4311
|
"seen": "a hand-written box overlap",
|
|
@@ -4073,6 +4360,16 @@ export const metadata = {
|
|
|
4073
4360
|
"tags": false,
|
|
4074
4361
|
"file": "packages/engine/core/scene/grid.js"
|
|
4075
4362
|
},
|
|
4363
|
+
"hud": {
|
|
4364
|
+
"kind": "hud",
|
|
4365
|
+
"seen": "projecting a world point to place a DOM marker / bar by hand",
|
|
4366
|
+
"use": "engine.hud: marker(target, opts), counter(id, opts), bar(id, opts)",
|
|
4367
|
+
"code": "/\\.project\\(\\s*(?:e\\.|engine\\.)?camera\\b/",
|
|
4368
|
+
"gameplayOnly": true,
|
|
4369
|
+
"quiet": "/\\bhud\\.(?:marker|bar|counter)\\b/",
|
|
4370
|
+
"docRef": "recipes/04-quests.md#1",
|
|
4371
|
+
"file": "packages/engine/modules/hud/index.js"
|
|
4372
|
+
},
|
|
4076
4373
|
"inventory": {
|
|
4077
4374
|
"kind": "inventory",
|
|
4078
4375
|
"seen": "a hand-made inventory (items kept in your own array / object)",
|
|
@@ -4197,6 +4494,15 @@ export const metadata = {
|
|
|
4197
4494
|
"code": "/(?:\\b(?:const|let|var)\\s+|\\bthis\\.)(?:pool|\\w*(?:bullet|projectile|shot|enemy|particle|mesh|object)pool|bullets|projectiles)\\s*=\\s*(?:\\[\\s*\\]|new Map\\b|new Set\\b)/i",
|
|
4198
4495
|
"file": "packages/engine/modules/swarm/Swarm.js"
|
|
4199
4496
|
},
|
|
4497
|
+
"post": {
|
|
4498
|
+
"kind": "post",
|
|
4499
|
+
"seen": "an EffectComposer or post pass of its own",
|
|
4500
|
+
"use": "engine.post.add(pass) with @threedog/post-effects (bloom, ao, lut, outline, dof)",
|
|
4501
|
+
"code": "/\\bnew\\s+(?:THREE\\.)?(?:EffectComposer|UnrealBloomPass|RenderPass|OutputPass)\\b/",
|
|
4502
|
+
"quiet": "/\\bpost\\.add\\b/",
|
|
4503
|
+
"docRef": "recipes/52-around-the-picture.md#post-effect-chain",
|
|
4504
|
+
"file": "packages/engine/render/PostFX.js"
|
|
4505
|
+
},
|
|
4200
4506
|
"quests": {
|
|
4201
4507
|
"kind": "quests",
|
|
4202
4508
|
"docRef": "recipes/04-quests.md §1",
|