@woosh/meep-engine 2.43.13 → 2.43.15

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 (88) hide show
  1. package/core/bvh2/aabb3/aabb3_detailed_volume_intersection.js +1 -1
  2. package/core/bvh2/traversal/__process_point_if_within_planes.js +1 -1
  3. package/core/geom/3d/SurfacePoint3.d.ts +5 -0
  4. package/core/geom/3d/plane/is_point_within_planes.js +1 -1
  5. package/core/geom/3d/plane/plane3_slerp.js +1 -1
  6. package/core/geom/3d/topology/computeTopoMeshVertexDuplicates.js +2 -1
  7. package/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +1 -1
  8. package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
  9. package/core/geom/3d/topology/weld_duplicate_vertices.js +1 -1
  10. package/core/geom/ConicRay.js +2 -1
  11. package/core/geom/Quaternion.js +2 -1
  12. package/core/geom/Vector3.js +5 -2
  13. package/core/geom/normalize_angle_rad.js +1 -1
  14. package/core/geom/random/randomPointInCircle.js +1 -1
  15. package/core/geom/random/randomPointInSphere.js +1 -1
  16. package/core/math/EPSILON.js +5 -0
  17. package/core/math/PI2.js +5 -0
  18. package/core/math/PI_HALF.js +5 -0
  19. package/core/math/bezierCurve.js +22 -0
  20. package/core/math/clamp.spec.js +15 -0
  21. package/core/math/computeGreatestCommonDivisor.js +28 -0
  22. package/core/math/computeIsoscelesTriangleApexAngle.js +17 -0
  23. package/core/math/computeWholeDivisorLow.js +30 -0
  24. package/core/math/computeWholeDivisorLow.spec.js +9 -0
  25. package/core/math/copysign.spec.js +13 -0
  26. package/core/math/cubicCurve.js +34 -0
  27. package/core/math/cubicCurve.spec.js +13 -0
  28. package/core/math/{MathUtils.d.ts → epsilonEquals.d.ts} +0 -0
  29. package/core/math/epsilonEquals.js +16 -0
  30. package/core/math/hash/computeHashFloat.spec.js +7 -0
  31. package/core/math/inverseLerp.spec.js +13 -0
  32. package/core/math/isValueBetween.spec.js +11 -0
  33. package/core/math/isValueBetweenInclusive.spec.js +16 -0
  34. package/core/math/lerp.spec.js +15 -0
  35. package/core/math/makeCubicCurve.js +15 -0
  36. package/core/math/makeCubicCurve.spec.js +9 -0
  37. package/core/math/makeSequenceLoop.js +20 -0
  38. package/core/math/max2.spec.js +13 -0
  39. package/core/math/max3.spec.js +27 -0
  40. package/core/math/min2.spec.js +12 -0
  41. package/core/math/min3.spec.js +27 -0
  42. package/core/math/normalizeArrayVector.js +25 -0
  43. package/core/math/overlap1D.spec.js +10 -0
  44. package/core/math/quadraticCurve.js +11 -0
  45. package/core/math/quadraticCurve.spec.js +13 -0
  46. package/core/math/sign.spec.js +13 -0
  47. package/core/model/stat/Stat.js +2 -1
  48. package/engine/EngineHarness.js +5 -23
  49. package/engine/achievements/AchievementManager.js +1 -1
  50. package/engine/animation/TransitionFunctions.js +1 -1
  51. package/engine/ecs/gui/position/ViewportPositionSystem.js +1 -1
  52. package/engine/ecs/systems/SteeringSystem.js +1 -1
  53. package/engine/ecs/terrain/ecs/Terrain.d.ts +7 -0
  54. package/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +68 -0
  55. package/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.js +31 -0
  56. package/engine/ecs/terrain/ecs/{ClingToTerrainSystem.js → cling/ClingToTerrainSystem.js} +52 -34
  57. package/engine/ecs/terrain/ecs/{ClingToTerrainSystem.spec.js → cling/ClingToTerrainSystem.spec.js} +1 -1
  58. package/engine/ecs/terrain/tiles/TerrainTile.js +1 -1
  59. package/engine/ecs/terrain/tiles/TerrainTileManager.js +2 -1
  60. package/engine/graphics/camera/CameraShake.js +1 -1
  61. package/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
  62. package/engine/graphics/ecs/path/entity/EntityPath.js +1 -1
  63. package/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
  64. package/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +4 -2
  65. package/engine/graphics/geometry/MikkT/NotZero.js +1 -1
  66. package/engine/graphics/impostors/octahedral/shader/ImpostorShaderV0.js +14 -288
  67. package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +1 -1
  68. package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
  69. package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
  70. package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
  71. package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
  72. package/engine/graphics/shadows/testShadowMapRendering.js +1 -1
  73. package/engine/input/ecs/util/TerrainCameraTargetSampler.js +1 -1
  74. package/engine/sound/material/detector/terrain/TerrainSoundMaterialSurfaceDetector.js +1 -1
  75. package/generation/example/themes/SampleTheme0.js +2 -2
  76. package/generation/grid/generation/GridTaskExecuteRuleTimes.js +1 -1
  77. package/generation/grid/generation/grid/select/CellSupplierBestN.js +1 -1
  78. package/generation/markers/GridActionRuleSet.js +1 -1
  79. package/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.js +1 -1
  80. package/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js +2 -1
  81. package/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js +2 -1
  82. package/package.json +1 -1
  83. package/view/elements/radial/RadialMenuElement.js +1 -1
  84. package/view/elements/radial/RadialText.js +1 -1
  85. package/view/tooltip/TooltipView.js +1 -1
  86. package/core/math/MathUtils.js +0 -247
  87. package/core/math/MathUtils.spec.js +0 -232
  88. package/engine/ecs/terrain/ecs/ClingToTerrain.js +0 -100
