@woosh/meep-engine 2.112.1 → 2.113.2

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 (39) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/build/meep.cjs +5 -2
  4. package/build/meep.module.js +5 -2
  5. package/editor/Editor.js +2 -0
  6. package/package.json +1 -1
  7. package/src/core/binary/BinaryBuffer.d.ts +7 -1
  8. package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
  9. package/src/core/binary/BinaryBuffer.js +17 -2
  10. package/src/core/binary/platform_compute_endianness.d.ts +8 -0
  11. package/src/core/binary/platform_compute_endianness.d.ts.map +1 -0
  12. package/src/core/binary/platform_compute_endianness.js +29 -0
  13. package/src/core/binary/type/DataTypeIndices.d.ts +1 -0
  14. package/src/core/binary/type/DataTypeIndices.d.ts.map +1 -1
  15. package/src/core/binary/type/DataTypeIndices.js +2 -1
  16. package/src/core/collection/CuckooFilter.d.ts +3 -0
  17. package/src/core/collection/CuckooFilter.d.ts.map +1 -1
  18. package/src/core/collection/CuckooFilter.js +8 -5
  19. package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js +1 -1
  20. package/src/core/collection/queue/Deque.d.ts.map +1 -1
  21. package/src/core/collection/queue/Deque.js +4 -1
  22. package/src/core/collection/table/RowFirstTableSpec.d.ts +2 -2
  23. package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
  24. package/src/core/collection/table/RowFirstTableSpec.js +11 -7
  25. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
  26. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +8 -3
  27. package/src/core/geom/3d/topology/simplify/collapseEdge.d.ts.map +1 -1
  28. package/src/core/geom/3d/topology/simplify/collapseEdge.js +8 -23
  29. package/src/core/geom/3d/topology/struct/TopoEdge.d.ts +1 -0
  30. package/src/core/geom/3d/topology/struct/TopoEdge.d.ts.map +1 -1
  31. package/src/core/geom/3d/topology/struct/TopoEdge.js +35 -36
  32. package/src/core/geom/3d/topology/struct/TopoMesh.d.ts.map +1 -1
  33. package/src/core/geom/3d/topology/struct/TopoMesh.js +18 -21
  34. package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
  35. package/src/core/geom/3d/topology/struct/TopoTriangle.js +24 -26
  36. package/src/core/geom/3d/topology/struct/TopoVertex.d.ts.map +1 -1
  37. package/src/core/geom/3d/topology/struct/TopoVertex.js +37 -70
  38. package/src/engine/scene/SerializedScene.d.ts.map +1 -1
  39. package/src/engine/scene/SerializedScene.js +7 -4
@@ -1 +1 @@
1
- {"version":3,"file":"TopoTriangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoTriangle.js"],"names":[],"mappings":";AASA;IAEQ;;;OAGG;IACH,OAFU,MAAM,CAEY;IAC5B;;;OAGG;IACH,UAFU,YAAY,CAEJ;IAClB;;;OAGG;IACH,OAFU,UAAU,CAEL;IAEf;;;OAGG;IACH,QAFU,MAAM,EAAE,GAAC,IAAI,CAEA;IAG3B,uBAEC;IAED;;;OAGG;IACH,YAFW,YAAY,QAQtB;IAED,sBAMC;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA0ClB;IAED;;;OAGG;IACH,YAFY,OAAO,CAKlB;IAED;;;;OAIG;IACH,6DAEC;IAED;;;;OAIG;IACH,mEAIC;IAED;;OAEG;IACH,gCASC;IAED;;OAEG;IACH,eAmBC;IAED;;;OAGG;IACH,2BAIC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,8BAMC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAKnB;IAED,sBAaC;IAGD;;;;OAIG;IACH,mBAHW,MAAM,4BAQhB;IAED;;;;OAIG;IACH,oCAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,EAAE,iBACd,MAAM,GACJ,MAAM,CA8BlB;IAGL;;;OAGG;IACH,qBAFU,OAAO,CAEgB;CANhC;qBAzRoB,WAAW"}
1
+ {"version":3,"file":"TopoTriangle.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoTriangle.js"],"names":[],"mappings":";AASA;IACI;;;OAGG;IACH,OAFU,MAAM,CAEQ;IACxB;;;OAGG;IACH,UAFU,YAAY,CAER;IACd;;;OAGG;IACH,OAFU,UAAU,CAET;IAEX;;;OAGG;IACH,QAFU,MAAM,EAAE,GAAC,IAAI,CAEJ;IAEnB,uBAEC;IAED;;;OAGG;IACH,YAFW,YAAY,QAQtB;IAED,sBAMC;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA0ClB;IAED;;;OAGG;IACH,YAFY,OAAO,CAKlB;IAED;;;;OAIG;IACH,6DAEC;IAED;;;;OAIG;IACH,mEAIC;IAED;;OAEG;IACH,gCASC;IAED;;OAEG;IACH,eAmBC;IAED;;;OAGG;IACH,2BAIC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAIlB;IAED;;;OAGG;IACH,8BAMC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAKnB;IAED,sBAaC;IAGD;;;;OAIG;IACH,mBAHW,MAAM,4BAQhB;IAED;;;;OAIG;IACH,oCAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,EAAE,iBACd,MAAM,GACJ,MAAM,CA8BlB;IAGL;;;OAGG;IACH,qBAFU,OAAO,CAEgB;CANhC;qBA3RoB,WAAW"}
@@ -1,36 +1,34 @@
1
- import { array_replace_all } from "../../../../collection/array/array_replace_all.js";
2
- import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
1
+ import { vec3 } from "gl-matrix";
3
2
  import { assert } from "../../../../assert.js";
