@woosh/meep-engine 2.113.15 → 2.114.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 (30) hide show
  1. package/build/meep.cjs +20 -4
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +20 -4
  4. package/package.json +1 -1
  5. package/src/core/collection/array/array_filter_by_multiple.d.ts +2 -0
  6. package/src/core/collection/array/array_filter_by_multiple.d.ts.map +1 -1
  7. package/src/core/collection/array/array_filter_by_multiple.js +11 -4
  8. package/src/core/collection/array/array_group_by.d.ts +10 -0
  9. package/src/core/collection/array/array_group_by.d.ts.map +1 -0
  10. package/src/core/collection/array/{groupArrayBy.js → array_group_by.js} +3 -3
  11. package/src/core/collection/array/array_sort_quick.d.ts +13 -0
  12. package/src/core/collection/array/array_sort_quick.d.ts.map +1 -0
  13. package/src/core/collection/array/{arrayQuickSort.js → array_sort_quick.js} +5 -1
  14. package/src/core/collection/table/RowFirstTable.d.ts +2 -2
  15. package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
  16. package/src/core/collection/table/RowFirstTable.js +30 -8
  17. package/src/core/color/Color.d.ts +5 -1
  18. package/src/core/color/Color.d.ts.map +1 -1
  19. package/src/core/color/Color.js +16 -2
  20. package/src/engine/graphics/render/forward_plus/LightManager.js +2 -2
  21. package/src/engine/graphics/sh3/path_tracer/sorting/sort_bvh_nodes_by_distance_to_point.js +2 -2
  22. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.js +2 -2
  23. package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +2 -2
  24. package/src/core/collection/array/arrayQuickSort.d.ts +0 -12
  25. package/src/core/collection/array/arrayQuickSort.d.ts.map +0 -1
  26. package/src/core/collection/array/array_remove_element.d.ts +0 -11
  27. package/src/core/collection/array/array_remove_element.d.ts.map +0 -1
  28. package/src/core/collection/array/array_remove_element.js +0 -16
  29. package/src/core/collection/array/groupArrayBy.d.ts +0 -10
  30. package/src/core/collection/array/groupArrayBy.d.ts.map +0 -1
package/build/meep.cjs CHANGED
@@ -53733,7 +53733,7 @@ class Color {
53733
53733
  this.b = b;
53734
53734
 
53735
53735
  /**
53736
- * Alpha channel
53736
+ * Alpha channel (transparency)
53737
53737
  * Value from 0 to 1
53738
53738
  * @type {number}
53739
53739
  */
@@ -54230,6 +54230,20 @@ class Color {
54230
54230
  return destination;
54231
54231
  }
54232
54232
 
54233
+ /**
54234
+ *
54235
+ * @param {number[]|Float32Array} source
54236
+ * @param {number} [offset]
54237
+ */
54238
+ fromArray(source, offset = 0) {
54239
+ const r = source[offset + 0];
54240
+ const g = source[offset + 1];
54241
+ const b = source[offset + 2];
54242
+ const a = source[offset + 3];
54243
+
54244
+ this.set(r, g, b, a);
54245
+ }
54246
+
54233
54247
 
54234
54248
  /**
54235
54249
  *
@@ -54345,7 +54359,7 @@ class Color {
54345
54359
  }
54346
54360
 
54347
54361
  /**
54348
- * Shortcut
54362
+ * @deprecated use {@link Color#toArray} instead
54349
54363
  * @readonly
54350
54364
  */
54351
54365
  Color.prototype.writeToArray = Color.prototype.toArray;
@@ -106384,6 +106398,7 @@ function computeBinaryDataTypeByPrecision(type, precision) {
106384
106398
  const stack$1 = [];
106385
106399
 
106386
106400
  /**
106401
+ * Quicksort implementation, instead of compare operator, uses scoring function
106387
106402
  * @template T
106388
106403
  * @param {T[]|ArrayLike<number>|Uint32Array} data
106389
106404
  * @param {function(T):number} score_function
@@ -106393,12 +106408,13 @@ const stack$1 = [];
106393
106408
  * @param {function(T[],number, number):*} [swap_operator]
106394
106409
  * @param {*} [swap_context]
106395
106410
  */
106396
- function arrayQuickSort(
106411
+ function array_sort_quick(
106397
106412
  data,
106398
106413
  score_function, score_function_context,
106399
106414
  start = 0, end = data.length - 1,
106400
106415
  swap_operator = array_swap_one, swap_context = undefined
106401
106416
  ) {
106417
+
106402
106418
  if (start >= end) {
106403
106419
  // section of 0 size, nothing to sort
106404
106420
  return;
@@ -111339,7 +111355,7 @@ class LightManager {
111339
111355
  array_copy(visible_light_set.elements, 0, sorted_lights, 0, visible_light_count);
111340
111356
  array_copy(visible_decal_set.elements, 0, sorted_lights, visible_light_count, visible_decal_count);
111341
111357
 
111342
- arrayQuickSort(sorted_lights, this.__sort_visible_light_score, this, 0, expected_sorted_size - 1);
111358
+ array_sort_quick(sorted_lights, this.__sort_visible_light_score, this, 0, expected_sorted_size - 1);
111343
111359
  }
111344
111360
 
111345
111361
  __update_visible_bvh() {