@@ -25,217 +25,20 @@ const shader_vx = `
25
25
 
26
26
  out vec3 local_ray_near;
27
27
  out vec3 local_ray_far;
28
-
29
- flat out vec2 frame1;
30
- flat out vec3 frame1_normal;
31
- out vec2 uv_frame1;
32
- out vec2 xy_frame1;
33
-
34
- flat out vec2 frame2;
35
- flat out vec3 frame2_normal;
36
- out vec2 uv_frame2;
37
- out vec2 xy_frame2;
38
-
39
- flat out vec2 frame3;
40
- flat out vec3 frame3_normal;
41
- out vec2 uv_frame3;
42
- out vec2 xy_frame3;
43
-
44
- out vec4 blend_weights;
45
28
 
46
29
  uniform mat4 modelViewMatrix;
47
30
  uniform mat4 projectionMatrix;
48
31
  uniform mat3 normalMatrix;
49
- uniform mat4 modelMatrix;
50
- uniform mat4 viewMatrix;
51
- uniform vec3 cameraPosition;
52
32
 
53
33
  uniform vec3 uOffset;
54
34
  uniform float uRadius;
55
35
  uniform float uFrames;
56
36
 
57
- uniform bool uIsFullSphere;
58
-
59
- vec2 VecToSphereOct(vec3 pivotToCamera)
60
- {
61
- vec3 octant = sign(pivotToCamera);
62
-
63
- // |x| + |y| + |z| = 1
64
- float sum = dot(pivotToCamera, octant);
65
- vec3 octahedron = pivotToCamera / sum;
66
-
67
- if (octahedron.y < 0.0){
68
- vec3 absolute = abs(octahedron);
69
- octahedron.xz = octant.xz * vec2(1.0 - absolute.z, 1.0 - absolute.x);
70
- }
71
- return octahedron.xz;
72
- }
73
-
74
- //for hemisphere
75
- vec2 VecToHemiSphereOct(vec3 vec)
76
- {
77
- vec.y = max(vec.y, 0.001);
78
- vec = normalize(vec);
79
- vec3 octant = sign(vec);
80
-
81
- // |x| + |y| + |z| = 1
82
- float sum = dot(vec, octant);
83
- vec3 octahedron = vec / sum;
84
-
85
- return vec2(
86
- octahedron.x + octahedron.z,
87
- octahedron.z - octahedron.x
88
- );
89
- }
90
- //for hemisphere
91
- vec3 OctaHemiSphereEnc(vec2 coord)
92
- {
93
- coord = vec2(coord.x + coord.y, coord.x - coord.y) * 0.5;
94
- vec3 vec = vec3(coord.x, 1.0 - dot(vec2(1.0, 1.0), abs(coord.xy)), coord.y);
95
- return vec;
96
- }
97
- //for sphere
98
- vec3 OctaSphereEnc(vec2 coord)
99
- {
100
- vec3 vec = vec3(coord.x, 1.0 - dot(vec2(1.0), abs(coord)), coord.y);
101
- if (vec.y < 0.0)
102
- {
103
- vec.x = (vec.x >=0.0 ? 1.0: -1.0)* (1.0 - abs(vec.z));
104
- vec.z = (vec.z >=0.0 ? 1.0: -1.0)* (1.0 - abs(vec.x));
105
- }
106
- return vec;
107
- }
108
- vec2 VectorToGrid(vec3 vec)
109
- {
110
- if (uIsFullSphere)
111
- {
112
- return VecToSphereOct(vec);
113
- }
114
- else
115
- {
116
- return VecToHemiSphereOct(vec);
117
- }
118
- }
119
-
120
- vec3 GridToVector(vec2 coord)
121
- {
122
- if (uIsFullSphere)
123
- {
124
- return OctaSphereEnc(coord);
125
- }
126
- else
127
- {
128
- return OctaHemiSphereEnc(coord);
129
- }
130
- }
131
-
132
- vec3 FrameXYToRay(vec2 frame, vec2 frameCountMinusOne)
133
- {
134
- //divide frame x y by framecount minus one to get 0-1
135
- vec2 f = (frame.xy/ frameCountMinusOne);
136
- //bias and scale to -1 to 1
137
-
138
- vec3 vec = GridToVector(f);
139
- vec = normalize(vec);
140
- return vec;
141
- }
142
-
143
- vec4 TriangleInterpolate(vec2 uv){
144
- uv = fract(uv);
145
-
146
- vec2 omuv = vec2(1.0, 1.0) - uv.xy;
147
-
148
- vec4 res = vec4(0, 0, 0, 0);
149
- //frame 0
150
- res.x = min(omuv.x, omuv.y);
151
- //frame 1
152
- res.y = abs(dot(uv, vec2(1.0, -1.0)));
153
- //frame 2
154
- res.z = min(uv.x, uv.y);
155
- //mask
156
- res.w = clamp(ceil(uv.x-uv.y),0.0, 1.0);
157
-
158
- return res;
159
- }
160
-
161
- vec3 projectOnPlaneBasis(vec3 ray, vec3 plane_normal, vec3 plane_x, vec3 plane_y)
162
- {
163
- //reproject plane normal onto planeXY basos
164
- return normalize(vec3(
165
- dot(plane_x, ray),
166
- dot(plane_y, ray),
167
- dot(plane_normal, ray)
168
- ));
169
- }
170
-
171
- void calcuateXYbasis(vec3 plane_normal, out vec3 plane_x, out vec3 plane_y)
172
- {
173
- vec3 up = vec3(0,1,0);
174
- //cross product doesnt work if we look directly from bottom
175
- if (abs(plane_normal.y) > 0.999f)
176
- {
177
- up = vec3(0,0,1);
178
- }
179
- plane_x = normalize(cross(plane_normal, up));
180
- plane_y = normalize(cross(plane_x, plane_normal));
181
- }
182
-
183
- //this function works well in orthogonal projection. It works okeyish with further distances of perspective projection
184
- vec2 virtualPlaneUV(vec3 plane_normal, vec3 plane_x, vec3 plane_y, vec3 pivotToCameraRay, vec3 vertexToCameraRay, float size)
185
- {
186
- plane_normal = normalize(plane_normal);
187
- plane_x = normalize(plane_x);
188
- plane_y = normalize(plane_y);
189
-
190
- // plane_normal is normalized but pivotToCameraRay & vertexToCameraRay are NOT
191
- // so what are we doing here ?
192
- // We are calculating length of pivotToCameraRay projected onto plane_normal
193
- // so pivotToCameraRay is vector to camera from CENTER OF object
194
- // we are recalculting this distance taking into account new plane normal
195
- float projectedNormalRayLength = dot(plane_normal, pivotToCameraRay);
196
- // tihs is direction is almost the same as origin, but its to individual vertex
197
- // not sure this is correct for perspective projection
198
- float projectedVertexRayLength = dot(plane_normal, vertexToCameraRay);
199
- // basically its length difference betwen center and vertex - "not precise"
200
- // projectedVertexRayLength is bigger than projectedNormalRayLength when vertex is
201
- // further than "main front facing billboard"
202
- // so offsetLength is getting smaller, otherwise is getting bigger
203
- float offsetLength = projectedNormalRayLength/projectedVertexRayLength;
204
-
205
- // ok so offsetLength is just a length
206
- // we want a vector so we multiply it by vertexToCameraRay to get this offset
207
- // now what are we REALY doing is calculuating distance difference
208
- // se are SUBSTRACTING pivotToCameraRay vector
209
- // we would get difference between center of plane and vertex rotated
210
- vec3 offsetVector = vertexToCameraRay * offsetLength - pivotToCameraRay;
211
-
212
- // we got the offset of rotated vertex, but we need to offset it from correct plane axis
213
- // so again we projecting length of intersection (offset of rotated vertex) onto plane_x
214
- // and plane_y
215
- vec2 duv = vec2(
216
- dot(plane_x, offsetVector),
217
- dot(plane_y, offsetVector)
218
- );
219
-
220
- //we are in space -1 to 1
221
- duv /= 2.0 * size;
222
- duv += 0.5;
223
- return duv;
224
- }
225
-
226
37
  void main() {
227
38
  vUv = uv;
228
39
 
229
40
  vec2 framesMinusOne = uFrames - vec2(1.0);
230
41
 
231
- vec3 cameraPos_WS = cameraPosition;
232
- vec3 cameraPos_OS = (inverse(viewMatrix) * vec4(cameraPos_WS, 1.0)).xyz;
233
-
234
- //TODO: check if this is correct. We are using orho projected images, so
235
- // camera far away
236
- vec3 pivotToCameraRay = (cameraPos_OS) * 10.0;
237
- vec3 pivotToCameraDir = normalize(cameraPos_OS);
238
-
239
42
  mat4 m4 = modelViewMatrix;
240
43
 
241
44
  m4[0][0] = 1.0;
@@ -262,7 +65,6 @@ const shader_vx = `
262
65
 
