@woosh/meep-engine 2.120.1 → 2.120.3

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 (98) hide show
  1. package/README.md +1 -1
  2. package/editor/process/symbolic/makeGridPositionSymbolDisplay.js +2 -1
  3. package/editor/view/ecs/EntityEditor.js +2 -1
  4. package/editor/view/makeEntityDecorators.js +5 -5
  5. package/package.json +1 -1
  6. package/src/core/binary/BitSet.d.ts +59 -38
  7. package/src/core/binary/BitSet.d.ts.map +1 -1
  8. package/src/core/binary/BitSet.js +76 -55
  9. package/src/core/function/noop.d.ts +4 -1
  10. package/src/core/function/noop.d.ts.map +1 -1
  11. package/src/core/function/noop.js +4 -1
  12. package/src/core/geom/2d/circle/Circle.d.ts +7 -5
  13. package/src/core/geom/2d/circle/Circle.d.ts.map +1 -1
  14. package/src/core/geom/2d/circle/Circle.js +7 -5
  15. package/src/core/geom/2d/circle/circle_area.d.ts +7 -0
  16. package/src/core/geom/2d/circle/circle_area.d.ts.map +1 -0
  17. package/src/core/geom/2d/circle/circle_area.js +8 -0
  18. package/src/core/geom/Quaternion.d.ts.map +1 -1
  19. package/src/core/geom/Quaternion.js +57 -23
  20. package/src/core/geom/Vector4.d.ts.map +1 -1
  21. package/src/core/geom/Vector4.js +27 -5
  22. package/src/core/math/gaussian.d.ts +5 -4
  23. package/src/core/math/gaussian.d.ts.map +1 -1
  24. package/src/core/math/gaussian.js +5 -4
  25. package/src/core/math/matrix/SquareMatrix.d.ts +55 -32
  26. package/src/core/math/matrix/SquareMatrix.d.ts.map +1 -1
  27. package/src/core/math/matrix/SquareMatrix.js +59 -33
  28. package/src/core/math/spline/spline_hermite3_to_bezier.d.ts +6 -5
  29. package/src/core/math/spline/spline_hermite3_to_bezier.d.ts.map +1 -1
  30. package/src/core/math/spline/spline_hermite3_to_bezier.js +15 -11
  31. package/src/core/model/ModuleRegistry.d.ts.map +1 -1
  32. package/src/core/model/ModuleRegistry.js +2 -2
  33. package/src/engine/EngineConfiguration.js +1 -1
  34. package/src/engine/ecs/Entity.d.ts.map +1 -1
  35. package/src/engine/ecs/Entity.js +44 -4
  36. package/src/engine/ecs/EntityBuilderUtils.js +1 -1
  37. package/src/engine/ecs/EntityComponentDataset.d.ts +1 -1
  38. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  39. package/src/engine/ecs/EntityComponentDataset.js +56 -17
  40. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  41. package/src/engine/ecs/EntityManager.js +16 -13
  42. package/src/engine/ecs/EntityObserver.d.ts.map +1 -1
  43. package/src/engine/ecs/EntityObserver.js +2 -10
  44. package/src/engine/ecs/EntityReference.d.ts +24 -2
  45. package/src/engine/ecs/EntityReference.d.ts.map +1 -1
  46. package/src/engine/ecs/EntityReference.js +42 -6
  47. package/src/engine/ecs/EventType.d.ts +10 -0
  48. package/src/engine/ecs/EventType.d.ts.map +1 -0
  49. package/src/engine/ecs/EventType.js +10 -0
  50. package/src/engine/ecs/System.d.ts.map +1 -1
  51. package/src/engine/ecs/System.js +1 -12
  52. package/src/engine/ecs/computeSystemName.d.ts +8 -0
  53. package/src/engine/ecs/computeSystemName.d.ts.map +1 -0
  54. package/src/engine/ecs/computeSystemName.js +10 -0
  55. package/src/engine/ecs/parent/ParentEntitySystem.js +1 -1
  56. package/src/engine/ecs/terrain/TerrainClouds.d.ts +43 -10
  57. package/src/engine/ecs/terrain/TerrainClouds.d.ts.map +1 -1
  58. package/src/engine/ecs/terrain/TerrainClouds.js +38 -2
  59. package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
  60. package/src/engine/ecs/terrain/ecs/Terrain.js +6 -0
  61. package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.d.ts.map +1 -1
  62. package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +3 -1
  63. package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.d.ts.map +1 -1
  64. package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.js +7 -7
  65. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +349 -50
  66. package/src/engine/input/devices/InputDeviceSwitch.d.ts +4 -0
  67. package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
  68. package/src/engine/input/devices/InputDeviceSwitch.js +4 -2
  69. package/src/engine/input/devices/KeyCodes.d.ts.map +1 -1
  70. package/src/engine/input/devices/KeyCodes.js +1 -0
  71. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  72. package/src/engine/input/devices/KeyboardDevice.js +28 -3
  73. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +3 -0
  74. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts.map +1 -1
  75. package/src/engine/intelligence/behavior/ecs/DieBehavior.js +4 -0
  76. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +17 -0
  77. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts.map +1 -0
  78. package/src/engine/intelligence/behavior/ecs/KillBehavior.js +47 -0
  79. package/src/engine/knowledge/database/StaticKnowledgeDataTable.d.ts.map +1 -1
  80. package/src/engine/knowledge/database/StaticKnowledgeDataTable.js +3 -0
  81. package/src/engine/ui/notification/NotificationManager.d.ts.map +1 -1
  82. package/src/engine/ui/notification/NotificationManager.js +2 -1
  83. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts +7 -6
  84. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
  85. package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +51 -43
  86. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +0 -48
  87. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +0 -1
  88. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +0 -1
  89. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +0 -1
  90. package/editor/actions/concrete/SelectionAddAction.d.ts.map +0 -1
  91. package/editor/actions/concrete/SelectionClearAction.d.ts.map +0 -1
  92. package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +0 -1
  93. package/editor/actions/concrete/TransformModifyAction.d.ts.map +0 -1
  94. package/editor/actions/concrete/WriteGridValueAction.d.ts.map +0 -1
  95. package/src/engine/ecs/read_entity_reference.d.ts +0 -9
  96. package/src/engine/ecs/read_entity_reference.d.ts.map +0 -1
  97. package/src/engine/ecs/read_entity_reference.js +0 -15
  98. package/src/engine/ecs/transform/Transform.editor.schema.json +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Quaternion.js"],"names":[],"mappings":";AAqBA;IAqOI;;;;;OAKG;IACH,2BAJW,OAAO,SACP,MAAM,GACJ,UAAU,CAQtB;IAylCD;;;;OAIG;IACH,kCAFa,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,6BALW,UAAU,QACV,UAAU,MACV,UAAU,aACV,MAAM,QAkBhB;IA53CD;;;;;;;OAOG;IACH,gBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EA+BhB;IA1BG;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IACV;;;OAGG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,oBAFU,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEnD;IAqBjC,iBAEC;IAlBD,gBAEC;IAkBD,iBAEC;IAlBD,gBAEC;IAkBD,iBAEC;IAlBD,gBAEC;IAkBD,iBAEC;IAlBD,gBAEC;IA+BD;;;;;;;;OAQG;IACH,kBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,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AOtB;IAED;;;OAGG;IACH,gCAFW,YAAY,QAStB;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,kBAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAShB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,EAAE,WACR,MAAM,GACJ,MAAM,EAAE,CASpB;IAED;;;;OAIG;IACH,cAHW,UAAU,GACR,OAAO,CAQnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAQlB;IAED;;;;;OAKG;IACH,qBAJW,UAAU,cACV,MAAM,GACL,OAAO,CAIlB;IAED;;;;;;;;;OASG;IACH,uBAKC;IAED;;;;OAIG;IACH,gBAHW,MAAW,MAAM,GAChB,UAAU,CAkBrB;IAED,mBAEC;IAwDL,mBAhKe,MAAM,EAAE,WACR,MAAM,UA+JS;IAC9B,kBAnJe,MAAM,EAAE,WACR,MAAM,KACJ,MAAM,EAAE,CAiJG;IAC5B,kBApJe,MAAM,EAAE,WACR,MAAM,KACJ,MAAM,EAAE,CAkJG;IAC5B,qBA1wBe,MAAM,KACN,MAAM,KACN,MAAM,UAwwBe;IA1zChC;;OAEG;IACH,sDAOC;CA2yCJ;;kBASS,UAAU;;mBA35CD,4BAA4B;oBAW3B,cAAc"}
