@woosh/meep-engine 2.43.16 → 2.43.17

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.
@@ -27,16 +27,12 @@ import { mat4 } from "gl-matrix";
27
27
  import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
28
28
  import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
29
29
  import { array_copy } from "../../../../core/collection/array/copyArray.js";
30
+ import { passThrough } from "../../../../core/function/Functions.js";
30
31
 
31
- function extractFaceIndexFromLeaf(leaf) {
32
- return leaf;
33
- }
34
-
35
-
32
+ /**
33
+ * terrain tile is a part of a 2d array
34
+ */
36
35
  class TerrainTile {
37
- /**
38
- * terrain tile is a part of a 2d array
39
- */
40
36
  constructor() {
41
37
  this.gridPosition = new Vector2();
42
38
  this.scale = new Vector2(1, 1);
@@ -103,6 +99,7 @@ class TerrainTile {
103
99
  this.onDestroyed = new Signal();
104
100
 
105
101
  /**
102
+ * Encodes whether stitching has been performed on per-neighbour basis
106
103
  * @private
107
104
  * @type {{bottomLeft: boolean, top: boolean, left: boolean, bottom: boolean, bottomRight: boolean, topLeft: boolean, topRight: boolean, right: boolean}}
108
105
  */
@@ -129,7 +126,7 @@ class TerrainTile {
129
126
 
130
127
  this.raycaster = new BVHGeometryRaycaster();
131
128
  //Binary BVH form doesn't have distinct leaf objects and stores face indices directly, this requires a special face index extractor that treats leaves as indices directly.
132
- this.raycaster.extractFaceIndexFromLeaf = extractFaceIndexFromLeaf;
129
+ this.raycaster.extractFaceIndexFromLeaf = passThrough;
133
130
  }
134
131
 
135
132
  /**
@@ -148,6 +145,7 @@ class TerrainTile {
148
145
  array_copy(m4, 0, this.mesh.matrixWorld.elements, 0, 16);
149
146
  this.computeBoundingBox();
150
147
 
148
+ // raycaster needs to store transform as well
151
149
  array_copy(m4, 0, this.raycaster.transform, 0, 16);
152
150
  }
153
151
 
@@ -1,7 +1,10 @@
1
1
  import Engine from "../../../Engine";
2
2
  import {System} from "../../../ecs/System";
3
3
  import {PathDisplay} from "./PathDisplay";
4
+ import Signal from "../../../../core/events/signal/Signal";
4
5
 
5
6
  export class PathDisplaySystem extends System<PathDisplay> {
6
7
  constructor(engine: Engine)
8
+
9
+ readonly onWorkDone: Signal<void>
7
10
  }
@@ -12,6 +12,7 @@ import { PathEvents } from "../../../navigation/ecs/components/PathEvents.js";
12
12
  import { assert } from "../../../../core/assert.js";
13
13
  import { TubePathBuilder } from "./tube/build/TubePathBuilder.js";
14
14
  import { Deque } from "../../../../core/collection/queue/Deque.js";
15
+ import Signal from "../../../../core/events/signal/Signal.js";
15
16
 
16
17
  const builders = {
17
18
  [PathDisplayType.None]: function (style, path, result) {
@@ -274,6 +275,12 @@ export class PathDisplaySystem extends AbstractContextSystem {
274
275
  * @private
275
276
  */
276
277
  this.__rebuild_queue = new Deque();
278
+
279
+ /**
280
+ *
281
+ * @type {Signal}
282
+ */
283
+ this.onWorkDone = new Signal();
277
284
  }
278
285
 
279
286
  /**
@@ -340,5 +347,8 @@ export class PathDisplaySystem extends AbstractContextSystem {
340
347
  ctx.rebuild();
341
348
 
342
349
  } while ((performance.now() - t0) < UPDATE_PROCESSING_BUDGET_MS && !queue.isEmpty());
350
+
351
+ // notify that some work was done
352
+ this.onWorkDone.send0();
343
353
  }
344
354
  }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.43.16",
8
+ "version": "2.43.17",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",