263
66
  vec3 transformedNormal = normalize(normalMatrix * normal);
264
67
 
265
-
266
68
  vec4 mvPosition = m4 * vec4( object_scale*(position+uOffset/card_diameter), 1.0 );
267
69
 
268
70
  gl_Position = projectionMatrix * mvPosition;
@@ -273,10 +75,6 @@ const shader_vx = `
273
75
  //get 2D projection of this vertex in normalized device coordinates
274
76
  vec2 pos = gl_Position.xy/gl_Position.w;
275
77
 
276
- vec3 projected = object_scale*position;
277
- vec3 vertexToCameraRay = (pivotToCameraRay - (projected));
278
- vec3 vertexToCameraDir = normalize(vertexToCameraRay);
279
-
280
78
  //compute ray's start and end as inversion of this coordinates
281
79
  //in near and far clip planes
282
80
  vec4 near_4 = inverse_matrix * (vec4(pos, -1.0, 1.0));
@@ -284,48 +82,6 @@ const shader_vx = `
284
82
 
285
83
  local_ray_near = near_4.xyz / near_4.w;
286
84
  local_ray_far = far_4.xyz/ far_4.w;
287
-
288
- //
289
- vec3 view_direction = normalize(local_ray_near-local_ray_far);
290
-
291
- vec2 grid = VectorToGrid(-view_direction);
292
- //bias and scale to 0 to 1
293
- grid = clamp((grid + 1.0) * 0.5, vec2(0, 0), vec2(1, 1));
294
- grid *= framesMinusOne;
295
- grid = clamp(grid, vec2(0), vec2(framesMinusOne));
296
- vec2 gridFloor = min(floor(grid), framesMinusOne);
297
- vec2 gridFract = fract(grid);
298
-
299
- blend_weights = TriangleInterpolate( gridFract );
300
-
301
- frame1 = gridFloor;
302
- frame2 = gridFloor + mix(vec2(0,1),vec2(1,0),blend_weights.w);
303
- frame3 = gridFloor + vec2(1.0,1.0);
304
-
305
- vec3 projectedQuadADir = FrameXYToRay(frame1, framesMinusOne);
306
- vec3 projectedQuadBDir = FrameXYToRay(frame2, framesMinusOne);
307
- vec3 projectedQuadCDir = FrameXYToRay(frame3, framesMinusOne);
308
-
309
- frame1_normal = (modelViewMatrix *vec4(projectedQuadADir, 0)).xyz;
310
- frame2_normal = (modelViewMatrix *vec4(projectedQuadBDir, 0)).xyz;
311
- frame3_normal = (modelViewMatrix *vec4(projectedQuadCDir, 0)).xyz;
312
-
313
- vec3 plane_x1, plane_y1, plane_x2, plane_y2, plane_x3, plane_y3;
314
-
315
- calcuateXYbasis(projectedQuadADir, plane_x1, plane_y1);
316
-
317
- uv_frame1 = virtualPlaneUV(projectedQuadADir, plane_x1, plane_y1, pivotToCameraRay, vertexToCameraRay, uRadius);
318
- xy_frame1 = projectOnPlaneBasis(-vertexToCameraDir, projectedQuadADir, plane_x1, plane_y1).xy;
319
-
320
- calcuateXYbasis(projectedQuadBDir, plane_x2, plane_y2);
321
- uv_frame2 = virtualPlaneUV(projectedQuadBDir, plane_x2, plane_y2, pivotToCameraRay, vertexToCameraRay, uRadius);
322
- xy_frame2 = projectOnPlaneBasis(-vertexToCameraDir, projectedQuadBDir, plane_x2, plane_y2).xy;
323
-
324
- calcuateXYbasis(projectedQuadCDir, plane_x3, plane_y3);
325
- uv_frame3 = virtualPlaneUV(projectedQuadCDir, plane_x3, plane_y3, pivotToCameraRay, vertexToCameraRay, uRadius);
326
- xy_frame3 = projectOnPlaneBasis(-vertexToCameraDir, projectedQuadCDir, plane_x3, plane_y3).xy;
327
-
328
-
329
85
  }
