@woosh/meep-engine 2.127.0 → 2.128.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 (91) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/packing/miniball/Miniball.d.ts +12 -10
  3. package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
  4. package/src/core/geom/packing/miniball/Miniball.js +76 -54
  5. package/src/engine/Clock.d.ts +2 -1
  6. package/src/engine/Clock.d.ts.map +1 -1
  7. package/src/engine/Clock.js +1 -0
  8. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  9. package/src/engine/ecs/EntityComponentDataset.js +2 -1
  10. package/src/engine/ecs/EntityManager.d.ts +5 -6
  11. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  12. package/src/engine/ecs/EntityManager.js +83 -37
  13. package/src/engine/ecs/System.d.ts +2 -2
  14. package/src/engine/ecs/System.d.ts.map +1 -1
  15. package/src/engine/ecs/System.js +41 -19
  16. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts +1 -1
  17. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.d.ts.map +1 -1
  18. package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +1 -4
  19. package/src/engine/ecs/fow/FogOfWarSystem.d.ts +2 -4
  20. package/src/engine/ecs/fow/FogOfWarSystem.d.ts.map +1 -1
  21. package/src/engine/ecs/fow/FogOfWarSystem.js +15 -21
  22. package/src/engine/ecs/gui/GUIElementSystem.d.ts.map +1 -1
  23. package/src/engine/ecs/gui/GUIElementSystem.js +7 -18
  24. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.d.ts.map +1 -1
  25. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +3 -10
  26. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts +2 -2
  27. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
  28. package/src/engine/ecs/gui/position/ViewportPositionSystem.js +2 -6
  29. package/src/engine/ecs/renderable/RenderSystem.d.ts.map +1 -1
  30. package/src/engine/ecs/renderable/RenderSystem.js +3 -7
  31. package/src/engine/ecs/speaker/VoiceSystem.d.ts +1 -1
  32. package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
  33. package/src/engine/ecs/speaker/VoiceSystem.js +2 -4
  34. package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts.map +1 -1
  35. package/src/engine/ecs/terrain/ecs/TerrainSystem.js +2 -5
  36. package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts +2 -2
  37. package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts.map +1 -1
  38. package/src/engine/ecs/tooltip/TooltipComponentSystem.js +10 -12
  39. package/src/engine/ecs/validateSystem.d.ts.map +1 -1
  40. package/src/engine/ecs/validateSystem.js +11 -2
  41. package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
  42. package/src/engine/graphics/ecs/camera/CameraSystem.js +5 -8
  43. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.d.ts.map +1 -1
  44. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -6
  45. package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.d.ts.map +1 -1
  46. package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.js +14 -27
  47. package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
  48. package/src/engine/graphics/ecs/light/LightSystem.js +2 -6
  49. package/src/engine/graphics/ecs/mesh/MeshSystem.d.ts.map +1 -1
  50. package/src/engine/graphics/ecs/mesh/MeshSystem.js +2 -6
  51. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  52. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +2 -5
  53. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts.map +1 -1
  54. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +1 -2
  55. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  56. package/src/engine/graphics/ecs/path/PathDisplaySystem.js +13 -17
  57. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts.map +1 -1
  58. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +2 -6
  59. package/src/engine/graphics/ecs/water/WaterSystem.d.ts +2 -2
  60. package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
  61. package/src/engine/graphics/ecs/water/WaterSystem.js +5 -11
  62. package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.d.ts.map +1 -1
  63. package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.js +2 -6
  64. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts +51 -7
  65. package/src/engine/graphics/render/frame_graph/RenderGraph.d.ts.map +1 -1
  66. package/src/engine/graphics/render/frame_graph/RenderGraph.js +109 -8
  67. package/src/engine/graphics/render/frame_graph/RenderPassBuilder.d.ts +44 -0
  68. package/src/engine/graphics/render/frame_graph/RenderPassBuilder.d.ts.map +1 -0
  69. package/src/engine/graphics/render/frame_graph/{RenderGraphBuilder.js → RenderPassBuilder.js} +25 -6
  70. package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts +1 -0
  71. package/src/engine/graphics/render/frame_graph/RenderPassNode.d.ts.map +1 -1
  72. package/src/engine/graphics/render/frame_graph/RenderPassNode.js +1 -0
  73. package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts +8 -0
  74. package/src/engine/graphics/render/frame_graph/ResourceEntry.d.ts.map +1 -1
  75. package/src/engine/graphics/render/frame_graph/ResourceEntry.js +8 -0
  76. package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts +1 -0
  77. package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.d.ts.map +1 -1
  78. package/src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js +3 -0
  79. package/src/engine/input/ecs/systems/InputControllerSystem.d.ts.map +1 -1
  80. package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -2
  81. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +2 -2
  82. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts.map +1 -1
  83. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +3 -5
  84. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +2 -2
  85. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
  86. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +2 -6
  87. package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts +0 -33
  88. package/src/engine/graphics/render/frame_graph/RenderGraphBuilder.d.ts.map +0 -1
  89. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts +0 -50
  90. package/src/engine/graphics/render/frame_graph/RenderPass.d.ts.map +0 -1
  91. package/src/engine/graphics/render/frame_graph/RenderPass.js +0 -74
