@woosh/meep-engine 2.122.6 → 2.123.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 (37) hide show
  1. package/build/bundle-worker-image-decoder.js +1 -1
  2. package/build/bundle-worker-terrain.js +1 -1
  3. package/editor/process/ObstacleGridDisplayProcess.js +5 -5
  4. package/package.json +1 -1
  5. package/samples/terrain/main.js +6 -6
  6. package/src/core/color/kelvin/prototype_kelvin_to_rgb.js +3 -3
  7. package/src/core/geom/3d/tetrahedra/triangle/prototype.js +1 -1
  8. package/src/core/geom/packing/computeBoundingSphereOfSpheres.d.ts +12 -1
  9. package/src/core/geom/packing/max-rect/MaxRectanglesPacker.d.ts +14 -11
  10. package/src/core/geom/packing/max-rect/MaxRectanglesPacker.d.ts.map +1 -1
  11. package/src/core/geom/packing/max-rect/MaxRectanglesPacker.js +25 -36
  12. package/src/core/geom/packing/max-rect/aabb2_validate_packing.d.ts +2 -0
  13. package/src/core/geom/packing/max-rect/aabb2_validate_packing.d.ts.map +1 -0
  14. package/src/core/geom/packing/max-rect/aabb2_validate_packing.js +29 -0
  15. package/src/core/geom/packing/max-rect/packMaxRectangles.d.ts +0 -3
  16. package/src/core/geom/packing/max-rect/packMaxRectangles.d.ts.map +1 -1
  17. package/src/core/geom/packing/max-rect/packMaxRectangles.js +0 -3
  18. package/src/core/geom/packing/miniball/Miniball.d.ts +2 -1
  19. package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
  20. package/src/core/geom/packing/miniball/Miniball.js +2 -1
  21. package/src/engine/asset/loaders/image/png/crc32.d.ts +11 -6
  22. package/src/engine/asset/loaders/image/png/crc32.d.ts.map +1 -1
  23. package/src/engine/asset/loaders/image/png/crc32.js +43 -18
  24. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +1 -1
  25. package/src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js +2 -2
  26. package/src/engine/graphics/particles/particular/engine/parameter/ParameterSheet.js +1 -1
  27. package/src/engine/graphics/particles/particular/engine/utils/volume/lut_to_sampler.js +1 -1
  28. package/src/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +1 -1
  29. package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +1 -1
  30. package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +3 -3
  31. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
  32. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
  33. package/src/engine/graphics/texture/sampler/Sampler2D.js +7 -6
  34. package/src/engine/graphics/texture/sampler/debug/prototypeSamplerFiltering.js +4 -4
  35. package/src/engine/graphics/texture/sampler/sampler2d_paint.js +1 -1
  36. package/src/engine/graphics/texture/sprite/prototypeSpriteCutoutGeometry.js +1 -1
  37. package/src/generation/theme/ThemeEngine.js +1 -1
@@ -30,11 +30,11 @@ for (let i = 0; i < sampler.width; i++) {
30
30
  sRGB_to_linear(color, 0, color, 0);
31
31
 
32
32
  for (let j = 0; j < sampler.height; j++) {
33
- sampler.set(i, j, color);
34
- // sampler.set(i, j, [f, f, f, 1]);
33
+ sampler.write(i, j, color);
34
+ // sampler.write(i, j, [f, f, f, 1]);
35
35
 
36
36
  }
37
- // sampler.set(i, sampler.height - 1, [f, f, f, 1]);
37
+ // sampler.write(i, sampler.height - 1, [f, f, f, 1]);
38
38
  }
39
39
 
40
40
  console.log(sampler);
@@ -111,7 +111,7 @@ async function main() {
111
111
 
112
112
  color.set(depth, depth, depth, 1);
113
113
 
114
- sampler.set(x, y, color)
114
+ sampler.write(x, y, color)
115
115
  }
116
116
  }
117
117
 
