threedog 0.1.0 → 0.2.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.
Files changed (217) hide show
  1. package/core/Animator.js +1 -0
  2. package/core/Assets.js +16 -0
  3. package/core/DebugOverrides.js +143 -0
  4. package/core/Describe.js +14 -3
  5. package/core/Engine.js +32 -69
  6. package/core/Events.js +59 -1
  7. package/core/I18n.js +2 -2
  8. package/core/Inspect.js +12 -32
  9. package/core/InspectScene.js +7 -3
  10. package/core/MaterialInfo.js +32 -0
  11. package/core/Ops.js +43 -59
  12. package/core/Saves.js +5 -4
  13. package/core/UrlState.js +3 -2
  14. package/core/Vars.js +1 -0
  15. package/core/Views.js +49 -0
  16. package/core/actor.js +2 -2
  17. package/core/assetReport.js +83 -0
  18. package/core/catalog.js +169 -0
  19. package/core/checks.js +67 -0
  20. package/core/claims.js +51 -0
  21. package/core/debugView.js +76 -0
  22. package/core/describeRender.js +45 -0
  23. package/core/describeText.js +11 -4
  24. package/core/errorCodes.js +33 -0
  25. package/core/errorHints.js +6 -1
  26. package/core/holds.js +106 -0
  27. package/core/lifecycle.js +1 -0
  28. package/core/lightWatch.js +23 -3
  29. package/core/look/coreParts.js +112 -0
  30. package/core/look/layers.js +136 -0
  31. package/core/look/part.js +173 -0
  32. package/core/look/report.js +79 -0
  33. package/core/look/write.js +86 -0
  34. package/core/loop.js +15 -14
  35. package/core/modules.js +19 -5
  36. package/core/opsAtomic.js +31 -0
  37. package/core/opsCheck.js +25 -14
  38. package/core/opsFail.js +20 -0
  39. package/core/opsHistory.js +6 -6
  40. package/core/opsRun.js +77 -0
  41. package/core/params.js +132 -0
  42. package/core/renamed.js +21 -0
  43. package/core/saveApply.js +2 -2
  44. package/core/sceneMethods.js +9 -34
  45. package/core/services.js +73 -0
  46. package/core/startup.js +3 -1
  47. package/core/styleParts.js +2 -2
  48. package/core/thingExplain.js +68 -0
  49. package/core/thingOps.js +35 -24
  50. package/core/things.js +15 -1
  51. package/core/util.js +11 -0
  52. package/core/validate.js +23 -7
  53. package/docs/AI.md +83 -109
  54. package/docs/API.md +7 -8
  55. package/docs/CODEMAP.md +63 -51
  56. package/docs/COMMANDS.md +17 -5
  57. package/docs/CONVENTIONS.md +17 -6
  58. package/docs/THREE.md +3 -3
  59. package/docs/api/assets.md +2 -0
  60. package/docs/api/characters.md +2 -0
  61. package/docs/api/collision.md +4 -0
  62. package/docs/api/content.md +1 -0
  63. package/docs/api/engine.md +20 -11
  64. package/docs/api/events.md +5 -1
  65. package/docs/api/post.md +5 -4
  66. package/docs/api/saves.md +2 -1
  67. package/docs/api/sky.md +3 -3
  68. package/docs/api/style.md +3 -3
  69. package/docs/api/tools.md +2 -0
  70. package/docs/api/weather.md +1 -1
  71. package/docs/recipes/02-npc.md +16 -0
  72. package/docs/recipes/03-items-pickups.md +1 -1
  73. package/docs/recipes/06-clock-events.md +13 -0
  74. package/docs/recipes/07-flow-scenes-pause.md +4 -0
  75. package/docs/recipes/08-weather-sky.md +1 -1
  76. package/docs/recipes/09-style-pack.md +5 -5
  77. package/docs/recipes/12-navmesh.md +22 -0
  78. package/docs/recipes/13-animation.md +3 -0
  79. package/docs/recipes/15-perf.md +1 -1
  80. package/docs/recipes/16-dev-bridge.md +51 -17
  81. package/docs/recipes/21-camera.md +51 -2
  82. package/docs/recipes/23-ops.md +45 -9
  83. package/docs/recipes/27-net.md +1 -1
  84. package/docs/recipes/29-grid.md +1 -1
  85. package/docs/recipes/34-environment-lighting.md +9 -8
  86. package/docs/recipes/38-environment-look-hooks.md +8 -6
  87. package/docs/recipes/40-scene.md +29 -0
  88. package/docs/recipes/41-thing-registry.md +29 -0
  89. package/docs/recipes/43-shader-patches-surface-looks.md +2 -0
  90. package/docs/recipes/44-water-weather-look-hooks.md +6 -4
  91. package/docs/recipes/45-cascaded-shadows.md +1 -1
  92. package/docs/recipes/46-blender-art-route.md +22 -0
  93. package/docs/recipes/48-make-material.md +70 -0
  94. package/docs/recipes/49-game-module-contract.md +71 -0
  95. package/docs/recipes/50-own-renderer.md +12 -0
  96. package/docs/recipes/51-capability-catalog.md +63 -0
  97. package/docs/recipes/52-look.md +108 -0
  98. package/examples/action/GAMEMAP.md +5 -5
  99. package/examples/action/content/index.js +2 -1
  100. package/examples/action/content/views.js +6 -0
  101. package/examples/sheepisland/GAMEMAP.md +2 -3
  102. package/examples/styletest/GAMEMAP.md +3 -3
  103. package/examples/styletest/main.js +1 -1
  104. package/examples/styletest/panel.js +3 -3
  105. package/examples/world/GAMEMAP.md +3 -3
  106. package/index.d.ts +27 -0
  107. package/index.js +3 -1
  108. package/llms.txt +5 -0
  109. package/modules/ambience/Ambience.js +5 -2
  110. package/modules/camera/FirstPersonCamera.js +3 -5
  111. package/modules/camera/FixedCamera.js +19 -12
  112. package/modules/camera/FollowCamera.js +14 -8
  113. package/modules/camera/RtsCamera.js +3 -5
  114. package/modules/camera/common.js +40 -10
  115. package/modules/camera/index.js +1 -1
  116. package/modules/camera/projection.js +34 -0
  117. package/modules/characters/Character.js +29 -17
  118. package/modules/characters/astar.js +14 -7
  119. package/modules/characters/index.js +6 -3
  120. package/modules/characters/movers/simple.js +6 -1
  121. package/modules/characters/npcSim.js +8 -2
  122. package/modules/characters/pathAsync.js +12 -6
  123. package/modules/characters/pathJob.js +2 -1
  124. package/modules/characters/proceduralRig.js +5 -1
  125. package/modules/characters/useModel.js +22 -0
  126. package/modules/characters/walkTo.js +58 -0
  127. package/modules/collision/Collision.js +102 -4
  128. package/modules/content/explain.js +13 -0
  129. package/modules/content/index.js +2 -0
  130. package/modules/content/loader.js +3 -0
  131. package/modules/content/rules.js +1 -0
  132. package/modules/debug/DebugPanel.js +11 -5
  133. package/modules/entities/Entities.js +6 -2
  134. package/modules/flow/index.js +5 -2
  135. package/modules/gameplay/Dialogue.js +5 -2
  136. package/modules/gameplay/Interactions.js +12 -2
  137. package/modules/gameplay/Inventory.js +21 -11
  138. package/modules/gameplay/Quests.js +13 -3
  139. package/modules/gameplay/pickups.js +5 -3
  140. package/modules/grid/Layer.js +1 -1
  141. package/modules/grid/index.js +1 -1
  142. package/modules/grid/tiles.js +9 -5
  143. package/modules/hlod/index.js +5 -2
  144. package/modules/hud/index.js +5 -2
  145. package/modules/level/index.js +5 -3
  146. package/modules/lights/index.js +5 -2
  147. package/modules/music/Music.js +6 -2
  148. package/modules/nav/index.js +5 -3
  149. package/modules/net/Client.js +4 -3
  150. package/modules/net/Host.js +2 -2
  151. package/modules/net/index.js +5 -3
  152. package/modules/particles/Particles.js +1 -1
  153. package/modules/photo/Photo.js +10 -7
  154. package/modules/rigid/RigidBodies.js +5 -2
  155. package/modules/settings/Settings.js +6 -3
  156. package/modules/settings/apply.js +2 -1
  157. package/modules/sky/Sky.js +21 -19
  158. package/modules/sky/cascades.js +6 -6
  159. package/modules/sky/domeLayers.js +1 -1
  160. package/modules/sky/environment.js +39 -13
  161. package/modules/sky/fog.js +9 -6
  162. package/modules/sky/frame.js +4 -3
  163. package/modules/sky/look.js +3 -2
  164. package/modules/sky/lookFog.js +80 -0
  165. package/modules/sky/lookShadow.js +50 -0
  166. package/modules/sky/lookSky.js +108 -0
  167. package/modules/sky/shader.js +2 -2
  168. package/modules/sky/shadow.js +4 -10
  169. package/modules/sky/skyModule.js +4 -3
  170. package/modules/terrain/ChunkManager.js +2 -33
  171. package/modules/terrain/chunkLevels.js +40 -0
  172. package/modules/terrain/index.js +10 -2
  173. package/modules/terrain/lookGround.js +61 -0
  174. package/modules/timeline/Timeline.js +7 -3
  175. package/modules/timeline/Tween.js +3 -7
  176. package/modules/timeline/shots.js +6 -4
  177. package/modules/triggers/index.js +9 -2
  178. package/modules/vegetation/Vegetation.js +2 -1
  179. package/modules/vegetation/index.js +6 -3
  180. package/modules/vegetation/lookWind.js +37 -0
  181. package/modules/water/Water.js +19 -3
  182. package/modules/water/look.js +80 -0
  183. package/modules/weather/Weather.js +22 -31
  184. package/modules/weather/look.js +75 -0
  185. package/modules/weather/particles.js +1 -1
  186. package/modules/weather/strings.js +15 -0
  187. package/modules/world/explain.js +11 -0
  188. package/modules/world/index.js +11 -4
  189. package/modules/world/thingSource.js +44 -0
  190. package/package.json +1 -1
  191. package/render/PostFX.js +48 -51
  192. package/render/effects.js +4 -2
  193. package/render/fuse.js +12 -0
  194. package/render/lights.js +4 -2
  195. package/render/lookSurface.js +161 -0
  196. package/render/materials.js +27 -10
  197. package/render/postLook.js +86 -0
  198. package/render/surface.js +3 -1
  199. package/types/core.d.ts +216 -24
  200. package/types/gameplay.d.ts +10 -0
  201. package/types/generated/core/DebugOverrides.d.ts +52 -0
  202. package/types/generated/core/Events.d.ts +43 -0
  203. package/types/generated/core/Ops.d.ts +62 -21
  204. package/types/generated/core/Saves.d.ts +1 -0
  205. package/types/generated/core/Views.d.ts +33 -0
  206. package/types/generated/modules/debug/DebugPanel.d.ts +2 -2
  207. package/types/generated/modules/grid/Layer.d.ts +1 -0
  208. package/types/generated/modules/sky/Sky.d.ts +10 -17
  209. package/types/generated/modules/weather/Weather.d.ts +5 -15
  210. package/types/generated/render/PostFX.d.ts +20 -23
  211. package/types/generated/render/materials.d.ts +10 -0
  212. package/types/physics.d.ts +8 -0
  213. package/types/style.d.ts +16 -6
  214. package/ui/Parts.js +6 -2
  215. package/ui/UI.js +1 -1
  216. package/ui/defaults.js +1 -1
  217. package/docs/api/debug.md +0 -10