330
86
  `;
331
87
  const shader_fg = `
@@ -355,23 +111,6 @@ const shader_fg = `
355
111
  in vec3 local_ray_near;
356
112
  in vec3 local_ray_far;
357
113
 
358
- flat in vec2 frame1;
359
- flat in vec3 frame1_normal;
360
- in vec2 uv_frame1;
361
- in vec2 xy_frame1;
362
-
363
- flat in vec2 frame2;
364
- flat in vec3 frame2_normal;
365
- in vec2 uv_frame2;
366
- in vec2 xy_frame2;
367
-
368
- flat in vec2 frame3;
369
- flat in vec3 frame3_normal;
370
- in vec2 uv_frame3;
371
- in vec2 xy_frame3;
372
-
373
- in vec4 blend_weights;
374
-
375
114
  struct Material{
376
115
  vec3 diffuse;
377
116
  vec3 normal;
@@ -497,14 +236,14 @@ const shader_fg = `
497
236
  ));
498
237
  }
499
238
 
500
- vec2 recompute_uv(vec2 frame, vec2 frame_uv, vec2 xy_f, sampler2D gBuffer){
239
+ vec2 recompute_uv(vec2 frame, vec2 frame_uv, sampler2D gBuffer){
501
240
  vec2 frame_size = vec2(1.0/ uFrames);
502
241
 
503
242
  vec2 source_uv = (frame + frame_uv)*frame_size;
504
243
 
505
244
  float n_depth = texture(gBuffer, source_uv).a;
506
245
 
507
- vec2 offset = clamp(xy_f * vec2(0.5-n_depth ) * depth_scale,0.0, 1.0);
246
+ vec2 offset = clamp(length(frame_uv*2.0 - 1.0) * vec2(0.5-n_depth ) * depth_scale,0.0, 1.0);
508
247
 
509
248
  vec2 uv_f = clamp(frame_uv+offset, 0.0, 1.0);
510
249
 
@@ -514,21 +253,6 @@ const shader_fg = `
514
253
  // return source_uv;
515
254
  }
516
255
 
517
- vec2 recalculateUV(vec2 uv_f, vec2 frame, vec2 xy_f, vec2 frame_size, float d_scale, sampler2D depthTexture)
518
- {
519
- //clamp for parallax sampling
520
- uv_f = clamp(uv_f, vec2(0.0), vec2(1.0));
521
- vec2 uv_quad = frame_size * (frame + uv_f);
522
- //paralax
523
- vec4 n_depth = (texture( depthTexture, uv_quad));
524
- uv_f = xy_f * (0.5-n_depth.a) * d_scale + uv_f;
525
- //clamp parallax offset
526
- uv_f = clamp(uv_f, vec2(0.0), vec2(1.0));
527
- uv_f = frame_size * (frame + uv_f);
528
- //clamped full UV
529
- return clamp(uv_f, vec2(0.0), vec2(1.0));
530
- }
531
-
532
256
  void main(){
533
257
  vec3 view_direction = normalize(local_ray_near-local_ray_far);
534
258
 
@@ -538,17 +262,19 @@ const shader_fg = `
538
262
  vec2 gridFrac = fract(grid);
539
263
  vec2 gridFloor = floor(grid);
540
264
 
541
- vec4 weights = blend_weights;
265
+ vec4 weights = TriangleInterpolate( gridFrac );
542
266
 
543
267
  vec2 frame_uv = vUv;
544
268
 
545
269
  //3 nearest frames
546
- vec2 quad_size = vec2(1.0) / uFrames;
547
- vec2 uv_f1 = recalculateUV(uv_frame1, frame1, xy_frame1, quad_size, depth_scale, tGeometry);
548
- vec2 uv_f2 = recalculateUV(uv_frame2, frame2, xy_frame2, quad_size, depth_scale, tGeometry);
549
- vec2 uv_f3 = recalculateUV(uv_frame3, frame3, xy_frame3, quad_size, depth_scale, tGeometry);
550
-
551
-
270
+ vec2 frame0 = gridFloor;
271
+ vec2 frame1 = gridFloor + mix(vec2(0,1),vec2(1,0),weights.w);
272
+ vec2 frame2 = gridFloor + vec2(1.0,1.0);
273
+
274
+ vec2 uv0 = recompute_uv(frame0, frame_uv, tGeometry);
275
+ vec2 uv1 = recompute_uv(frame1, frame_uv, tGeometry);
276
+ vec2 uv2 = recompute_uv(frame2, frame_uv, tGeometry);
277
+
552
278
  vec4 ddxy = vec4( dFdx(vUv.xy), dFdy(vUv.xy) );
553
279
 
554
280
  vec2 frame_size = vec2(1.0/ uFrames);
@@ -556,9 +282,9 @@ const shader_fg = `
556
282
  vec4 texel_color = ImposterBlendWeights(
557
283
  // vec4 texel_color = ImposterBlendWeightsNearest(
558
284
  tBase,
559
- uv_f1,
560
- uv_f2,
561
- uv_f3,
285
+ uv0,
286
+ uv1,
287
+ uv2,
562
288
  weights, ddxy
563
289
  );
564
290
 
@@ -1,5 +1,5 @@
1
- import { PI_HALF } from "../../../../../core/math/MathUtils.js";
2
1
  import { v3_angle_between } from "../../../../../core/geom/v3_angle_between.js";
2
+ import { PI_HALF } from "../../../../../core/math/PI_HALF.js";
3
3
 
4
4
  /**
5
5
  *
@@ -11,7 +11,7 @@ import AnimationSystem from "../../../../../../ecs/systems/AnimationSystem.js";
11
11
  import TopDownCameraControllerSystem from "../../../../../ecs/camera/topdown/TopDownCameraControllerSystem.js";
12
12
  import { CameraSystem } from "../../../../../ecs/camera/CameraSystem.js";
13
13
  import { MeshSystem } from "../../../../../ecs/mesh/MeshSystem.js";
14
- import ClingToTerrainSystem from "../../../../../../ecs/terrain/ecs/ClingToTerrainSystem.js";
14
+ import ClingToTerrainSystem from "../../../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
15
15
  import TerrainSystem from "../../../../../../ecs/terrain/ecs/TerrainSystem.js";
16
16
  import Trail2DSystem from "../../../../../ecs/trail2d/Trail2DSystem.js";
17
17
  import { Foliage2System } from "../../../../../../ecs/foliage/ecs/Foliage2System.js";
@@ -18,7 +18,7 @@ import TopDownCameraControllerSystem from "../../../ecs/camera/topdown/TopDownCa
18
18
  import { TopDownCameraLanderSystem } from "../../../ecs/camera/topdown/TopDownCameraLanderSystem.js";
19
19
  import { CameraSystem } from "../../../ecs/camera/CameraSystem.js";
20
20
  import { MeshSystem } from "../../../ecs/mesh/MeshSystem.js";
21
- import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/ClingToTerrainSystem.js";
21
+ import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
22
22
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
23
23
  import WaterSystem from "../../../ecs/water/WaterSystem.js";
24
24
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
@@ -19,7 +19,7 @@ import TopDownCameraControllerSystem from "../../../ecs/camera/topdown/TopDownCa
19
19
  import { TopDownCameraLanderSystem } from "../../../ecs/camera/topdown/TopDownCameraLanderSystem.js";
20
20
  import { CameraSystem } from "../../../ecs/camera/CameraSystem.js";
21
21
  import { MeshSystem } from "../../../ecs/mesh/MeshSystem.js";
22
- import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/ClingToTerrainSystem.js";
22
+ import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
23
23
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
24
24
  import WaterSystem from "../../../ecs/water/WaterSystem.js";
25
25
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
@@ -18,7 +18,7 @@ import TopDownCameraControllerSystem from "../../../ecs/camera/topdown/TopDownCa
18
18
  import { TopDownCameraLanderSystem } from "../../../ecs/camera/topdown/TopDownCameraLanderSystem.js";
19
19
  import { CameraSystem } from "../../../ecs/camera/CameraSystem.js";
20
20
  import { MeshSystem } from "../../../ecs/mesh/MeshSystem.js";
21
- import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/ClingToTerrainSystem.js";
21
+ import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
22
22
  import TerrainSystem from "../../../../ecs/terrain/ecs/TerrainSystem.js";
23
23
  import WaterSystem from "../../../ecs/water/WaterSystem.js";
24
24
  import Trail2DSystem from "../../../ecs/trail2d/Trail2DSystem.js";
@@ -12,7 +12,7 @@ import SoundListenerSystem from "../../sound/ecs/SoundListenerSystem.js";
12
12
  import AnimationSystem from "../../ecs/systems/AnimationSystem.js";
13
13
  import TopDownCameraControllerSystem from "../ecs/camera/topdown/TopDownCameraControllerSystem.js";
14
14
  import { CameraSystem } from "../ecs/camera/CameraSystem.js";
15
- import ClingToTerrainSystem from "../../ecs/terrain/ecs/ClingToTerrainSystem.js";
15
+ import ClingToTerrainSystem from "../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
16
16
  import TerrainSystem from "../../ecs/terrain/ecs/TerrainSystem.js";
17
17
  import Trail2DSystem from "../ecs/trail2d/Trail2DSystem.js";
18
18
  import { Foliage2System } from "../../ecs/foliage/ecs/Foliage2System.js";
@@ -1,6 +1,6 @@
1
1
  import { Sampler2D } from "../../../graphics/texture/sampler/Sampler2D.js";
2
2
  import { sampler2D_scale_down_linear } from "../../../graphics/texture/sampler/sampler2D_scale_down_linear.js";
3
- import { computeWholeDivisorLow } from "../../../../core/math/MathUtils.js";
3
+ import { computeWholeDivisorLow } from "../../../../core/math/computeWholeDivisorLow.js";
4
4
 
5
5
  /**
6
6
  *
@@ -1,11 +1,11 @@
1
1
  import { SoundMaterialSurfaceDetector } from "../SoundMaterialSurfaceDetector.js";
2
2
  import Vector2 from "../../../../../core/geom/Vector2.js";
3
- import { normalizeArrayVector } from "../../../../../core/math/MathUtils.js";
4
3
  import { SoundMaterialComposition } from "../../concrete/SoundMaterialComposition.js";
5
4
  import { SilentSoundMaterial } from "../../concrete/SilentSoundMaterial.js";
6
5
  import { SingleSoundMaterial } from "../../concrete/SingleSoundMaterial.js";
7
6
  import { deserializeSoundMaterialFromJSON } from "../../concrete/json/deserializeSoundMaterialFromJSON.js";
8
7
  import { assert } from "../../../../../core/assert.js";
8
+ import { normalizeArrayVector } from "../../../../../core/math/normalizeArrayVector.js";
9
9
 
10
10
  const v2_temp = new Vector2();
11
11
 
@@ -24,7 +24,6 @@ import GUIElement from "../../../engine/ecs/gui/GUIElement.js";
24
24
  import {
25
25
  MarkerNodeTransformerYRotateByFilterGradient
26
26
  } from "../../markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js";
27
- import { PI_HALF } from "../../../core/math/MathUtils.js";
28
27
  import { CellFilterGaussianBlur } from "../../filtering/numeric/complex/CellFilterGaussianBlur.js";
29
28
  import { CellProcessingRule } from "../../theme/cell/CellProcessingRule.js";
30
29
  import {
@@ -32,7 +31,7 @@ import {
32
31
  } from "../../grid/actions/ContinuousGridCellActionSetTerrainHeight.js";
33
32
  import { MirGridLayers } from "../grid/MirGridLayers.js";
34
33
  import { CellFilterSampleLayerLinear } from "../../filtering/numeric/sampling/CellFilterSampleLayerLinear.js";
35
- import ClingToTerrain from "../../../engine/ecs/terrain/ecs/ClingToTerrain.js";
34
+ import ClingToTerrain from "../../../engine/ecs/terrain/ecs/cling/ClingToTerrain.js";
36
35
  import { MarkerNodeTransformerYRotateByFilter } from "../../markers/transform/MarkerNodeTransformerYRotateByFilter.js";
37
36
  import { CellFilterAngleToNormal } from "../../filtering/numeric/complex/CellFilterAngleToNormal.js";
38
37
  import Vector3 from "../../../core/geom/Vector3.js";
@@ -52,6 +51,7 @@ import GeneratedArmy from "../../../../model/game/ecs/component/generator/army/G
52
51
  import { MirMarkerTypes } from "../../../../generator/MirMarkerTypes.js";
53
52
  import { TerrainLayerDescription } from "../../theme/TerrainLayerDescription.js";
54
53
  import Vector2 from "../../../core/geom/Vector2.js";
54
+ import { PI_HALF } from "../../../core/math/PI_HALF.js";
55
55
 
56
56
  export const SampleTheme0 = new Theme();
57
57
 
@@ -3,10 +3,10 @@ import { GridTaskGenerator } from "../GridTaskGenerator.js";
3
3
  import Task from "../../../core/process/task/Task.js";
4
4
  import { TaskSignal } from "../../../core/process/task/TaskSignal.js";
5
5
  import { BitSet } from "../../../core/binary/BitSet.js";
6
- import { PI_HALF } from "../../../core/math/MathUtils.js";
7
6
  import TaskGroup from "../../../core/process/task/TaskGroup.js";
8
7
  import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
9
8
  import { actionTask } from "../../../core/process/task/util/actionTask.js";
9
+ import { PI_HALF } from "../../../core/math/PI_HALF.js";
10
10
 
11
11
  export class GridTaskExecuteRuleTimes extends GridTaskGenerator {
12
12
  constructor() {
@@ -1,7 +1,7 @@
1
1
  import { CellSupplier } from "./CellSupplier.js";
2
2
  import { assert } from "../../../../../core/assert.js";
3
3
  import { CellMatcherAny } from "../../../../rules/CellMatcherAny.js";
4
- import { PI_HALF } from "../../../../../core/math/MathUtils.js";
4
+ import { PI_HALF } from "../../../../../core/math/PI_HALF.js";
5
5
 
6
6
  /**
7
7
  *
@@ -1,4 +1,3 @@
1
- import { PI_HALF } from "../../core/math/MathUtils.js";
2
1
  import { assert } from "../../core/assert.js";
3
2
  import { seededRandom } from "../../core/math/random/seededRandom.js";
4
3
  import { RuleSelectionPolicyType } from "./RuleSelectionPolicyType.js";
@@ -7,6 +6,7 @@ import { ArrayIteratorRandom } from "../../core/collection/array/ArrayIteratorRa
7
6
  import TaskGroup from "../../core/process/task/TaskGroup.js";
8
7
  import { randomCountTask } from "../../core/process/task/util/randomCountTask.js";
9
8
  import { countTask } from "../../core/process/task/util/countTask.js";
9
+ import { PI_HALF } from "../../core/math/PI_HALF.js";
10
10
 
11
11
 
12
12
  /**
@@ -1,6 +1,6 @@
1
1
  import { MarkerNodeEntityProcessor } from "./MarkerNodeEntityProcessor.js";
2
2
  import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
3
- import { alignToVector } from "../../../../engine/ecs/terrain/ecs/ClingToTerrainSystem.js";
3
+ import { alignToVector } from "../../../../engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
4
4
  import { obtainTerrain } from "../../../../engine/ecs/terrain/util/obtainTerrain.js";
5
5
 
6
6
  const p = new SurfacePoint3();
@@ -1,7 +1,8 @@
1
1
  import { MarkerNodeTransformer } from "./MarkerNodeTransformer.js";
2
2
  import { assert } from "../../../core/assert.js";
3
- import { EPSILON, epsilonEquals } from "../../../core/math/MathUtils.js";
4
3
  import Vector3 from "../../../core/geom/Vector3.js";
4
+ import { epsilonEquals } from "../../../core/math/epsilonEquals.js";
5
+ import { EPSILON } from "../../../core/math/EPSILON.js";
5
6
 
6
7
  const v3_object = new Vector3();
7
8
 
@@ -2,7 +2,8 @@ import { MarkerNodeTransformer } from "./MarkerNodeTransformer.js";
2
2
  import Vector3 from "../../../core/geom/Vector3.js";
3
3
  import { assert } from "../../../core/assert.js";
4
4
  import { computeCellFilterGradient } from "../../filtering/numeric/process/computeCellFilterGradient.js";
5
- import { EPSILON, epsilonEquals } from "../../../core/math/MathUtils.js";
5
+ import { epsilonEquals } from "../../../core/math/epsilonEquals.js";
6
+ import { EPSILON } from "../../../core/math/EPSILON.js";
6
7
 
7
8
  const v3_object = new Vector3();
8
9
 
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.43.13",
8
+ "version": "2.43.15",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",
@@ -4,8 +4,8 @@
4
4
  import dom from "../../DOM.js";
5
5
  import SVG from "../../SVG.js";
6
6
  import View from "../../View.js";
7
- import { computeIsoscelesTriangleApexAngle } from "../../../core/math/MathUtils.js";
8
7
  import { RadialText } from "./RadialText.js";
8
+ import { computeIsoscelesTriangleApexAngle } from "../../../core/math/computeIsoscelesTriangleApexAngle.js";
9
9
 
10
10
  const PI2 = Math.PI * 2;
11
11
 
@@ -1,8 +1,8 @@
1
1
  import View from "../../View.js";
2
2
  import SVG, { svgCircularPath } from "../../SVG.js";
3
- import { PI2 } from "../../../core/math/MathUtils.js";
4
3
  import { assert } from "../../../core/assert.js";
5
4
  import { isValueBetween } from "../../../core/math/isValueBetween.js";
5
+ import { PI2 } from "../../../core/math/PI2.js";
6
6
 
7
7
  let idCount = 0;
8
8
 
@@ -3,10 +3,10 @@ import Vector2 from "../../core/geom/Vector2.js";
3
3
  import AABB2 from "../../core/geom/AABB2.js";
4
4
  import { CompassArrowView } from "../elements/CompassArrowView.js";
5
5
  import EmptyView from "../elements/EmptyView.js";
6
- import { EPSILON } from "../../core/math/MathUtils.js";
7
6
  import { forceIntoBox } from "../../core/graph/layout/box/forceIntoBox.js";
8
7
  import { pullBoxTowardsPoint } from "../../core/graph/layout/box/pullBoxTowardsPoint.js";
9
8
  import { resolveAABB2Overlap } from "../../core/graph/layout/box/resolveAABB2Overlap.js";
9
+ import { EPSILON } from "../../core/math/EPSILON.js";
10
10
 
11
11
 
12
12
  class TooltipView extends View {