@woosh/meep-engine 2.119.103 → 2.119.105

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 (45) hide show
  1. package/package.json +1 -1
  2. package/src/core/cache/Cache.d.ts.map +1 -1
  3. package/src/core/cache/Cache.js +13 -6
  4. package/src/core/collection/map/HashMap.d.ts.map +1 -1
  5. package/src/core/collection/map/HashMap.js +1 -0
  6. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +4 -0
  7. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
  8. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +4 -0
  9. package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.d.ts +8 -0
  10. package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.d.ts.map +1 -0
  11. package/src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.js +9 -0
  12. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_kill.d.ts +6 -0
  13. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_kill.d.ts.map +1 -0
  14. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_kill.js +26 -0
  15. package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.d.ts +7 -0
  16. package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.d.ts.map +1 -0
  17. package/src/core/geom/3d/topology/struct/binary/io/bt_face_kill.js +8 -0
  18. package/src/core/geom/3d/topology/struct/binary/io/bt_index_geometry_to_topology.js +1 -1
  19. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_edge.d.ts +8 -0
  20. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_edge.d.ts.map +1 -0
  21. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_edge.js +9 -0
  22. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_face.d.ts +8 -0
  23. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_face.d.ts.map +1 -0
  24. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_face.js +9 -0
  25. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_vert.d.ts +7 -0
  26. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_vert.d.ts.map +1 -0
  27. package/src/core/geom/3d/topology/struct/binary/io/bt_kill_only_vert.js +8 -0
  28. package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.d.ts +18 -0
  29. package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.d.ts.map +1 -0
  30. package/src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.js +83 -0
  31. package/src/core/geom/3d/topology/struct/binary/io/bt_vert_kill.d.ts +7 -0
  32. package/src/core/geom/3d/topology/struct/binary/io/bt_vert_kill.d.ts.map +1 -0
  33. package/src/core/geom/3d/topology/struct/binary/io/bt_vert_kill.js +18 -0
  34. package/src/core/geom/vec3/v3_array_equals.d.ts +9 -0
  35. package/src/core/geom/vec3/v3_array_equals.d.ts.map +1 -0
  36. package/src/core/geom/vec3/v3_array_equals.js +13 -0
  37. package/src/core/process/worker/OnDemandWorkerManager.d.ts +4 -3
  38. package/src/core/process/worker/OnDemandWorkerManager.d.ts.map +1 -1
  39. package/src/core/process/worker/OnDemandWorkerManager.js +12 -5
  40. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts +5 -1
  41. package/src/engine/asset/loaders/image/ImageRGBADataLoader.d.ts.map +1 -1
  42. package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +8 -2
  43. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts +5 -0
  44. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.d.ts.map +1 -1
  45. package/src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js +9 -2
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.103",
8
+ "version": "2.119.105",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../src/core/cache/Cache.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,mBAHa,GAAG,EAAE,KAAK;IAYnB;;;;;;;;OAQG;IACH,sGARW,MAAM,EAuFhB;IAxDG;;;;OAIG;IACH,mBAA4B;IAE5B;;;;OAIG;IACH,qBAAgC;IAEhC;;;;OAIG;IACH,gBAAmB;IACnB;;;;OAIG;IACH,eAAkB;IAGlB;;;;OAIG;IACH,aAIE;IAEF;;;OAGG;IACH,WAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEE;IAE7B;;;OAGG;IACH,WAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEE;IAE7B;;;OAGG;IACH,OAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEF;IAG7B;;;;;OAKG;IACH,kBAyBC;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;OAEG;IACH,+BAEC;IAUD;;;OAGG;IACH,qBAFW,MAAM,EAUhB;IAED,iBAZW,MAAM,CAchB;IAxBD;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAoBD;;;;OAIG;IACH,wBAaC;IAED;;;;;;OAMG;IACH,yBAHW,GAAG,GACD,OAAO,CAgCnB;IAED;;;;;OAKG;IACH,6BAUC;IAED;;;OAGG;IACH,sBAFa,YAAY,CAAC,GAAG,EAAC,KAAK,CAAC,GAAC,IAAI,CAIxC;IAED;;;OAGG;IACH,YAFa,OAAO,CAkBnB;IAED;;;OAGG;IACH,+BAFW,MAAM,QAWhB;IAED;;;;OAIG;IACH,SAHW,GAAG,SACH,KAAK,QAwEf;IAED;;;;OAIG;IACH,cAHW,GAAG,GACD,OAAO,CAInB;IAED;;;;OAIG;IACH,SAHW,GAAG,GACD,KAAK,GAAC,IAAI,CAYtB;IAGD;;;;;;OAMG;IACH,kBALW,GAAG,WACH,CAAS,IAAG,EAAH,GAAG,KAAE,KAAK,oBACnB,GAAC,GACA,KAAK,CAchB;IAED;;;;OAIG;IACH,wBAqBC;IAED;;;;OAIG;IACH,YAHW,GAAG,GACD,OAAO,CAgBnB;IAED;;;;;OAKG;IACH,kBAHW,GAAG,GACD,OAAO,CAanB;IAED;;OAEG;IACH,cAcC;IAED;;;OAGG;IACH,aAOC;IAED;;;;;OAKG;IACH,kCAHW,GAAC,GACC,OAAO,CAMnB;IAGL;;;OAGG;IACH,6CAAmB;IAEnB;;;OAGG;IACH,+BA5FiB,OAAO,CA4FF;IAEtB;;;OAGG;IACH,4BA9KiB,OAAO,CA8KL;;CAlBlB;mBAhiBkB,4BAA4B;6BAKlB,mBAAmB"}
1
+ {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../src/core/cache/Cache.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,mBAHa,GAAG,EAAE,KAAK;IAYnB;;;;;;;;OAQG;IACH,sGARW,MAAM,EAuFhB;IAxDG;;;;OAIG;IACH,mBAA4B;IAE5B;;;;OAIG;IACH,qBAAgC;IAEhC;;;;OAIG;IACH,gBAAmB;IACnB;;;;OAIG;IACH,eAAkB;IAGlB;;;;OAIG;IACH,aAIE;IAEF;;;OAGG;IACH,WAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEE;IAE7B;;;OAGG;IACH,WAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEE;IAE7B;;;OAGG;IACH,OAFU,MAAM,CAAC,GAAG,EAAC,KAAK,CAAC,CAEF;IAG7B;;;;;OAKG;IACH,kBAyBC;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;OAEG;IACH,+BAEC;IAUD;;;OAGG;IACH,sBAFW,MAAM,EAiBhB;IAED,iBAnBW,MAAM,CAqBhB;IA/BD;;;OAGG;IACH,cAFa,MAAM,CAIlB;IA2BD;;;;OAIG;IACH,wBAaC;IAED;;;;;;OAMG;IACH,yBAHW,GAAG,GACD,OAAO,CAgCnB;IAED;;;;;OAKG;IACH,6BAUC;IAED;;;OAGG;IACH,sBAFa,YAAY,CAAC,GAAG,EAAC,KAAK,CAAC,GAAC,IAAI,CAIxC;IAED;;;OAGG;IACH,YAFa,OAAO,CAkBnB;IAED;;;OAGG;IACH,+BAFW,MAAM,QAWhB;IAED;;;;OAIG;IACH,SAHW,GAAG,SACH,KAAK,QAwEf;IAED;;;;OAIG;IACH,cAHW,GAAG,GACD,OAAO,CAInB;IAED;;;;OAIG;IACH,SAHW,GAAG,GACD,KAAK,GAAC,IAAI,CAYtB;IAGD;;;;;;OAMG;IACH,kBALW,GAAG,WACH,CAAS,IAAG,EAAH,GAAG,KAAE,KAAK,oBACnB,GAAC,GACA,KAAK,CAchB;IAED;;;;OAIG;IACH,wBAqBC;IAED;;;;OAIG;IACH,YAHW,GAAG,GACD,OAAO,CAgBnB;IAED;;;;;OAKG;IACH,kBAHW,GAAG,GACD,OAAO,CAanB;IAED;;OAEG;IACH,cAcC;IAED;;;OAGG;IACH,aAOC;IAED;;;;;OAKG;IACH,kCAHW,GAAC,GACC,OAAO,CAMnB;IAGL;;;OAGG;IACH,6CAAmB;IAEnB;;;OAGG;IACH,+BA5FiB,OAAO,CA4FF;IAEtB;;;OAGG;IACH,4BA9KiB,OAAO,CA8KL;;CAlBlB;mBAviBkB,4BAA4B;6BAKlB,mBAAmB"}
@@ -171,16 +171,23 @@ export class Cache {
171
171
 
172
172
  /**
173
173
  * Will cause evictions if current weight is smaller than what we're setting
174
- * @param {number} value
174
+ * @param {number} weight
175
175
  */
176
- set maxWeight(value) {
177
- if (typeof value !== "number" || value < 0) {
178
- throw new Error(`Weight must be a non-negative number, instead was '${value}'`);
176
+ set maxWeight(weight) {
177
+ if (typeof weight !== "number" || weight < 0) {
178
+ throw new Error(`Weight must be a non-negative number, instead was '${weight}'`);
179
179
  }
180
180
 
181
- this.#maxWeight = value;
181
+ const old_limit = this.#maxWeight;
182
182
 
183
- this.evictUntilWeight(this.#maxWeight);
183
+ this.#maxWeight = weight;
184
+
185
+ if (old_limit > weight) {
186
+
187
+ // shrinking, let's make sure we are upholding the constraint
188
+ this.evictUntilWeight(this.#maxWeight);
189
+
190
+ }
184
191
  }
185
192
 
186
193
  get maxWeight() {
@@ -1 +1 @@
1
- {"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AA8FD;;;;;;;GAOG;AACH,qBAHa,CAAC,EAAC,CAAC;IAkEZ;;;;;;OAMG;IACH,6EALW,CAAS,IAAC,EAAD,GAAC,KAAE,MAAM,EAsC5B;IAtGD;;;;OAIG;IACH,QAFU,WAAW,CAED;IAEpB;;;OAGG;IACH,WAFU,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAET;IAEzB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,QAFU,MAAM,CAEL;IAEX,oBAAgB;IAEhB;;;OAGG;IACH,2BAFU,MAAM,CAEc;IAE9B,iCAA6B;IAE7B,qCAAiC;IAEjC;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;;OAIG;IACH,sBAAoC;IAEpC;;;OAGG;IACH,WAFU,MAAM,CAEF;IAwBV;;;;;OAKG;IACH,iCAAsC;IACtC;;;;;OAKG;IACH,qCAA8C;IAOlD,mBAEC;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA2CD;;;;;OAKG;IACH,0BAUC;IAsGD;;;;OAIG;IACH,SAHW,CAAC,SACD,CAAC,QA0EX;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,CAAC,GAAC,SAAS,CA+BvB;IAED;;;;;;;;OAQG;IACH,kBALW,CAAC,WACD,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,oBACb,GAAC,GACA,CAAC,CAgBZ;IAED;;;;;OAKG;IACH,cAJW,CAAC,SACD,CAAC,GACA,CAAC,CAYZ;IAwBD;;;;OAIG;IACH,YAHW,CAAC,GACC,OAAO,CA+CnB;IAED;;;;;OAKG;IACH,sCAHW,GAAC,GACC,OAAO,CA+BnB;IAOD;;OAEG;IACH,gBA0DC;IAmBD,2CA0BC;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,OAAO,CAInB;IAED;;OAEG;IACH,cA6BC;IA+BD;;;OAGG;IACH,UAFa,QAAQ,CAAC,CAAC,CAAC,CAOvB;IAED;;;OAGG;IACH,QAFa,QAAQ,CAAC,CAAC,CAAC,CAMvB;IAhDD,yDA2BC;;CAsBJ;AAj1BD;;GAEG;AACH,2BAFa,CAAC,EAAC,CAAC;IAGZ;;;;;OAKG;IACH,iBAJW,CAAC,SACD,CAAC,QACD,MAAM,EAsBhB;IAlBG;;;OAGG;IACH,KAFU,CAAC,CAEG;IAEd;;;OAGG;IACH,OAFU,CAAC,CAEO;IAElB;;;OAGG;IACH,MAFU,MAAM,CAEA;CAGvB"}
1
+ {"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AA8FD;;;;;;;GAOG;AACH,qBAHa,CAAC,EAAC,CAAC;IAkEZ;;;;;;OAMG;IACH,6EALW,CAAS,IAAC,EAAD,GAAC,KAAE,MAAM,EAsC5B;IAtGD;;;;OAIG;IACH,QAFU,WAAW,CAED;IAEpB;;;OAGG;IACH,WAFU,KAAK,CAAC,YAAY,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAET;IAEzB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,QAFU,MAAM,CAEL;IAEX,oBA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ap {
562
562
  return existing;
563
563
  }
564
564
 
565
+ // TODO we can do this more efficiently, no need to hash twice
565
566
  this.set(key, value);
566
567
 
567
568
  return value;
@@ -57,6 +57,10 @@ export class BinaryTopology {
57
57
  */
58
58
  get byteSize(): number;
59
59
  trim(): void;
60
+ /**
61
+ *
62
+ * @return {BinaryElementPool}
63
+ */
60
64
  get vertices(): BinaryElementPool;
61
65
  /**
62
66
  * Edges are shared among faces, edges point to 2 unordered vertices
@@ -1 +1 @@
1
- {"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH;IACI;;;;;;;;OAQG;IACH,sBAA4F;IAC5F;;;;;;;;;OASG;IACH,oBAAsD;IACtD;;;;;;;;;;;;OAYG;IACH,oBAAsD;IACtD;;;;;;OAMG;IACH,oBAAsE;IAGtE;;;OAGG;IACH,gBAFY,MAAM,CAQjB;IAED,aAKC;IAED,kCAEC;IAED;;;OAGG;IACH,aAFY,iBAAiB,CAI5B;IAED;;;OAGG;IACH,aAFY,iBAAiB,CAI5B;IAED,+BAEC;IAGD;;OAEG;IACH,cAKC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAQhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAQhB;IAED;;;OAGG;IACH,qBAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,sBAFW,MAAM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QlB;IAED;;;;OAIG;IACH,2BAFW,MAAM,SADN,MAAM,QAShB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;CACJ;kCAxmBiC,wBAAwB"}
1
+ {"version":3,"file":"BinaryTopology.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/topology/struct/binary/BinaryTopology.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,2BAFU,MAAM,CAEuB;AAEvC;;;GAGG;AACH;IACI;;;;;;;;OAQG;IACH,sBAA4F;IAC5F;;;;;;;;;OASG;IACH,oBAAsD;IACtD;;;;;;;;;;;;OAYG;IACH,oBAAsD;IACtD;;;;;;OAMG;IACH,oBAAsE;IAGtE;;;OAGG;IACH,gBAFY,MAAM,CAQjB;IAED,aAKC;IAED;;;OAGG;IACH,gBAFY,iBAAiB,CAI5B;IAED;;;OAGG;IACH,aAFY,iBAAiB,CAI5B;IAED;;;OAGG;IACH,aAFY,iBAAiB,CAI5B;IAED,+BAEC;IAGD;;OAEG;IACH,cAKC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,SACN,MAAM,EAAE,gBACR,MAAM,QAQhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,GAAC,YAAY,iBACvC,MAAM,MACN,MAAM,QAQhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,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M,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,2BAFW,MAAM,SADN,MAAM,QAShB;IAED;;;;OAIG;IACH,0BAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;OAIG;IACH,2BAFW,MAAM,SADN,MAAM,QAShB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;OAIG;IACH,oBAFW,MAAM,SADN,MAAM,QAQhB;CACJ;kCA5mBiC,wBAAwB"}
@@ -91,6 +91,10 @@ export class BinaryTopology {
91
91
  this.__face_pool.trim();
92
92
  }
93
93
 
94
+ /**
95
+ *
96
+ * @return {BinaryElementPool}
97
+ */
94
98
  get vertices() {
95
99
  return this.__vertex_pool;
96
100
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_structure.cc#L162
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} edge
5
+ * @param {number} vertex
6
+ */
7
+ export function bt_disk_edge_remove(mesh: BinaryTopology, edge: number, vertex: number): void;
8
+ //# sourceMappingURL=bt_disk_edge_remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_disk_edge_remove.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_disk_edge_remove.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0CAJW,cAAc,QACd,MAAM,UACN,MAAM,QAIhB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_structure.cc#L162
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} edge
5
+ * @param {number} vertex
6
+ */
7
+ export function bt_disk_edge_remove(mesh, edge, vertex) {
8
+ throw new Error('Not Implemented');
9
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param {BinaryTopology} mesh
3
+ * @param {number} e
4
+ */
5
+ export function bt_edge_kill(mesh: BinaryTopology, e: number): void;
6
+ //# sourceMappingURL=bt_edge_kill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_edge_kill.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_edge_kill.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,mCAHW,cAAc,KACd,MAAM,QAkBhB"}
@@ -0,0 +1,26 @@
1
+ import { NULL_POINTER } from "../BinaryTopology.js";
2
+ import { bt_disk_edge_remove } from "./bt_disk_edge_remove.js";
3
+ import { bt_face_kill } from "./bt_face_kill.js";
4
+ import { bt_kill_only_edge } from "./bt_kill_only_edge.js";
5
+
6
+ /**
7
+ * @param {BinaryTopology} mesh
8
+ * @param {number} e
9
+ */
10
+ export function bt_edge_kill(mesh, e) {
11
+ let l = NULL_POINTER;
12
+
13
+ while ((l = mesh.edge_read_loop(e)) !== NULL_POINTER) {
14
+ const face = mesh.loop_read_face(l);
15
+
16
+ bt_face_kill(mesh, face);
17
+ }
18
+
19
+ const v1 = mesh.edge_read_vertex1(e);
20
+ const v2 = mesh.edge_read_vertex2(e);
21
+
22
+ bt_disk_edge_remove(mesh, e, v1);
23
+ bt_disk_edge_remove(mesh, e, v2);
24
+
25
+ bt_kill_only_edge(mesh, e);
26
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} f
5
+ */
6
+ export function bt_face_kill(mesh: BinaryTopology, f: number): void;
7
+ //# sourceMappingURL=bt_face_kill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_face_kill.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_face_kill.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mCAHW,cAAc,KACd,MAAM,QAIhB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} f
5
+ */
6
+ export function bt_face_kill(mesh, f) {
7
+ throw new Error('Not Implemented');
8
+ }
@@ -68,7 +68,7 @@ export function bt_index_geometry_to_topology(
68
68
  const vertex_b = b;
69
69
  const vertex_c = c;
70
70
 
71
- const face_id = i ;
71
+ const face_id = i;
72
72
 
73
73
  // create edges
74
74
  const edge_ab = bt_edge_get_or_create(out, vertex_a, vertex_b);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * low level function, only frees the edge,
3
+ * doesn't change or adjust surrounding geometry
4
+ * @param {BinaryTopology} mesh
5
+ * @param {number} e
6
+ */
7
+ export function bt_kill_only_edge(mesh: BinaryTopology, e: number): void;
8
+ //# sourceMappingURL=bt_kill_only_edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_kill_only_edge.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_kill_only_edge.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wCAHW,cAAc,KACd,MAAM,QAIhB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * low level function, only frees the edge,
3
+ * doesn't change or adjust surrounding geometry
4
+ * @param {BinaryTopology} mesh
5
+ * @param {number} e
6
+ */
7
+ export function bt_kill_only_edge(mesh, e) {
8
+ mesh.edges.release(e);
9
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * low level function, only frees the face,
3
+ * doesn't change or adjust surrounding geometry
4
+ * @param {BinaryTopology} mesh
5
+ * @param {number} f
6
+ */
7
+ export function bt_kill_only_face(mesh: BinaryTopology, f: number): void;
8
+ //# sourceMappingURL=bt_kill_only_face.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_kill_only_face.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_kill_only_face.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wCAHW,cAAc,KACd,MAAM,QAIhB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * low level function, only frees the face,
3
+ * doesn't change or adjust surrounding geometry
4
+ * @param {BinaryTopology} mesh
5
+ * @param {number} f
6
+ */
7
+ export function bt_kill_only_face(mesh, f) {
8
+ mesh.faces.release(f);
9
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} v
5
+ */
6
+ export function bt_kill_only_vert(mesh: BinaryTopology, v: number): void;
7
+ //# sourceMappingURL=bt_kill_only_vert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_kill_only_vert.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_kill_only_vert.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wCAHW,cAAc,KACd,MAAM,QAIhB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} v
5
+ */
6
+ export function bt_kill_only_vert(mesh, v) {
7
+ mesh.vertices.release(v);
8
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Patch mesh structure to make all loops/edges/faces point to this new replacement vertex instead of the victim
3
+ * This effectively removes any usage of the victim from the mesh enabling us to safely remove it
4
+ * @param {BinaryTopology} mesh
5
+ * @param {number} victim
6
+ * @param {number} replacement
7
+ */
8
+ export function bt_replace_vertex(mesh: BinaryTopology, victim: number, replacement: number): void;
9
+ /**
10
+ * Only considers distance, no other attributes are accounted for
11
+ * Performs operation in-place
12
+ * IMPORTANT: Assumes vertices are compacted, that is - there are no holes in the vertex element pool
13
+ * @param {BinaryTopology} mesh
14
+ * @param {number[]} mesh_bounds bounding box of the mesh, required for quantization
15
+ * @param {number} [max_distance] distance between vertices within which we perform the merge
16
+ */
17
+ export function bt_merge_verts_by_distance(mesh: BinaryTopology, mesh_bounds: number[], max_distance?: number): void;
18
+ //# sourceMappingURL=bt_merge_verts_by_distance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_merge_verts_by_distance.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_merge_verts_by_distance.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wCAJW,cAAc,UACd,MAAM,eACN,MAAM,QAIhB;AAED;;;;;;;GAOG;AACH,iDAJW,cAAc,eACd,MAAM,EAAE,iBACR,MAAM,QA6DhB"}
@@ -0,0 +1,83 @@
1
+ import { HashMap } from "../../../../../../collection/map/HashMap.js";
2
+ import { v3_distance_sqr } from "../../../../../vec3/v3_distance_sqr.js";
3
+ import v3_morton_encode from "../../../../morton/v3_morton_encode.js";
4
+
5
+ /**
6
+ * Patch mesh structure to make all loops/edges/faces point to this new replacement vertex instead of the victim
7
+ * This effectively removes any usage of the victim from the mesh enabling us to safely remove it
8
+ * @param {BinaryTopology} mesh
9
+ * @param {number} victim
10
+ * @param {number} replacement
11
+ */
12
+ export function bt_replace_vertex(mesh, victim, replacement) {
13
+ throw new Error("Not Implemented");
14
+ }
15
+
16
+ /**
17
+ * Only considers distance, no other attributes are accounted for
18
+ * Performs operation in-place
19
+ * IMPORTANT: Assumes vertices are compacted, that is - there are no holes in the vertex element pool
20
+ * @param {BinaryTopology} mesh
21
+ * @param {number[]} mesh_bounds bounding box of the mesh, required for quantization
22
+ * @param {number} [max_distance] distance between vertices within which we perform the merge
23
+ */
24
+ export function bt_merge_verts_by_distance(
25
+ mesh,
26
+ mesh_bounds,
27
+ max_distance = 0.0001
28
+ ) {
29
+ const max_distance2 = max_distance * max_distance;
30
+
31
+ const v0 = new Float32Array(3);
32
+ const v1 = new Float32Array(3);
33
+
34
+ // 10 bit quantization
35
+ const e_x = 1023 / (mesh_bounds[3] - mesh_bounds[0]);
36
+ const e_y = 1023 / (mesh_bounds[4] - mesh_bounds[1]);
37
+ const e_z = 1023 / (mesh_bounds[5] - mesh_bounds[2]);
38
+
39
+ /**
40
+ *
41
+ * @type {HashMap<number,number>}
42
+ */
43
+ const vertex_hash = new HashMap({
44
+ keyHashFunction(vertex_index) {
45
+ mesh.vertex_read_coordinate(v0, 0, vertex_index);
46
+
47
+ return v3_morton_encode(
48
+ Math.round((v0[0] - mesh_bounds[0]) * e_x),
49
+ Math.round((v0[1] - mesh_bounds[1]) * e_y),
50
+ Math.round((v0[2] - mesh_bounds[2]) * e_z)
51
+ );
52
+ },
53
+ keyEqualityFunction(a, b) {
54
+ mesh.vertex_read_coordinate(v0, 0, a);
55
+ mesh.vertex_read_coordinate(v1, 0, b);
56
+
57
+ const d2 = v3_distance_sqr(
58
+ v0[0], v0[1], v0[2],
59
+ v1[0], v1[1], v1[2],
60
+ );
61
+
62
+ return d2 <= max_distance2;
63
+ }
64
+ });
65
+
66
+ const vertices = mesh.vertices;
67
+ let vertex_count = vertices.size;
68
+
69
+ for (let vertex = 1; vertex < vertex_count; vertex++) {
70
+ const master_vertex = vertex_hash.getOrSet(vertex, vertex);
71
+
72
+ if (master_vertex === vertex) {
73
+ // no collisions, vertex was hashed
74
+ continue;
75
+ }
76
+
77
+ // got a collision, need to remove the vertex
78
+ // let's take over all data from this vertex
79
+
80
+ bt_replace_vertex(mesh, vertex, master_vertex);
81
+ }
82
+
83
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_core.cc#L977
3
+ * @param {BinaryTopology} mesh
4
+ * @param {number} v
5
+ */
6
+ export function bt_vert_kill(mesh: BinaryTopology, v: number): void;
7
+ //# sourceMappingURL=bt_vert_kill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bt_vert_kill.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/geom/3d/topology/struct/binary/io/bt_vert_kill.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,mCAHW,cAAc,KACd,MAAM,QAShB"}
@@ -0,0 +1,18 @@
1
+ import { NULL_POINTER } from "../BinaryTopology.js";
2
+ import { bt_edge_kill } from "./bt_edge_kill.js";
3
+ import { bt_kill_only_vert } from "./bt_kill_only_vert.js";
4
+
5
+
6
+ /**
7
+ * @see https://github.com/blender/blender/blob/afb0d411072db51b871607034befe3677f9fd82d/source/blender/bmesh/intern/bmesh_core.cc#L977
8
+ * @param {BinaryTopology} mesh
9
+ * @param {number} v
10
+ */
11
+ export function bt_vert_kill(mesh, v) {
12
+ let e = NULL_POINTER;
13
+ while ((e = mesh.vertex_read_edge(v)) !== NULL_POINTER) {
14
+ bt_edge_kill(mesh, e);
15
+ }
16
+
17
+ bt_kill_only_vert(mesh, v);
18
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ * @param {number[]|Float32Array} a
4
+ * @param {number} a_offset
5
+ * @param {number[]|Float32Array} b
6
+ * @param {number} b_offset
7
+ */
8
+ export function v3_array_equals(a: number[] | Float32Array, a_offset: number, b: number[] | Float32Array, b_offset: number): boolean;
9
+ //# sourceMappingURL=v3_array_equals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_array_equals.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_array_equals.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,mCALW,MAAM,EAAE,GAAC,YAAY,YACrB,MAAM,KACN,MAAM,EAAE,GAAC,YAAY,YACrB,MAAM,WAOhB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * @param {number[]|Float32Array} a
4
+ * @param {number} a_offset
5
+ * @param {number[]|Float32Array} b
6
+ * @param {number} b_offset
7
+ */
8
+ export function v3_array_equals(a, a_offset, b, b_offset) {
9
+ return a[a_offset] === b[b_offset]
10
+ && a[a_offset + 1] === b[b_offset + 1]
11
+ && a[a_offset + 2] === b[b_offset + 2]
12
+ ;
13
+ }
@@ -28,10 +28,10 @@ export class OnDemandWorkerManager {
28
28
  */
29
29
  worker: WorkerProxy;
30
30
  /**
31
- * In milliseconds
32
- * @param {number} v
31
+ * Configure how long to wait after processing a request until deciding to shut down the worker
32
+ * @param {number} delay_ms In milliseconds
33
33
  */
34
- setTimeout(v: number): void;
34
+ setTimeout(delay_ms: number): void;
35
35
  /**
36
36
  * @private
37
37
  */
@@ -54,6 +54,7 @@ export class OnDemandWorkerManager {
54
54
  */
55
55
  private increment;
56
56
  /**
57
+ * Submit request to the worker
57
58
  * @template T
58
59
  * @param {string} name
59
60
  * @param {Array} [parameters]
@@ -1 +1 @@
1
- {"version":3,"file":"OnDemandWorkerManager.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/OnDemandWorkerManager.js"],"names":[],"mappings":"AAEA;IAwBI;;;OAGG;IACH,oBAFW,WAAW,EAOrB;IA/BD;;;;OAIG;IACH,wBAAoB;IAEpB;;;;;OAKG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,8BAA2B;IAOvB;;OAEG;IACH,QAFU,WAAW,CAED;IAGxB;;;OAGG;IACH,cAFW,MAAM,QAMhB;IAED;;OAEG;IACH,kBAKC;IAED;;OAEG;IACH,mCASC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAMhB;IAED;;OAEG;IACH,kBAMC;IAED;;OAEG;IACH,kBAWC;IAGD;;;;;OAKG;IACH,QALa,CAAC,QACH,MAAM,uBAEL,OAAO,CAAC,CAAC,CAAC,CAWrB;CACJ"}
1
+ {"version":3,"file":"OnDemandWorkerManager.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/OnDemandWorkerManager.js"],"names":[],"mappings":"AAEA;IAwBI;;;OAGG;IACH,oBAFW,WAAW,EAOrB;IA/BD;;;;OAIG;IACH,wBAAoB;IAEpB;;;;;OAKG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,8BAA2B;IAOvB;;OAEG;IACH,QAFU,WAAW,CAED;IAGxB;;;OAGG;IACH,qBAFW,MAAM,QAMhB;IAED;;OAEG;IACH,kBAKC;IAED;;OAEG;IACH,mCASC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAMhB;IAED;;OAEG;IACH,kBAMC;IAED;;OAEG;IACH,kBAiBC;IAGD;;;;;;OAMG;IACH,QALa,CAAC,QACH,MAAM,uBAEL,OAAO,CAAC,CAAC,CAAC,CAWrB;CACJ"}
@@ -36,13 +36,13 @@ export class OnDemandWorkerManager {
36
36
  }
37
37
 
38
38
  /**
39
- * In milliseconds
40
- * @param {number} v
39
+ * Configure how long to wait after processing a request until deciding to shut down the worker
40
+ * @param {number} delay_ms In milliseconds
41
41
  */
42
- setTimeout(v) {
43
- assert.isNonNegativeInteger(v, 'v');
42
+ setTimeout(delay_ms) {
43
+ assert.isNonNegativeInteger(delay_ms, 'v');
44
44
 
45
- this.__timeout = v;
45
+ this.__timeout = delay_ms;
46
46
  }
47
47
 
48
48
  /**
@@ -97,9 +97,15 @@ export class OnDemandWorkerManager {
97
97
  this.__request_count++;
98
98
 
99
99
  if (!this.worker.isRunning()) {
100
+
101
+ // worker is down, start it
102
+
100
103
  this.worker.start();
104
+
101
105
  } else if (this.__pending_termination >= 0) {
102
106
 
107
+ // worker is up, but we're in the termination timeout period, lets clear that
108
+
103
109
  clearInterval(this.__pending_termination);
104
110
  this.__pending_termination = -1;
105
111
 
@@ -108,6 +114,7 @@ export class OnDemandWorkerManager {
108
114
 
109
115
 
110
116
  /**
117
+ * Submit request to the worker
111
118
  * @template T
112
119
  * @param {string} name
113
120
  * @param {Array} [parameters]
@@ -1,5 +1,9 @@
1
1
  export class ImageRGBADataLoader extends AssetLoader<any, any> {
2
- constructor();
2
+ /**
3
+ *
4
+ * @param {string} [worker_path] Path to decoder worker, allows flexibility in deployment
5
+ */
6
+ constructor({ worker_path }?: string);
3
7
  decoder: CodecWithFallback;
4
8
  link(assetManager: any, engine: any): Promise<void>;
5
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ImageRGBADataLoader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/image/ImageRGBADataLoader.js"],"names":[],"mappings":"AAYA;IACI,cAOC;IAJG,2BAGC;IAGL,oDAOC;IAED;;;;;;OAMG;IACH,4BASC;IAED;;;;;;OAMG;IACH,mBAoBC;IAED,6EAiCC;CACJ;4BA5G2B,mBAAmB;kCACb,8BAA8B"}
1
+ {"version":3,"file":"ImageRGBADataLoader.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/image/ImageRGBADataLoader.js"],"names":[],"mappings":"AAYA;IACI;;;OAGG;IACH,8BAFW,MAAM,EAWhB;IAJG,2BAGC;IAGL,oDAOC;IAED;;;;;;OAMG;IACH,4BASC;IAED;;;;;;OAMG;IACH,mBAoBC;IAED,6EAiCC;CACJ;4BAlH2B,mBAAmB;kCACb,8BAA8B"}
@@ -11,11 +11,17 @@ import { ImageRGBADataAsset } from "./ImageRGBADataAsset.js";
11
11
  const ASSET_TYPE_ARRAY_BUFFER = "arraybuffer";
12
12
 
13
13
  export class ImageRGBADataLoader extends AssetLoader {
14
- constructor() {
14
+ /**
15
+ *
16
+ * @param {string} [worker_path] Path to decoder worker, allows flexibility in deployment
17
+ */
18
+ constructor({
19
+ worker_path
20
+ } = {}) {
15
21
  super();
16
22
 
17
23
  this.decoder = new CodecWithFallback(
18
- new ThreadedImageDecoder(),
24
+ new ThreadedImageDecoder({ worker_path }),
19
25
  new NativeImageDecoder()
20
26
  );
21
27
  }
@@ -1,4 +1,9 @@
1
1
  export class ThreadedImageDecoder extends Codec {
2
+ /**
3
+ *
4
+ * @param {string} [worker_path]
5
+ */
6
+ constructor({ worker_path }?: string);
2
7
  /**
3
8
  *
4
9
  * @type {OnDemandWorkerManager}
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadedImageDecoder.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js"],"names":[],"mappings":"AAKA;IAYQ;;;OAGG;IACH,QAFU,qBAAqB,CAE+B;IAKlE,kCASC;IAED,gCAEC;CACJ;sBArCqB,YAAY;sCAHI,6DAA6D"}
1
+ {"version":3,"file":"ThreadedImageDecoder.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/codec/ThreadedImageDecoder.js"],"names":[],"mappings":"AAKA;IACI;;;OAGG;IACH,8BAFW,MAAM,EAuBhB;IAPG;;;OAGG;IACH,QAFU,qBAAqB,CAE+B;IAKlE,kCASC;IAED,gCAEC;CACJ;sBA5CqB,YAAY;sCAHI,6DAA6D"}
@@ -4,12 +4,19 @@ import { PNG_HEADER_BYTES } from "../png/PNG_HEADER_BYTES.js";
4
4
  import { Codec } from "./Codec.js";
5
5
 
6
6
  export class ThreadedImageDecoder extends Codec {
7
- constructor() {
7
+ /**
8
+ *
9
+ * @param {string} [worker_path]
10
+ */
11
+ constructor({
12
+ worker_path = 'bundle-worker-image-decoder.js'
13
+ }={}) {
14
+
8
15
  super();
9
16
 
10
17
  const workerBuilder = new WorkerBuilder();
11
18
 
12
- workerBuilder.importScript('bundle-worker-image-decoder.js');
19
+ workerBuilder.importScript(worker_path);
13
20
 
14
21
  workerBuilder.addMethod('decode', function (data, type) {
15
22
  return Lib.decode(data, type);