@@ -0,0 +1,52 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/core/DebugOverrides.js (edit the JSDoc in the source, then run npm run map)
2
+ export class DebugOverrides {
3
+ /** The F3 debug panel (the debug() module), or null when it is not installed @type {any} */
4
+ panel: any;
5
+ /**
6
+ * Diagnostic view: 'albedo' | 'lighting' | 'shadow' | 'normals' to look at one part of the render, 'off' to restore. Temporary and owner-scoped; never saved
7
+ * (describe().render says which view is active, so it is not mistaken for the real look). While one owner's view is on, another owner can neither switch it
8
+ * nor turn it off without force: true; engine.debug.clear(owner) turns that owner's view off too.
9
+ * @example engine.debug.view('normals'); // look at the screenshot, then engine.debug.view('off')
10
+ * @param {'albedo' | 'lighting' | 'shadow' | 'normals' | 'off'} mode @param {{ owner?: string, force?: boolean }} [opts]
11
+ * @returns {{ mode: string, owner: string | null, what?: string, note?: string }}
12
+ */
13
+ view(mode: "albedo" | "lighting" | "shadow" | "normals" | "off", opts?: {
14
+ owner?: string;
15
+ force?: boolean;
16
+ }): {
17
+ mode: string;
18
+ owner: string | null;
19
+ what?: string;
20
+ note?: string;
21
+ };
22
+ /** The active view ({ mode: 'off', owner: null } when none) @returns {{ mode: string, owner: string | null, what?: string }} */
23
+ viewState(): {
24
+ mode: string;
25
+ owner: string | null;
26
+ what?: string;
27
+ };
28
+ /**
29
+ * Change how an object looks for diagnosis, owned by `owner`. Returns { remove() }. Never saved, never part of the game state; listed in
30
+ * describe().scene.overrides while active. A thing id is remembered as the id: when that thing is removed, or a load replaces it, the override is dropped.
31
+ * @param {string} owner who sets it (a tool or session name); engine.debug.clear(owner) removes all of that owner's overrides
32
+ * @param {string | import('three').Object3D} target a thing id (engine.thing), an object name or any Object3D, or a look part id ('look.tone'): then patch is that part's set() values, written on its debug layer above every game owner
33
+ * @param {{ visible?: boolean, material?: 'flat' | 'wire', apply?: (obj: any) => (() => void) | void }} patch flat = unlit base colour, wire = wireframe, apply = your own change (return its undo)
34
+ * @example const h = engine.debug.override('ai-session', 'windmill', { material: 'flat' }); h.remove(); // or engine.debug.clear('ai-session')
35
+ */
36
+ override(owner: string, target: string | import("three").Object3D, patch: {
37
+ visible?: boolean;
38
+ material?: "flat" | "wire";
39
+ apply?: (obj: any) => (() => void) | void;
40
+ }): any;
41
+ /**
42
+ * Remove every override of one owner (nothing else), its look-part debug values and its view; returns how many were removed
43
+ * @param {string} owner
44
+ */
45
+ clear(owner: string): number;
46
+ /** Active overrides as plain data (describe().scene.overrides) */
47
+ overrides(): any[];
48
+ /** Active overrides on one object, for engine.thing(id).explain() */
49
+ overridesOn(obj: any): any[];
50
+ /** Undo everything, drop / restore what the views put back, re-apply */
51
+ dispose(): void;
52
+ }
@@ -3,6 +3,49 @@
3
3
  export class Events {
4
4
  /** How many history entries to keep, default 200; 0 records nothing */
5
5
  historySize: number;
6
+ /** Cause trace ring size, default 0 = off (no cost). Set e.g. 200 in dev to record which event or op caused which follow-up event; read with trace() */
7
+ traceSize: number;
8
+ /**
9
+ * Verbose trace for one object (needs traceSize > 0): perception queries and state checks that name `obj` === id are recorded in full (misses too), the rest of the world only
10
+ * records what changed. null clears. For "why did this guard not see me": traceFocus('guard-1'), play, then read trace('sight').
11
+ * @param {string | null} id world record id
12
+ * @example engine.events.traceSize = 300; engine.events.traceFocus('guard-1');
13
+ */
14
+ traceFocus(id: string | null): void;
15
+ /**
16
+ * Add one entry to the cause trace (no-op while traceSize is 0; check `events.traceSize > 0` first to skip building info). Returns its parent id (`ev:<n>`) to pass as info.parent of follow-ups, or null.
17
+ * info: code (failure code), obj (world record id it is about), data (small plain values), verbose (true = only recorded while traceFocus(obj)), parent (default: the event or op running now).
18
+ * The engine notes failed ops (`op:<name>`), collision.lineClear (`sight`) and NPC state changes (`npc:state`); a game's behaviors can note their own, e.g. 'npc:mode' patrol -> investigate.
19
+ * @param {string} name
20
+ * @param {{ code?: string, obj?: string, data?: object, verbose?: boolean, parent?: string }} [info]
21
+ * @returns {string | null}
22
+ * @example if (e.events.traceSize > 0) e.events.note('npc:mode', { obj: rec.id, data: { from: 'patrol', to: 'investigate' } });
23
+ */
24
+ note(name: string, info?: {
25
+ code?: string;
26
+ obj?: string;
27
+ data?: object;
28
+ verbose?: boolean;
29
+ parent?: string;
30
+ }): string | null;
31
+ /**
32
+ * Cause chains (needs traceSize > 0): each emitted event is recorded with parent = the event (`ev:<id>`) or op (`op:<name>#<seq>`) whose handler emitted it, null when
33
+ * it came from outside any. chain lists the causes from the nearest to the root (as far as the ring still holds). For "why did this fire".
34
+ * @param {string} [name] only events of this name
35
+ * Entries also carry code (failure code), obj and data when noted with events.note.
36
+ * @returns {{ id: number, tick: number, name: string, parent: string | null, chain: string[], code?: string, obj?: string, data?: object }[]}
37
+ * @example engine.events.traceSize = 200; engine.ops.run('shop.buy', { item: 'bread' }); engine.events.trace('item:add').at(-1).chain; // ['op:shop.buy#12']
38
+ */
39
+ trace(name?: string): {
40
+ id: number;
41
+ tick: number;
42
+ name: string;
43
+ parent: string | null;
44
+ chain: string[];
45
+ code?: string;
46
+ obj?: string;
47
+ data?: object;
48
+ }[];
6
49
  /**
7
50
  * Recent events (old -> new); with name, only that kind: { tick = which fixed step, name, data = summary (simple values only; objects become '…') }. For "why did it not fire", first check whether it happened at all
8
51
  * @param {string} [name]
@@ -4,15 +4,21 @@
4
4
  * Inside an op use ctx.actor (world record id, default engine.actor = 'player'), never engine.player: NPCs and network peers run the same op as themselves.
5
5
  */
6
6
  export class Ops {
7
+ /** Counter bumped on each committed op (an op that failed or rolled back does not bump it); every run result carries it, so "did anything change since I looked" is one compare */
8
+ revision: number;
7
9
  set historySize(n: number);
8
10
  /** History entries kept (ring, default 256); setting it clears the history */
9
11
  get historySize(): number;
10
12
  /**
11
13
  * Register an op. Name it noun.verb. run changes state; can (optional) is read-only and returns true or a reason string; offers (optional) lists the arg sets possible now (for list / describe / the dev bridge `ops` command).
12
14
  * args shape types: string number int bool position id any, suffix ? for optional. net: 'peer' lets remote players request it (default: host only);
15
+ * or { type, default, min, max, values, desc } (default is filled in, engine.catalog shows it).
16
+ * atomic: true = world records, inventory containers and vars written by run are rolled back if run fails or throws (events and other state are not; see recipe 23); after(e, args, value, ctx): sound / animation, runs only once the op committed.
17
+ * run (and can) may fail with { ok: false, code, facts, nextActions } (facts: object or list [{ id, field, actual, expected? }]); nextActions are the game's own suggestions.
13
18
  * owner (optional, checked by net() for peer requests): args => world record id whose `owner` field must equal the requesting actor.
14
19
  * @param {string} name
15
- * @param {{ run: (e: any, args: any, ctx: OpContext) => any, can?: (e: any, args: any, ctx: OpContext) => true | string, args?: Record<string, string>, offers?: (e: any, ctx: OpContext) => object[], reasons?: Record<string, string>, desc?: string, undo?: (e: any, args: any, value: any) => void, net?: 'peer' | 'local', owner?: (args: any) => string }} def
20
+ * targets (optional): the thing ids, kinds or template names this op is for; engine.thing(id).explain().ops lists it ('*' = any thing).
21
+ * @param {{ run: (e: any, args: any, ctx: OpContext) => any, can?: (e: any, args: any, ctx: OpContext) => true | string | { code: string, facts?: object, nextActions?: { op: string, args?: object }[] }, targets?: string | string[], args?: Record<string, string | { type: string, default?: any, min?: number, max?: number, values?: any[], desc?: string, optional?: boolean }>, offers?: (e: any, ctx: OpContext) => object[], reasons?: Record<string, string>, desc?: string, undo?: (e: any, args: any, value: any) => void, net?: 'peer' | 'local', owner?: (args: any) => string, atomic?: boolean, after?: (e: any, args: any, value: any, ctx: OpContext) => void }} def
16
22
  * @returns {{ remove(): void }}
17
23
  * @example
18
24
  * const PRICE = { bread: 5 };
@@ -34,28 +40,46 @@ export class Ops {
34
40
  */
35
41
  define(name: string, def: {
36
42
  run: (e: any, args: any, ctx: OpContext) => any;
37
- can?: (e: any, args: any, ctx: OpContext) => true | string;
38
- args?: Record<string, string>;
43
+ can?: (e: any, args: any, ctx: OpContext) => true | string | {
44
+ code: string;
45
+ facts?: object;
46
+ nextActions?: {
47
+ op: string;
48
+ args?: object;
49
+ }[];
50
+ };
51
+ targets?: string | string[];
52
+ args?: Record<string, string | {
53
+ type: string;
54
+ default?: any;
55
+ min?: number;
56
+ max?: number;
57
+ values?: any[];
58
+ desc?: string;
59
+ optional?: boolean;
60
+ }>;
39
61
  offers?: (e: any, ctx: OpContext) => object[];
40
62
  reasons?: Record<string, string>;
41
63
  desc?: string;
42
64
  undo?: (e: any, args: any, value: any) => void;
43
65
  net?: "peer" | "local";
44
66
  owner?: (args: any) => string;
67
+ atomic?: boolean;
68
+ after?: (e: any, args: any, value: any, ctx: OpContext) => void;
45
69
  }): {
46
70
  remove(): void;
47
71
  };
48
72
  /**
49
- * Run an op now (synchronously): checks args (dev), calls can, then run, and logs it. Returns { ok: true, value } or { ok: false, reason }.
73
+ * Run an op now (synchronously): checks args (dev), calls can, then run, and logs it. Returns { ok: true, value, revision } or { ok: false, code, facts, nextActions, revision } (revision = ops.revision, counts committed ops); can may also return { code, facts?, nextActions? }.
50
74
  * Pass a fresh args object each call (it is kept in the history; in dev it is frozen). opts.source: 'player' | 'game' | 'bridge' | 'test' | 'replay' | 'net'
51
75
  * (default: 'game' inside a fixed step, 'player' between steps); opts.actor: who does it (world record id, default engine.actor, which is 'player' unless the game hands control elsewhere).
52
76
  * @param {string} name
53
77
  * @param {object} [args]
54
78
  * @param {{ source?: string, actor?: string }} [opts]
55
- * @returns {{ ok: boolean, value?: any, reason?: string }}
79
+ * @returns {{ ok: boolean, value?: any, revision: number, code?: string, facts?: object, nextActions?: { op: string, args?: object }[] }}
56
80
  * @example
57
81
  * const r = engine.ops.run('shop.buy', { shop: 'bakery', item: 'bread' });
58
- * if (!r.ok) showHint(engine.t('op.shop.buy.' + r.reason));
82
+ * if (!r.ok) showHint(engine.t('op.shop.buy.' + r.code));
59
83
  * // from a fixed step, for an input-driven action: e.ops.run('combat.roll', { dir }, { source: 'player' })
60
84
  */
61
85
  run(name: string, args?: object, opts?: {
@@ -64,31 +88,42 @@ export class Ops {
64
88
  }): {
65
89
  ok: boolean;
66
90
  value?: any;
67
- reason?: string;
91
+ revision: number;
92
+ code?: string;
93
+ facts?: object;
94
+ nextActions?: {
95
+ op: string;
96
+ args?: object;
97
+ }[];
68
98
  };
69
99
  /**
70
100
  * Reverse a finished op with the undo(e, args, value) its definition declared: pass the same args and the value run returned.
71
- * Returns { ok: true }, or { ok: false, reason: 'noUndo' } when the op did not declare undo. The undo runs as an op write (the dev guard stays quiet).
101
+ * Returns { ok: true }, or { ok: false, code: 'noUndo', facts: { op }, nextActions } when the op did not declare undo. The undo runs as an op write (the dev guard stays quiet).
72
102
  * @example const r = engine.ops.run('inventory.trade', { take: 'rusty_key', give: 'gold_key' }); engine.ops.undo('inventory.trade', { take: 'rusty_key', give: 'gold_key' }, r.value);
73
103
  * @param {string} name
74
104
  * @param {object} args
75
105
  * @param {any} value
76
106
  * @param {{ actor?: string }} [opts]
77
- * @returns {{ ok: boolean, reason?: string }}
107
+ * @returns {{ ok: boolean, code?: string, facts?: object, nextActions?: { op: string, args?: object }[] }}
78
108
  */
79
109
  undo(name: string, args: object, value: any, opts?: {
80
110
  actor?: string;
81
111
  }): {
82
112
  ok: boolean;
83
- reason?: string;
113
+ code?: string;
114
+ facts?: object;
115
+ nextActions?: {
116
+ op: string;
117
+ args?: object;
118
+ }[];
84
119
  };
85
120
  /**
86
121
  * Ask without doing: runs only can (no state change, no history). For greying out buttons and input buffers.
87
122
  * @param {string} name
88
123
  * @param {object} [args]
89
124
  * @param {{ actor?: string, source?: string }} [opts]
90
- * @returns {{ ok: boolean, reason?: string }}
91
- * @example const { ok, reason } = engine.ops.can('shop.buy', { shop: 'bakery', item: 'bread' });
125
+ * @returns {{ ok: boolean, code?: string, facts?: object, nextActions?: { op: string, args?: object }[] }}
126
+ * @example const { ok, code } = engine.ops.can('shop.buy', { shop: 'bakery', item: 'bread' });
92
127
  * button.disabled = !ok;
93
128
  */
94
129
  can(name: string, args?: object, opts?: {
@@ -96,14 +131,19 @@ export class Ops {
96
131
  source?: string;
97
132
  }): {
98
133
  ok: boolean;
99
- reason?: string;
134
+ code?: string;
135
+ facts?: object;
136
+ nextActions?: {
137
+ op: string;
138
+ args?: object;
139
+ }[];
100
140
  };
101
141
  /**
102
142
  * What exists, or with { available: true } what is possible now: every arg set from each op's offers checked with can
103
143
  * (an op with neither offers nor args is checked once with {}; one with args but no offers is skipped, since its args are free-form).
104
144
  * @param {{ available?: boolean, actor?: string }} [opts]
105
- * @returns {{ name: string, desc?: string, args?: any, ok?: boolean, reason?: string }[]}
106
- * @example engine.ops.list({ available: true }); // [{ name: 'shop.buy', args: { shop: 'bakery', item: 'bread' }, ok: false, reason: 'noMoney' }, ...]
145
+ * @returns {{ name: string, desc?: string, args?: any, atomic: boolean, ok?: boolean, code?: string }[]}
146
+ * @example engine.ops.list({ available: true }); // [{ name: 'shop.buy', args: { shop: 'bakery', item: 'bread' }, ok: false, code: 'noMoney' }, ...]
107
147
  */
108
148
  list({ available, actor }?: {
109
149
  available?: boolean;
@@ -112,15 +152,16 @@ export class Ops {
112
152
  name: string;
113
153
  desc?: string;
114
154
  args?: any;
155
+ atomic: boolean;
115
156
  ok?: boolean;
116
- reason?: string;
157
+ code?: string;
117
158
  }[];
118
159
  /**
119
- * Recent history (old -> new), optionally of one op: { seq, tick, phase: 'fixed' | 'between', name, args, source, actor, ok, reason, depth, count }.
120
- * Consecutive identical failures (same actor, op and reason) merge into one entry with count.
160
+ * Recent history (old -> new), optionally of one op: { seq, tick, phase: 'fixed' | 'between', name, args, source, actor, ok, code, depth, count }.
161
+ * Consecutive identical failures (same actor, op and code) merge into one entry with count.
121
162
  * @param {string} [name]
122
- * @returns {{ seq: number, tick: number, phase: string, name: string, args: any, source: string, actor: string, ok: boolean, reason: string | null, depth: number, count: number }[]}
123
- * @example engine.ops.recent('shop.buy').at(-1); // { tick: 812, phase: 'between', ok: false, reason: 'noMoney', ... }
163
+ * @returns {{ seq: number, tick: number, phase: string, name: string, args: any, source: string, actor: string, ok: boolean, code: string | null, depth: number, count: number }[]}
164
+ * @example engine.ops.recent('shop.buy').at(-1); // { tick: 812, phase: 'between', ok: false, code: 'noMoney', ... }
124
165
  */
125
166
  recent(name?: string): {
126
167
  seq: number;
@@ -131,7 +172,7 @@ export class Ops {
131
172
  source: string;
132
173
  actor: string;
133
174
  ok: boolean;
134
- reason: string | null;
175
+ code: string | null;
135
176
  depth: number;
136
177
  count: number;
137
178
  }[];
@@ -31,6 +31,7 @@ export class Saves {
31
31
  * shape.
32
32
  * A save whose part is newer than this build's version is refused as a whole (load returns false, the save is kept).
33
33
  * A part registered after a save was loaded (a module installed later) is handed its data from that save at once.
34
+ * atomic: true joins this part to atomic ops: it is copied before an atomic op runs and put back if the op fails (plain data only; afterLoad does not run on rollback).
34
35
  * @param {string} key
35
36
  * @param {SaveProvider} provider
36
37
  * @example
@@ -0,0 +1,33 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/core/Views.js (edit the JSDoc in the source, then run npm run map)
2
+ export class Views {
3
+ /** @param {any} engine */
4
+ constructor(engine: any);
5
+ engine: any;
6
+ map: Map<any, any>;
7
+ current: string;
8
+ /**
9
+ * Declare a view. position and target are [x, y, z]; fov (degrees) is optional (the camera's own when left out). Returns { remove() } (undeclares it).
10
+ * @param {string} name @param {{ position: number[], target?: number[], fov?: number }} v
11
+ * @returns {{ remove(): void }}
12
+ */
13
+ define(name: string, v: {
14
+ position: number[];
15
+ target?: number[];
16
+ fov?: number;
17
+ }): {
18
+ remove(): void;
19
+ };
20
+ /** @param {string} name */
21
+ has(name: string): boolean;
22
+ /** @returns {string[]} the declared view names */
23
+ list(): string[];
24
+ /**
25
+ * Put the camera on a view and keep it there (the camera rigs leave it alone) until release() or the returned handle's remove(); null for an unknown name
26
+ * @param {string} name @returns {{ remove(): void } | null}
27
+ */
28
+ show(name: string): {
29
+ remove(): void;
30
+ } | null;
31
+ /** Give the camera back (to the previous holder, e.g. a running cutscene, or to the rig) */
32
+ release(): void;
33
+ }
@@ -1,6 +1,6 @@
1
1
  // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/debug/DebugPanel.js (edit the JSDoc in the source, then run npm run map)
2
2
  /**
3
- * F3 F3 debug panel -> engine.debug: performance panel, settings, stress test. Collapsed by default; F3 shows/hides it; open: true shows it at start. Just do not install it in a release
3
+ * F3 debug panel -> engine.debug.panel: performance panel, settings, stress test. Collapsed by default; F3 shows/hides it; open: true shows it at start. Just do not install it in a release
4
4
  * @param {{ open?: boolean }} [opts]
5
5
  * @returns {ModuleDef<DebugPanel>}
6
6
  */
@@ -8,7 +8,7 @@ export function debug(opts?: {
8
8
  open?: boolean;
9
9
  }): ModuleDef<DebugPanel>;
10
10
  /** @import { ModuleDef } from '../../../core' */
11
- /** engine.debug (F3 panel) */
11
+ /** engine.debug.panel (F3 panel) */
12
12
  export class DebugPanel {
13
13
  /** Stress test running (player auto-runs fast) @type {boolean} */
14
14
  benchmarking: boolean;
@@ -53,6 +53,7 @@ export class Layer {
53
53
  export type LayerOptions = {
54
54
  tiles?: boolean | {
55
55
  look?: (data: Record<string, any>, cell: [number, number]) => any;
56
+ colors?: Record<string, number | string>;
56
57
  lift?: number;
57
58
  } | ((engine: any, layer: Layer) => {
58
59
  update?: (cells: {
@@ -33,7 +33,7 @@ export class Sky {
33
33
  sway: number;
34
34
  distance: number;
35
35
  };
36
- /** Current shadow params (change via setShadow) @readonly @type {SkyShadowParams} */
36
+ /** Current shadow params (change via look.shadow.set) @readonly @type {SkyShadowParams} */
37
37
  readonly shadow: SkyShadowParams;
38
38
  /** three's CSM (addons/csm) while shadow.cascades > 1, else null; its lights[0] is sun (recipes/45) @type {any} */
39
39
  csm: any;
@@ -110,14 +110,11 @@ export class Sky {
110
110
  */
111
111
  onSeason(name: string, fn: (season: string) => void): Handle;
112
112
  /**
113
- * Change shadow params (only the given fields): bias / normalBias prevent banding; updateEvery updates shadows every N frames (1 = every frame);
114
- * snap snap = shadow center snap grid (meters, or 'texel' to snap to shadow pixels); ahead = meters to shift the shadow center in front of the view;
115
- * type = 'basic' (hard edge) | 'pcf' | 'vsm' (soft, costlier; switching rebuilds the shadow map and recompiles materials, so do it rarely);
116
- * radius = edge softness (pcf, vsm; no effect on basic); blurSamples = blur quality (vsm only); cascades 2-4 = cascaded shadows, 1 = off (recipes/45)
117
- * @param {Partial<SkyShadowParams>} [opts]
118
- * @returns {this}
113
+ * Renamed in 0.2: throws and names the new call, engine.look.shadow.set(opts) (fields: bias, normalBias, updateEvery, snap, ahead, type, radius, blurSamples, cascades; recipes/45)
114
+ * @param {Partial<SkyShadowParams>} [_opts]
115
+ * @returns {never}
119
116
  */
120
- setShadow(opts?: Partial<SkyShadowParams>): this;
117
+ setShadow(_opts?: Partial<SkyShadowParams>): never;
121
118
  /**
122
119
  * Change shadow resolution (raise temporarily for photo mode)
123
120
  * @param {number} n pixels
@@ -125,20 +122,16 @@ export class Sky {
125
122
  */
126
123
  setShadowMapSize(n: number): void;
127
124
  /**
128
- * Environment lighting (scene.environment), separate from the background and off by default. source 'sky' builds it from the procedural sky (rebuilt at
129
- * most every `interval` seconds, only when the sky changed); an asset name or path (.hdr, .jpg, .ktx2) is an equirectangular panorama. intensity scales
130
- * the light (default 1), rotation turns it around Y (radians). Given fields change, the rest stay; null turns it off. Lambert surfaces get soft ambient
131
- * light from it (no reflections); lower the hemisphere ambient when you turn it on (recipes/09)
132
- * @example engine.sky.setEnvironment({ source: 'sky', intensity: 0.8 }); engine.sky.setEnvironment(null);
133
- * @param {{ source?: string | null, intensity?: number, rotation?: number, interval?: number } | null} [opts]
134
- * @returns {this}
125
+ * Renamed in 0.2: throws and names the new call, engine.look.env.replace(source) then engine.look.env.set({ intensity, rotation, interval })
126
+ * @param {{ source?: string | null, intensity?: number, rotation?: number, interval?: number } | null} [_opts]
127
+ * @returns {never}
135
128
  */
136
- setEnvironment(opts?: {
129
+ setEnvironment(_opts?: {
137
130
  source?: string | null;
138
131
  intensity?: number;
139
132
  rotation?: number;
140
133
  interval?: number;
141
- } | null): this;
134
+ } | null): never;
142
135
  /** Environment lighting now: { source, intensity, rotation, interval, builds }, null when off @type {SkyEnvironmentInfo | null} */
143
136
  get environment(): SkyEnvironmentInfo | null;
144
137
  }
@@ -29,22 +29,12 @@ export class Weather {
29
29
  /** Particle systems drawn now: field -> { field, object, uniforms } (rain / snow when the table has them, plus define()) @type {Map<string, any>} */
30
30
  systems: Map<string, any>;
31
31
  /**
32
- * Draw particles for a field of this game's weather table (its amount is weather.current[field], so they fade with the weather). spec takes the
33
- * keys of style.weather.rain (shape, color, size, speed, sway, density, glsl...) or create(engine, { area, count }) => { object, update } for a
34
- * system of your own. The same field again replaces it, rain and snow included. See recipes/44-water-weather-look-hooks.md
35
- * @example
36
- * engine.weather.define('ash', { shape: 'soft', color: 0x555555, size: 14, speed: 0.8, sway: 3 }); // types: { ashfall: { ash: 1, grey: 0.5 } }
37
- * @param {string} field
38
- * @param {import('../../../style').StyleWeatherParticles} [spec]
39
- * @returns {{ field: string, object: THREE.Object3D, uniforms: Record<string, { value: any }> | null }}
32
+ * Renamed in 0.2: throws and names the new call, engine.look.weather.replace({ [field]: spec }) (recipes/44-water-weather-look-hooks.md)
33
+ * @param {string} _field
34
+ * @param {import('../../../style').StyleWeatherParticles} [_spec]
35
+ * @returns {never}
40
36
  */
41
- define(field: string, spec?: import("../../../style").StyleWeatherParticles): {
42
- field: string;
43
- object: THREE.Object3D;
44
- uniforms: Record<string, {
45
- value: any;
46
- }> | null;
47
- };
37
+ define(_field: string, _spec?: import("../../../style").StyleWeatherParticles): never;
48
38
  /**
49
39
  * Automatic weather on/off
50
40
  * @param {boolean} on
@@ -1,7 +1,7 @@
1
1
  // Generated by npm run map, do not edit by hand. Source: packages/engine/render/PostFX.js (edit the JSDoc in the source, then run npm run map)
2
2
  export class PostFX {
3
3
  /**
4
- * MSAA on (read-only; switch with post.enable('antialias', on))
4
+ * MSAA on (read-only; switch with post.setAntialias(on))
5
5
  * @returns {boolean}
6
6
  */
7
7
  get antialias(): boolean;
@@ -11,40 +11,40 @@ export class PostFX {
11
11
  */
12
12
  get active(): boolean;
13
13
  /**
14
- * Add a named effect; returns its handle. Slot and order come from the effect unless given here.
15
- * @example
16
- * import { RenderPixelatedPass } from 'three/addons/postprocessing/RenderPixelatedPass.js';
17
- * const pixels = engine.post.add({ name: 'pixelate', slot: 'scene', params: { size: 4 },
18
- * create: ({ scene, camera, width, height, params }) => new RenderPixelatedPass(params.size, scene, camera),
19
- * update: (pass, p) => pass.setPixelSize(p.size) });
20
- * pixels.set({ size: 6 }); pixels.enable(false); pixels.remove();
21
- * @param {PostEffect} effect
22
- * @param {{ slot?: PostSlot, order?: number, enabled?: boolean }} [opts]
23
- * @returns {PostHandle}
14
+ * Renamed in 0.2: throws and names the new call (engine.look.post.patch / engine.look.post.replace, recipes/52-look.md)
15
+ * @param {PostEffect} _effect
16
+ * @param {{ slot?: PostSlot, order?: number, enabled?: boolean }} [_opts]
17
+ * @returns {never}
24
18
  * @experimental
25
19
  */
26
- add(effect: PostEffect, { slot, order, enabled }?: {
20
+ add(_effect: PostEffect, _opts?: {
27
21
  slot?: PostSlot;
28
22
  order?: number;
29
23
  enabled?: boolean;
30
- }): PostHandle;
24
+ }): never;
31
25
  /**
32
- * Handle of an added effect, or undefined: engine.post.get('bloom')?.set({ strength: 0.6 })
26
+ * Read-only record of an added effect (name, slot, order, enabled, params), or undefined. Change one with engine.look.post.set({ 'bloom.strength': 0.6 })
33
27
  * @param {string} name
34
28
  * @returns {PostHandle | undefined}
35
29
  * @experimental
36
30
  */
37
31
  get(name: string): PostHandle | undefined;
38
32
  /**
39
- * Turn an effect, or 'antialias' (MSAA), on or off; false (and a dev warning naming the effects) when no such effect is added
40
- * @example
41
- * engine.post.enable('bloom', false); engine.post.enable('antialias', true);
42
- * @param {string} name
33
+ * Renamed in 0.2: throws and names the new call (engine.look.post.set({ 'bloom.enabled': on }); MSAA: engine.post.setAntialias(on))
34
+ * @param {string} _name
35
+ * @param {boolean} _on
36
+ * @returns {never}
37
+ * @experimental
38
+ */
39
+ enable(_name: string, _on: boolean): never;
40
+ /**
41
+ * Turn MSAA (antialiasing of the post chain) on or off. It is a render target setting, not a look part.
42
+ * @example engine.post.setAntialias(false);
43
43
  * @param {boolean} on
44
- * @returns {boolean}
44
+ * @returns {void}
45
45
  * @experimental
46
46
  */
47
- enable(name: string, on: boolean): boolean;
47
+ setAntialias(on: boolean): void;
48
48
  /**
49
49
  * Effects in render order: [{ name, slot, order, enabled }]
50
50
  * @returns {{ name: string, slot: PostSlot, order: number, enabled: boolean }[]}
@@ -120,9 +120,6 @@ export type PostHandle = {
120
120
  readonly order: number;
121
121
  readonly enabled: boolean;
122
122
  readonly params: Record<string, any>;
123
- enable(on: boolean): void;
124
- set(params: Record<string, any>): void;
125
- remove(): void;
126
123
  };
127
124
  import type { Engine } from '../../core';
128
125
  import * as THREE from 'three';
@@ -25,6 +25,16 @@ export function makeMaterial(purpose?: string, params?: {
25
25
  }, engine?: {
26
26
  style: any;
27
27
  }): THREE.Material;
28
+ export function windCustom({ glsl, uniforms }: {
29
+ glsl: any;
30
+ uniforms: any;
31
+ }): {
32
+ uniforms: Record<string, {
33
+ value: any;
34
+ }>;
35
+ decl: string;
36
+ glsl: any;
37
+ };
28
38
  /**
29
39
  * Add effects to any material (built-in, from a style pack, or third-party); returns the same material. The one entry for shader effects:
30
40
  * wind (sway amplitude; the shadow sways too, nothing else to set up), clouds (drifting cloud shadows, default on; how dark is
@@ -67,6 +67,12 @@ export interface Collision {
67
67
  addCircle(position: PositionLike, opts?: CircleColliderOptions): Handle;
68
68
  /** Add a box collider (house, fence): position is the center, e.g. addBox(house, { halfWidth: 3, halfDepth: 2, rotation: 0.3 }). Returns a handle { remove() } */
69
69
  addBox(position: PositionLike, opts?: BoxColliderOptions): Handle;
70
+ /** Add a thin wall along a -> b (fence). Options: thickness (default 0.3), height, y. A gap between segments is a gate. Returns a handle { remove() } */
71
+ addSegment(a: PositionLike, b: PositionLike, opts?: { thickness?: number; height?: number; y?: number }): Handle;
72
+ /** Mark ground impassable where fn(x, z) is true (river, lava); fn must be pure. bounds skips fn outside it. Returns a handle { remove() } */
73
+ addBlocked(fn: (x: number, z: number) => boolean, opts?: { bounds?: { minX: number; maxX: number; minZ: number; maxZ: number } }): Handle;
74
+ /** Is a character of this radius touching addBlocked ground at (x, z) */
75
+ blockedAt(x: number, z: number, radius?: number): boolean;
70
76
  /** Add a collider from an object's bounding box, pad expands outward (meters). Returns a handle { remove() } */
71
77
  addObject(obj: Object3D, opts?: { pad?: number }): Handle;
72
78
  /** Iterate all static colliders added by hand */
@@ -75,6 +81,8 @@ export interface Collision {
75
81
  walkable(position: PositionLike, opts?: { radius?: number }): boolean;
76
82
  /** walkable with plain numbers, allocating nothing (A* inner loops); radius defaults to engine.movement.radius */
77
83
  walkableAt(x: number, z: number, radius?: number): boolean;
84
+ /** Line of sight with height: is the 3D segment a -> b free of boxes, circles and terrain trees? radius fattens the line; addBlocked water is ignored. Give eye heights in a / b */
85
+ lineClear(a: PositionLike, b: PositionLike, opts?: { radius?: number }): boolean;
78
86
  }
79
87
 
80
88
  // ======================================================================
package/types/style.d.ts CHANGED
@@ -145,7 +145,7 @@ export interface StyleSky {
145
145
  skybox?: string;
146
146
  /** Shadows: mapSize resolution (pixels), extent coverage (meters), etc., see StyleShadow */
147
147
  shadow?: StyleShadow;
148
- /** Environment lighting (scene.environment), off unless a source is given; see Sky.setEnvironment. A pack can give defaults, sky({ environment }) overrides */
148
+ /** Environment lighting (scene.environment), off unless a source is given; see engine.look.env. A pack can give defaults, sky({ environment }) overrides */
149
149
  environment?: StyleEnvironment;
150
150
  /** Fog model and color (default: linear fog in the horizon color); see StyleFog */
151
151
  fog?: StyleFog;
@@ -165,6 +165,12 @@ export interface StyleFog {
165
165
  color?: 'horizon' | ColorLike | ((sky: any) => ColorLike);
166
166
  /** Per meter, exp / exp2 / height (default: derived from engine.fogFar, so fog reaches the same distance as linear); weather fog divides it */
167
167
  density?: number;
168
+ /** Linear fog start (meters); default 0.3 x far. Same keys as engine.look.fog.set */
169
+ near?: number;
170
+ /** Linear fog end (meters); default engine.fogFar */
171
+ far?: number;
172
+ /** false: no fog; default true */
173
+ enabled?: boolean;
168
174
  /** 'height': world y of the fog floor, default 0 */
169
175
  height?: number;
170
176
  /** 'height': how fast the fog thins above the floor, per meter, default 0.05 */
@@ -185,6 +191,8 @@ export interface StyleFog {
185
191
  * return vec4(uAurora, band * night); }` }]
186
192
  */
187
193
  export interface StyleSkyLayer {
194
+ /** The layer's name, the key for engine.look.sky.patch('layer:<name>'); default layer0, layer1 ... by position */
195
+ name?: string;
188
196
  /** Defines `vec4 threedogSkyLayer(vec3 dir, float time, vec3 sunDir, float night)` returning (rgb, amount 0..1); renamed per layer, so layers never clash */
189
197
  glsl: string;
190
198
  /** Custom uniforms (numbers, THREE.Color, [x, y(, z, w)], THREE.Texture), live in engine.sky.dome.material.uniforms */
@@ -271,10 +279,12 @@ export interface StyleWind {
271
279
  uniforms?: Record<string, number | number[] | object>;
272
280
  }
273
281
 
274
- /** engine.sky.shadow: the shadow params in use (Sky.setShadow changes them); field meanings as in StyleShadow */
282
+ /** engine.sky.shadow: the shadow params in use (engine.look.shadow.set changes them); field meanings as in StyleShadow */
275
283
  export interface SkyShadowParams {
276
284
  bias: number; normalBias: number; updateEvery: number; snap: number | 'texel'; ahead: number; type: 'basic' | 'pcf' | 'vsm'; radius: number; blurSamples: number;
277
285
  cascades: number; maxFar: number; fade: boolean; lightMargin: number; split: StyleShadow['split'];
286
+ /** Same keys as engine.look.shadow.set */
287
+ mapSize?: number; enabled?: boolean;
278
288
  }
279
289
 
280
290
  export interface StyleShadow {
@@ -343,7 +353,7 @@ export interface StyleWeather {
343
353
  types?: Record<string, Partial<WeatherPreset>>;
344
354
  }
345
355
 
346
- /** Falling weather particles: style.weather.rain / snow and engine.weather.define(field, spec). See recipes/44-water-weather-look-hooks.md */
356
+ /** Falling weather particles: style.weather.rain / snow and engine.look.weather.replace({ field: spec }). See recipes/44-water-weather-look-hooks.md */
347
357
  /** style.weather.snow: the snow particles' look plus the cover it leaves */
348
358
  export interface StyleWeatherSnow extends StyleWeatherParticles {
349
359
  /** Snow lying on foliage / ground while it snows (StyleSnowCover); leave out for particles only */
@@ -395,7 +405,7 @@ export interface StyleWeatherParticles {
395
405
  glsl?: { vertex?: string; fragment?: string };
396
406
  /** Uniforms for your glsl: numbers, colors, [x, y(, z, w)] arrays, textures; live in engine.weather.systems.get(field).uniforms */
397
407
  uniforms?: Record<string, any>;
398
- /** A system of your own instead (engine.weather.define only): the engine adds object, shows it while the amount is above 0.02, calls update */
408
+ /** A system of your own instead (engine.look.weather.replace only): the engine adds object, shows it while the amount is above 0.02, calls update */
399
409
  create?: (engine: Engine, ctx: { area: number; count: number }) => {
400
410
  object: Object3D; update?: (amount: number, ctx: { camera: any; time: number; wind: number }) => void };
401
411
  }
@@ -548,11 +558,11 @@ export interface Style {
548
558
  name?: string;
549
559
  /**
550
560
  * Exposure, default 1 (lowpoly: 1.05): a number, or over the day [[time 0-1, exposure], ...] (sorted, wraps across midnight) or (sky) => number,
551
- * evaluated by the sky module every frame. engine.setExposure changes it at run time
561
+ * evaluated by the sky module every frame. engine.look.tone.set changes it at run time
552
562
  * @example exposure: [[0, 1.6], [0.3, 1], [0.75, 1.1]] // brighter nights
553
563
  */
554
564
  exposure?: number | number[][] | ((sky: any) => number);
555
- /** Tone mapping, default 'neutral' (lowpoly: 'aces') */
565
+ /** Tone mapping. Engine default 'none' (no style pack, no tone mapping); the style pack picks the look (lowpoly: 'aces') */
556
566
  toneMapping?: Loose<'aces' | 'agx' | 'neutral' | 'none'>;
557
567
  /** Background color (when there is no sky module) */
558
568
  background?: ColorLike;