1
+ {"version":3,"file":"Quaternion.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Quaternion.js"],"names":[],"mappings":";AAqBA;;;GAGG;AACH;IAqOI;;;;;OAKG;IACH,2BAJW,OAAO,SACP,MAAM,GACJ,UAAU,CAQtB;IAunCD;;;;OAIG;IACH,kCAFa,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,UAAU,CAQtB;IAED;;;;;;OAMG;IACH,6BALW,UAAU,QACV,UAAU,MACV,UAAU,aACV,MAAM,QAkBhB;IA15CD;;;;;;;OAOG;IACH,gBANW,MAAM,MACN,MAAM,MACN,MAA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UA+JS;IAC9B,kBAnJe,MAAM,EAAE,WACR,MAAM,KACJ,MAAM,EAAE,CAiJG;IAC5B,kBApJe,MAAM,EAAE,WACR,MAAM,KACJ,MAAM,EAAE,CAkJG;IAC5B,qBAtxBe,MAAM,KACN,MAAM,KACN,MAAM,gBAoxBe;IAx1ChC;;OAEG;IACH,sDAOC;CAy0CJ;;kBASS,UAAU;;mBA77CD,4BAA4B;oBAW3B,cAAc"}
@@ -19,6 +19,10 @@ const scratch_v3_c = new Vector3();
19
19
  const sin = Math.sin;