@@ -1,6 +1,6 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import LineBuilder from "../../../../core/codegen/LineBuilder.js";
3
- import { RenderGraphBuilder } from "./RenderGraphBuilder.js";
3
+ import { RenderPassBuilder } from "./RenderPassBuilder.js";
4
4
  import { RenderPassNode } from "./RenderPassNode.js";
5
5
  import { RenderPassResources } from "./RenderPassResources.js";
6
6
  import { ResourceEntry } from "./ResourceEntry.js";
@@ -8,7 +8,35 @@ import { ResourceNode } from "./ResourceNode.js";
8
8
 
9
9
  /**
10
10
  * Based on the Frostbite's GDC paper "FrameGraph: Extensible Rendering Architecture in Frostbite" by Yuriy O'Donnell
11
- * @see https://github.com/skaarj1989/FrameGraph
11
+ * @example
12
+ * const graph = new RenderGraph("My Graph");
13
+ *
14
+ * const pass_data = {};
15
+ * const pass = graph.add("GBuffer Pass", pass_data, (data, resources, context) => {
16
+ *
17
+ * context.beginRenderPass({
18
+ * depth_attachment: resources.get(data.depth),
19
+ * color_attachments:[
20
+ * resources.get(data.normal),
21
+ * resources.get(data.albedo),
22
+ * ]
23
+ * });
24
+ *
25
+ * for (const renderable in renderables){
26
+ * drawMesh(context, renderable.mesh, renderable.material);
27
+ * }
28
+ *
29
+ * context.endRenderPass();
30
+ *
31
+ * });
32
+ *
33
+ * pass_data.depth = pass.create("depth", {...});
34
+ * pass_data.albedo = pass.create("albedo", {...});
35
+ * pass_data.normal = pass.create("normal", {...});
36
+ *
37
+ * graph.compile();
38
+ * graph.execute(context);
39
+ *
12
40
  */
