@woosh/meep-engine 2.120.0 → 2.120.1

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 (107) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/core/binary/FLOAT32_MAX.d.ts +2 -0
  4. package/src/core/binary/FLOAT32_MAX.d.ts.map +1 -0
  5. package/src/core/binary/FLOAT32_MAX.js +1 -0
  6. package/src/core/collection/RingBuffer.d.ts +2 -3
  7. package/src/core/collection/RingBuffer.d.ts.map +1 -1
  8. package/src/core/collection/RingBuffer.js +9 -4
  9. package/src/core/color/Color.d.ts.map +1 -1
  10. package/src/core/color/Color.js +15 -1
  11. package/src/core/geom/Vector4.d.ts.map +1 -1
  12. package/src/core/geom/Vector4.js +32 -0
  13. package/src/core/geom/mat2/M2_IDENTITY.d.ts +6 -0
  14. package/src/core/geom/mat2/M2_IDENTITY.d.ts.map +1 -0
  15. package/src/core/geom/mat2/M2_IDENTITY.js +8 -0
  16. package/src/core/geom/mat2/m2_is_diagonal.d.ts +8 -0
  17. package/src/core/geom/mat2/m2_is_diagonal.d.ts.map +1 -0
  18. package/src/core/geom/mat2/m2_is_diagonal.js +9 -0
  19. package/src/core/geom/mat2/m2_is_orthogonal.d.ts +8 -0
  20. package/src/core/geom/mat2/m2_is_orthogonal.d.ts.map +1 -0
  21. package/src/core/geom/mat2/m2_is_orthogonal.js +23 -0
  22. package/src/core/geom/mat2/m2_transpose.d.ts +9 -0
  23. package/src/core/geom/mat2/m2_transpose.d.ts.map +1 -0
  24. package/src/core/geom/mat2/m2_transpose.js +17 -0
  25. package/src/core/graph/graph_compute_adjacency_matrix.d.ts +7 -5
  26. package/src/core/graph/graph_compute_adjacency_matrix.d.ts.map +1 -1
  27. package/src/core/graph/graph_compute_adjacency_matrix.js +11 -5
  28. package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -1
  29. package/src/core/graph/graph_compute_distance_matrix.js +30 -56
  30. package/src/core/graph/graph_compute_laplacian_matrix.d.ts +6 -6
  31. package/src/core/graph/graph_compute_laplacian_matrix.js +6 -6
  32. package/src/core/json/abstractJSONDeserializer.d.ts.map +1 -1
  33. package/src/core/json/abstractJSONDeserializer.js +7 -1
  34. package/src/core/math/bell_membership_function.d.ts.map +1 -1
  35. package/src/core/math/bell_membership_function.js +6 -1
  36. package/src/core/math/linalg/m2/m2_polar_decomp.d.ts +19 -0
  37. package/src/core/math/linalg/m2/m2_polar_decomp.d.ts.map +1 -0
  38. package/src/core/math/linalg/m2/m2_polar_decomp.js +27 -0
  39. package/src/core/math/linalg/m2/m2_polar_decomp_noS.d.ts +15 -0
  40. package/src/core/math/linalg/m2/m2_polar_decomp_noS.d.ts.map +1 -0
  41. package/src/core/math/linalg/m2/m2_polar_decomp_noS.js +32 -0
  42. package/src/core/math/linalg/m2/m2_svd.d.ts +19 -0
  43. package/src/core/math/linalg/m2/m2_svd.d.ts.map +1 -0
  44. package/src/core/math/linalg/m2/m2_svd.js +96 -0
  45. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +1 -1
  46. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +1 -1
  47. package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
  48. package/src/core/model/node-graph/node/NodeDescription.js +14 -0
  49. package/src/core/model/node-graph/type/DataType.d.ts.map +1 -1
  50. package/src/core/model/node-graph/type/DataType.js +4 -0
  51. package/src/core/process/WatchDog.d.ts +41 -12
  52. package/src/core/process/WatchDog.d.ts.map +1 -1
  53. package/src/core/process/WatchDog.js +47 -16
  54. package/src/engine/development/performance/RingBufferMetric.d.ts +1 -1
  55. package/src/engine/development/performance/RingBufferMetric.d.ts.map +1 -1
  56. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.js +3 -3
  57. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationUpgrader_0_1.d.ts +4 -0
  58. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationUpgrader_0_1.d.ts.map +1 -0
  59. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationUpgrader_0_1.js +24 -0
  60. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
  61. package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +3 -9
  62. package/src/engine/ecs/terrain/overlay/TerrainOverlay.d.ts.map +1 -1
  63. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +14 -8
  64. package/src/engine/ecs/transform/Transform.d.ts +5 -1
  65. package/src/engine/ecs/transform/Transform.d.ts.map +1 -1
  66. package/src/engine/ecs/transform/Transform.js +5 -1
  67. package/src/engine/intelligence/blackboard/BlackboardStack.d.ts +1 -1
  68. package/src/engine/intelligence/blackboard/BlackboardStack.js +1 -1
  69. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.d.ts.map +1 -1
  70. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.js +3 -1
  71. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_2_3.d.ts.map +1 -1
  72. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_2_3.js +3 -7
  73. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_3_4.d.ts +5 -0
  74. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_3_4.d.ts.map +1 -0
  75. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_3_4.js +19 -0
  76. package/src/engine/physics/mls-mpm/MLS_MPM.d.ts +1 -1
  77. package/src/engine/physics/mls-mpm/MLS_MPM.d.ts.map +1 -1
  78. package/src/engine/physics/mls-mpm/MLS_MPM.js +9 -114
  79. package/src/engine/physics/mls-mpm/README.md +5 -0
  80. package/src/engine/physics/ammo/Body.js +0 -103
  81. package/src/engine/physics/ammo/PhysicsWorker.d.ts +0 -72
  82. package/src/engine/physics/ammo/PhysicsWorker.d.ts.map +0 -1
  83. package/src/engine/physics/ammo/PhysicsWorker.js +0 -437
  84. package/src/engine/physics/ammo/World.d.ts +0 -68
  85. package/src/engine/physics/ammo/World.d.ts.map +0 -1
  86. package/src/engine/physics/ammo/World.js +0 -336
  87. package/src/engine/physics/ammo/shapes/BoxShape.d.ts +0 -10
  88. package/src/engine/physics/ammo/shapes/BoxShape.d.ts.map +0 -1
  89. package/src/engine/physics/ammo/shapes/BoxShape.js +0 -11
  90. package/src/engine/physics/ammo/shapes/CapsuleShape.d.ts +0 -9
  91. package/src/engine/physics/ammo/shapes/CapsuleShape.d.ts.map +0 -1
  92. package/src/engine/physics/ammo/shapes/CapsuleShape.js +0 -10
  93. package/src/engine/physics/ammo/shapes/MeshShape.d.ts +0 -8
  94. package/src/engine/physics/ammo/shapes/MeshShape.d.ts.map +0 -1
  95. package/src/engine/physics/ammo/shapes/MeshShape.js +0 -9
  96. package/src/engine/physics/ammo/shapes/PlaneShape.d.ts +0 -11
  97. package/src/engine/physics/ammo/shapes/PlaneShape.d.ts.map +0 -1
  98. package/src/engine/physics/ammo/shapes/PlaneShape.js +0 -14
  99. package/src/engine/physics/ammo/shapes/Shape.d.ts +0 -7
  100. package/src/engine/physics/ammo/shapes/Shape.d.ts.map +0 -1
  101. package/src/engine/physics/ammo/shapes/Shape.js +0 -9
  102. package/src/engine/physics/ammo/shapes/SphereShape.d.ts +0 -8
  103. package/src/engine/physics/ammo/shapes/SphereShape.d.ts.map +0 -1
  104. package/src/engine/physics/ammo/shapes/SphereShape.js +0 -9
  105. package/src/engine/physics/cannon/CannonJSPhysicsSystem.d.ts +0 -15
  106. package/src/engine/physics/cannon/CannonJSPhysicsSystem.d.ts.map +0 -1
  107. package/src/engine/physics/cannon/CannonJSPhysicsSystem.js +0 -196
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Performs a polar decomposition of a 2x2 matrix, returning only the rotation matrix (R).
3
+ * This function is optimized for speed and assumes the input matrix `m` is stored in a flattened,
4
+ * transposed format (consistent with the Taichi programming language convention).
5
+ * It decomposes `m` into R, such that m = R * S, where R is a 2x2 rotation matrix.
6
+ * The symmetric matrix S is *not* computed. This version is optimized
7
+ * for cases where only the rotational component (R) is needed.
8
+ *
9
+ * @param {number[]} R Output: 2x2 rotation matrix, stored as a flattened array [c, s, -s, c],
10
+ * where 'c' is the cosine and 's' is the sine of the rotation angle. Modified in-place.
11
+ * @param {number[]} m Input: 2x2 matrix, stored as a flattened, *transposed* array [a, b, c, d],
12
+ * representing the matrix [[a, c], [b, d]].
13
+ */
14
+ export function m2_polar_decomp_noS(R: number[], m: number[]): void;
15
+ //# sourceMappingURL=m2_polar_decomp_noS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"m2_polar_decomp_noS.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/linalg/m2/m2_polar_decomp_noS.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,uCALW,MAAM,EAAE,KAER,MAAM,EAAE,QAqBlB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Performs a polar decomposition of a 2x2 matrix, returning only the rotation matrix (R).
3
+ * This function is optimized for speed and assumes the input matrix `m` is stored in a flattened,
4
+ * transposed format (consistent with the Taichi programming language convention).
5
+ * It decomposes `m` into R, such that m = R * S, where R is a 2x2 rotation matrix.
6
+ * The symmetric matrix S is *not* computed. This version is optimized
7
+ * for cases where only the rotational component (R) is needed.
8
+ *
9
+ * @param {number[]} R Output: 2x2 rotation matrix, stored as a flattened array [c, s, -s, c],
10
+ * where 'c' is the cosine and 's' is the sine of the rotation angle. Modified in-place.
11
+ * @param {number[]} m Input: 2x2 matrix, stored as a flattened, *transposed* array [a, b, c, d],
12
+ * representing the matrix [[a, c], [b, d]].
13
+ */
14
+ export function m2_polar_decomp_noS(
15
+ R,
16
+ m
17
+ ) {
18
+ // transposed as in taichi
19
+ const x = m[0] + m[3];
20
+ const y = m[2] - m[1];
21
+
22
+ const scale = 1.0 / Math.sqrt(x * x + y * y);
23
+
24
+ const c = x * scale;
25
+ const s = y * scale;
26
+
27
+ R[0] = c;
28
+ R[1] = s;
29
+ R[2] = -s;
30
+ R[3] = c;
31
+
32
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Performs Singular Value Decomposition (SVD) on a 2x2 matrix, optimized for MLS-MPM.
3
+ *
4
+ * This function computes the SVD of a 2x2 matrix `m` such that m = U * Σ * V^T, where:
5
+ *
6
+ * - U is a 2x2 orthogonal matrix (rotation).
7
+ * - Σ (sig) is a 2x2 diagonal matrix containing the singular values.
8
+ * - V is a 2x2 orthogonal matrix (rotation).
9
+ *
10
+ * The function modifies U, sig, and V in-place. The input matrix `m` and the intermediate matrix `S` are overwritten during the computation.
11
+ * The algorithm uses a closed-form solution and optimizations specific to 2x2 matrices, making it very fast. It also handles the case where the off-diagonal elements of the intermediate matrix S are close to zero, simplifying calculations. The results are transposed, consistent with the Taichi programming language.
12
+ * @param {number[]} U Output: 2x2 orthogonal matrix (rotation), stored as a flattened array [c, s, -s, c]. Modified in-place.
13
+ * @param {number[]} S Output: Intermediate 2x2 matrix, overwritten during calculation. Modified in-place.
14
+ * @param {number[]} V Output: 2x2 orthogonal matrix (rotation), stored as a flattened array. Modified in-place.
15
+ * @param {number[]} sig Output: 2x2 diagonal matrix containing singular values, stored as a flattened array [σ1, 0, 0, σ2]. Modified in-place.
16
+ * @param {number[]} m Input: 2x2 matrix, stored as a flattened array [a, b, c, d], representing [[a, c], [b, d]]. Will be overwritten.
17
+ */
18
+ export function m2_svd(U: number[], S: number[], V: number[], sig: number[], m: number[]): void;
19
+ //# sourceMappingURL=m2_svd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"m2_svd.d.ts","sourceRoot":"","sources":["../../../../../../src/core/math/linalg/m2/m2_svd.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,0BANW,MAAM,EAAE,KACR,MAAM,EAAE,KACR,MAAM,EAAE,OACR,MAAM,EAAE,KACR,MAAM,EAAE,QA6ElB"}
@@ -0,0 +1,96 @@
1
+ import { m2_multiply } from "../../../geom/mat2/m2_multiply.js";
2
+ import { m2_polar_decomp } from "./m2_polar_decomp.js";
3
+
4
+ /**
5
+ * Performs Singular Value Decomposition (SVD) on a 2x2 matrix, optimized for MLS-MPM.
6
+ *
7
+ * This function computes the SVD of a 2x2 matrix `m` such that m = U * Σ * V^T, where:
8
+ *
9
+ * - U is a 2x2 orthogonal matrix (rotation).
10
+ * - Σ (sig) is a 2x2 diagonal matrix containing the singular values.
11
+ * - V is a 2x2 orthogonal matrix (rotation).
12
+ *
13
+ * The function modifies U, sig, and V in-place. The input matrix `m` and the intermediate matrix `S` are overwritten during the computation.
14
+ * The algorithm uses a closed-form solution and optimizations specific to 2x2 matrices, making it very fast. It also handles the case where the off-diagonal elements of the intermediate matrix S are close to zero, simplifying calculations. The results are transposed, consistent with the Taichi programming language.
15
+ * @param {number[]} U Output: 2x2 orthogonal matrix (rotation), stored as a flattened array [c, s, -s, c]. Modified in-place.
16
+ * @param {number[]} S Output: Intermediate 2x2 matrix, overwritten during calculation. Modified in-place.
17
+ * @param {number[]} V Output: 2x2 orthogonal matrix (rotation), stored as a flattened array. Modified in-place.
18
+ * @param {number[]} sig Output: 2x2 diagonal matrix containing singular values, stored as a flattened array [σ1, 0, 0, σ2]. Modified in-place.
19
+ * @param {number[]} m Input: 2x2 matrix, stored as a flattened array [a, b, c, d], representing [[a, c], [b, d]]. Will be overwritten.
20
+ */
21
+ export function m2_svd(
22
+ U,
23
+ S,
24
+ V,
25
+ sig,
26
+ m
27
+ ) {
28
+ // transposed as in taichi
29
+
30
+ m2_polar_decomp(U, S, m);
31
+
32
+ let c, s;
33
+
34
+ if (Math.abs(S[1]) < 1e-6) {
35
+ // If the off-diagonal element of S is close to zero,
36
+ // S is already diagonal. No rotation needed for V.
37
+
38
+ sig[0] = S[0];
39
+ sig[1] = 0; // Ensure off-diagonal is exactly zero
40
+ sig[2] = 0; // Ensure off-diagonal is exactly zero
41
+ sig[3] = S[3];
42
+
43
+ c = 1;
44
+ s = 0;
45
+
46
+ } else {
47
+ const tao = 0.5 * (S[0] - S[3]);
48
+
49
+ const w = Math.sqrt(tao * tao + S[1] * S[1]);
50
+
51
+ // Numerical Methods for Engineers, Chapra, Canale, 6th Ed., p. 292
52
+ const t = tao > 0 ? S[1] / (tao + w) : S[1] / (tao - w);
53
+
54
+ c = 1.0 / Math.sqrt(t * t + 1);
55
+
56
+ s = -t * c;
57
+
58
+ const s2 = s * s;
59
+ const c2 = c * c;
60
+
61
+ const cs_2 = 2 * c * s;
62
+
63
+ sig[0] = c2 * S[0] - cs_2 * S[1] + s2 * S[3];
64
+ sig[1] = 0;
65
+ sig[2] = 0;
66
+ sig[3] = s2 * S[0] + cs_2 * S[1] + c2 * S[3];
67
+ }
68
+
69
+ if (sig[0] < sig[3]) {
70
+
71
+ // Swap singular values if they are not in descending order.
72
+ const tmp = sig[0];
73
+
74
+ sig[0] = sig[3];
75
+ sig[3] = tmp;
76
+
77
+ // Correspondingly swap columns of V (remember, V is transposed here).
78
+
79
+ V[0] = -s;
80
+ V[1] = c;
81
+ V[2] = -c;
82
+ V[3] = -s;
83
+
84
+ } else {
85
+
86
+ // If already in descending order
87
+
88
+ V[0] = c;
89
+ V[1] = s;
90
+ V[2] = -s;
91
+ V[3] = c;
92
+
93
+ }
94
+
95
+ m2_multiply(U, U, V);
96
+ }
@@ -4,7 +4,7 @@
4
4
  * @param {number[]} A
5
5
  * @param {number[]} x
6
6
  * @param {number[]} b
7
- * @returns {boolean}
7
+ * @returns {boolean} `true` iff solution is found, false otherwise
8
8
  */
9
9
  export function solve_linear_system_GEPP_2x2(A: number[], x: number[], b: number[]): boolean;
10
10
  //# sourceMappingURL=solve_linear_system_GEPP_2x2.d.ts.map
@@ -11,7 +11,7 @@ const epsilon = 256 * FLT_EPSILON_64;
11
11
  * @param {number[]} A
12
12
  * @param {number[]} x
13
13
  * @param {number[]} b
14
- * @returns {boolean}
14
+ * @returns {boolean} `true` iff solution is found, false otherwise
15
15
  */
16
16
  export function solve_linear_system_GEPP_2x2(A, x, b) {
17
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,MAAM,CAAC,IAAI,CAAC;QAGtB;;;WAGG;8BADO,MAAM,CAAC,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,wBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,gBAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,eAFa,IAAI,EAAE,CAIlB;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,GAAC,IAAI,CAiBzC;IAGD;;;;;;OAMG;IACH,iBALW,QAAQ,2BAER,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;;OAKG;IACH,+BAHW,aAAa,GACZ,OAAO,CAiBlB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAYnB;IAED,mBAEC;IAED;;;;MAMC;IAED;;;;;;OAMG;IACH,8BALW,EAAE,YAGF,YAAY,QAUtB;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBAvaoB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
1
+ {"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IAsXI;;;;;OAKG;IACH,kCAHW,YAAY,GACV,eAAe,CAQ3B;IAjYD;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,MAAM,CAAC,IAAI,CAAC;QAGtB;;;WAGG;8BADO,MAAM,CAAC,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,wBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,gBAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,eAFa,IAAI,EAAE,CAIlB;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,GAAC,IAAI,CAiBzC;IAGD;;;;;;OAMG;IACH,iBALW,QAAQ,2BAER,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;;OAKG;IACH,+BAHW,aAAa,GACZ,OAAO,CAiBlB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAYnB;IAED,mBAEC;IAED;;;;MAMC;IAgBD;;;;;;OAMG;IACH,8BALW,EAAE,YAGF,YAAY,QAUtB;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBArboB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
@@ -412,6 +412,20 @@ export class NodeDescription {
412
412
  }
413
413
  }
414
414
 
415
+ /**
416
+ *
417
+ * @param j
418
+ * @param {NodeRegistry} registry
419
+ * @returns {NodeDescription}
420
+ */
421
+ static fromJSON(j, registry){
422
+ const r = new NodeDescription();
423
+
424
+ r.fromJSON(j,registry);
425
+
426
+ return r;
427
+ }
428
+
415
429
  /**
416
430
  *
417
431
  * @param {[]} ports
@@ -1 +1 @@
1
- {"version":3,"file":"DataType.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/type/DataType.js"],"names":[],"mappings":"AAEA;IAyDI;;;;OAIG;IACH,mBAHW,GAAC,GACC,QAAQ,CAQpB;IAGD;;;;;OAKG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,QAAQ,CAQpB;IAjFD;;;OAGG;IACH,IAFU,MAAM,CAET;IAEP;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV,mBAEC;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAKnB;IAED;;;;OAIG;IACH,QAHW,MAAM,QACN,MAAM,QAQhB;IAED;;;MAEC;IAED;;;aAEC;IAgCL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAP5B"}
1
+ {"version":3,"file":"DataType.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/type/DataType.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH;IAyDI;;;;OAIG;IACH,mBAHW,GAAC,GACC,QAAQ,CAQpB;IAGD;;;;;OAKG;IACH,gBAJW,MAAM,QACN,MAAM,GACJ,QAAQ,CAQpB;IAjFD;;;OAGG;IACH,IAFU,MAAM,CAET;IAEP;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV,mBAEC;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAKnB;IAED;;;;OAIG;IACH,QAHW,MAAM,QACN,MAAM,QAQhB;IAED;;;MAEC;IAED;;;aAEC;IAgCL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAP5B"}
@@ -1,5 +1,9 @@
1
1
  import { assert } from "../../../assert.js";
2
2
 
3
+ /**
4
+ * Abstract type representation.
5
+ * Useful for tagging data
6
+ */
3
7
  export class DataType {
4
8
 
5
9
  /**
@@ -1,39 +1,68 @@
1
+ /**
2
+ * A watchdog timer that executes a callback function if `kick()` is not called within a specified timeout period.
3
+ */
1
4
  export class WatchDog {
2
5
  /**
3
6
  *
4
- * @param {function} action
5
- * @param {*} [actionContext]
7
+ * @param {function} action Callback function to execute on timeout
8
+ * @param {*} [actionContext] `this` context for the callback function.
6
9
  * @constructor
7
10
  */
8
11
  constructor(action: Function, actionContext?: any);
9
- timeoutId: number;
12
+ /**
13
+ * @private
14
+ * @type {number}
15
+ */
16
+ private timeoutId;
17
+ /**
18
+ * Timeout duration in milliseconds
19
+ * @type {number}
20
+ */
10
21
  timeout: number;
11
- __timeLastKicked: number;
12
22
  /**
13
23
  *
14
- * @type {Function}
24
+ * @type {number}
25
+ * @private
26
+ */
27
+ private __timeLastKicked;
28
+ /**
29
+ * Callback function to be executed when the watchdog timer expires.
30
+ * @type {function}
15
31
  */
16
32
  action: Function;
17
33
  /**
18
- *
34
+ * The context (`this` value) for the {@link action} callback.
19
35
  * @type {*}
20
36
  */
21
37
  actionContext: any;
22
- bark(): void;
38
+ /**
39
+ * @private
40
+ * Executes the callback function and clears the timer. Called when the watchdog timer expires.
41
+ */
42
+ private bark;
43
+ /**
44
+ * Starts the watchdog timer.
45
+ * If the timer is already running, this does nothing.
46
+ */
23
47
  start(): void;
48
+ /**
49
+ * Stops the watchdog timer.
50
+ * If the timer is not running, this does nothing.
51
+ */
24
52
  stop(): void;
25
53
  /**
26
- *
27
- * @returns {boolean}
54
+ * Checks if the watchdog timer is currently active.
55
+ * @returns {boolean} `true` if the timer is running, `false` otherwise.
28
56
  */
29
57
  isActive(): boolean;
30
58
  /**
31
- *
59
+ * Resets the watchdog timer. Throws an error if the timer is not active.
60
+ * @throws {Error} If the watchdog is not active.
32
61
  */
33
62
  kick(): void;
34
63
  /**
35
- *
36
- * @param {number} delay in milliseconds
64
+ * Sets the timeout duration. Does not start or restart the timer.
65
+ * @param {number} delay Timeout duration in milliseconds.
37
66
  */
38
67
  setTimeout(delay: number): void;
39
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WatchDog.d.ts","sourceRoot":"","sources":["../../../../src/core/process/WatchDog.js"],"names":[],"mappings":"AAAA;IAQI;;;;;OAKG;IACH,8CAHW,GAAC,EAeX;IAxBD,kBAAe;IAEf,gBAAY;IAEZ,yBAAqB;IASjB;;;OAGG;IACH,iBAAoB;IAEpB;;;OAGG;IACH,eAFU,GAAC,CAEuB;IAGtC,aAOK;IAEL,cASC;IAED,aASC;IAED;;;OAGG;IACH,YAFa,OAAO,CAInB;IAED;;OAEG;IACH,aAiBC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAIhB;CACJ"}
1
+ {"version":3,"file":"WatchDog.d.ts","sourceRoot":"","sources":["../../../../src/core/process/WatchDog.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAqBI;;;;;OAKG;IACH,8CAHW,GAAC,EAiBX;IAvCD;;;OAGG;IACH,kBAAe;IAEf;;;OAGG;IACH,SAFU,MAAM,CAEJ;IAEZ;;;;OAIG;IACH,yBAAqB;IAWjB;;;OAGG;IACH,iBAAoB;IAEpB;;;OAGG;IACH,eAFU,GAAC,CAEuB;IAEtC;;;OAGG;IACH,aAOK;IACL;;;OAGG;IACH,cASC;IAED;;;OAGG;IACH,aASC;IAED;;;OAGG;IACH,YAFa,OAAO,CAInB;IAED;;;OAGG;IACH,aAiBC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAIhB;CACJ"}
@@ -1,51 +1,81 @@
1
+ import { assert } from "../assert.js";
2
+
3
+ /**
4
+ * A watchdog timer that executes a callback function if `kick()` is not called within a specified timeout period.
5
+ */
1
6
  export class WatchDog {
2
7
 
8
+ /**
9
+ * @private
10
+ * @type {number}
11
+ */
3
12
  timeoutId = -1;
4
13
 
14
+ /**
15
+ * Timeout duration in milliseconds
16
+ * @type {number}
17
+ */
5
18
  timeout = 0;
6
19
 
20
+ /**
21
+ *
22
+ * @type {number}
23
+ * @private
24
+ */
7
25
  __timeLastKicked = 0;
8
26
 
9
27
  /**
10
28
  *
11
- * @param {function} action
12
- * @param {*} [actionContext]
29
+ * @param {function} action Callback function to execute on timeout
30
+ * @param {*} [actionContext] `this` context for the callback function.
13
31
  * @constructor
14
32
  */
15
33
  constructor(action, actionContext) {
34
+ assert.isFunction(action,'action');
35
+
16
36
  /**
17
- *
18
- * @type {Function}
37
+ * Callback function to be executed when the watchdog timer expires.
38
+ * @type {function}
19
39
  */
20
40
  this.action = action;
21
41
 
22
42
  /**
23
- *
43
+ * The context (`this` value) for the {@link action} callback.
24
44
  * @type {*}
25
45
  */
26
46
  this.actionContext = actionContext;
27
47
  }
28
-
48
+ /**
49
+ * @private
50
+ * Executes the callback function and clears the timer. Called when the watchdog timer expires.
51
+ */
29
52
  bark() {
30
- //
53
+
31
54
  console.warn('WatchDog.bark');
32
55
 
33
56
  this.action.call(this.actionContext);
34
- //
57
+
35
58
  this.timeoutId = -1;
36
59
  }
37
-
60
+ /**
61
+ * Starts the watchdog timer.
62
+ * If the timer is already running, this does nothing.
63
+ */
38
64
  start() {
39
65
  //console.warn(`WatchDog.start`);
40
66
 
41
67
  if (this.isActive()) {
42
68
  //do nothing
43
69
  } else {
44
- this.timeoutId = setTimeout(this.bark, this.timeout);
70
+ this.timeoutId = setTimeout(this.bark.bind(this), this.timeout);
45
71
  this.__timeLastKicked = Date.now();
46
72
  }
47
73
  }
48
74
 
75
+ /**
76
+ * Stops the watchdog timer.
77
+ * If the timer is not running, this does nothing.
78
+ */
49
79
  stop() {
50
80
  //console.warn(`WatchDog.stop`);
51
81
 
@@ -58,15 +88,16 @@ export class WatchDog {
58
88
  }
59
89
 
60
90
  /**
61
- *
62
- * @returns {boolean}
91
+ * Checks if the watchdog timer is currently active.
92
+ * @returns {boolean} `true` if the timer is running, `false` otherwise.
63
93
  */
64
94
  isActive() {
65
95
  return this.timeoutId !== -1;
66
96
  }
67
97
 
68
98
  /**
69
- *
99
+ * Resets the watchdog timer. Throws an error if the timer is not active.
100
+ * @throws {Error} If the watchdog is not active.
70
101
  */
71
102
  kick() {
72
103
  // const timeLastKicked = this.__timeLastKicked;
@@ -81,15 +112,15 @@ export class WatchDog {
81
112
 
82
113
  if (this.isActive()) {
83
114
  clearTimeout(this.timeoutId);
84
- this.timeoutId = setTimeout(this.bark, this.timeout);
115
+ this.timeoutId = setTimeout(this.bark.bind(this), this.timeout);
85
116
  } else {
86
117
  throw new Error(`WatchDog is not active`);
87
118
  }
88
119
  }
89
120
 
90
121
  /**
91
- *
92
- * @param {number} delay in milliseconds
122
+ * Sets the timeout duration. Does not start or restart the timer.
123
+ * @param {number} delay Timeout duration in milliseconds.
93
124
  */
94
125
  setTimeout(delay) {
95
126
  this.timeout = delay;
@@ -12,7 +12,7 @@ export class RingBufferMetric extends AbstractMetric {
12
12
  * @param {number} size
13
13
  */
14
14
  resize(size: number): void;
15
- getLastRecord(): V;
15
+ getLastRecord(): any;
16
16
  record(value: any): void;
17
17
  }
18
18
  import { AbstractMetric } from "./AbstractMetric.js";
@@ -1 +1 @@
1
- {"version":3,"file":"RingBufferMetric.d.ts","sourceRoot":"","sources":["../../../../../src/engine/development/performance/RingBufferMetric.js"],"names":[],"mappings":"AAOA;IACI,2BAUC;IAPG;;;;;OAKG;IACH,wBAAkC;IAGtC;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED,mBAEC;IAED,yBAEC;CAsCJ;+BAnE8B,qBAAqB"}
1
+ {"version":3,"file":"RingBufferMetric.d.ts","sourceRoot":"","sources":["../../../../../src/engine/development/performance/RingBufferMetric.js"],"names":[],"mappings":"AAOA;IACI,2BAUC;IAPG;;;;;OAKG;IACH,wBAAkC;IAGtC;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED,qBAEC;IAED,yBAEC;CAsCJ;+BAnE8B,qBAAqB"}
@@ -4,7 +4,7 @@ import ClingToTerrain from "./ClingToTerrain.js";
4
4
  export class ClingToTerrainSerializationAdapter extends BinaryClassSerializationAdapter {
5
5
 
6
6
  klass = ClingToTerrain;
7
- version = 0;
7
+ version = 1;
8
8
 
9
9
  /**
10
10
  *
@@ -12,8 +12,8 @@ export class ClingToTerrainSerializationAdapter extends BinaryClassSerialization
12
12
  * @param {ClingToTerrain} value
13
13
  */
14
14
  serialize(buffer, value) {
15
- //TODO serialize rotation speed
16
15
  buffer.writeUint8(value.normalAlign ? 1 : 0);
16
+ buffer.writeFloat32(value.rotationSpeed);
17
17
  }
18
18
 
19
19
  /**
@@ -22,7 +22,7 @@ export class ClingToTerrainSerializationAdapter extends BinaryClassSerialization
22
22
  * @param {ClingToTerrain} value
23
23
  */
24
24
  deserialize(buffer, value) {
25
- //TODO deserialize rotation speed
26
25
  value.normalAlign = buffer.readUint8() !== 0;
26
+ value.rotationSpeed = buffer.readFloat32();
27
27
  }
28
28
  }
@@ -0,0 +1,4 @@
1
+ export class ClingToTerrainSerializationUpgrader_0_1 extends BinaryClassUpgrader {
2
+ }
3
+ import { BinaryClassUpgrader } from "../../../storage/binary/BinaryClassUpgrader.js";
4
+ //# sourceMappingURL=ClingToTerrainSerializationUpgrader_0_1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClingToTerrainSerializationUpgrader_0_1.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationUpgrader_0_1.js"],"names":[],"mappings":"AAEA;CAqBC;oCAvBmC,gDAAgD"}
@@ -0,0 +1,24 @@
1
+ import { BinaryClassUpgrader } from "../../../storage/binary/BinaryClassUpgrader.js";
2
+
3
+ export class ClingToTerrainSerializationUpgrader_0_1 extends BinaryClassUpgrader {
4
+
5
+
6
+ __startVersion = 0;
7
+ __targetVersion = 1;
8
+
9
+
10
+ /**
11
+ *
12
+ * @param {BinaryBuffer} source
13
+ * @param {BinaryBuffer} target
14
+ */
15
+ upgrade(source, target) {
16
+ // Read the old data
17
+ const normalAlign = source.readUint8();
18
+
19
+ // Write the old data to the new format
20
+ target.writeUint8(normalAlign);
21
+ // Write a default value for the new field (rotationSpeed)
22
+ target.writeFloat32(3); // Use the default value from the ClingToTerrain class
23
+ }
24
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"SplatMapping.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/terrain/ecs/splat/SplatMapping.js"],"names":[],"mappings":"AAaA;;GAEG;AACH;IAEQ;;;OAGG;IACH,MAFU,OAAO,CAEY;IAE7B;;;OAGG;IACH,OAFU,MAAM,CAEF;IAOd;;;OAGG;IACH,eAFU,kBAAkB,CAEiE;IAO7F;;;;OAIG;IACH,iBAFU,WAAW,CAEoE;IAG7F;;;;MAQC;IAED;;;;;;aA6BC;IAED;;;;;OAKG;IACH,8BAJW,SAAS,SACT,MAAM,YACN,MAAM,QAgChB;IAED;;;;;OAKG;IACH,gCAJW,SAAS,SACT,MAAM,YACN,MAAM,QA2BhB;IAED;;;;;;;OAOG;IACH,wBANW,UAAU,gBACV,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,QA2ChB;IAED;;;;;;;OAOG;IACH,4BANW,UAAU,WACV,MAAM,WACN,MAAM,SACN,MAAM,UACN,MAAM,QAuChB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,iBACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,SAAS,CAcrB;IAED;;OAEG;IACH,kBAFa,iBAAiB,GAAC,UAAU,CAIxC;IAED;;;OAGG;IACH,oBAFa,iBAAiB,GAAC,UAAU,CAIxC;IAED;;;OAGG;IACH,uBAFY,SAAS,CAIpB;IAED;;;OAGG;IACH,YAFY,IAAI,EAAE,CAKjB;IAED;;;;OAIG;IACH,gCAHW,UAAU,GACR,IAAI,CAmDhB;IAED,gBAGC;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,OAAO,CAuCnB;IAED;;;;OAIG;IACH,8BAHW,MAAM,SACN,MAAM,QAqBhB;IAED,uBAiBC;IAED;;;;;;OAMG;IACH,cALW,MAAM,UACN,MAAM,SACN,MAAM,cACN,OAAO,QAsDjB;CACJ;oBAphBmB,qCAAqC;mCALiD,OAAO;4BAAP,OAAO;0BAUvF,mDAAmD"}
1
+ {"version":3,"file":"SplatMapping.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/ecs/terrain/ecs/splat/SplatMapping.js"],"names":[],"mappings":"AAaA;;GAEG;AACH;IAEQ;;;OAGG;IACH,MAFU,OAAO,CAEY;IAE7B;;;OAGG;IACH,OAFU,MAAM,CAEF;IAOd;;;OAGG;IACH,eAFU,kBAAkB,CAEiE;IAO7F;;;;OAIG;IACH,iBAFU,WAAW,CAEoE;IAG7F;;;;MAQC;IAED;;;;;;aA6BC;IAED;;;;;OAKG;IACH,8BAJW,SAAS,SACT,MAAM,YACN,MAAM,QA0BhB;IAED;;;;;OAKG;IACH,gCAJW,SAAS,SACT,MAAM,YACN,MAAM,QA2BhB;IAED;;;;;;;OAOG;IACH,wBANW,UAAU,gBACV,MAAM,gBACN,MAAM,eACN,MAAM,gBACN,MAAM,QA2ChB;IAED;;;;;;;OAOG;IACH,4BANW,UAAU,WACV,MAAM,WACN,MAAM,SACN,MAAM,UACN,MAAM,QAuChB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,iBACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,SAAS,CAcrB;IAED;;OAEG;IACH,kBAFa,iBAAiB,GAAC,UAAU,CAIxC;IAED;;;OAGG;IACH,oBAFa,iBAAiB,GAAC,UAAU,CAIxC;IAED;;;OAGG;IACH,uBAFY,SAAS,CAIpB;IAED;;;OAGG;IACH,YAFY,IAAI,EAAE,CAKjB;IAED;;;;OAIG;IACH,gCAHW,UAAU,GACR,IAAI,CAmDhB;IAED,gBAGC;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,OAAO,CAuCnB;IAED;;;;OAIG;IACH,8BAHW,MAAM,SACN,MAAM,QAqBhB;IAED,uBAiBC;IAED;;;;;;OAMG;IACH,cALW,MAAM,UACN,MAAM,SACN,MAAM,cACN,OAAO,QAsDjB;CACJ;oBA9gBmB,qCAAqC;mCALiD,OAAO;4BAAP,OAAO;0BAUvF,mDAAmD"}
@@ -107,23 +107,17 @@ export class SplatMapping {
107
107
 
108
108
  const dataOffset = index * width * height;
109
109
 
110
- const sourceWidth = source.width;
111
- const sourceHeight = source.height;
112
-
113
- const source_max_y = sourceHeight - 1;
114
- const source_max_x = sourceWidth - 1;
115
-
116
110
  for (let y = 0; y < height; y++) {
117
- const v = y / height;
111
+ const v = (y + 0.5) / height;
118
112
 
119
113
  for (let x = 0; x < width; x++) {
120
114
 
121
- const u = x / width;
115
+ const u = (x + 0.5) / width;
122
116
 
123
117
  const targetIndex = y * width + x;
124
118
  const targetAddress = dataOffset + targetIndex;
125
119
 
126
- const value = source.sampleChannelBilinear(u * source_max_x, v * source_max_y, channel);
120
+ const value = source.sampleChannelBilinearUV(u , v , channel);
127
121
 
128
122
  weightData[targetAddress] = value;
129
123
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TerrainOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/overlay/TerrainOverlay.js"],"names":[],"mappings":"AA+CA;IACI;;;;OAIG;IACH,kBAHW,OAAO,EA8DjB;IA1DG;;;;OAIG;IACH,sBAHU,OAAO,CAGkB;IACnC;;;;OAIG;IACH,eAHU,OAAO,CAGsB;IAEvC;;;OAGG;IACH,WAFU,cAAc,CAEiC;IAEzD;;;OAGG;IACH,SAFU,SAAS,CAE8B;IAEjC,qBAAiD;IAiBjE;;;OAGG;IACH,OAFU,OAAO,EAAE,CAEJ;IAsBnB;;;OAGG;IACH,qBAFW,MAAM,EAQhB;IAlBD;;;OAGG;IACH,qBAFa,MAAM,CAIlB;IAcD;;OAEG;IACH,cAFa,iBAAiB,CAI7B;IAED;;OAEG;IACH,aASC;IAED;;OAEG;IACH,YAuBC;IAED,cAMC;IAED,eAEC;IAED;;;;;OAKG;IACH,aAJW,MAAM,KACN,MAAM,UACN,OAAO,QAQjB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,KACN,MAAM,QACN,OAAO,QAmBjB;IAED;;;;OAIG;IACH,cAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;;OAKG;IACH,cAJW,MAAM,KACN,MAAM,QACN,OAAO,QAUjB;IAED;;;OAGG;IACH,gBAFW,UAAU,GAAC,MAAM,EAAE,QAuB7B;IAED;;;;;;;OAOG;IACH,kBANW,iBAAiB,MACjB,MAAM,MACN,MAAM,WACN,MAAM,YACN,MAAM,QAMhB;IAED;;;;;;;OAOG;IACH,qBANW,SAAS,MACT,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,QAWhB;CACJ;oBAxTmB,kCAAkC;oBAClC,kCAAkC;2BAE3B,0CAA0C;0BAG3C,gDAAgD;4BAZV,OAAO;AAgBvE;IACI;;;;;;OAMG;IACH,qBALW,SAAS,eACT,MAAM,aACN,MAAM,EAqBhB;IAjBG;;;OAGG;IACH,SAFU,SAAS,CAEG;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEc;IAE9B;;;OAGG;IACH,WAFU,MAAM,CAEU;CAEjC;oBAnCmB,kCAAkC"}
1
+ {"version":3,"file":"TerrainOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/overlay/TerrainOverlay.js"],"names":[],"mappings":"AA+CA;IACI;;;;OAIG;IACH,kBAHW,OAAO,EAkEjB;IA9DG;;;;OAIG;IACH,sBAHU,OAAO,CAGkB;IACnC;;;;OAIG;IACH,eAHU,OAAO,CAGsB;IAEvC;;;OAGG;IACH,WAFU,cAAc,CAEiC;IAEzD;;;OAGG;IACH,SAFU,SAAS,CAE8B;IAEjC,qBAIf;IAiBD;;;OAGG;IACH,OAFU,OAAO,EAAE,CAEJ;IAsBnB;;;OAGG;IACH,qBAFW,MAAM,EAMhB;IAhBD;;;OAGG;IACH,qBAFa,MAAM,CAIlB;IAYD;;OAEG;IACH,cAFa,iBAAiB,CAI7B;IAED;;OAEG;IACH,aAaC;IAED;;OAEG;IACH,YAuBC;IAED,cAMC;IAED,eAEC;IAED;;;;;OAKG;IACH,aAJW,MAAM,KACN,MAAM,UACN,OAAO,QAQjB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,KACN,MAAM,QACN,OAAO,QAmBjB;IAED;;;;OAIG;IACH,cAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;;OAKG;IACH,cAJW,MAAM,KACN,MAAM,QACN,OAAO,QAUjB;IAED;;;OAGG;IACH,gBAFW,UAAU,GAAC,MAAM,EAAE,QAuB7B;IAED;;;;;;;OAOG;IACH,kBANW,iBAAiB,MACjB,MAAM,MACN,MAAM,WACN,MAAM,YACN,MAAM,QAMhB;IAED;;;;;;;OAOG;IACH,qBANW,SAAS,MACT,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,QAWhB;CACJ;oBA9TmB,kCAAkC;oBAClC,kCAAkC;2BAE3B,0CAA0C;0BAG3C,gDAAgD;4BAZV,OAAO;AAgBvE;IACI;;;;;;OAMG;IACH,qBALW,SAAS,eACT,MAAM,aACN,MAAM,EAqBhB;IAjBG;;;OAGG;IACH,SAFU,SAAS,CAEG;IAEtB;;;OAGG;IACH,aAFU,MAAM,CAEc;IAE9B;;;OAGG;IACH,WAFU,MAAM,CAEU;CAEjC;oBAnCmB,kCAAkC"}
@@ -77,7 +77,11 @@ export class TerrainOverlay {
77
77
  */
78
78
  this.sampler = Sampler2D.uint8(4, size.x, size.y);
79
79
 
80
- const texture = this.texture = new DataTexture(this.sampler.data);
80
+ const texture = this.texture = new DataTexture(
81
+ this.sampler.data,
82
+ size.x,
83
+ size.y,
84
+ );
81
85
 
82
86
  texture.wrapS = ClampToEdgeWrapping;
83
87
  texture.wrapT = ClampToEdgeWrapping;
@@ -117,7 +121,7 @@ export class TerrainOverlay {
117
121
  * @returns {string}
118
122
  */
119
123
  get baseTileImage() {
120
- return this.stack.length === 0 ? this.tileImage.getValue() : this.stack[0].tileImage
124
+ return this.tileImage.getValue();
121
125
  }
122
126
 
123
127
  /**
@@ -125,11 +129,9 @@ export class TerrainOverlay {
125
129
  * @param {string} v
126
130
  */
127
131
  set baseTileImage(v) {
128
- if (this.stack.length === 0) {
129
- this.tileImage.set(v);
130
- } else {
131
- this.stack[0].tileImage = v;
132
- }
132
+
133
+ this.tileImage.set(v);
134
+
133
135
  }
134
136
 
135
137
  /**
@@ -145,7 +147,11 @@ export class TerrainOverlay {
145
147
  push() {
146
148
  const sampler = this.sampler.clone();
147
149
 
148
- const context = new Context(sampler, this.borderWidth.getValue(), this.tileImage.getValue());
150
+ const context = new Context(
151
+ sampler,
152
+ this.borderWidth.getValue(),
153
+ this.tileImage.getValue()
154
+ );
149
155
 
150
156
  this.stack.push(context);
151
157
 
@@ -1,5 +1,9 @@
1
1
  /**
2
- * Described position/rotation/scale in 3d space
2
+ * A Transform represents the position, rotation, and scale of an object in 3D space.
3
+ * Think of it like the object's location, orientation, and size.
4
+ * It has properties for position (like coordinates), rotation (how it's turned), and scale (how big it is).
5
+ *
6
+ * It also uses a "matrix" (a table of numbers) internally to efficiently store and calculate transformations, but you usually interact with the position, rotation, and scale directly.
3
7
  * @class
4
8
  */
5
9
  export class Transform {
@@ -1 +1 @@
1
- {"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AAsBA;;;GAGG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,uBAHW,MAAM,EAAE,GAAC,YAAY,GACnB,SAAS,CAQrB;IAiED;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IA/WD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,CAEC;IAEvB;;;;OAIG;IACH,OAFU,MAAM,CAEM;IAOtB;;;;OAIG;IACH,eAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,UAFY,OAAO,CAQlB;IAED;;;OAGG;IACH,aAFY,OAAO,CAQlB;IAED;;;;OAIG;IACH,uCAFW,GAAC,QAMX;IAED;;;;OAIG;IACH,yCAFW,GAAC,QAMX;IAYD;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,SACrB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,OAAO,CAInB;IAED;;OAEG;IACH,qBAEC;IAED;;;;OAIG;IACH,eAHW,OAAO,OACP,OAAO,QAmBjB;IAED,0BAwBC;IAED;;;;MAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAenB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACP,OAAO,CAMnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAKlB;IA4BD;;;;OAIG;IACH,sBAHW,SAAS,KACT,SAAS,QAMnB;IAED;;;OAGG;IACH,oBAFW,IAAI,GAAC,MAAM,EAAE,GAAC,YAAY,QAgBpC;IAED;;;OAGG;IACH,kBAFW,MAAM,EAAE,GAAC,YAAY,QAI/B;IAED;;;;;OAKG;IACH,qBAEC;IAED;;;OAGG;IACH,cAFa,OAAO,CAMnB;IAED,mBAEC;IA2BL;;;OAGG;IACH,sBAFU,OAAO,CAEc;;CAZ9B;;kBAIS,MAAM;;oBAzYI,+BAA+B;uBAD5B,kCAAkC;+BAE1B,qBAAqB"}
1
+ {"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform.js"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH;IAwQI;;;;OAIG;IACH,4BAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,uBAHW,MAAM,EAAE,GAAC,YAAY,GACnB,SAAS,CAQrB;IAiED;;;;;OAKG;IACH,wCAJW,UAAU,gBACV,OAAO,wBAajB;IA/WD;;;OAGG;IACH,mBAHU,OAAO,CAGe;IAEhC;;;OAGG;IACH,mBAHU,UAAU,CAGkB;IAEtC;;;OAGG;IACH,gBAHU,OAAO,CAGY;IAE7B;;;;OAIG;IACH,iBAFU,YAAY,CAEC;IAEvB;;;;OAIG;IACH,OAFU,MAAM,CAEM;IAOtB;;;;OAIG;IACH,eAFa,OAAO,CAQnB;IAED;;;OAGG;IACH,UAFY,OAAO,CAQlB;IAED;;;OAGG;IACH,aAFY,OAAO,CAQlB;IAED;;;;OAIG;IACH,uCAFW,GAAC,QAMX;IAED;;;;OAIG;IACH,yCAFW,GAAC,QAMX;IAYD;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,GACnB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,cAAc,SACrB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM,GAAC,cAAc,GACnB,OAAO,CAInB;IAED;;OAEG;IACH,qBAEC;IAED;;;;OAIG;IACH,eAHW,OAAO,OACP,OAAO,QAmBjB;IAED,0BAwBC;IAED;;;;MAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAenB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;OAIG;IACH,cAHW,SAAS,GACP,OAAO,CAMnB;IAED;;;OAGG;IACH,QAFa,MAAM,CAKlB;IA4BD;;;;OAIG;IACH,sBAHW,SAAS,KACT,SAAS,QAMnB;IAED;;;OAGG;IACH,oBAFW,IAAI,GAAC,MAAM,EAAE,GAAC,YAAY,QAgBpC;IAED;;;OAGG;IACH,kBAFW,MAAM,EAAE,GAAC,YAAY,QAI/B;IAED;;;;;OAKG;IACH,qBAEC;IAED;;;OAGG;IACH,cAFa,OAAO,CAMnB;IAED,mBAEC;IA2BL;;;OAGG;IACH,sBAFU,OAAO,CAEc;;CAZ9B;;kBAIS,MAAM;;oBA7YI,+BAA+B;uBAD5B,kCAAkC;+BAE1B,qBAAqB"}