3
+ import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
4
4
  import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
5
- import { vec3 } from "gl-matrix";
5
+ import { array_replace_all } from "../../../../collection/array/array_replace_all.js";
6
6
  import { compute_triangle_normal } from "../../compute_triangle_normal.js";
7
7
 
8
8
  let index_counter = 0;
9
9
 
10
10
  export class TopoTriangle {
11
- constructor() {
12
- /**
13
- * Identifying index, can be used to link back to buffer-geometry face by index or any other useful ID purposes
14
- * @type {number}
15
- */
16
- this.index = index_counter++;
17
- /**
18
- *
19
- * @type {TopoVertex[]}
20
- */
21
- this.vertices = [];
22
- /**
23
- *
24
- * @type {TopoEdge[]}
25
- */
26
- this.edges = [];
27
-
28
- /**
29
- *
30
- * @type {number[]|vec3}
31
- */
32
- this.normal = [0, 0, 0];
33
- }
11
+ /**
12
+ * Identifying index, can be used to link back to buffer-geometry face by index or any other useful ID purposes
13
+ * @type {number}
14
+ */
15
+ index = index_counter++;
16
+ /**
17
+ *
18
+ * @type {TopoVertex[]}
19
+ */
20
+ vertices = [];
21
+ /**
22
+ *
23
+ * @type {TopoEdge[]}
24
+ */
25
+ edges = [];
26
+
27
+ /**
28
+ *
29
+ * @type {number[]|vec3}
30
+ */
31
+ normal = [0, 0, 0];
34
32
 
35
33
  get byteSize() {
36
34
  return 80 + 4 * 4 + 4 + this.vertices.length * 8 + 10 + this.edges.length * 8 + 10 + 8 * 3 + 10;
@@ -1 +1 @@
1
- {"version":3,"file":"TopoVertex.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoVertex.js"],"names":[],"mappings":"AAKA;IAEQ;;;OAGG;IACH,OAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,OAFU,UAAU,CAEL;IAEf;;;OAGG;IACH,OAFU,cAAc,CAET;IAEf;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAGd,gBAEC;IAED,gBAEC;IAED,gBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,YAFW,UAAU,QAYpB;IAED;;OAEG;IACH,SAFa,UAAU,CAQtB;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA8BlB;IAED;;;;OAIG;IACH,kBAHW,UAAU,GACT,MAAM,CAWjB;IAED;;;OAGG;IACH,+BAKC;IAED;;;;OAIG;IACH,gCAFY,OAAO,CAMlB;IAED;;;;OAIG;IACH,kCAFY,OAAO,CAKlB;IAED;;;OAGG;IACH,kCAKC;IAED;;;OAGG;IACH,2BAMC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAOlB;IAED;;;;OAIG;IACH,2DAaC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAMnB;IAED;;;;OAIG;IACH,yBAFa,OAAO,CAWnB;IAED;;;;OAIG;IACH,6BAFW,UAAU,QAqCpB;IAED;;;;;OAKG;IACH,iCAJW,UAAU,EAAE,iBACZ,MAAM,GACJ,MAAM,CAoBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
1
+ {"version":3,"file":"TopoVertex.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/topology/struct/TopoVertex.js"],"names":[],"mappings":"AAMA;IAEI;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,OAFU,UAAU,CAET;IAEX;;;OAGG;IACH,OAFU,cAAc,CAEb;IAEX;;;OAGG;IACH,GAFU,MAAM,CAEV;IACN;;;OAGG;IACH,GAFU,MAAM,CAEV;IACN;;;OAGG;IACH,GAFU,MAAM,CAEV;IAEN,gBAEC;IAED,gBAEC;IAED,gBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,YAFW,UAAU,QAYpB;IAED;;OAEG;IACH,SAFa,UAAU,CAQtB;IAED;;;;OAIG;IACH,+BAFY,OAAO,CA8BlB;IAED;;;;OAIG;IACH,kBAHW,UAAU,GACT,MAAM,CAWjB;IAED;;;OAGG;IACH,+BAKC;IAED;;;;OAIG;IACH,gCAFY,OAAO,CAMlB;IAED;;;;OAIG;IACH,kCAFY,OAAO,CAKlB;IAED;;;OAGG;IACH,kCAKC;IAED;;;OAGG;IACH,2BAMC;IAED;;;;OAIG;IACH,4BAFY,OAAO,CAOlB;IAED;;;;OAIG;IACH,2DAaC;IAED;;;;OAIG;IACH,8BAFa,OAAO,CAMnB;IAED;;;;OAIG;IACH,yBAFa,OAAO,CAWnB;IAED;;;;OAIG;IACH,6BAFW,UAAU,QAIpB;IAED;;;;;OAKG;IACH,iCAJW,UAAU,EAAE,iBACZ,MAAM,GACJ,MAAM,CAoBlB;IAGL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC"}
@@ -2,43 +2,43 @@ import { assert } from "../../../../assert.js";
2
2
  import { array_push_if_unique } from "../../../../collection/array/array_push_if_unique.js";
3
3
  import { array_remove_first } from "../../../../collection/array/array_remove_first.js";
4
4
  import { v3_distance } from "../../../vec3/v3_distance.js";
5
+ import { query_vertex_in_edge } from "../query/query_vertex_in_edge.js";
5
6
 
6
7
  export class TopoVertex {
7
- constructor() {
8
- /**
9
- * Identification number, expected to be unique within a given topology
10
- * @type {number}
11
- */
12
- this.index = 0;
13
-
14
- /**
15
- *
16
- * @type {TopoEdge[]}
17
- */
18
- this.edges = [];
19
-
20
- /**
21
- *
22
- * @type {TopoTriangle[]}
23
- */
24
- this.faces = [];
25
-
26
- /**
27
- *
28
- * @type {number}
29
- */
30
- this.x = 0;
31
- /**
32
- *
33
- * @type {number}
34
- */
35
- this.y = 0;
36
- /**
37
- *
38
- * @type {number}
39
- */
40
- this.z = 0;
41
- }
8
+
9
+ /**
10
+ * Identification number, expected to be unique within a given topology
11
+ * @type {number}
12
+ */
13
+ index = 0;
14
+
15
+ /**
16
+ *
17
+ * @type {TopoEdge[]}
18
+ */
19
+ edges = [];
20
+
21
+ /**
22
+ *
23
+ * @type {TopoTriangle[]}
24
+ */
25
+ faces = [];
26
+
27
+ /**
28
+ *
29
+ * @type {number}
30
+ */
31
+ x = 0;
32
+ /**
33
+ *
34
+ * @type {number}
35
+ */
36
+ y = 0;
37
+ /**
38
+ *
39
+ * @type {number}
40
+ */
41
+ z = 0;
42
42
 
43
43
  get 0() {
44
44
  return this.x;
@@ -113,7 +113,7 @@ export class TopoVertex {
113
113
  for (let i = 0; i < edge_count; i++) {
114
114
  const edge = edges[i];
115
115
 
116
- if (!edge.containsVertex(this)) {
116
+ if (!query_vertex_in_edge(edge, this)) {
117
117
  error_consumer(`Missing back-link from edge[${i}]`);
118
118
  valid = false;
119
119
  }
@@ -258,40 +258,7 @@ export class TopoVertex {
258
258
  * @param {TopoVertex} victim
259
259
  */
260
260
  replaceAnotherVertex(victim) {
261
- assert.defined(victim, 'victim');
262
- assert.notNull(victim, 'victim');
263
- assert.equal(victim.isTopoVertex, true, "victim.isTopoVertex !== true");
264
- assert.notEqual(this, victim, "cannot replace self");
265
-
266
- const faces = victim.faces;
267
- const face_count = faces.length;
268
-
269
- let i = 0;
270
-
271
- for (; i < face_count; i++) {
272
- // take over the victim's faces
273
- const face = faces[i];
274
-
275
-
276
- // face.computeNormal(); // DEBUG
277
- face.replaceVertex(victim, this);
278
-
279
- this.addUniqueFace(face);
280
-
281
- // face.computeNormal(); // DEBUG
282
- }
283
-
284
- const edges = victim.edges;
285
- const edge_count = edges.length;
286
-
287
- for (i = 0; i < edge_count; i++) {
288
- // take over the victim's edges
289
- const edge = edges[i];
290
-
291
- edge.replaceVertex(victim, this);
292
-
293
- this.addUniqueEdge(edge);
294
- }
261
+ throw new Error(`deprecated, use "tm_vert_splice" instead`)
295
262
  }
296
263
 
297
264
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SerializedScene.d.ts","sourceRoot":"","sources":["../../../../src/engine/scene/SerializedScene.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,0CALW,MAAM,gDAGJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;GAMG;AACH,qDALW,MAAM,gDAGJ,aAAa,CAuBzB;AAED;IACI;;;;OAIG;IACH,4BAHW,MAAM,EAOhB;IADG,UAAgB;IAIpB,gHAcC;CACJ;yBA7EwB,2CAA2C"}
1
+ {"version":3,"file":"SerializedScene.d.ts","sourceRoot":"","sources":["../../../../src/engine/scene/SerializedScene.js"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,0CALW,MAAM,gDAGJ,QAAQ,IAAI,CAAC,CASzB;AAED;;;;;;GAMG;AACH,qDALW,MAAM,gDAGJ,aAAa,CAyBzB;AAED;IACI;;;;OAIG;IACH,4BAHW,MAAM,EAOhB;IADG,UAAgB;IAIpB,gHAcC;CACJ;yBApFwB,2CAA2C"}
@@ -1,9 +1,10 @@
1
- import { GameAssetType } from "../asset/GameAssetType.js";
2
- import BinaryBufferDeSerializer from "../ecs/storage/BinaryBufferDeSerializer.js";
3
- import { EncodingBinaryBuffer } from "../../core/binary/EncodingBinaryBuffer.js";
4
- import { assert } from "../../core/assert.js";
5
1
  import { MirScene } from "../../../../model/game/scenes/MirScene.js";
2
+ import { assert } from "../../core/assert.js";
3
+ import { EncodingBinaryBuffer } from "../../core/binary/EncodingBinaryBuffer.js";
4
+ import { EndianType } from "../../core/binary/EndianType.js";
6
5
  import { emptyTask } from "../../core/process/task/util/emptyTask.js";
6
+ import { GameAssetType } from "../asset/GameAssetType.js";
7
+ import BinaryBufferDeSerializer from "../ecs/storage/BinaryBufferDeSerializer.js";
7
8
 
8
9
  /**
9
10
  *
@@ -44,6 +45,8 @@ export async function createSceneDeserializationTask(path, ecd, engine) {
44
45
 
45
46
  const binaryBuffer = new EncodingBinaryBuffer();
46
47
 
48
+ binaryBuffer.endianness = EndianType.BigEndian;
49
+
47
50
  binaryBuffer.fromArrayBuffer(buffer);
48
51
 
49
52
  const task = deSerializer.process(binaryBuffer, engine, ecd);