@woosh/meep-engine 2.101.0 → 2.102.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 (48) hide show
  1. package/build/meep.cjs +107 -92
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +107 -92
  4. package/package.json +1 -1
  5. package/src/core/__module.d.ts +4 -0
  6. package/src/core/__module.js +4 -0
  7. package/src/core/geom/3d/cone/computeConePlaneSide.js +1 -1
  8. package/src/core/geom/3d/mat4/{allocate_transform_m4.d.ts → allocate_m4.d.ts} +2 -2
  9. package/src/core/geom/3d/mat4/allocate_m4.d.ts.map +1 -0
  10. package/src/core/geom/3d/mat4/{allocate_transform_m4.js → allocate_m4.js} +1 -1
  11. package/src/core/geom/Vector4.d.ts.map +1 -1
  12. package/src/core/geom/Vector4.js +13 -92
  13. package/src/core/geom/vec4/v4_distance_sqr.d.ts +14 -0
  14. package/src/core/geom/vec4/v4_distance_sqr.d.ts.map +1 -0
  15. package/src/core/geom/vec4/v4_distance_sqr.js +20 -0
  16. package/src/core/geom/vec4/v4_dot.d.ts +14 -0
  17. package/src/core/geom/vec4/v4_dot.d.ts.map +1 -0
  18. package/src/core/geom/vec4/v4_dot.js +19 -0
  19. package/src/core/geom/vec4/v4_length_sqr.d.ts +10 -0
  20. package/src/core/geom/vec4/v4_length_sqr.d.ts.map +1 -0
  21. package/src/core/geom/vec4/v4_length_sqr.js +11 -0
  22. package/src/core/geom/vec4/v4_multiply_mat4.d.ts +8 -0
  23. package/src/core/geom/vec4/v4_multiply_mat4.d.ts.map +1 -0
  24. package/src/core/geom/vec4/v4_multiply_mat4.js +42 -0
  25. package/src/engine/ecs/fow/FogOfWar.js +2 -2
  26. package/src/engine/ecs/transform/Transform.d.ts.map +1 -1
  27. package/src/engine/ecs/transform/Transform.js +2 -2
  28. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts +4 -0
  29. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.d.ts.map +1 -1
  30. package/src/engine/graphics/texture/virtual/tile/VirtualTextureTile.js +4 -0
  31. package/src/engine/graphics/trail/x/NOTES.md +3 -0
  32. package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts +11 -2
  33. package/src/engine/graphics/trail/x/RibbonMaterialX.d.ts.map +1 -1
  34. package/src/engine/graphics/trail/x/RibbonMaterialX.js +28 -13
  35. package/src/engine/graphics/util/projectSphere.js +4 -4
  36. package/src/core/geom/3d/mat4/allocate_transform_m4.d.ts.map +0 -1
  37. package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts +0 -4
  38. package/src/engine/graphics/trail/CodeflowTrailMaterial.d.ts.map +0 -1
  39. package/src/engine/graphics/trail/CodeflowTrailMaterial.js +0 -134
  40. package/src/engine/graphics/trail/TemporalPath.d.ts +0 -39
  41. package/src/engine/graphics/trail/TemporalPath.d.ts.map +0 -1
  42. package/src/engine/graphics/trail/TemporalPath.js +0 -129
  43. package/src/engine/graphics/trail/TemporalPath.spec.d.ts +0 -2
  44. package/src/engine/graphics/trail/TemporalPath.spec.d.ts.map +0 -1
  45. package/src/engine/graphics/trail/TemporalPath.spec.js +0 -5
  46. package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts +0 -9
  47. package/src/engine/graphics/util/composeMatrix4RotationScale.d.ts.map +0 -1
  48. package/src/engine/graphics/util/composeMatrix4RotationScale.js +0 -14
package/build/meep.cjs CHANGED
@@ -806,7 +806,7 @@ const MATRIX_BYTE_SIZE = 4 * 16;
806
806
  * custom Float32Array allocator, allocated memory in continuous chunks
807
807
  * @returns {Float32Array}
808
808
  */