@@ -1 +1,12 @@
1
- export function computeBoundingSphereOfSpheres(result: ArrayLike<number>, data: ArrayLike<number>, offset: number, count: number, dimensions: number): void;
1
+ /**
2
+ * Computes bounding sphere of a number of spheres
3
+ * NOTE: implementation does not produce a very tight sphere, here is a good resource for a better implementation:
4
+ * https://github.com/CGAL/cgal/blob/master/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_support_set.h
5
+ * @param {number[]|Float32Array|Float64Array} result
6
+ * @param {number[]|Float32Array|Float64Array} data
7
+ * @param {number} offset
8
+ * @param {number} count
9
+ * @param {number} dimensions
10
+ */
11
+ export function computeBoundingSphereOfSpheres(result: number[] | Float32Array | Float64Array, data: number[] | Float32Array | Float64Array, offset: number, count: number, dimensions: number): void;
12
+ //# sourceMappingURL=computeBoundingSphereOfSpheres.d.ts.map
@@ -1,7 +1,9 @@
1
1
  /**
2
- * Packs rectangles into a finite area, packer is incremental and supports both insertions and removals of rectangles
2
+ * Packs rectangles into a finite area, packer is incremental and supports both insertions and removals of rectangles.
3
3
  * Implementation of "max rectangles" packing algorithm.
4
- * Useful for packing texture atlases
4
+ * Useful for packing texture atlases.
5
+ *
6
+ * @see "A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing" 2010 Jukka Jylänki
5
7
  */
6
8
  export class MaxRectanglesPacker {
7
9
  /**
@@ -17,26 +19,29 @@ export class MaxRectanglesPacker {
17
19
  */
18
20
  free: QuadTreeNode<any>;
19
21
  /**
20
- *
22
+ * Currently held boxes.
23
+ * Managed internally, do not modify.
24
+ * @readonly
21
25
  * @type {AABB2[]}
22
26
  */
23
- boxes: AABB2[];
27
+ readonly boxes: AABB2[];
24
28
  /**
25
29
  *
26
- * @param {AABB2} box
27
- * @returns {boolean}
30
+ * @param {AABB2} box exact box to remove
31
+ * @returns {boolean} true when box is removed, false if not found
28
32
  */
29
33
  remove(box: AABB2): boolean;
30
34
  /**
31
35
  *
32
36
  * @param {AABB2[]} boxes
33
- * @returns {number} how many failed to be removed
37
+ * @returns {number} How many failed to be removed. Failure represents box that was not packed in the first place.
34
38
  */
35
39
  removeMany(boxes: AABB2[]): number;
36
40
  /**
37
- *
41
+ * Pack a given box.
42
+ * Atomic, if box fails packing - the existing data structure is unchanged.
38
43
  * @param {AABB2} box
39
- * @returns {boolean}
44
+ * @returns {boolean} true if box was successfully added into the packing, false otherwise
40
45
  */
41
46
  add(box: AABB2): boolean;
42
47
  /**
@@ -69,9 +74,7 @@ export class MaxRectanglesPacker {
69
74
  * @returns {boolean} false if packing fails after resize, true otherwise
70
75
  */
71
76
  resize(width: number, height: number): boolean;
72
- validate(): boolean;
73
77
  }
74
78
  import Vector2 from "../../Vector2.js";
75
79
  import { QuadTreeNode } from "../../2d/quad-tree/QuadTreeNode.js";
76
- import AABB2 from "../../2d/aabb/AABB2.js";
77
80
  //# sourceMappingURL=MaxRectanglesPacker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MaxRectanglesPacker.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/MaxRectanglesPacker.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH;IACI;;;;OAIG;IACH,mBAHW,MAAM,UACN,MAAM,EAmBhB;IAhBG,cAAsC;IAEtC;;;OAGG;IACH,wBAAiD;IAKjD;;;OAGG;IACH,OAFU,KAAK,EAAE,CAEF;IAGnB;;;;OAIG;IACH,YAHW,KAAK,GACH,OAAO,CAoBnB;IAED;;;;OAIG;IACH,kBAHW,KAAK,EAAE,GACL,MAAM,CAgBlB;IAED;;;;OAIG;IACH,SAHW,KAAK,GACH,OAAO,CAanB;IAED;;;;;;OAMG;IACH,UAJW,MAAM,KACN,MAAM,GACL,OAAO,CAIlB;IAED;;;;OAIG;IACH,eAHW,KAAK,EAAE,GACL,OAAO,CAiDnB;IAED;;;OAGG;IACH,UAFa,OAAO,CAWnB;IAED;;OAEG;IACH,cAKC;IAED;;;;;OAKG;IACH,cAJW,MAAM,UACN,MAAM,GACJ,OAAO,CA2BnB;IAED,oBAsBC;CACJ;oBAtPmB,kBAAkB;6BADT,oCAAoC;kBAF/C,wBAAwB"}