13
41
  export class RenderGraph {
14
42
  /**
@@ -103,11 +131,13 @@ export class RenderGraph {
103
131
  * @template T
104
132
  * @param {string} name
105
133
  * @param {T} descriptor
134
+ * @returns {number}
106
135
  */
107
136
  create_resource(name, descriptor) {
108
137
  assert.isString(name, 'name');
109
138
  assert.defined(descriptor, 'descriptor');
110
139
  assert.notNull(descriptor, 'descriptor');
140
+ assert.isObject(descriptor, 'descriptor');
111
141
 
112
142
  const resource = this._createResourceEntry(descriptor);
113
143
 
@@ -160,11 +190,11 @@ export class RenderGraph {
160
190
 
161
191
  /**
162
192
  *
163
- * @param {number} res
164
- * @returns {number}
193
+ * @param {number} node_id
194
+ * @returns {number} ID of the cloned resource node
165
195
  */
166
- clone_resource(res) {
167
- const node = this.getResourceNode(res);
196
+ clone_resource(node_id) {
197
+ const node = this.getResourceNode(node_id);
168
198
 
169
199
  const entry = this.__resource_registry[node.resource_id];
170
200
 
@@ -210,11 +240,12 @@ export class RenderGraph {
210
240
  }
211
241
 
212
242
  /**
243
+ * Add a new pass to the graph.
213
244
  * @template T
214
245
  * @param {string} name
215
246
  * @param {T} data
216
247
  * @param {function(data:T, resources: RenderPassResources, context:IRenderContext):void} execute
217
- * @returns {RenderGraphBuilder}
248
+ * @returns {RenderPassBuilder}
218
249
  */
219
250
  add(name, data, execute) {
220
251
  assert.isString(name, 'name');
@@ -227,7 +258,7 @@ export class RenderGraph {
227
258
 
228
259
  const pass_nodes = this.__pass_nodes;
229
260
 
230
- const builder = new RenderGraphBuilder();
261
+ const builder = new RenderPassBuilder();
231
262
  const node = new RenderPassNode();
232
263
 
233
264
  node.id = pass_nodes.length;
@@ -253,6 +284,7 @@ export class RenderGraph {
253
284
  validate(problem_consumer, problem_consumer_context) {
254
285
 
255
286
  // TODO implement
287
+ // TODO check for "read before write"
256
288
 
257
289
  return true;
258
290
  }
@@ -402,6 +434,75 @@ export class RenderGraph {
402
434
  }
403
435
 
404
436
  /**
437
+ * Should only call after {@link compile}
438
+ *
439
+ * Can be visualized with this tool: https://skaarj1989.github.io/FrameGraph/
440
+ *
441
+ * @see https://github.com/skaarj1989/FrameGraph/blob/viewer/JsonWriter.hpp
442
+ * @return {{passes: [], resources: []}}
443
+ */
444
+ exportToJson() {
445
+
446
+ const resources = [];
447
+
448
+ this.__resource_registry.forEach((entry, entry_id) => {
449
+ const node = this.getResourceNode(entry.resource_id);
450
+
451
+ const j = {
452
+ id: entry_id,
453
+ name: node.name,
454
+ transient: entry.isTransient(),
455
+ };
456
+
457
+ const description = entry.resource_descriptor?.toString();
458
+
459
+ if (description) {
460
+ j.description = description;
461
+ }
462
+
463
+ if (entry.producer !== null) {
464
+ j.createdBy = entry.producer.id;
465
+ }
466
+
467
+ const readers = [];
468
+ const writers = [];
469
+
470
+ this.__pass_nodes.forEach(pass => {
471
+ if (pass.reads(entry.resource_id)) {
472
+ readers.push(pass.id);
473
+ }
474
+ if (pass.writes(entry.resource_id)) {
475
+ writers.push(pass.id);
476
+ }
477
+ })
478
+
479
+ if (readers.length > 0) {
480
+ j.readers = readers;
481
+ }
482
+ if (writers.length > 0) {
483
+ j.writers = writers;
484
+ }
485
+
486
+ resources[entry_id] = j;
487
+ })
488
+
489
+ return {
490
+ passes: this.__pass_nodes.map(node => {
491
+ return {
492
+ id: node.id,
493
+ name: node.name,
494
+ culled: !node.can_execute(),
495
+ reads: node.resource_reads,
496
+ writes: node.resource_writes,
497
+ }
498
+ }),
499
+ resources
500
+ }
501
+ }
502
+
503
+ /**
504
+ * Export the graph diagram in GraphViz DOT format.
505
+ * Useful for debugging.
405
506
  * @see https://en.wikipedia.org/wiki/DOT_(graph_description_language)
406
507
  * @return {string}
407
508
  */
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Allows you to declare resources for the pass, reading/writing/creating resources that will be used by the pass.
3
+ *
4
+ * @example
5
+ * const pass_data = {};
6
+ * const pass_builder = graph.add("pass", pass_data, (data, resources, context) => { ... });
7
+ * pass_data.resource_a = pass_builder.create("A", {});
8
+ */
9
+ export class RenderPassBuilder {
10
+ /**
11
+ *
12
+ * @param {RenderGraph} graph
13
+ * @param {RenderPassNode} node
14
+ */
15
+ init(graph: RenderGraph, node: RenderPassNode): void;
16
+ /**
17
+ * Create a new resource.
18
+ * Creation implies writing as well.
19
+ * @param {string} name
20
+ * @param {ResourceDescriptor} descriptor
21
+ * @returns {number} resource ID
22
+ */
23
+ create(name: string, descriptor: ResourceDescriptor): number;
24
+ /**
25
+ * Read an existing resource
26
+ * @param {number} resource
27
+ * @returns {number} resource ID same as the input
28
+ */
29
+ read(resource: number): number;
30
+ /**
31
+ * Write a resource
32
+ * @param {number} resource
33
+ * @returns {number} resource ID
34
+ */
35
+ write(resource: number): number;
36
+ /**
37
+ * Indicate that this pass has side effects.
38
+ * Will force the node to always be executed, regardless if it contributes to the final outputs of the graph or not.
39
+ * Useful for debug purposes or cases where some of the resources written are not part of the graph.
40
+ */
41
+ make_side_effect(): void;
42
+ #private;
43
+ }
44
+ //# sourceMappingURL=RenderPassBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderPassBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassBuilder.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH;IAgBI;;;;OAIG;IACH,qDAMC;IAED;;;;;;OAMG;IACH,aAJW,MAAM,mCAEJ,MAAM,CAYlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CASlB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAsBlB;IAED;;;;OAIG;IACH,yBAEC;;CACJ"}
@@ -1,12 +1,22 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
 
3
- export class RenderGraphBuilder {
3
+ /**
4
+ * Allows you to declare resources for the pass, reading/writing/creating resources that will be used by the pass.
5
+ *
6
+ * @example
7
+ * const pass_data = {};
8
+ * const pass_builder = graph.add("pass", pass_data, (data, resources, context) => { ... });
9
+ * pass_data.resource_a = pass_builder.create("A", {});
10
+ */
11
+ export class RenderPassBuilder {
12
+
4
13
  /**
5
14
  *
6
15
  * @type {RenderGraph}
7
16
  * @private
8
17
  */
9
18
  #graph = null;
19
+
10
20
  /**
11
21
  *
12
22
  * @type {RenderPassNode}
@@ -20,12 +30,16 @@ export class RenderGraphBuilder {
20
30
  * @param {RenderPassNode} node
21
31
  */
22
32
  init(graph, node) {
33
+ assert.defined(graph, 'graph');
34
+ assert.defined(node, 'node');
35
+
23
36
  this.#graph = graph;
24
37
  this.#node = node;
25
38
  }
26
39
 
27
40
  /**
28
- * Create a new resource
41
+ * Create a new resource.
42
+ * Creation implies writing as well.
29
43
  * @param {string} name
30
44
  * @param {ResourceDescriptor} descriptor
31
45
  * @returns {number} resource ID
@@ -45,18 +59,21 @@ export class RenderGraphBuilder {
45
59
  /**
46
60
  * Read an existing resource
47
61
  * @param {number} resource
48
- * @returns {number}
62
+ * @returns {number} resource ID same as the input
49
63
  */
50
64
  read(resource) {
51
65
  assert.isNonNegativeInteger(resource, 'resource');
66
+ assert.defined(this.#graph.getResourceEntry(resource), 'resource node');
52
67
 
53
- return this.#node.read(resource);
68
+ const node = this.#node;
69
+
70
+ return node.read(resource);
54
71
  }
55
72
 
56
73
  /**
57
74
  * Write a resource
58
75
  * @param {number} resource
59
- * @returns {number}
76
+ * @returns {number} resource ID
60
77
  */
61
78
  write(resource) {
62
79
  assert.isNonNegativeInteger(resource, 'resource');
@@ -81,7 +98,9 @@ export class RenderGraphBuilder {
81
98
  }
82
99
 
83
100
  /**
84
- * Will force the node to be executed
101
+ * Indicate that this pass has side effects.
102
+ * Will force the node to always be executed, regardless if it contributes to the final outputs of the graph or not.
103
+ * Useful for debug purposes or cases where some of the resources written are not part of the graph.
85
104
  */
86
105
  make_side_effect() {
87
106
  this.#node.has_side_effects = true;
@@ -51,6 +51,7 @@ export class RenderPassNode extends GraphNode {
51
51
  /**
52
52
  *
53
53
  * @param {number} resource
54
+ * @returns {number} same as the input
54
55
  */
55
56
  read(resource: number): number;
56
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAIA;IAEI;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IAEtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IAEpB;;;OAGG;IACH,iBAFU,MAAM,EAAE,CAEG;IAErB;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,UAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,WAHW,MAAM,GACL,OAAO,CAMlB;IAED,0BAOC;IAED;;;OAGG;IACH,eAFW,MAAM,UAUhB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;CACJ;0BAvGyB,gBAAgB"}
1
+ {"version":3,"file":"RenderPassNode.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPassNode.js"],"names":[],"mappings":"AAIA;IAEI;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,kBAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,UAAU;IAEV;;;OAGG;IACH,kBAFU,MAAM,EAAE,CAEI;IAEtB;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEE;IAEpB;;;OAGG;IACH,iBAFU,MAAM,EAAE,CAEG;IAErB;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,UAHW,MAAM,GACL,OAAO,CAMlB;IAED;;;;OAIG;IACH,WAHW,MAAM,GACL,OAAO,CAMlB;IAED,0BAOC;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CAUlB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;CACJ;0BAxGyB,gBAAgB"}
@@ -85,6 +85,7 @@ export class RenderPassNode extends GraphNode {
85
85
  /**
86
86
  *
87
87
  * @param {number} resource
88
+ * @returns {number} same as the input
88
89
  */
89
90
  read(resource) {
90
91
  if (this.reads(resource)) {
@@ -48,7 +48,15 @@ export class ResourceEntry<T> {
48
48
  * @param {RenderResourceManager} resources
49
49
  */
50
50
  destroy(resources: RenderResourceManager): void;
51
+ /**
52
+ *
53
+ * @return {boolean}
54
+ */
51
55
  isImported(): boolean;
56
+ /**
57
+ *
58
+ * @return {boolean}
59
+ */
52
60
  isTransient(): boolean;
53
61
  toString(): any;
54
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceEntry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceEntry.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACI;;;OAGG;IACH,aAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,qBAFU,wBAAsB,IAAI,CAET;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,UAFU,CAAC,GAAC,IAAI,CAEA;IAEhB;;;;OAIG;IACH,UAFU,OAAO,CAEA;IAEjB;;;OAGG;IACH,UAFU,iBAAe,IAAI,CAEb;IAEhB;;;OAGG;IACH,MAFU,iBAAe,IAAI,CAEjB;IAEZ;;;OAGG;IACH,+CAIC;IAED;;;OAGG;IACH,gDAIC;IAED,sBAEC;IAED,uBAEC;IAED,gBAQC;CACJ"}
1
+ {"version":3,"file":"ResourceEntry.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/ResourceEntry.js"],"names":[],"mappings":"AAIA;;GAEG;AACH;IACI;;;OAGG;IACH,aAFU,MAAM,CAEW;IAE3B;;;OAGG;IACH,qBAFU,wBAAsB,IAAI,CAET;IAE3B;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,UAFU,CAAC,GAAC,IAAI,CAEA;IAEhB;;;;OAIG;IACH,UAFU,OAAO,CAEA;IAEjB;;;OAGG;IACH,UAFU,iBAAe,IAAI,CAEb;IAEhB;;;OAGG;IACH,MAFU,iBAAe,IAAI,CAEjB;IAEZ;;;OAGG;IACH,+CAIC;IAED;;;OAGG;IACH,gDAIC;IAED;;;OAGG;IACH,cAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,eAFY,OAAO,CAIlB;IAED,gBAQC;CACJ"}
@@ -69,10 +69,18 @@ export class ResourceEntry {
69
69
  resources.release(this.resource);
70
70
  }
71
71
 
72
+ /**
73
+ *
74
+ * @return {boolean}
75
+ */
72
76
  isImported() {
73
77
  return this.imported;
74
78
  }
75
79
 
80
+ /**
81
+ *
82
+ * @return {boolean}
83
+ */
76
84
  isTransient() {
77
85
  return !this.imported;
78
86
  }
@@ -20,5 +20,6 @@ export class ResourceDescriptor {
20
20
  * @returns {boolean}
21
21
  */
22
22
  equals<T>(other: T): boolean;
23
+ toString(): string;
23
24
  }
24
25
  //# sourceMappingURL=ResourceDescriptor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAEI;;;;OAIG;IACH,mBAEC;IAED;;;OAGG;IACH,oCAEC;IAGD,eAEC;IAED;;;;OAIG;IACH,qBAFa,OAAO,CAInB;CAEJ"}
1
+ {"version":3,"file":"ResourceDescriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/render/frame_graph/resource/ResourceDescriptor.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAEI;;;;OAIG;IACH,mBAEC;IAED;;;OAGG;IACH,oCAEC;IAGD,eAEC;IAED;;;;OAIG;IACH,qBAFa,OAAO,CAInB;IAED,mBAEC;CACJ"}
@@ -34,4 +34,7 @@ export class ResourceDescriptor {
34
34
  return this.type === other.type;
35
35
  }
36
36
 
37
+ toString(){
38
+ return this.type;
39
+ }
37
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InputControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/systems/InputControllerSystem.js"],"names":[],"mappings":";AAsLA;;GAEG;AACH;IACI,0BA+BC;IA7BG,uBAAsC;IAEtC,yCAAqC;IAErC,aAAsB;IA2B1B,0EAIC;IAFG,YAAiB;IAIrB;;;;OAIG;IACH,gBAHW,eAAe,qBAOzB;IAED;;;;OAIG;IACH,kBAHW,eAAe,qBASzB;CACJ;uBArPsB,wBAAwB;0BADrB,yCAAyC;4BAEvC,kCAAkC"}
1
+ {"version":3,"file":"InputControllerSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/input/ecs/systems/InputControllerSystem.js"],"names":[],"mappings":";AAsLA;;GAEG;AACH;IACI,0BA+BC;IA7BG,uBAAsC;IAEtC,yCAAqC;IAErC,aAAsB;IA2B1B,2CAGC;IADG,YAAiB;IAGrB;;;;OAIG;IACH,gBAHW,eAAe,qBAOzB;IAED;;;;OAIG;IACH,kBAHW,eAAe,qBASzB;CACJ;uBApPsB,wBAAwB;0BADrB,yCAAyC;4BAEvC,kCAAkC"}
@@ -217,10 +217,9 @@ class InputControllerSystem extends System {
217
217
  });
218
218
  }
219
219
 
220
- startup(entityManager, readyCallback, errorCallback) {
220
+ async startup(entityManager) {
221
221
  this.entityManager = entityManager;
222
222
  this.proxies = {};
223
- readyCallback();
224
223
  }
225
224
 
226
225
  /**
@@ -17,8 +17,8 @@ export class BehaviorSystem extends System<BehaviorComponent, any, any, any, any
17
17
  * @type {Engine}
18
18
  */
19
19
  engine: Engine;
20
- startup(entityManager: any, readyCallback: any, errorCallback: any): void;
21
- shutdown(entityManager: any, readyCallback: any, errorCallback: any): void;
20
+ startup(entityManager: any): Promise<void>;
21
+ shutdown(entityManager: any): Promise<void>;
22
22
  /**
23
23
  *
24
24
  * @param {BehaviorComponent} component
@@ -1 +1 @@
1
- {"version":3,"file":"BehaviorSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorSystem.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH;IACI;;;OAGG;IACH,4BAaC;IATG,2CAAuC;IAEvC,mBAA8B;IAE9B;;;OAGG;IACH,eAAoB;IAGxB,0EAIC;IAED,2EAIC;IAED;;;;OAIG;IACH,gBAHW,iBAAiB,UACjB,MAAM,QAiBhB;IAED;;;;OAIG;IACH,kBAHW,iBAAiB,UACjB,MAAM,QAUhB;IAED,6BA2CC;CACJ;kCA7IiC,wBAAwB;uBAFnC,wBAAwB;kBAD7B,mBAAmB"}
1
+ {"version":3,"file":"BehaviorSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/intelligence/behavior/ecs/BehaviorSystem.js"],"names":[],"mappings":"AAyBA;;;;;GAKG;AACH;IACI;;;OAGG;IACH,4BAaC;IATG,2CAAuC;IAEvC,mBAA8B;IAE9B;;;OAGG;IACH,eAAoB;IAGxB,2CAIC;IAED,4CAEC;IAED;;;;OAIG;IACH,gBAHW,iBAAiB,UACjB,MAAM,QAiBhB;IAED;;;;OAIG;IACH,kBAHW,iBAAiB,UACjB,MAAM,QAUhB;IAED,6BA2CC;CACJ;kCA3IiC,wBAAwB;uBAFnC,wBAAwB;kBAD7B,mBAAmB"}
@@ -49,16 +49,14 @@ export class BehaviorSystem extends System {
49
49
  this.engine = engine;
50
50
  }
51
51
 
52
- startup(entityManager, readyCallback, errorCallback) {
52
+ async startup(entityManager) {
53
53
  this.systemClock.start();
54
54
 
55
- super.startup(entityManager, readyCallback, errorCallback);
55
+ this.entityManager = entityManager;
56
56
  }
57
57
 
58
- shutdown(entityManager, readyCallback, errorCallback) {
58
+ async shutdown(entityManager) {
59
59
  this.systemClock.stop();
60
-
61
- super.shutdown(entityManager, readyCallback, errorCallback);
62
60
  }
63
61
 
64
62
  /**
@@ -49,8 +49,8 @@ export class SoundEmitterSystem extends System<any, any, any, any, any> {
49
49
  * @private
50
50
  */
51
51
  private __linkedCount;
52
- startup(entityManager: any, readyCallback: any, errorCallback: any): void;
53
- shutdown(entityManager: any, readyCallback: any, errorCallback: any): void;
52
+ startup(entityManager: any): Promise<void>;
53
+ shutdown(entityManager: any): Promise<void>;
54
54
  /**
55
55
  *
56
56
  * @param {SoundEmitterComponentContext} ctx
@@ -1 +1 @@
1
- {"version":3,"file":"SoundEmitterSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/ecs/emitter/SoundEmitterSystem.js"],"names":[],"mappings":"mCAmBU,MAAM;;;;;;AAchB;IACI;;;;;;;OAOG;IACH,yDALW,SAAS,WACT,YAAY,EA0DtB;IAnDG,yDAA6C;IAG7C,2BAAsC;IACtC;;;OAGG;IACH,iBAFU,YAAY,CAEQ;IAC9B,2BAAgC;IAEhC;;;OAGG;IACH,cAAkB;IAWlB;;;OAGG;IACH,MAFU,4BAA4B,EAAE,CAE1B;IAEd;;;OAGG;IACH,WAFU,oBAAoB,4BAA4B,CAAC,CAEE;IAE7D;;;;OAIG;IACH,cAAsB;IAEtB;;;;OAIG;IACH,sBAAsB;IAG1B,0EAKC;IAED,2EAKC;IAED;;;OAGG;IACH,6BAFW,4BAA4B,QAItC;IAED;;;OAGG;IACH,+BAFW,4BAA4B,QAItC;IAED;;;;OAIG;IACH,gCAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,sCAFW,MAAM,QAIhB;IAED,4BAeC;IAED;;;;OAIG;IACH,0BAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,cAJW,YAAY,aACZ,SAAS,UACT,MAAM,QA6DhB;IAED;;;;;OAKG;IACH,gBAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAmBhB;IAED;;;;OAIG;IACH,kCAHW,4BAA4B,GAC1B,OAAO,CAKnB;IAQD,6BA6GC;;CAGJ;uBAjYsB,wBAAwB;0BACrB,qCAAqC;6BAGlC,mBAAmB;6CAEH,mCAAmC;oCAJ5C,4DAA4D"}
1
+ {"version":3,"file":"SoundEmitterSystem.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/sound/ecs/emitter/SoundEmitterSystem.js"],"names":[],"mappings":"mCAmBU,MAAM;;;;;;AAchB;IACI;;;;;;;OAOG;IACH,yDALW,SAAS,WACT,YAAY,EA0DtB;IAnDG,yDAA6C;IAG7C,2BAAsC;IACtC;;;OAGG;IACH,iBAFU,YAAY,CAEQ;IAC9B,2BAAgC;IAEhC;;;OAGG;IACH,cAAkB;IAWlB;;;OAGG;IACH,MAFU,4BAA4B,EAAE,CAE1B;IAEd;;;OAGG;IACH,WAFU,oBAAoB,4BAA4B,CAAC,CAEE;IAE7D;;;;OAIG;IACH,cAAsB;IAEtB;;;;OAIG;IACH,sBAAsB;IAG1B,2CAGC;IAED,4CAGC;IAED;;;OAGG;IACH,6BAFW,4BAA4B,QAItC;IAED;;;OAGG;IACH,+BAFW,4BAA4B,QAItC;IAED;;;;OAIG;IACH,gCAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,sCAFW,MAAM,QAIhB;IAED,4BAeC;IAED;;;;OAIG;IACH,0BAFa,OAAO,CAInB;IAED;;;;;OAKG;IACH,cAJW,YAAY,aACZ,SAAS,UACT,MAAM,QA6DhB;IAED;;;;;OAKG;IACH,gBAJW,YAAY,aACZ,SAAS,UACT,MAAM,QAmBhB;IAED;;;;OAIG;IACH,kCAHW,4BAA4B,GAC1B,OAAO,CAKnB;IAQD,6BA6GC;;CAGJ;uBA7XsB,wBAAwB;0BACrB,qCAAqC;6BAGlC,mBAAmB;6CAEH,mCAAmC;oCAJ5C,4DAA4D"}
@@ -96,18 +96,14 @@ export class SoundEmitterSystem extends System {
96
96
  this.__linkedCount = 0;
97
97
  }
98
98
 
99
- startup(entityManager, readyCallback, errorCallback) {
99
+ async startup(entityManager) {
100
100
  this.activeSet.onAdded.add(this.handleContextActivation, this);
101
101
  this.activeSet.onRemoved.add(this.handleContextDeactivation, this);
102
-
103
- super.startup(entityManager, readyCallback, errorCallback);
104
102
  }
105
103
 
106
- shutdown(entityManager, readyCallback, errorCallback) {
104
+ async shutdown(entityManager) {
107
105
  this.activeSet.onAdded.remove(this.handleContextActivation, this);
108
106
  this.activeSet.onRemoved.remove(this.handleContextDeactivation, this);
109
-
110
- super.shutdown(entityManager, readyCallback, errorCallback);
111
107
  }
112
108
 
113
109
  /**
@@ -1,33 +0,0 @@
1
- export class RenderGraphBuilder {
2
- /**
3
- *
4
- * @param {RenderGraph} graph
5
- * @param {RenderPassNode} node
6
- */
7
- init(graph: RenderGraph, node: RenderPassNode): void;
8
- /**
9
- * Create a new resource
10
- * @param {string} name
11
- * @param {ResourceDescriptor} descriptor
12
- * @returns {number} resource ID
13
- */
14
- create(name: string, descriptor: ResourceDescriptor): number;
15
- /**
16
- * Read an existing resource
17
- * @param {number} resource
18
- * @returns {number}
19
- */
20
- read(resource: number): number;
21
- /**
22
- * Write a resource
23
- * @param {number} resource
24
- * @returns {number}
25
- */
26
- write(resource: number): number;
27
- /**
28
- * Will force the node to be executed
29
- */
30
- make_side_effect(): void;
31
- #private;
32
- }
33
- //# sourceMappingURL=RenderGraphBuilder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderGraphBuilder.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraphBuilder.js"],"names":[],"mappings":"AAEA;IAcI;;;;OAIG;IACH,qDAGC;IAED;;;;;OAKG;IACH,aAJW,MAAM,mCAEJ,MAAM,CAYlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,MAAM,CAsBlB;IAED;;OAEG;IACH,yBAEC;;CACJ"}
@@ -1,50 +0,0 @@
1
- /**
2
- * @deprecated new syntax does not require a separate data structure, use lambda functions instead
3
- * @template [DATA=Object<number>]
4
- * @class
5
- */
6
- export class RenderPass<DATA = any> {
7
- /**
8
- *
9
- * @param [inputs]
10
- */
11
- constructor(inputs?: any);
12
- /**
13
- * Used for debug and visualisation
14
- * @type {string}
15
- */
16
- name: string;
17
- /**
18
- *
19
- * @type {number|RenderPassFlags}
20
- */
21
- flags: number | RenderPassFlags;
22
- /**
23
- * Arbitrary dictionary of data
24
- * @deprecated
25
- * @type {Object<number>}
26
- */
27
- inputs: any;
28
- /**
29
- *
30
- * @param {RenderGraphBuilder} builder
31
- * @returns {DATA} resources/handles that are used by the pass, includes both inputs and outputs
32
- */
33
- setup(builder: RenderGraphBuilder): DATA;
34
- /**
35
- * @param {DATA} data
36
- * @param {RenderPassResources} resources
37
- * @param {IRenderContext} render_context
38
- * @returns {void}
39
- */
40
- execute(data: DATA, resources: RenderPassResources, render_context: IRenderContext): void;
41
- /**
42
- * Validate render pass internal structure
43
- * This is an optional method, mainly useful for debugging purposes
44
- * Default behaviour is to report pass as "valid" (true)
45
- * @param {function(problem:string)} problem_consumer when returning false, reasons are supplied here
46
- * @return {boolean} true for valid, false for invalid
47
- */
48
- validate(problem_consumer: any): boolean;
49
- }
50
- //# sourceMappingURL=RenderPass.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderPass.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderPass.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH;IAsBI;;;OAGG;IACH,0BAQC;IAhCD;;;OAGG;IACH,MAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,OAFU,MAAM,kBAAgB,CAEV;IAGtB;;;;OAIG;IACH,YAAY;IAiBZ;;;;OAIG;IACH,oCAFa,IAAI,CAIhB;IAED;;;;;OAKG;IACH,cALW,IAAI,mEAGF,IAAI,CAIhB;IAED;;;;;;OAMG;IACH,iCAFY,OAAO,CAIlB;CACJ"}
@@ -1,74 +0,0 @@
1
- const DEFAULT_FLAGS = 0;
2
-
3
- /**
4
- * @deprecated new syntax does not require a separate data structure, use lambda functions instead
5
- * @template [DATA=Object<number>]
6
- * @class
7
- */
8
- export class RenderPass {
9
-
10
- /**
11
- * Used for debug and visualisation
12
- * @type {string}
13
- */
14
- name = "Render Pass";
15
-
16
- /**
17
- *
18
- * @type {number|RenderPassFlags}
19
- */
20
- flags = DEFAULT_FLAGS;
21
-
22
-
23
- /**
24
- * Arbitrary dictionary of data
25
- * @deprecated
26
- * @type {Object<number>}
27
- */
28
- inputs = {};
29
-
30
- /**
31
- *
32
- * @param [inputs]
33
- */
34
- constructor(inputs ) {
35
-
36
- if(inputs !== undefined){
37
- console.warn("Default inputs are deprecated, please use class fields instead");
38
-
39
- this.inputs = inputs;
40
- }
41
-
42
- }
43
-
44
-
45
- /**
46
- *
47
- * @param {RenderGraphBuilder} builder
48
- * @returns {DATA} resources/handles that are used by the pass, includes both inputs and outputs
49
- */
50
- setup(builder) {
51
- throw new Error('Not Implemented');
52
- }
53
-
54
- /**
55
- * @param {DATA} data
56
- * @param {RenderPassResources} resources
57
- * @param {IRenderContext} render_context
58
- * @returns {void}
59
- */
60
- execute(data, resources, render_context) {
61
- throw new Error('Not Implemented');
62
- }
63
-
64
- /**
65
- * Validate render pass internal structure
66
- * This is an optional method, mainly useful for debugging purposes
67
- * Default behaviour is to report pass as "valid" (true)
68
- * @param {function(problem:string)} problem_consumer when returning false, reasons are supplied here
69
- * @return {boolean} true for valid, false for invalid
70
- */
71
- validate(problem_consumer) {
72
- return true;
73
- }
74
- }