@woosh/meep-engine 2.113.3 → 2.113.6

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 (75) hide show
  1. package/build/meep.cjs +40 -34
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +40 -34
  4. package/package.json +1 -1
  5. package/src/core/binary/bitset_find_clear_gap.d.ts +10 -0
  6. package/src/core/binary/bitset_find_clear_gap.d.ts.map +1 -0
  7. package/src/core/binary/bitset_find_clear_gap.js +30 -0
  8. package/src/core/collection/array/combine_hash.d.ts +7 -0
  9. package/src/core/collection/array/combine_hash.d.ts.map +1 -0
  10. package/src/core/collection/array/combine_hash.js +13 -0
  11. package/src/core/collection/array/computeHashIntegerArray.d.ts.map +1 -1
  12. package/src/core/collection/array/computeHashIntegerArray.js +4 -7
  13. package/src/core/collection/array/typed/uint_array_for_count.d.ts +2 -2
  14. package/src/core/collection/array/typed/uint_array_for_count.d.ts.map +1 -1
  15. package/src/core/collection/array/typed/uint_array_for_count.js +5 -2
  16. package/src/core/collection/map/HashMap.js +1 -1
  17. package/src/core/function/FunctionCompiler.js +3 -3
  18. package/src/core/geom/ConicRay.js +2 -2
  19. package/src/core/geom/Vector4.js +2 -2
  20. package/src/core/math/{isPowerOrTwo.d.ts → isPowerOfTwo.d.ts} +1 -1
  21. package/src/core/math/isPowerOfTwo.d.ts.map +1 -0
  22. package/src/core/model/node-graph/NodeGraph.d.ts +8 -0
  23. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  24. package/src/core/model/node-graph/NodeGraph.js +29 -0
  25. package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
  26. package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
  27. package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
  28. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
  29. package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
  30. package/src/core/primitives/strings/computeStringHash.d.ts.map +1 -1
  31. package/src/core/primitives/strings/computeStringHash.js +13 -4
  32. package/src/engine/animation/curve/compression/downsample_float_array_curve_by_error.js +4 -4
  33. package/src/engine/asset/AssetDescription.js +2 -2
  34. package/src/engine/asset/loaders/material/computeMaterialHash.js +6 -6
  35. package/src/engine/asset/loaders/material/computeTextureHash.js +2 -2
  36. package/src/engine/ecs/animation/Animation.js +2 -2
  37. package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
  38. package/src/engine/ecs/animation/AnimationClip.js +4 -4
  39. package/src/engine/ecs/gui/GUIElement.js +2 -2
  40. package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
  41. package/src/engine/ecs/gui/position/ViewportPosition.js +2 -2
  42. package/src/engine/ecs/ik/IKConstraint.d.ts.map +1 -1
  43. package/src/engine/ecs/ik/IKConstraint.js +3 -3
  44. package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
  45. package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +4 -4
  46. package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +4 -4
  47. package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
  48. package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +3 -3
  49. package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraph.js +2 -2
  50. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.d.ts.map +1 -1
  51. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +8 -8
  52. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
  53. package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +3 -3
  54. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
  55. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +2 -2
  56. package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +2 -2
  57. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts.map +1 -1
  58. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +8 -3
  59. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +1 -1
  60. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +3 -3
  61. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +1 -1
  62. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +4 -4
  63. package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.d.ts.map +1 -1
  64. package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.js +4 -4
  65. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +2 -2
  66. package/src/engine/grid/obstacle/GridObstacle.js +2 -2
  67. package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
  68. package/src/engine/sound/ecs/emitter/SoundEmitter.js +2 -2
  69. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
  70. package/src/engine/sound/ecs/emitter/SoundTrack.js +6 -6
  71. package/src/misc/makeMaterialIconCached.js +2 -2
  72. package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
  73. package/src/view/common/HTMLElementCacheKey.js +5 -5
  74. package/src/core/math/isPowerOrTwo.d.ts.map +0 -1
  75. /package/src/core/math/{isPowerOrTwo.js → isPowerOfTwo.js} +0 -0
package/build/meep.cjs CHANGED
@@ -50535,11 +50535,12 @@ function computeIntegerArrayHash(data, offset, length) {
50535
50535
  }
50536
50536
 
50537
50537
  /**
50538
- * Computes hash on integer values
50538
+ * Computes hash on integer values, useful for building composite hashes
50539
50539
  * @param {...number} value
50540
50540
  * @returns {number}
50541
50541
  */