1
+ {"version":3,"file":"MaxRectanglesPacker.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/MaxRectanglesPacker.js"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH;IACI;;;;OAIG;IACH,mBAHW,MAAM,UACN,MAAM,EAqBhB;IAlBG,cAAsC;IAEtC;;;OAGG;IACH,wBAAiD;IAKjD;;;;;OAKG;IACH,gBAFU,KAAK,EAAE,CAEF;IAGnB;;;;OAIG;IACH,YAHW,KAAK,GACH,OAAO,CAoBnB;IAED;;;;OAIG;IACH,kBAHW,KAAK,EAAE,GACL,MAAM,CAgBlB;IAED;;;;;OAKG;IACH,SAHW,KAAK,GACH,OAAO,CAanB;IAED;;;;;;OAMG;IACH,UAJW,MAAM,KACN,MAAM,GACL,OAAO,CAIlB;IAED;;;;OAIG;IACH,eAHW,KAAK,EAAE,GACL,OAAO,CAiDnB;IAED;;;OAGG;IACH,UAFa,OAAO,CAWnB;IAED;;OAEG;IACH,cAKC;IAED;;;;;OAKG;IACH,cAJW,MAAM,UACN,MAAM,GACJ,OAAO,CAmCnB;CAEJ;oBA5OmB,kBAAkB;6BADT,oCAAoC"}
@@ -1,6 +1,5 @@
1
1
  import { assert } from "../../../assert.js";
2
2
  import BinaryHeap from "../../../collection/heap/BinaryHeap.js";
3
- import AABB2 from "../../2d/aabb/AABB2.js";
4
3
  import { QuadTreeDatum } from "../../2d/quad-tree/QuadTreeDatum.js";
5
4
  import { QuadTreeNode } from "../../2d/quad-tree/QuadTreeNode.js";
6
5
  import Vector2 from "../../Vector2.js";
@@ -10,9 +9,11 @@ import { packOneBox } from "./packOneBox.js";
10
9
  import { removeRedundantBoxes } from "./removeRedundantBoxes.js";
11
10
 
12
11
  /**
13
- * Packs rectangles into a finite area, packer is incremental and supports both insertions and removals of rectangles
12
+ * Packs rectangles into a finite area, packer is incremental and supports both insertions and removals of rectangles.
14
13
  * Implementation of "max rectangles" packing algorithm.
15
- * Useful for packing texture atlases
14
+ * Useful for packing texture atlases.
15
+ *
16
+ * @see "A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing" 2010 Jukka Jylänki
16
17
  */
17
18
  export class MaxRectanglesPacker {
18
19
  /**
@@ -33,7 +34,9 @@ export class MaxRectanglesPacker {
33
34
  this.free.add(null, 0, 0, width, height);
34
35
 
35
36
  /**
36
- *
37
+ * Currently held boxes.
38
+ * Managed internally, do not modify.
39
+ * @readonly
37
40
  * @type {AABB2[]}
38
41
  */
39
42
  this.boxes = [];
@@ -41,8 +44,8 @@ export class MaxRectanglesPacker {
41
44
 
42
45
  /**
43
46
  *
44
- * @param {AABB2} box
45
- * @returns {boolean}
47
+ * @param {AABB2} box exact box to remove
48
+ * @returns {boolean} true when box is removed, false if not found
46
49
  */
47
50
  remove(box) {
48
51
  const i = this.boxes.indexOf(box);
@@ -54,7 +57,7 @@ export class MaxRectanglesPacker {
54
57
 
55
58
  this.boxes.splice(i, 1);
56
59
 
57
- //introduce a free node in the unoccupied space
60
+ // introduce a free node in the unoccupied space
58
61
  this.free.insertDatum(new QuadTreeDatum(box.x0, box.y0, box.x1, box.y1));
59
62
 
60
63
 
@@ -67,7 +70,7 @@ export class MaxRectanglesPacker {
67
70
  /**
68
71
  *
69
72
  * @param {AABB2[]} boxes
70
- * @returns {number} how many failed to be removed
73
+ * @returns {number} How many failed to be removed. Failure represents box that was not packed in the first place.
71
74
  */
72
75
  removeMany(boxes) {
73
76
  let failures = 0;
@@ -86,9 +89,10 @@ export class MaxRectanglesPacker {
86
89
  }
87
90
 
88
91
  /**
89
- *
92
+ * Pack a given box.
93
+ * Atomic, if box fails packing - the existing data structure is unchanged.
90
94
  * @param {AABB2} box
91
- * @returns {boolean}
95
+ * @returns {boolean} true if box was successfully added into the packing, false otherwise
92
96
  */
93
97
  add(box) {
94
98
  const success = packOneBox(box, this.free);
@@ -120,8 +124,8 @@ export class MaxRectanglesPacker {
120
124
  * @returns {boolean}
121
125
  */
122
126
  addMany(boxes) {
123
- assert.defined(boxes,'boxes');
124
- assert.isArray(boxes,'boxes');
127
+ assert.defined(boxes, 'boxes');
128
+ assert.isArray(boxes, 'boxes');
125
129
 
126
130
  // assert.ok(this.validate());
127
131
 
@@ -200,6 +204,14 @@ export class MaxRectanglesPacker {
200
204
  * @returns {boolean} false if packing fails after resize, true otherwise
201
205
  */
202
206
  resize(width, height) {
207
+ assert.isNumber(width, 'width');
208
+ assert.isNumber(height, 'height');
209
+
210
+ assert.isFiniteNumber(width, 'width');
211
+ assert.isFiniteNumber(height, 'height');
212
+
213
+ assert.greaterThan(width, 0, 'width');
214
+ assert.greaterThan(height, 0, 'height');
203
215
 
204
216
  // assert.ok(this.validate());
205
217
 
@@ -209,7 +221,7 @@ export class MaxRectanglesPacker {
209
221
  this.size.set(width, height);
210
222
 
211
223
  if (oldWidth > width || oldHeight > height) {
212
- //canvas was made smaller in at least one dimension, re-pack is required
224
+ // canvas was made smaller in at least one dimension, re-pack is required
213
225
  return this.repack();
214
226
  }
215
227
 
@@ -226,29 +238,6 @@ export class MaxRectanglesPacker {
226
238
  return true;
227
239
  }
228
240
 
229
- validate() {
230
-
231
- const boxes = this.boxes;
232
- const numPatches = boxes.length;
233
- let i, j;
234
-
235
- for (i = 0; i < numPatches; i++) {
236
- const p0 = boxes[i];
237
-
238
-
239
- for (j = i + 1; j < numPatches; j++) {
240
- const p1 = boxes[j];
241
-
242
- if (p0.computeOverlap(p1, new AABB2())) {
243
- console.warn("Overlap", p0, p1);
244
- return false;
245
- }
246
-
247
- }
248
- }
249
-
250
- return true;
251
- }
252
241
  }
253
242
 
254
243
 
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=aabb2_validate_packing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aabb2_validate_packing.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/aabb2_validate_packing.js"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import AABB2 from "../../2d/aabb/AABB2.js";
2
+
3
+ /**
4
+ *
5
+ * @param {AABB2[]} boxes
6
+ * @return {boolean}
7
+ */
8
+ function validate(boxes) {
9
+
10
+ const numPatches = boxes.length;
11
+ let i, j;
12
+
13
+ for (i = 0; i < numPatches; i++) {
14
+ const p0 = boxes[i];
15
+
16
+
17
+ for (j = i + 1; j < numPatches; j++) {
18
+ const p1 = boxes[j];
19
+
20
+ if (p0.computeOverlap(p1, new AABB2())) {
21
+ console.warn("Overlap", p0, p1);
22
+ return false;
23
+ }
24
+
25
+ }
26
+ }
27
+
28
+ return true;
29
+ }
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * Packs {@link AABB2} boxes into defined bounds
3
3
  *
4
- * Based on paper "A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing" 2010 Jukka Jylänki
5
- * Method presented called Maximal Rectangles
6
- *
7
4
  * @param {number} width
8
5
  * @param {number} height
9
6
  * @param {AABB2[]} boxes
@@ -1 +1 @@
1
- {"version":3,"file":"packMaxRectangles.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/packMaxRectangles.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,yCALW,MAAM,UACN,MAAM,SACN,KAAK,EAAE,GACL,OAAO,CAOnB"}
1
+ {"version":3,"file":"packMaxRectangles.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/max-rect/packMaxRectangles.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,yCALW,MAAM,UACN,MAAM,SACN,KAAK,EAAE,GACL,OAAO,CAOnB"}
@@ -3,9 +3,6 @@ import { MaxRectanglesPacker } from "./MaxRectanglesPacker.js";
3
3
  /**
4
4
  * Packs {@link AABB2} boxes into defined bounds
5
5
  *
6
- * Based on paper "A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing" 2010 Jukka Jylänki
7
- * Method presented called Maximal Rectangles
8
- *
9
6
  * @param {number} width
10
7
  * @param {number} height
11
8
  * @param {AABB2[]} boxes
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Computes the miniball of the given point set.
3
- * @class
3
+ *
4
+ * @copyright Company Named Limited (c) 2025
4
5
  */
5
6
  export class Miniball {
6
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"AAwBA;;;GAGG;AACH;IACI;;;;;OAKG;IACH,oBAFW,QAAQ,EAoGlB;IA/FG;;;OAGG;IACH,WAFU,MAAM,CAEE;IAClB;;;OAGG;IACH,WAFU,MAAM,CAEE;IAClB;;;OAGG;IACH,iBAFU,MAAM,CAEQ;IACxB;;;;;;;;;;OAUG;IACH,wBAAwB;IACxB;;;;OAIG;IACH,iBAAiB;IACjB;;;OAGG;IACH,SAFU,MAAM,CAEA;IAEhB;;OAEG;IACH,GAFU,QAAQ,CAEH;IAEf;;;;OAIG;IACH,eAA2B;IAI3B;;;OAGG;IACH,KAFU,MAAM,CAEU;IAM1B;;;;OAIG;IACH,iBAA4D;IAE5D;;;OAGG;IACH,aAFU,MAAM,EAAE,GAAC,YAAY,CAEkD;IAEjF;;;OAGG;IACH,eAFU,MAAM,EAAE,GAAC,YAAY,CAEwD;IAEvF;;;OAGG;IACH,SAFU,MAAM,EAAE,GAAC,YAAY,CAEsD;IAErF;;;;OAIG;IACH,kBAAgC;IAIpC;;;;;;;OAOG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,CAIjB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,EAAE,CAInB;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;;;OAMG;IACH,QAJY,MAAM,CAMjB;IAED;;;;;;;;OAQG;IACH,iBAkCC;IAED;;OAEG;IACH,yBAGC;IAED;;OAEG;IACH,qBAcC;IAED;;;;;;;;;;OAUG;IACH,gBA4CC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CA4BlB;IAED;;;;;;;;OAQG;IACH,yBAyDC;IAGD;;;OAGG;IACH,YAFY,MAAM,CAkBjB;CACJ;wBAlbuB,cAAc"}
1
+ {"version":3,"file":"Miniball.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/packing/miniball/Miniball.js"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH;IACI;;;;;OAKG;IACH,oBAFW,QAAQ,EAoGlB;IA/FG;;;OAGG;IACH,WAFU,MAAM,CAEE;IAClB;;;OAGG;IACH,WAFU,MAAM,CAEE;IAClB;;;OAGG;IACH,iBAFU,MAAM,CAEQ;IACxB;;;;;;;;;;OAUG;IACH,wBAAwB;IACxB;;;;OAIG;IACH,iBAAiB;IACjB;;;OAGG;IACH,SAFU,MAAM,CAEA;IAEhB;;OAEG;IACH,GAFU,QAAQ,CAEH;IAEf;;;;OAIG;IACH,eAA2B;IAI3B;;;OAGG;IACH,KAFU,MAAM,CAEU;IAM1B;;;;OAIG;IACH,iBAA4D;IAE5D;;;OAGG;IACH,aAFU,MAAM,EAAE,GAAC,YAAY,CAEkD;IAEjF;;;OAGG;IACH,eAFU,MAAM,EAAE,GAAC,YAAY,CAEwD;IAEvF;;;OAGG;IACH,SAFU,MAAM,EAAE,GAAC,YAAY,CAEsD;IAErF;;;;OAIG;IACH,kBAAgC;IAIpC;;;;;;;OAOG;IACH,WAFY,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,CAIjB;IAED;;;;;;OAMG;IACH,UAFY,MAAM,EAAE,CAInB;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;;;OAMG;IACH,QAJY,MAAM,CAMjB;IAED;;;;;;;;OAQG;IACH,iBAkCC;IAED;;OAEG;IACH,yBAGC;IAED;;OAEG;IACH,qBAcC;IAED;;;;;;;;;;OAUG;IACH,gBA4CC;IAED;;;;;;;;OAQG;IACH,kBAFY,OAAO,CA4BlB;IAED;;;;;;;;OAQG;IACH,yBAyDC;IAGD;;;OAGG;IACH,YAFY,MAAM,CAkBjB;CACJ;wBAnbuB,cAAc"}
@@ -24,7 +24,8 @@ const MAX_ITERATIONS = 10000;
24
24
 
25
25
  /**
26
26
  * Computes the miniball of the given point set.
27
- * @class
27
+ *
28
+ * @copyright Company Named Limited (c) 2025
28
29
  */
29
30
  export class Miniball {
30
31
  /**
@@ -1,11 +1,16 @@
1
1
  /**
2
- * 32-bit cyclic redundancy checksum
3
- * Returns CRC of the bytes buf[0..len-1]
2
+ * 32-bit Cyclic Redundancy Checksum.
4
3
  * @see https://en.wikipedia.org/wiki/Cyclic_redundancy_check
5
4
  * @param {Uint8Array} buffer byte buffer
6
- * @param {number} offset
7
- * @param {number} length how many bytes to include in checksum calculation
8
- * @return {number}
5
+ * @param {number} [offset=0] where to start in the input buffer
6
+ * @param {number} [length=buffer.length] how many bytes to include in checksum calculation
7
+ * @return {number} Unsigned 32-bit integer value
8
+ * @copyright Company Named Limited (c) 2025
9
+ *
10
+ * @example
11
+ * const buffer = new BinaryBuffer();
12
+ * buffer.writeASCIIString("Hello World");
13
+ * const checksum = crc32(buffer.raw_bytes, 0, buffer.position);
9
14
  */
10
- export function crc32(buffer: Uint8Array, offset: number, length: number): number;
15
+ export function crc32(buffer: Uint8Array, offset?: number, length?: number): number;
11
16
  //# sourceMappingURL=crc32.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/crc32.js"],"names":[],"mappings":"AAuDA;;;;;;;;GAQG;AACH,8BALW,UAAU,UACV,MAAM,UACN,MAAM,GACL,MAAM,CAIjB"}
1
+ {"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/asset/loaders/image/png/crc32.js"],"names":[],"mappings":"AAuEA;;;;;;;;;;;;;GAaG;AACH,8BAXW,UAAU,WACV,MAAM,WACN,MAAM,GACL,MAAM,CAcjB"}
@@ -1,3 +1,5 @@
1
+ import { assert } from "../../../../../core/assert.js";
2
+
1
3
  /*
2
4
  * Ported from C source at https://www.w3.org/TR/PNG-CRCAppendix.html
3
5
  * See also ISO 3309 [ISO-3309] or ITU-T V.42 [ITU-V42] for a formal specification
@@ -12,13 +14,18 @@ const crc_table = new Uint32Array(256);
12
14
  // Precompute checksum table
13
15
  for (let n = 0; n < 256; n++) {
14
16
  let c = n;
17
+
15
18
  for (let k = 0; k < 8; k++) {
16
- if (c & 1) {
19
+
20
+ if ((c & 1) !== 0) {
21
+ // CRC32b polynomial
17
22
  c = 0xedb88320 ^ (c >>> 1);
18
23
  } else {
19
24
  c = c >>> 1;
20
25
  }
26
+
21
27
  }
28
+
22
29
  crc_table[n] = c;
23
30
  }
24
31
 
@@ -28,40 +35,58 @@ const INITIAL = 0xffffffff;
28
35
  * Update a running CRC with the bytes buf[0..len-1]--the CRC
29
36
  * should be initialized to all 1's, and the transmitted value
30
37
  * is the 1's complement of the final running CRC (see the crc32() routine below)).
31
- * @param {number} crc
32
- * @param {Uint8Array} buf
38
+ * @param {number} input_crc starting CRC value
39
+ * @param {Uint8Array} buffer
33
40
  * @param {number} offset
34
- * @param {number} len
41
+ * @param {number} length
35
42
  * @return {number}
36
43
  */
37
44
  function update_crc(
38
- crc,
39
- buf,
45
+ input_crc,
46
+ buffer,
40
47
  offset,
41
- len,
48
+ length,
42
49
  ) {
43
- let c = crc;
50
+ assert.isNonNegativeInteger(input_crc, 'input_crc');
51
+ assert.defined(buffer, 'buffer');
52
+ assert.isNonNegativeInteger(offset, 'offset');
53
+ assert.isNonNegativeInteger(length, 'length');
54
+
55
+ let crc = input_crc;
44
56
 
45
- const end = offset + len;
57
+ const end = offset + length;
46
58
 
47
59
  for (let n = offset; n < end; n++) {
48
- const lookup_index = (c ^ buf[n]) & 0xff;
49
60
 
50
- c = crc_table[lookup_index] ^ (c >>> 8);
61
+ const byte = buffer[n];
62
+
63
+ const lookup_index = (crc ^ byte) & 0xff;
64
+
65
+ crc = crc_table[lookup_index] ^ (crc >>> 8);
66
+
51
67
  }
52
68
 
53
- return c;
69
+ return crc;
54
70
  }
55
71
 
56
72
  /**
57
- * 32-bit cyclic redundancy checksum
58
- * Returns CRC of the bytes buf[0..len-1]
73
+ * 32-bit Cyclic Redundancy Checksum.
59
74
  * @see https://en.wikipedia.org/wiki/Cyclic_redundancy_check
60
75
  * @param {Uint8Array} buffer byte buffer
61
- * @param {number} offset
62
- * @param {number} length how many bytes to include in checksum calculation
63
- * @return {number}
76
+ * @param {number} [offset=0] where to start in the input buffer
77
+ * @param {number} [length=buffer.length] how many bytes to include in checksum calculation
78
+ * @return {number} Unsigned 32-bit integer value
79
+ * @copyright Company Named Limited (c) 2025
80
+ *
81
+ * @example
82
+ * const buffer = new BinaryBuffer();
83
+ * buffer.writeASCIIString("Hello World");
84
+ * const checksum = crc32(buffer.raw_bytes, 0, buffer.position);
64
85
  */
65
- export function crc32(buffer, offset, length) {
86
+ export function crc32(
87
+ buffer,
88
+ offset=0,
89
+ length=buffer.length,
90
+ ) {
66
91
  return (update_crc(INITIAL, buffer, offset, length) ^ INITIAL) >>> 0;
67
92
  }
@@ -244,7 +244,7 @@ export class TerrainOverlay {
244
244
  * @param {number} y
245
245
  */
246
246
  clearPoint(x, y) {
247
- this.sampler.set(x, y, COLOR_UINT_8_TRANSPARENT);
247
+ this.sampler.write(x, y, COLOR_UINT_8_TRANSPARENT);
248
248
  }
249
249
 
250
250
  /**
@@ -72,7 +72,7 @@ export function paintTerrainOverlayViaLookupTable({
72
72
  if (Number.isNaN(p)) {
73
73
  // handle NaN values by writing special color
74
74
 
75
- buffer.set(i, j, NAN_COLOR);
75
+ buffer.write(i, j, NAN_COLOR);
76
76
 
77
77
  NaN_count++;
78
78
 
@@ -87,7 +87,7 @@ export function paintTerrainOverlayViaLookupTable({
87
87
 
88
88
  lut.sample(position, colorSample);
89
89
 
90
- buffer.set(i, j, colorSample);
90
+ buffer.write(i, j, colorSample);
91
91
  }
92
92
  }
93
93
 
@@ -172,7 +172,7 @@ function buildParameterSampler(parameter, length) {
172
172
 
173
173
  for (k = 0; k < trackThickness; k++) {
174
174
  //write sampled value to the sampler
175
- sampler2D.set(j, i * trackThickness + k, encodedValue);
175
+ sampler2D.write(j, i * trackThickness + k, encodedValue);
176
176
  }
177
177
  }
178
178
  }
@@ -18,7 +18,7 @@ export function lut_to_sampler(lut, width, height) {
18
18
  s[3] = 255;
19
19
 
20
20
  for (let j = 0; j < height; j++) {
21
- sampler.set(i, j, s);
21
+ sampler.write(i, j, s);
22
22
  }
23
23
 
24
24
  }
@@ -152,7 +152,7 @@ export class FPlusDebugMaterial extends ShaderMaterial {
152
152
  for (let i = 0; i < heatmap_sampler.width; i++) {
153
153
  heatmap_lut.sample(i / (heatmap_sampler.width - 1), r);
154
154
 
155
- heatmap_sampler.set(i, 0, r);
155
+ heatmap_sampler.write(i, 0, r);
156
156
  }
157
157
 
158
158
  const heatmap_texture = sampler2d_to_texture(heatmap_sampler);
@@ -566,7 +566,7 @@ function prepare_scene_decal_0() {
566
566
  sample[2] = 255;
567
567
  sample[3] = Math.round((1 - smoothstep(distance, 0.5, 1)) * 255);
568
568
 
569
- s.set(x, y, sample);
569
+ s.write(x, y, sample);
570
570
  }
571
571
  }
572
572
 
@@ -56,12 +56,12 @@ for (let i = 0; i < sampler.width; i++) {
56
56
 
57
57
  sky(color, 0, direction, 0);
58
58
 
59
- sampler.set(i, j, color);
59
+ sampler.write(i, j, color);
60
60
 
61
- // sampler.set(i, j, [f, f, f, 1]);
61
+ // sampler.write(i, j, [f, f, f, 1]);
62
62
 
63
63
  }
64
- // sampler.set(i, sampler.height - 1, [f, f, f, 1]);
64
+ // sampler.write(i, sampler.height - 1, [f, f, f, 1]);
65
65
  }
66
66
 
67
67
  console.log(sampler);
@@ -336,7 +336,7 @@ export class Sampler2D {
336
336
  /**
337
337
  * @deprecated use {@link write} instead
338
338
  */
339
- set: (x: number, y: number, texel: number[] | ArrayLike<number>) => void;
339
+ set(): void;
340
340
  /**
341
341
  * @readonly
342
342
  * @type {boolean}
@@ -1 +1 @@
1
- {"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mapp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;;OAKG;IACH,eAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,mBAHW,MAAM,UACN,OAAO,QASjB;IAED;;;;;;;;;OASG;IACH,aARW,SAAS,qHAoDnB;IAGD;;;;;;;OAOG;IACH,oEA8BC;IAED;;;;OAIG;IACH,2BAHW,MAAM,SACN,MAAM,QAYhB;IAED;;;;;;;OAOG;IACH,QANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,KAAK,CAAE,MAAM,CAAC,QAqCxB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,WACN,MAAM,SACN,MAAM,QAqBhB;IAGD;;;;;;;OAOG;IACH,wBALW,MAAM,WACN,MAAM,UACN,MAAM,sBAyBhB;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,iBACN,OAAO,QAyDjB;IAED;;;OAGG;IACH,mBAFY,MAAM,CAejB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACR,OAAO,CAiBlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAgCjB;IAGD;;OAEG;IACH,SAFa,SAAS,CAerB;IAED;;;;;;MAUC;IAED;;;;;;aAwBC;IAiHL;;OAEG;IACH,SA9jBe,MAAM,KACN,MAAM,SACN,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,UA4jBlB;IAEvB;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAZ9B;;kBAgBS,MAAM"}
1
+ {"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH;IAi7BI;;;;;;OAMG;IACH,8BALW,GAAG,SACH,GAAG,UACH,GAAG,GACF,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,uBALW,GAAG,SACH,GAAG,UACH,GAAG,GACF,SAAS,CAKpB;IAED;;;;;;OAMG;IACH,wBALW,GAAG,SACH,GAAG,UACH,GAAG,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;IAED;;;;;;;OAOG;IACH,QANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,KAAK,CAAE,MAAM,CAAC,QAqCxB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,WACN,MAAM,SACN,MAAM,QAqBhB;IAGD;;;;;;;OAOG;IACH,wBALW,MAAM,WACN,MAAM,UACN,MAAM,sBAyBhB;IAED;;;;;OAKG;IACH,UAJW,MAAM,KACN,MAAM,iBACN,OAAO,QAyDjB;IAED;;;OAGG;IACH,mBAFY,MAAM,CAejB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACR,OAAO,CAiBlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAgCjB;IAGD;;OAEG;IACH,SAFa,SAAS,CAerB;IAED;;;;;;MAUC;IAED;;;;;;aAwBC;IA8GD;;OAEG;IACH,YAEC;IAIL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;;kBAUS,MAAM"}
@@ -1077,13 +1077,14 @@ export class Sampler2D {
1077
1077
  return new Sampler2D(data, itemSize, width, height);
1078
1078
  }
1079
1079
 
1080
- }
1081
-
1080
+ /**
1081
+ * @deprecated use {@link write} instead
1082
+ */
1083
+ set(){
1084
+ throw new Error("Deprecated, use 'write' instead")
1085
+ }
1082
1086
 
1083
- /**
1084
- * @deprecated use {@link write} instead
1085
- */
1086
- Sampler2D.prototype.set = Sampler2D.prototype.write;
1087
+ }
1087
1088
 
1088
1089
  /**
1089
1090
  * @readonly
@@ -155,7 +155,7 @@ function test_sampling(source, engine) {
155
155
 
156
156
  input.sampleNearestUV(x / (out.width - 1), y / (out.height - 1), sample);
157
157
 
158
- out.set(x, y, sample);
158
+ out.write(x, y, sample);
159
159
  }
160
160
  }
161
161
  },
@@ -173,7 +173,7 @@ function test_sampling(source, engine) {
173
173
 
174
174
  input.sampleBilinearUV(x / (out.width - 1), y / (out.height - 1), sample);
175
175
 
176
- out.set(x, y, sample);
176
+ out.write(x, y, sample);
177
177
  }
178
178
  }
179
179
  },
@@ -190,7 +190,7 @@ function test_sampling(source, engine) {
190
190
 
191
191
  input.sampleBicubicUV(x / (out.width - 1), y / (out.height - 1), sample);
192
192
 
193
- out.set(x, y, sample);
193
+ out.write(x, y, sample);
194
194
  }
195
195
  }
196
196
  },
@@ -207,7 +207,7 @@ function test_sampling(source, engine) {
207
207
 
208
208
  input.sampleCatmullRomUV(x / (out.width - 1), y / (out.height - 1), sample);
209
209
 
210
- out.set(x, y, sample);
210
+ out.write(x, y, sample);
211
211
  }
212
212
  }
213
213
  },
@@ -72,7 +72,7 @@ export function sampler2d_paint(
72
72
 
73
73
  blendFunction(c1, c0, c3);
74
74
 
75
- destination.set(d_x, d_y, c3);
75
+ destination.write(d_x, d_y, c3);
76
76
 
77
77
  }
78
78
  }