20
20
  const cos = Math.cos;
21
21
 
22
+ /**
23
+ * Rotation representation in 3d space
24
+ * @see https://en.wikipedia.org/wiki/Quaternion
25
+ */
22
26
  class Quaternion {
23
27
  /**
24
28
  *
@@ -268,6 +272,8 @@ class Quaternion {
268
272
  * @param {number} angle
269
273
  */
270
274
  fromAxisAngle(axis, angle) {
275
+ assert.defined(axis,'axis');
276
+
271
277
  this._fromAxisAngle(axis.x, axis.y, axis.z, angle);
272
278
  }
273
279
 
@@ -384,6 +390,10 @@ class Quaternion {
384
390
  return rad;
385
391
  }
386
392
 
393
+ /**
394
+ *
395
+ * @returns {this}
396
+ */
387
397
  normalize() {
388
398
  let l = this.length();
389
399
 
@@ -395,12 +405,14 @@ class Quaternion {
395
405
  const m = 1 / l;
396
406
  this.multiplyScalar(m);
397
407
  }
408
+
409
+ return this;
398
410
  }
399
411
 
400
412
  /**
401
413
  *
402
414
  * @param {number} val
403
- * @return {Quaternion}
415
+ * @return {this}
404
416
  */
405
417
  multiplyScalar(val) {
406
418
  return this.set(
@@ -413,15 +425,17 @@ class Quaternion {
413
425
 
414
426
  /**
415
427
  * @param {Quaternion} other
428
+ * @returns {this}
416
429
  */
417
430
  multiply(other) {
418
- this.multiplyQuaternions(this, other);
431
+ return this.multiplyQuaternions(this, other);
419
432
  }
420
433
 
421
434
  /**
422
435
  *
423
436
  * @param {Quaternion} first
424
437
  * @param {Quaternion} second
438
+ * @returns {this}
425
439
  */
426
440
  multiplyQuaternions(first, second) {
427
441
  const aX = first.x;
@@ -434,7 +448,7 @@ class Quaternion {
434
448
  const bZ = second.z;
435
449
  const bW = second.w;
436
450
 
437
- this._multiplyQuaternions(aX, aY, aZ, aW, bX, bY, bZ, bW)
451
+ return this._multiplyQuaternions(aX, aY, aZ, aW, bX, bY, bZ, bW)
438
452
  }
439
453
 
440
454
  /**
@@ -447,9 +461,12 @@ class Quaternion {
447
461
  * @param {number} by
448
462
  * @param {number} bz
449
463
  * @param {number} bw
450
- * @return {Quaternion}
464
+ * @returns {this}
451
465
  */
452
- _multiplyQuaternions(ax, ay, az, aw, bx, by, bz, bw) {
466
+ _multiplyQuaternions(
467
+ ax, ay, az, aw,
468
+ bx, by, bz, bw
469
+ ) {
453
470
 
454
471
  // see http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
455
472
 
@@ -478,9 +495,12 @@ class Quaternion {
478
495
  *
479
496
  * @param {Quaternion} other
480
497
  * @param {number} max_delta in radians
498
+ * @returns {this}
481
499
  */
482
500
  rotateTowards(other, max_delta) {
483
501
  Quaternion.rotateTowards(this, this, other, max_delta);
502
+
503
+ return this;
484
504
  }
485
505
 
486
506
  /**
@@ -504,9 +524,11 @@ class Quaternion {
504
524
  * @param {function():number} random
505
525
  */
506
526
  setRandom(random) {
527
+ assert.isFunction(random,'random');
528
+
507
529
  this.set(random(), random(), random(), random());
508
530
 
509
- this.normalize();
531
+ return this.normalize();
510
532
  }
511
533
 
512
534
  /**
@@ -655,6 +677,7 @@ class Quaternion {
655
677
  * @param {number} x angle in X axis in radians
656
678
  * @param {number} y angle in Y axis in radians
657
679
  * @param {number} z angle in Z axis in radians
680
+ * @returns {this}
658
681
  */
659
682
  fromEulerAnglesXYZ(x, y, z) {
660
683
  const half_x = x * 0.5;
@@ -674,7 +697,7 @@ class Quaternion {
674
697
  const _z = c1 * c2 * s3 + s1 * s2 * c3;
675
698
  const _w = c1 * c2 * c3 - s1 * s2 * s3;
676
699
 
677
- this.set(_x, _y, _z, _w);
700
+ return this.set(_x, _y, _z, _w);
678
701
  }
679
702
 
680
703
  /**
@@ -685,6 +708,7 @@ class Quaternion {
685
708
  * @param {number} x angle in X axis in radians
686
709
  * @param {number} y angle in Y axis in radians
687
710
  * @param {number} z angle in Z axis in radians
711
+ * @returns {this}
688
712
  */
689
713
  fromEulerAnglesYXZ(x, y, z) {
690
714
  const scaled_x = x * 0.5;
@@ -704,7 +728,7 @@ class Quaternion {
704
728
  const _z = c1 * c2 * s3 - s1 * s2 * c3;
705
729
  const _w = c1 * c2 * c3 + s1 * s2 * s3;
706
730
 
707
- this.set(_x, _y, _z, _w);
731
+ return this.set(_x, _y, _z, _w);
708
732
  }
709
733
 
710
734
  /**
@@ -715,6 +739,7 @@ class Quaternion {
715
739
  * @param {number} x angle in X axis in radians
716
740
  * @param {number} y angle in Y axis in radians
717
741
  * @param {number} z angle in Z axis in radians
742
+ * @returns {this}
718
743
  */
719
744
  fromEulerAnglesZXY(x, y, z) {
720
745
  const scaled_x = x * 0.5;
@@ -734,7 +759,7 @@ class Quaternion {
734
759
  const _z = c1 * c2 * s3 + s1 * s2 * c3;
735
760
  const _w = c1 * c2 * c3 - s1 * s2 * s3;
736
761
 
737
- this.set(_x, _y, _z, _w);
762
+ return this.set(_x, _y, _z, _w);
738
763
  }
739
764
 
740
765
  /**
@@ -745,6 +770,7 @@ class Quaternion {
745
770
  * @param {number} x angle in X axis in radians
746
771
  * @param {number} y angle in Y axis in radians
747
772
  * @param {number} z angle in Z axis in radians
773
+ * @returns {this}
748
774
  */
749
775
  fromEulerAnglesZYX(x, y, z) {
750
776
  const scaled_x = x * 0.5;
@@ -764,7 +790,7 @@ class Quaternion {
764
790
  const _z = c1 * c2 * s3 - s1 * s2 * c3;
765
791
  const _w = c1 * c2 * c3 + s1 * s2 * s3;
766
792
 
767
- this.set(_x, _y, _z, _w);
793
+ return this.set(_x, _y, _z, _w);
768
794
  }
769
795
 
770
796
  /**
@@ -775,6 +801,7 @@ class Quaternion {
775
801
  * @param {number} x angle in X axis in radians
776
802
  * @param {number} y angle in Y axis in radians
777
803
  * @param {number} z angle in Z axis in radians
804
+ * @returns {this}
778
805
  */
779
806
  fromEulerAnglesYZX(x, y, z) {
780
807
  const scaled_x = x * 0.5;
@@ -794,7 +821,7 @@ class Quaternion {
794
821
  const _z = c1 * c2 * s3 - s1 * s2 * c3;
795
822
  const _w = c1 * c2 * c3 - s1 * s2 * s3;
796
823
 
797
- this.set(_x, _y, _z, _w);
824
+ return this.set(_x, _y, _z, _w);
798
825
  }
799
826
 
800
827
  /**
@@ -805,6 +832,7 @@ class Quaternion {
805
832
  * @param {number} x angle in X axis in radians
806
833
  * @param {number} y angle in Y axis in radians
807
834
  * @param {number} z angle in Z axis in radians
835
+ * @returns {this}
808
836
  */
809
837
  fromEulerAnglesXZY(x, y, z) {
810
838
  const scaled_x = x * 0.5;
@@ -824,7 +852,7 @@ class Quaternion {
824
852
  const _z = c1 * c2 * s3 + s1 * s2 * c3;
825
853
  const _w = c1 * c2 * c3 + s1 * s2 * s3;
826
854
 
827
- this.set(_x, _y, _z, _w);
855
+ return this.set(_x, _y, _z, _w);
828
856
  }
829
857
 
830
858
  /**
@@ -832,6 +860,7 @@ class Quaternion {
832
860
  * Based on blog post: http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
833
861
  * @param {Vector3} from
834
862
  * @param {Vector3} to
863
+ * @returns {this}
835
864
  */
836
865
  fromUnitVectors(from, to) {
837
866
  assert.ok(from.isNormalized(), `from vector is not normalized, length = ${from.length()}`);
@@ -890,7 +919,7 @@ class Quaternion {
890
919
  const wZ = inv_m * crossZ;
891
920
 
892
921
 
893
- this.set(
922
+ return this.set(
894
923
  wX,
895
924
  wY,
896
925
  wZ,
@@ -900,12 +929,13 @@ class Quaternion {
900
929
 
901
930
  /**
902
931
  * @param {number[]} m4x4
932
+ * @returns {this}
903
933
  */
904
934
  setFromRotationMatrix(m4x4) {
905
935
  assert.defined(m4x4, 'm4x4');
906
936
  assert.isArrayLike(m4x4, 'm4x4');
907
937
 
908
- this.__setFromRotationMatrix(
938
+ return this.__setFromRotationMatrix(
909
939
  m4x4[0], m4x4[4], m4x4[8],
910
940
  m4x4[1], m4x4[5], m4x4[9],
911
941
  m4x4[2], m4x4[6], m4x4[10]
@@ -926,7 +956,7 @@ class Quaternion {
926
956
  * @param {number} m31
927
957
  * @param {number} m32
928
958
  * @param {number} m33
929
- * @returns {Quaternion}
959
+ * @returns {this}
930
960
  */
931
961
  __setFromRotationMatrix(
932
962
  m11, m12, m13,
@@ -1008,18 +1038,21 @@ class Quaternion {
1008
1038
  * Linear interpolation
1009
1039
  * @param {Quaternion} other
1010
1040
  * @param {number} t fractional value between 0 and 1
1041
+ * @returns {this}
1011
1042
  */
1012
1043
  lerp(other, t) {
1013
1044
 
1014
- this.lerpQuaternions(this, other, t);
1045
+ return this.lerpQuaternions(this, other, t);
1015
1046
 
1016
1047
  }
1017
1048
 
1018
1049
  /**
1019
- *
1050
+ * Linear interpolation of two quaternions
1051
+ * Pretty good, not as good as slerp, but close enough for most application
1020
1052
  * @param {Quaternion} first
1021
1053
  * @param {Quaternion} second
1022
1054
  * @param {number} t
1055
+ * @returns {this}
1023
1056
  */
1024
1057
  lerpQuaternions(first, second, t) {
1025
1058
 
@@ -1034,7 +1067,7 @@ class Quaternion {
1034
1067
  const w = lerp(first.w, second.w, t);
1035
1068
 
1036
1069
 
1037
- this.set(x, y, z, w);
1070
+ return this.set(x, y, z, w);
1038
1071
  }
1039
1072
 
1040
1073
  /**
@@ -1042,6 +1075,7 @@ class Quaternion {
1042
1075
  * @param {Quaternion} from
1043
1076
  * @param {Quaternion} to
1044
1077
  * @param {number} t coefficient, how much between the input quats?
1078
+ * @returns {this}
1045
1079
  */
1046
1080
  slerpQuaternions(from, to, t) {
1047
1081
  assert.isNumber(t, 't');
@@ -1095,7 +1129,7 @@ class Quaternion {
1095
1129
  const _z = scale0 * az + scale1 * bz;
1096
1130
  const _w = scale0 * aw + scale1 * bw;
1097
1131
 
1098
- this.set(_x, _y, _z, _w);
1132
+ return this.set(_x, _y, _z, _w);
1099
1133
  }
1100
1134
 
1101
1135
 
@@ -1110,7 +1144,7 @@ class Quaternion {
1110
1144
 
1111
1145
  /**
1112
1146
  *
1113
- * @param {function} handler
1147
+ * @param {function(x:number,y:number,z:number,w:number)} handler
1114
1148
  */
1115
1149
  process(handler) {
1116
1150
  handler(this.x, this.y, this.z, this.w);
@@ -1121,7 +1155,7 @@ class Quaternion {
1121
1155
  /**
1122
1156
  *
1123
1157
  * @param {Quaternion} other
1124
- * @returns {Quaternion}
1158
+ * @returns {this}
1125
1159
  */
1126
1160
  copy(other) {
1127
1161
  return this.set(other.x, other.y, other.z, other.w);
@@ -1145,7 +1179,7 @@ class Quaternion {
1145
1179
  * @param {number} y
1146
1180
  * @param {number} z
1147
1181
  * @param {number} w
1148
- * @returns {Quaternion}
1182
+ * @returns {this}
1149
1183
  */
1150
1184
  set(x, y, z, w) {
1151
1185
  assert.isNumber(x, 'x');
@@ -1180,7 +1214,7 @@ class Quaternion {
1180
1214
 
1181
1215
  /**
1182
1216
  *
1183
- * @returns {Quaternion}
1217
+ * @returns {this}
1184
1218
  */
1185
1219
  conjugate() {
1186
1220
  return this.set(-this.x, -this.y, -this.z, this.w);
@@ -1 +1 @@
1
- {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":";AAMA;IA2YI;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IAxZD;;;;;;;;OAQG;IACH,4DAOC;IANG,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IAEV,eAA6B;IAOjC;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAVD,SAMW,MAAM,CAJhB;IAcD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAVD,SAMW,MAAM,CAJhB;IAcD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IA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DAOC;CAiBJ"}
1
+ {"version":3,"file":"Vector4.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector4.js"],"names":[],"mappings":";AAMA;IAiaI;;;;;;OAMG;IACH,gBALW,OAAO,MACP,OAAO,qBAEP,OAAO,QASjB;IA9aD;;;;;;;;OAQG;IACH,gBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAiBhB;IANG,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IAEV,eAA6B;IAWjC;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAkBD;;;OAGG;IACH,SAFW,MAAM,EAIhB;IAdD;;;OAGG;IACH,SAFa,MAAM,CAIlB;IAUD;;;;OAIG;IACH,qBAHW,MAAM,EAAE,WACR,MAAM,QAShB;IAED;;;;OAIG;IACH,oBAHW,MAAM,EAAE,WACR,MAAM,QAOhB;IAED;;;;;;;OAOG;IACH,iDAFa,OAAO,CAkCnB;IAED;;;OAGG;IACH,oBAFW,OAAO,QAQjB;IAED;;;;OAIG;IACH,+BAFa,OAAO,CAOnB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,kBAlBW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAoBnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,MAAM,CAIlB;IAED;;;;OAIG;IACH,SAHW,OAAO,GAAC,OAAO,GACb,OAAO,CASnB;IAED;;;;OAIG;IACH,qBAHW,OAAO,GACL,OAAO,CAUnB;IAED;;;;OAIG;IACH,WAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,SAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,mBAFW,UAAU,QAyBpB;IAED;;;;OAIG;IACH,aAHW,OAAO,GACL,OAAO,CAInB;IAED;;;OAGG;IACH,QAFY,MAAM,CASjB;IAED;;;;OAIG;IACH,gBAJW,OAAO,MACP,OAAO,mBAKjB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAOlB;IAED;;OAEG;IACH,WAFa,MAAM,EAAE,CAQpB;IAED;;;;OAIG;IACH,mBAHW,MAAM,EAAE,UACR,MAAM,QAIhB;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;OAGG;IACH,uBAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,yBAFW,YAAY,QAStB;IAED,sDAOC;CAiBJ"}
@@ -7,14 +7,20 @@ import { computeHashFloat } from "../primitives/numbers/computeHashFloat.js";
7
7
  class Vector4 {
8
8
  /**
9
9
  *
10
- * @param {Number} [x=0]
11
- * @param {Number} [y=0]
12
- * @param {Number} [z=0]
13
- * @param {Number} [w=0]
10
+ * @param {number} [x=0]
11
+ * @param {number} [y=0]
12
+ * @param {number} [z=0]
13
+ * @param {number} [w=0]
14
14
  * @constructor
15
15
  * @class
16
16
  */
17
- constructor(x = 0, y = 0, z = 0, w = 0) {
17
+ constructor(
18
+ x = 0,
19
+ y = 0,
20
+ z = 0,
21
+ w = 0
22
+ ) {
23
+
18
24
  this.x = x;
19
25
  this.y = y;
20
26
  this.z = z;
@@ -23,6 +29,10 @@ class Vector4 {
23
29
  this.onChanged = new Signal();
24
30
  }
25
31
 
32
+ /**
33
+ *
34
+ * @returns {number}
35
+ */
26
36
  get 0() {
27
37
  return this.x;
28
38
  }
@@ -35,6 +45,10 @@ class Vector4 {
35
45
  this.x = v;
36
46
  }
37
47
 
48
+ /**
49
+ *
50
+ * @returns {number}
51
+ */
38
52
  get 1() {
39
53
  return this.y;
40
54
  }
@@ -47,6 +61,10 @@ class Vector4 {
47
61
  this.y = v;
48
62
  }
49
63
 
64
+ /**
65
+ *
66
+ * @returns {number}
67
+ */
50
68
  get 2() {
51
69
  return this.z;
52
70
  }
@@ -59,6 +77,10 @@ class Vector4 {
59
77
  this.z = v;
60
78
  }
61
79
 
80
+ /**
81
+ *
82
+ * @returns {number}
83
+ */
62
84
  get 3() {
63
85
  return this.w;
64
86
  }
@@ -1,8 +1,9 @@
1
1
  /**
2
- *
3
- * @param {number} sigma distance from mean
4
- * @param {number} v Variance
5
- * @returns {number}
2
+ * This is not the standard gaussian.
3
+ * It lacks the normalization factor, standard gaussian would be weighted by `1 / √(2π * variance)`
4
+ * @param {number} sigma Standard deviation. Distance from mean. Represents the "width" of the Gaussian-like curve. Note: The parameter is named `sigma`, but its placement in the formula means it scales inversely to the usual effect of sigma.
5
+ * @param {number} v Variance. Represents the "height" or "amplitude" of the curve, but at a distance from the mean. Larger variance values result in larger function values further away from the mean (0).
6
+ * @returns {number} Ranges from 0 to 1 (exclusive of 0)
6
7
  */
7
8
  export function gaussian(sigma: number, v: number): number;
8
9
  //# sourceMappingURL=gaussian.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gaussian.d.ts","sourceRoot":"","sources":["../../../../src/core/math/gaussian.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,gCAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAOlB"}
1
+ {"version":3,"file":"gaussian.d.ts","sourceRoot":"","sources":["../../../../src/core/math/gaussian.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,gCAJW,MAAM,KACN,MAAM,GACJ,MAAM,CAOlB"}
@@ -1,8 +1,9 @@
1
1
  /**
2
- *
3
- * @param {number} sigma distance from mean
4
- * @param {number} v Variance
5
- * @returns {number}
2
+ * This is not the standard gaussian.
3
+ * It lacks the normalization factor, standard gaussian would be weighted by `1 / √(2π * variance)`
4
+ * @param {number} sigma Standard deviation. Distance from mean. Represents the "width" of the Gaussian-like curve. Note: The parameter is named `sigma`, but its placement in the formula means it scales inversely to the usual effect of sigma.
5
+ * @param {number} v Variance. Represents the "height" or "amplitude" of the curve, but at a distance from the mean. Larger variance values result in larger function values further away from the mean (0).
6
+ * @returns {number} Ranges from 0 to 1 (exclusive of 0)
6
7
  */
7
8
  export function gaussian(sigma, v) {
8
9
  const v2 = v * v;
@@ -1,93 +1,116 @@
1
+ /**
2
+ * Represents a square matrix (number of rows equals number of columns).
3
+ * Data is stored in a typed array.
4
+ */
1
5
  export class SquareMatrix {
2
6
  /**
3
- *
4
- * @param {number} size
5
- * @param {BinaryDataType|string} type
7
+ * @param {number} size Side length of the matrix (e.g. '3' for a 3x3 matrix).
8
+ * @param {BinaryDataType|string} type Data type of the elements. Must be a valid BinaryDataType (e.g., "uint8", "float32").
9
+ * @throws {Error} If the provided type is not supported.
6
10
  */
7
11
  constructor(size: number, type: BinaryDataType | string);
8
12
  /**
9
- *
13
+ * Side length of the matrix.
10
14
  * @type {number}
11
15
  */
12
16
  size: number;
13
17
  /**
14
- *
18
+ * Data type of matrix elements.
15
19
  * @type {BinaryDataType}
16
20
  */
17
21
  type: BinaryDataType;
18
22
  /**
23
+ * Matrix data, stored as a typed array. Column-major order.
19
24
  * @type {number[]}
20
25
  */
21
26
  data: number[];
27
+ /**
28
+ * @returns {number} Side length of the matrix.
29
+ */
22
30
  get n(): number;
31
+ /**
32
+ * @returns {number} Total number of elements in the matrix (size * size).
33
+ */
23
34
  get length(): number;
35
+ /**
36
+ * Returns direct reference to underlying data, modifying it WILL affect the matrix.
37
+ * @returns {number[]}
38
+ */
24
39
  get val(): number[];
25
- fill(v: any): void;
26
40
  /**
27
- *
28
- * @param {SquareMatrix} other
41
+ * Fills the entire matrix with the given value.
42
+ * @param {number} v Value to fill the matrix with.
43
+ * @returns {void}
44
+ */
45
+ fill(v: number): void;
46
+ /**
47
+ * Subtracts another matrix from this matrix (this = this - other).
48
+ * @param {SquareMatrix} other The matrix to subtract. Must be of the same size.
29
49
  */
30
50
  subtract(other: SquareMatrix): void;
31
51
  /**
32
- * Component-size subtraction
33
- * @param {SquareMatrix} a
34
- * @param {SquareMatrix} b
52
+ * Subtracts matrix 'b' from matrix 'a', storing the result in this matrix (this = a - b).
53
+ * Component-wise operation.
54
+ * @param {SquareMatrix} a The first matrix.
55
+ * @param {SquareMatrix} b The second matrix.
35
56
  */
36
57
  subtractMatrices(a: SquareMatrix, b: SquareMatrix): void;
37
58
  /**
38
- * Individually negate each value in the matrix
59
+ * Negates all elements of the matrix (multiplies each element by -1).
39
60
  */
40
61
  negate(): void;
41
62
  /**
42
- * Set all cells to 0
63
+ * Sets all elements of the matrix to 0.
43
64
  */
44
65
  clear(): void;
45
66
  /**
46
67
  * Set diagonal to 1
68
+ * NOTE: if the other cells are 0s - it will produce identity matrix, but those cells will not be written explicitly
47
69
  */
48
70
  eye(): void;
49
71
  /**
50
- *
51
- * @param {SquareMatrix} other
72
+ * Copies the elements of another matrix into this matrix.
73
+ * @param {SquareMatrix} other The matrix to copy from. Must be the same size.
52
74
  */
53
75
  copy(other: SquareMatrix): void;
54
76
  /**
55
- *
56
- * @return {SquareMatrix}
77
+ * Creates a new matrix that is a copy of this matrix.
78
+ * @returns {SquareMatrix} A new matrix with the same elements.
57
79
  */
58
80
  clone(): SquareMatrix;
59
81
  /**
60
- * Transpose matrix
82
+ * Transposes the matrix in-place (swaps rows and columns).
61
83
  */
62
84
  transpose(): void;
63
85
  /**
64
- *
65
- * @param {number[]} arr
86
+ * Populates matrix from a 1D array.
87
+ * @param {number[]} arr Source array. Must have at least size*size elements.
66
88
  */
67
89
  fromArray(arr: number[]): void;
68
90
  /**
69
- *
70
- * @param {number[]} [destination]
71
- * @param {number} [offset]
91
+ * Copies matrix elements into a 1D array.
92
+ * @param {number[]} [destination] Array to store matrix into. Creates a new array if not provided.
93
+ * @param {number} [offset=0] Starting index in the destination array.
94
+ * @returns {number[]} The array containing the matrix data.
72
95
  */
73
96
  toArray(destination?: number[], offset?: number): number[];
74
97
  /**
75
- *
76
- * @param {number} row_index
77
- * @param {number} column_index
78
- * @param {number} value
98
+ * Sets the value of a cell in the matrix.
99
+ * @param {number} row_index Row index (0-based).
100
+ * @param {number} column_index Column index (0-based).
101
+ * @param {number} value The value to set.
79
102
  */
80
103
  setCellValue(row_index: number, column_index: number, value: number): void;
81
104
  /**
82
- *
83
- * @param {number} row_index
84
- * @param {number} column_index
85
- * @return {number}
105
+ * Retrieves the value of a cell in the matrix.
106
+ * @param {number} row_index Row index (0-based).
107
+ * @param {number} column_index Column index (0-based).
108
+ * @returns {number} The value of the cell.
86
109
  */
87
110
  getCellValue(row_index: number, column_index: number): number;
88
111
  /**
89
112
  * Read values at the diagonal, from left to right, top to bottom
90
- * @param {number[]|Float32Array|Float64Array} result
113
+ * @param {number[]|Float32Array|Float64Array} result Array to store the diagonal.
91
114
  */
92
115
  readDiagonal(result: number[] | Float32Array | Float64Array): void;
93
116
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SquareMatrix.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/matrix/SquareMatrix.js"],"names":[],"mappings":"AAIA;IACI;;;;OAIG;IACH,kBAHW,MAAM,QACN,cAAc,GAAC,MAAM,EA2B/B;IAhBG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,MAFU,cAAc,CAER;IAEhB;;OAEG;IACH,MAFU,MAAM,EAAE,CAEqB;IAG3C,gBAEC;IAED,qBAEC;IAED,oBAEC;IAED,mBAEC;IAED;;;OAGG;IACH,gBAFW,YAAY,QAItB;IAED;;;;OAIG;IACH,oBAHW,YAAY,KACZ,YAAY,QAiBtB;IAED;;OAEG;IACH,eAMC;IAED;;OAEG;IACH,cAEC;IAED;;OAEG;IACH,YAMC;IAED;;;OAGG;IACH,YAFW,YAAY,QAMtB;IAED;;;OAGG;IACH,SAFY,YAAY,CAQvB;IAED;;OAEG;IACH,kBAcC;IAED;;;OAGG;IACH,eAFW,MAAM,EAAE,QAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,EAAE,WACR,MAAM,YAMhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,SACN,MAAM,QAYhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,GACL,MAAM,CAWjB;IAED;;;OAGG;IACH,qBAFW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAU5C;CACJ"}
1
+ {"version":3,"file":"SquareMatrix.d.ts","sourceRoot":"","sources":["../../../../../src/core/math/matrix/SquareMatrix.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IAEI;;;;OAIG;IACH,kBAJW,MAAM,QACN,cAAc,GAAC,MAAM,EA6B/B;IAjBG;;;OAGG;IACH,MAFU,MAAM,CAEA;IAEhB;;;OAGG;IACH,MAFU,cAAc,CAER;IAEhB;;;OAGG;IACH,MAFU,MAAM,EAAE,CAEqB;IAG3C;;OAEG;IACH,SAFa,MAAM,CAIlB;IAED;;OAEG;IACH,cAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,WAFa,MAAM,EAAE,CAIpB;IAED;;;;OAIG;IACH,QAHW,MAAM,GACJ,IAAI,CAIhB;IAED;;;OAGG;IACH,gBAFW,YAAY,QAItB;IAED;;;;;OAKG;IACH,oBAHW,YAAY,KACZ,YAAY,QAiBtB;IAED;;OAEG;IACH,eAMC;IAED;;OAEG;IACH,cAEC;IAED;;;OAGG;IACH,YAMC;IAED;;;OAGG;IACH,YAFW,YAAY,QAMtB;IAED;;;OAGG;IACH,SAFa,YAAY,CAQxB;IAED;;OAEG;IACH,kBAcC;IAED;;;OAGG;IACH,eAFW,MAAM,EAAE,QAIlB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,EAAE,WACR,MAAM,GACJ,MAAM,EAAE,CASpB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,SACN,MAAM,QAYhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,gBACN,MAAM,GACJ,MAAM,CAUlB;IAED;;;OAGG;IACH,qBAFW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAU5C;CACJ"}