50542
- function computeHashIntegerArray(...value) {
50542
+ function combine_hash(...value) {
50543
+
50543
50544
  return computeIntegerArrayHash(value, 0, value.length);
50544
50545
  }
50545
50546
 
@@ -50801,7 +50802,7 @@ class Vector4 {
50801
50802
  * @return {number}
50802
50803
  */
50803
50804
  hash() {
50804
- return computeHashIntegerArray(
50805
+ return combine_hash(
50805
50806
  computeHashFloat(this.x),
50806
50807
  computeHashFloat(this.y),
50807
50808
  computeHashFloat(this.z),
@@ -50928,16 +50929,21 @@ function computeStringHash(string) {
50928
50929
 
50929
50930
  const length = string.length;
50930
50931
 
50931
- let hash = 0;
50932
+ let hash = length;
50932
50933
 
50933
50934
  for (let i = 0; i < length; i++) {
50934
- const charCode = string.charCodeAt(i);
50935
+ const code_point = string.charCodeAt(i);
50935
50936
 
50936
- hash = (31 * hash + charCode) | 0;
50937
+ /*
50938
+ * Avoiding potentially expensive multiplication operation by using 2 cheaper operation instead
50939
+ * (h<<5) - h === h*31
50940
+ */
50941
+ hash = ((hash << 5) - hash) + code_point;
50937
50942
 
50938
50943
  }
50939
50944
 
50940
- return hash;
50945
+ // force uint32
50946
+ return hash >>> 0;
50941
50947
  }
50942
50948
 
50943
50949
  /**
@@ -59811,9 +59817,9 @@ function array_swap_one(array, index0, index1) {
59811
59817
  }
59812
59818
 
59813
59819
  /**
59814
- *
59820
+ * @example `const my_array = new ( UintArrayForCount(x) )(length);`
59815
59821
  * @param {number} max_value maximum value to be contained in the array
59816
- * @returns {function} constructor
59822
+ * @returns {function} TypedArray constructor
59817
59823
  */
59818
59824
  function UintArrayForCount(max_value) {
59819
59825
 
@@ -75865,15 +75871,6 @@ class GenericRendererAdapter extends AbstractRenderAdapter {
75865
75871
 
75866
75872
  }
75867
75873
 
75868
- /**
75869
- *
75870
- * @param {Plane} plane
75871
- * @returns {number}
75872
- */
75873
- function planeHash(plane) {
75874
- return mortonEncode_magicbits(plane.normal.x, plane.normal.y, plane.normal.z) ^ plane.constant;
75875
- }
75876
-
75877
75874
  /**
75878
75875
  * @template T
75879
75876
  * @param {T[]} array
@@ -75899,6 +75896,23 @@ function computeHashArray(array, elementHashFunction, thisArg) {
75899
75896
  return hash;
75900
75897
  }
75901
75898
 
75899
+ /**
75900
+ *
75901
+ * @param {THREE.Color} c
75902
+ */
75903
+ function computeHashColor(c) {
75904
+ return c.getHex();
75905
+ }
75906
+
75907
+ /**
75908
+ *
75909
+ * @param {Plane} plane
75910
+ * @returns {number}
75911
+ */
75912
+ function planeHash(plane) {
75913
+ return mortonEncode_magicbits(plane.normal.x, plane.normal.y, plane.normal.z) ^ plane.constant;
75914
+ }
75915
+
75902
75916
  /**
75903
75917
  *
75904
75918
  * @param {THREE.Texture} texture
@@ -75912,14 +75926,6 @@ function textureHashById(texture) {
75912
75926
  return texture.id;
75913
75927
  }
75914
75928
 
75915
- /**
75916
- *
75917
- * @param {THREE.Color} c
75918
- */
75919
- function computeHashColor(c) {
75920
- return c.getHex();
75921
- }
75922
-
75923
75929
  /**
75924
75930
  *
75925
75931
  * @param {Material|MeshStandardMaterial|ShaderMaterial} material
@@ -75927,7 +75933,7 @@ function computeHashColor(c) {
75927
75933
  */
75928
75934
  function computeMaterialHash(material) {
75929
75935
 
75930
- let hash = computeHashIntegerArray(
75936
+ let hash = combine_hash(
75931
75937
  computeHashFloat(material.alphaTest),
75932
75938
  material.blendDst,
75933
75939
  material.blendDstAlpha === null ? 0 : computeHashFloat(material.blendDstAlpha),
@@ -75961,7 +75967,7 @@ function computeMaterialHash(material) {
75961
75967
 
75962
75968
 
75963
75969
  if (material.isMeshStandardMaterial) {
75964
- hash = computeHashIntegerArray(
75970
+ hash = combine_hash(
75965
75971
  hash,
75966
75972
  computeHashColor(material.color),
75967
75973
  computeHashFloat(material.roughness),
@@ -76509,7 +76515,7 @@ function computeTextureHash(t) {
76509
76515
 
76510
76516
  const specificHash = computeSpecificHash(t);
76511
76517
 
76512
- return computeHashIntegerArray(
76518
+ return combine_hash(
76513
76519
  t.mapping,
76514
76520
  t.wrapS,
76515
76521
  t.wrapT,
@@ -85550,7 +85556,7 @@ class AssetDescription {
85550
85556
  * @returns {number}
85551
85557
  */
85552
85558
  hash() {
85553
- return computeHashIntegerArray(
85559
+ return combine_hash(
85554
85560
  computeStringHash(this.path),
85555
85561
  computeStringHash(this.type)
85556
85562
  );
@@ -98230,7 +98236,7 @@ function isArrayEqual(first, second) {
98230
98236
  * @param {KeyValuePair<string,string>} pair
98231
98237
  */
98232
98238
  function computeStringPairHash(pair) {
98233
- return computeHashIntegerArray(
98239
+ return combine_hash(
98234
98240
  computeStringHash(pair.key),
98235
98241
  computeStringHash(pair.value)
98236
98242
  );
@@ -98465,7 +98471,7 @@ class HTMLElementCacheKey {
98465
98471
  const tagHash = computeStringHash(this.tag);
98466
98472
 
98467
98473
 
98468
- this.__hash = computeHashIntegerArray(
98474
+ this.__hash = combine_hash(
98469
98475
  styleHash,
98470
98476
  attributeHash,
98471
98477
  tagHash
@@ -102798,7 +102804,7 @@ class GUIElement {
102798
102804
  * @return {number}
102799
102805
  */
102800
102806
  hash() {
102801
- return computeHashIntegerArray(
102807
+ return combine_hash(
102802
102808
  this.flags,
102803
102809
  computeStringHash(this.klass),
102804
102810
  this.anchor.hash(),
@@ -102935,7 +102941,7 @@ class ViewportPosition {
102935
102941
  }
102936
102942
 
102937
102943
  hash() {
102938
- return computeHashIntegerArray(
102944
+ return combine_hash(
102939
102945
  this.position.hash(),
102940
102946
  this.offset.hash(),
102941
102947
  this.anchor.hash(),