809
- function allocate_transform_m4() {
809
+ function allocate_m4() {
810
810
  if (transform_bucket_cursor >= TRANSFORM_ALLOCATOR_BUCKET_CAPACITY) {
811
811
  transform_bucket = new ArrayBuffer(TRANSFORM_ALLOCATOR_BUCKET_CAPACITY * MATRIX_BYTE_SIZE);
812
812
  transform_bucket_cursor = 0;
@@ -4705,7 +4705,7 @@ class Transform {
4705
4705
  * @readonly
4706
4706
  * @type {Float32Array}
4707
4707
  */
4708
- matrix = allocate_transform_m4();
4708
+ matrix = allocate_m4();
4709
4709
 
4710
4710
  /**
4711
4711
  * Various bit flags, see {@link TransformFlags}
@@ -50637,93 +50637,6 @@ function computeHashIntegerArray(...value) {
50637
50637
  */
50638
50638
 
50639
50639
 
50640
- /**
50641
- *
50642
- * @param {number[]} result
50643
- * @param {number[]} input
50644
- * @param {number[]} mat4
50645
- */
50646
- function v4_applyMatrix4(result, input, mat4) {
50647
- const a0 = mat4[0];
50648
- const a1 = mat4[1];
50649
- const a2 = mat4[2];
50650
- const a3 = mat4[3];
50651
-
50652
- const b0 = mat4[4];
50653
- const b1 = mat4[5];
50654
- const b2 = mat4[6];
50655
- const b3 = mat4[7];
50656
-
50657
- const c0 = mat4[8];
50658
- const c1 = mat4[9];
50659
- const c2 = mat4[10];
50660
- const c3 = mat4[11];
50661
-
50662
- const d0 = mat4[12];
50663
- const d1 = mat4[13];
50664
- const d2 = mat4[14];
50665
- const d3 = mat4[15];
50666
-
50667
- const _x = input[0];
50668
- const _y = input[1];
50669
- const _z = input[2];
50670
- const _w = input[3];
50671
-
50672
- const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
50673
- const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
50674
- const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
50675
- const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
50676
-
50677
- result[0] = x;
50678
- result[1] = y;
50679
- result[2] = z;
50680
- result[3] = w;
50681
- }
50682
-
50683
- /**
50684
- *
50685
- * @param {number} x0
50686
- * @param {number} y0
50687
- * @param {number} z0
50688
- * @param {number} w0
50689
- * @param {number} x1
50690
- * @param {number} y1
50691
- * @param {number} z1
50692
- * @param {number} w1
50693
- * @returns {number}
50694
- */
50695
- function v4_dot(x0, y0, z0, w0, x1, y1, z1, w1) {
50696
- return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
50697
- }
50698
-
50699
- /**
50700
- *
50701
- * @param {number} x
50702
- * @param {number} y
50703
- * @param {number} z
50704
- * @param {number} w
50705
- * @returns {number}
50706
- */
50707
- function v4_length_sqr(x, y, z, w) {
50708
- return x * x + y * y + z * z + w * w;
50709
- }
50710
-
50711
- /**
50712
- *
50713
- * @param {number} x0
50714
- * @param {number} y0
50715
- * @param {number} z0
50716
- * @param {number} w0
50717
- * @param {number} x1
50718
- * @param {number} y1
50719
- * @param {number} z1
50720
- * @param {number} w1
50721
- * @returns {number}
50722
- */
50723
- function v4_distance_sqr(x0, y0, z0, w0, x1, y1, z1, w1) {
50724
- return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
50725
- }
50726
-
50727
50640
  class Vector4 {
50728
50641
  /**
50729
50642
  *
@@ -50808,7 +50721,10 @@ class Vector4 {
50808
50721
  this.w = w;
50809
50722
 
50810
50723
  if (this.onChanged.hasHandlers()) {
50811
- this.onChanged.dispatch(x, y, z, w, _x, _y, _z, _w);
50724
+ this.onChanged.send8(
50725
+ x, y, z, w,
50726
+ _x, _y, _z, _w
50727
+ );
50812
50728
  }
50813
50729
  }
50814
50730
 
@@ -50892,7 +50808,12 @@ class Vector4 {
50892
50808
  * @returns {Vector4}
50893
50809
  */
50894
50810
  add3(v3) {
50895
- return this.set(this.x + v3.x, this.y + v3.y, this.z + v3.z, this.w);
50811
+ return this.set(
50812
+ this.x + v3.x,
50813
+ this.y + v3.y,
50814
+ this.z + v3.z,
50815
+ this.w
50816
+ );
50896
50817
  }
50897
50818
 
50898
50819
  /**
@@ -117807,6 +117728,100 @@ function v2_angle_between(x0, y0, x1, y1) {
117807
117728
  return Math.acos(theta);
117808
117729
  }
117809
117730
 
117731
+ /**
117732
+ *
117733
+ * @param {number[]} result
117734
+ * @param {number[]} input
117735
+ * @param {number[]} mat4
117736
+ */
117737
+ function v4_multiply_mat4(result, input, mat4) {
117738
+ const a0 = mat4[0];
117739
+ const a1 = mat4[1];
117740
+ const a2 = mat4[2];
117741
+ const a3 = mat4[3];
117742
+
117743
+ const b0 = mat4[4];
117744
+ const b1 = mat4[5];
117745
+ const b2 = mat4[6];
117746
+ const b3 = mat4[7];
117747
+
117748
+ const c0 = mat4[8];
117749
+ const c1 = mat4[9];
117750
+ const c2 = mat4[10];
117751
+ const c3 = mat4[11];
117752
+
117753
+ const d0 = mat4[12];
117754
+ const d1 = mat4[13];
117755
+ const d2 = mat4[14];
117756
+ const d3 = mat4[15];
117757
+
117758
+ const _x = input[0];
117759
+ const _y = input[1];
117760
+ const _z = input[2];
117761
+ const _w = input[3];
117762
+
117763
+ const x = a0 * _x + b0 * _y + c0 * _z + d0 * _w;
117764
+ const y = a1 * _x + b1 * _y + c1 * _z + d1 * _w;
117765
+ const z = a2 * _x + b2 * _y + c2 * _z + d2 * _w;
117766
+ const w = a3 * _x + b3 * _y + c3 * _z + d3 * _w;
117767
+
117768
+ result[0] = x;
117769
+ result[1] = y;
117770
+ result[2] = z;
117771
+ result[3] = w;
117772
+ }
117773
+
117774
+ /**
117775
+ *
117776
+ * @param {number} x0
117777
+ * @param {number} y0
117778
+ * @param {number} z0
117779
+ * @param {number} w0
117780
+ * @param {number} x1
117781
+ * @param {number} y1
117782
+ * @param {number} z1
117783
+ * @param {number} w1
117784
+ * @returns {number}
117785
+ */
117786
+ function v4_dot(
117787
+ x0, y0, z0, w0,
117788
+ x1, y1, z1, w1
117789
+ ) {
117790
+
117791
+ return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
117792
+ }
117793
+
117794
+ /**
117795
+ *
117796
+ * @param {number} x
117797
+ * @param {number} y
117798
+ * @param {number} z
117799
+ * @param {number} w
117800
+ * @returns {number}
117801
+ */
117802
+ function v4_length_sqr(x, y, z, w) {
117803
+ return x * x + y * y + z * z + w * w;
117804
+ }
117805
+
117806
+ /**
117807
+ *
117808
+ * @param {number} x0
117809
+ * @param {number} y0
117810
+ * @param {number} z0
117811
+ * @param {number} w0
117812
+ * @param {number} x1
117813
+ * @param {number} y1
117814
+ * @param {number} z1
117815
+ * @param {number} w1
117816
+ * @returns {number}
117817
+ */
117818
+ function v4_distance_sqr(
117819
+ x0, y0, z0, w0,
117820
+ x1, y1, z1, w1
117821
+ ) {
117822
+ return v4_length_sqr(x0 - x1, y0 - y1, z0 - z1, w0 - w1);
117823
+ }
117824
+
117810
117825
  exports.AmbientOcclusionPostProcessEffect = AmbientOcclusionPostProcessEffect;
117811
117826
  exports.Behavior = Behavior;
117812
117827
  exports.BehaviorStatus = BehaviorStatus;
@@ -117839,7 +117854,7 @@ exports.v2_distance = v2_distance;
117839
117854
  exports.v2_dot = v2_dot;
117840
117855
  exports.v2_length_sqr = v2_length_sqr;
117841
117856
  exports.v2_magnitude = v2_magnitude;
117842
- exports.v4_applyMatrix4 = v4_applyMatrix4;
117843
117857
  exports.v4_distance_sqr = v4_distance_sqr;
117844
117858
  exports.v4_dot = v4_dot;
117845
117859
  exports.v4_length_sqr = v4_length_sqr;
117860
+ exports.v4_multiply_mat4 = v4_multiply_mat4;