@woosh/meep-engine 2.108.0 → 2.108.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 (216) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +650 -308
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +650 -308
  5. package/editor/tools/paint/TerrainHeightPaintTool.js +5 -5
  6. package/package.json +1 -1
  7. package/src/core/binary/float_to_uint8.d.ts +7 -0
  8. package/src/core/binary/float_to_uint8.d.ts.map +1 -0
  9. package/src/core/binary/{float2uint8.js → float_to_uint8.js} +1 -1
  10. package/src/core/binary/uint8_to_float.d.ts +7 -0
  11. package/src/core/binary/uint8_to_float.d.ts.map +1 -0
  12. package/src/core/binary/{uint82float.js → uint8_to_float.js} +1 -1
  13. package/src/core/binary/uint8_to_float.spec.d.ts +2 -0
  14. package/src/core/binary/uint8_to_float.spec.d.ts.map +1 -0
  15. package/src/core/binary/uint8_to_float.spec.js +7 -0
  16. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts +6 -0
  17. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  18. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +15 -3
  19. package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +3 -3
  20. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
  21. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +25 -14
  22. package/src/core/codegen/codeToBlob.d.ts +8 -0
  23. package/src/core/codegen/codeToBlob.d.ts.map +1 -0
  24. package/src/core/codegen/codeToBlob.js +36 -0
  25. package/src/core/codegen/codeToURL.d.ts +8 -0
  26. package/src/core/codegen/codeToURL.d.ts.map +1 -0
  27. package/src/core/codegen/codeToURL.js +22 -0
  28. package/src/core/collection/array/arrayQuickSort.d.ts +0 -9
  29. package/src/core/collection/array/arrayQuickSort.d.ts.map +1 -1
  30. package/src/core/collection/array/arrayQuickSort.js +0 -73
  31. package/src/core/collection/array/array_quick_sort_by_comparator.d.ts +10 -0
  32. package/src/core/collection/array/array_quick_sort_by_comparator.d.ts.map +1 -0
  33. package/src/core/collection/array/array_quick_sort_by_comparator.js +75 -0
  34. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts +8 -0
  35. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts.map +1 -0
  36. package/src/core/collection/array/array_quick_sort_by_lookup.js +78 -0
  37. package/src/core/collection/array/array_shuffle.d.ts +8 -0
  38. package/src/core/collection/array/array_shuffle.d.ts.map +1 -0
  39. package/src/core/collection/array/array_shuffle.js +22 -0
  40. package/src/core/collection/array/array_shuffle.spec.d.ts +2 -0
  41. package/src/core/collection/array/array_shuffle.spec.d.ts.map +1 -0
  42. package/src/core/collection/array/{randomizeArrayElementOrder.spec.js → array_shuffle.spec.js} +4 -4
  43. package/src/core/collection/array/iterator/ArrayIteratorRandom.js +2 -2
  44. package/src/core/collection/array/randomMultipleFromArray.js +2 -2
  45. package/src/core/color/Color.js +9 -9
  46. package/src/core/color/hsv/hsv2rgb.js +4 -4
  47. package/src/core/color/rgb2uint24.js +4 -4
  48. package/src/core/color/sRGB/linear_to_sRGB.d.ts +1 -0
  49. package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
  50. package/src/core/color/sRGB/linear_to_sRGB.js +4 -4
  51. package/src/core/geom/2d/triangle2d_get_barycentric.d.ts +15 -0
  52. package/src/core/geom/2d/triangle2d_get_barycentric.d.ts.map +1 -0
  53. package/src/core/geom/2d/triangle2d_get_barycentric.js +48 -0
  54. package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
  55. package/src/core/geom/3d/aabb/AABB3.js +4 -1
  56. package/src/core/geom/3d/aabb/aabb3_from_v3_array.d.ts.map +1 -1
  57. package/src/core/geom/3d/aabb/aabb3_from_v3_array.js +2 -7
  58. package/src/core/geom/3d/aabb/aabb3_intersects_ray.js +3 -3
  59. package/src/core/geom/3d/aabb3_compute_from_triangle.d.ts +11 -0
  60. package/src/core/geom/3d/aabb3_compute_from_triangle.d.ts.map +1 -0
  61. package/src/core/geom/3d/aabb3_compute_from_triangle.js +43 -0
  62. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
  63. package/src/core/geom/3d/shape/UnitSphereShape3D.js +14 -14
  64. package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts.map +1 -1
  65. package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.js +2 -0
  66. package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +5 -5
  67. package/src/core/geom/3d/sphere/harmonics/sh_compute_K.d.ts +9 -0
  68. package/src/core/geom/3d/sphere/harmonics/sh_compute_K.d.ts.map +1 -0
  69. package/src/core/geom/3d/sphere/harmonics/sh_compute_K.js +17 -0
  70. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts +6 -3
  71. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
  72. package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +56 -18
  73. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_walk_towards_containing_tetrahedron.d.ts +1 -1
  74. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_walk_towards_containing_tetrahedron.d.ts.map +1 -1
  75. package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_walk_towards_containing_tetrahedron.js +11 -4
  76. package/src/core/geom/3d/tetrahedra/{GetDepthForTetrahedronProbe.glsl → triangle/GetDepthForTetrahedronProbe.glsl} +17 -10
  77. package/src/core/geom/3d/tetrahedra/triangle/prototype.d.ts +2 -0
  78. package/src/core/geom/3d/tetrahedra/triangle/prototype.d.ts.map +1 -0
  79. package/src/core/geom/3d/tetrahedra/triangle/prototype.js +128 -0
  80. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.d.ts +13 -0
  81. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.d.ts.map +1 -0
  82. package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js +120 -0
  83. package/src/core/geom/3d/tetrahedra/triangle/triangle_encode_rasterized_depth.d.ts +3 -0
  84. package/src/core/geom/3d/tetrahedra/triangle/triangle_encode_rasterized_depth.d.ts.map +1 -0
  85. package/src/core/geom/3d/tetrahedra/triangle/triangle_encode_rasterized_depth.js +106 -0
  86. package/src/core/geom/Vector3.js +3 -3
  87. package/src/core/geom/random/randomPointInSphere.d.ts +1 -1
  88. package/src/core/geom/random/randomPointInSphere.js +2 -2
  89. package/src/core/geom/random/randomPointOnSphere.d.ts +3 -3
  90. package/src/core/geom/random/randomPointOnSphere.d.ts.map +1 -1
  91. package/src/core/geom/random/randomPointOnSphere.js +5 -9
  92. package/src/core/math/factorial.d.ts +7 -0
  93. package/src/core/math/factorial.d.ts.map +1 -0
  94. package/src/core/math/factorial.js +15 -0
  95. package/src/core/math/factorial.spec.d.ts +2 -0
  96. package/src/core/math/factorial.spec.d.ts.map +1 -0
  97. package/src/core/math/factorial.spec.js +9 -0
  98. package/src/core/model/DebouncedObservedBoolean.d.ts +1 -1
  99. package/src/core/model/DebouncedObservedBoolean.d.ts.map +1 -1
  100. package/src/core/model/node-graph/node/NodeDescription.d.ts +6 -4
  101. package/src/core/process/task/util/randomCountTask.js +3 -3
  102. package/src/core/process/worker/WorkerBuilder.d.ts.map +1 -1
  103. package/src/core/process/worker/WorkerBuilder.js +5 -35
  104. package/src/engine/EngineHarness.d.ts.map +1 -1
  105. package/src/engine/EngineHarness.js +7 -1
  106. package/src/engine/asset/loaders/ArrayBufferLoader.d.ts.map +1 -1
  107. package/src/engine/asset/loaders/ArrayBufferLoader.js +17 -10
  108. package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.d.ts.map +1 -1
  109. package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.js +3 -0
  110. package/src/engine/asset/loaders/material/computeTextureEquality.d.ts.map +1 -1
  111. package/src/engine/asset/loaders/material/computeTextureEquality.js +8 -1
  112. package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +4 -4
  113. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts.map +1 -1
  114. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +4 -0
  115. package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.d.ts.map +1 -1
  116. package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.js +3 -1
  117. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
  118. package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +7 -7
  119. package/src/engine/graphics/filter/sampler2d_flipY_in_place.d.ts +8 -0
  120. package/src/engine/graphics/filter/sampler2d_flipY_in_place.d.ts.map +1 -0
  121. package/src/engine/graphics/filter/{FlipArrayInPlace.js → sampler2d_flipY_in_place.js} +1 -1
  122. package/src/engine/graphics/geometry/bvh/buffered/bvh32_set_leaf_from_triangle.d.ts.map +1 -1
  123. package/src/engine/graphics/geometry/bvh/buffered/bvh32_set_leaf_from_triangle.js +5 -27
  124. package/src/engine/graphics/impostors/octahedral/bake/prepare_bake_material.js +3 -3
  125. package/src/engine/graphics/render/Lines.d.ts.map +1 -1
  126. package/src/engine/graphics/render/Lines.js +10 -2
  127. package/src/engine/graphics/sh3/SH3VisualisationMaterial.d.ts.map +1 -1
  128. package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -6
  129. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts +24 -0
  130. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -0
  131. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +293 -0
  132. package/src/engine/graphics/sh3/gi/material/build_fragment_shader.d.ts +6 -0
  133. package/src/engine/graphics/sh3/gi/material/build_fragment_shader.d.ts.map +1 -0
  134. package/src/engine/graphics/sh3/gi/material/build_fragment_shader.js +71 -0
  135. package/src/engine/graphics/sh3/gi/material/build_vertex_shader.d.ts +6 -0
  136. package/src/engine/graphics/sh3/gi/material/build_vertex_shader.d.ts.map +1 -0
  137. package/src/engine/graphics/sh3/gi/material/build_vertex_shader.js +256 -0
  138. package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.js +4 -4
  139. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +3 -1
  140. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
  141. package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +12 -1
  142. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
  143. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -5
  144. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts +2 -1
  145. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
  146. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +6 -6
  147. package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts +8 -0
  148. package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts.map +1 -1
  149. package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.js +3 -2
  150. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
  151. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +9 -4
  152. package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts +3 -3
  153. package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
  154. package/src/engine/graphics/sh3/path_tracer/PathTracer.js +2 -2
  155. package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.d.ts +2 -2
  156. package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.d.ts.map +1 -1
  157. package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.js +18 -8
  158. package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +14 -6
  159. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts +10 -0
  160. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts.map +1 -0
  161. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.js +20 -0
  162. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts +10 -0
  163. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts.map +1 -0
  164. package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.js +31 -0
  165. package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts +9 -0
  166. package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts.map +1 -0
  167. package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.js +21 -0
  168. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +1 -1
  169. package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts.map +1 -1
  170. package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.js +2 -3
  171. package/src/engine/graphics/sh3/path_tracer/vec3_uint8_to_float.js +4 -4
  172. package/src/engine/graphics/sh3/prototypeSH3Probe.js +116 -19
  173. package/src/engine/graphics/texture/AttributeDataTexture.d.ts.map +1 -1
  174. package/src/engine/graphics/texture/AttributeDataTexture.js +8 -2
  175. package/src/engine/graphics/texture/computeThreeTextureFormat.js +2 -1
  176. package/src/engine/graphics/texture/computeThreeTextureFormatFromDataType.d.ts +7 -0
  177. package/src/engine/graphics/texture/computeThreeTextureFormatFromDataType.d.ts.map +1 -0
  178. package/src/engine/graphics/texture/computeThreeTextureFormatFromDataType.js +13 -0
  179. package/src/engine/graphics/texture/numericTypeFromBinaryDataType.d.ts +9 -0
  180. package/src/engine/graphics/texture/numericTypeFromBinaryDataType.d.ts.map +1 -0
  181. package/src/engine/graphics/texture/numericTypeFromBinaryDataType.js +31 -0
  182. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
  183. package/src/engine/graphics/texture/sampler/Sampler2D.js +4 -4
  184. package/src/engine/graphics/texture/sampler/convertTexture2Sampler2D.d.ts.map +1 -1
  185. package/src/engine/graphics/texture/sampler/convertTexture2Sampler2D.js +47 -19
  186. package/src/engine/graphics/texture/sampler/debug/prototypeSamplerFiltering.js +5 -33
  187. package/src/engine/graphics/texture/sampler/sampler2d_copy_rectangle.d.ts +11 -0
  188. package/src/engine/graphics/texture/sampler/sampler2d_copy_rectangle.d.ts.map +1 -0
  189. package/src/engine/graphics/texture/sampler/sampler2d_copy_rectangle.js +41 -0
  190. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts +0 -4
  191. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts.map +1 -1
  192. package/src/engine/graphics/texture/virtual/VirtualTextureUsage.js +19 -30
  193. package/src/engine/network/convertPathToURL.d.ts +3 -1
  194. package/src/engine/network/convertPathToURL.d.ts.map +1 -1
  195. package/src/engine/network/convertPathToURL.js +68 -51
  196. package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
  197. package/src/engine/physics/fluid/SliceVisualiser.js +4 -4
  198. package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
  199. package/src/generation/filtering/numeric/CellFilterCache.js +1 -0
  200. package/src/core/binary/float2uint8.d.ts +0 -7
  201. package/src/core/binary/float2uint8.d.ts.map +0 -1
  202. package/src/core/binary/uint82float.d.ts +0 -7
  203. package/src/core/binary/uint82float.d.ts.map +0 -1
  204. package/src/core/binary/uint82float.spec.d.ts +0 -2
  205. package/src/core/binary/uint82float.spec.d.ts.map +0 -1
  206. package/src/core/binary/uint82float.spec.js +0 -7
  207. package/src/core/collection/array/randomizeArrayElementOrder.d.ts +0 -8
  208. package/src/core/collection/array/randomizeArrayElementOrder.d.ts.map +0 -1
  209. package/src/core/collection/array/randomizeArrayElementOrder.js +0 -24
  210. package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts +0 -2
  211. package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts.map +0 -1
  212. package/src/engine/graphics/filter/FlipArrayInPlace.d.ts +0 -8
  213. package/src/engine/graphics/filter/FlipArrayInPlace.d.ts.map +0 -1
  214. package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts +0 -3
  215. package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts.map +0 -1
  216. package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.js +0 -3
@@ -25,10 +25,6 @@ export class VirtualTextureUsage {
25
25
  * @param {number} bias added to the ancestor tiles to make them more likely to be loaded
26
26
  */
27
27
  promoteAncestors(bias?: number): void;
28
- /**
29
- * Sort occupancy list in descending order
30
- */
31
- sortOccupancy(): void;
32
28
  sortOccupancyByLOD(): void;
33
29
  /**
34
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualTextureUsage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureUsage.js"],"names":[],"mappings":"AAOA;IAcI,0BAEC;IAKD,+BAIC;IAED,4BAEC;IAGD,6BAEC;IAED,8BAEC;IAkBD;;;;OAIG;IACH,mCAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAMlB;IAED,cAGC;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAsChB;IAWD;;OAEG;IACH,sBAiBC;IAED,2BAqBC;IAGD;;;OAGG;IACH,kBAFW,UAAU,QAsCpB;;CACJ"}
1
+ {"version":3,"file":"VirtualTextureUsage.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/virtual/VirtualTextureUsage.js"],"names":[],"mappings":"AAMA;IAcI,0BAEC;IAKD,+BAIC;IAED,4BAEC;IAGD,6BAEC;IAED,8BAEC;IAkBD;;;;OAIG;IACH,mCAHW,MAAM,GACJ,MAAM,CAMlB;IAED;;;;;;OAMG;IACH,gBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAMlB;IAED,cAGC;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAsChB;IAWD,2BAiCC;IAGD;;;OAGG;IACH,kBAFW,UAAU,QAsCpB;;CACJ"}
@@ -1,6 +1,5 @@
1
- import { array_quick_sort_by_comparator, arrayQuickSort } from "../../../../core/collection/array/arrayQuickSort.js";
1
+ import { array_quick_sort_by_comparator } from "../../../../core/collection/array/array_quick_sort_by_comparator.js";
2
2
  import { compose_tile_address } from "./tile/compose_tile_address.js";
3
- import { decompose_finger_print } from "./tile/decompose_finger_print.js";
4
3
  import { finger_print_to_tile_address } from "./tile/finger_print_to_tile_address.js";
5
4
  import { tile_address_to_finger_print } from "./tile/tile_address_to_finger_print.js";
6
5
 
@@ -142,36 +141,21 @@ export class VirtualTextureUsage {
142
141
  this.#occupancy_cursor++;
143
142
  }
144
143
 
145
- /**
146
- * Sort occupancy list in descending order
147
- */
148
- sortOccupancy() {
149
- // array_quick_sort_by_comparator(this.#occupancy, (a, b) => {
150
- //
151
- // return a-b;
152
- //
153
- //
154
- // }, null, 0, this.#occupancy_cursor - 1);
155
-
156
- //
157
- // arrayQuickSort(this.#occupancy, v => -v, null, 0, this.#occupancy_cursor - 1);
158
- arrayQuickSort(
159
- this.#occupancy,
160
- (index) => {
161
- return -this.#counts_intrinsic[index]
162
- }, null,
163
- 0, this.#occupancy_cursor - 1
164
- );
165
- }
166
-
167
144
  sortOccupancyByLOD() {
168
- array_quick_sort_by_comparator(this.#occupancy, (a, b) => {
145
+ /**
146
+ *
147
+ * @param {number} a
148
+ * @param {number} b
149
+ * @return {number}
150
+ */
151
+ const compare = (a, b) => {
169
152
 
170
153
  const fingerprint_a = tile_address_to_finger_print(a);
171
154
  const fingerprint_b = tile_address_to_finger_print(b);
172
155
 
173
- const { mip: mip_a } = decompose_finger_print(fingerprint_a);
174
- const { mip: mip_b } = decompose_finger_print(fingerprint_b);
156
+ // read MIP levels
157
+ const mip_a = (fingerprint_a >> 24) & 0xFF;
158
+ const mip_b = (fingerprint_b >> 24) & 0xFF;
175
159
 
176
160
  const mip_delta = mip_a - mip_b;
177
161
 
@@ -179,11 +163,16 @@ export class VirtualTextureUsage {
179
163
  return mip_delta;
180
164
  }
181
165
 
182
- const count_a = this.#counts_intrinsic[a];
183
- const count_b = this.#counts_intrinsic[b];
166
+ const intrinsic = this.#counts_intrinsic;
167
+
168
+ const count_a = intrinsic[a];
169
+ const count_b = intrinsic[b];
170
+
184
171
  return count_b - count_a;
185
172
 
186
- }, null, 0, this.#occupancy_cursor - 1);
173
+ };
174
+
175
+ array_quick_sort_by_comparator(this.#occupancy, compare, null, 0, this.#occupancy_cursor - 1);
187
176
 
188
177
  }
189
178
 
@@ -1,5 +1,7 @@
1
1
  /**
2
- *
2
+ * Given a path, which may be a local path, produce a fully qualified URL
3
+ * @example '/path' -> 'http://example.com/path'
4
+ * @example 'some/local/path' -> 'http://example.com/current_path/some/local/path'
3
5
  * @param {string} path
4
6
  * @return {string}
5
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"convertPathToURL.d.ts","sourceRoot":"","sources":["../../../../src/engine/network/convertPathToURL.js"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,uCAHW,MAAM,GACL,MAAM,CAoEjB"}
1
+ {"version":3,"file":"convertPathToURL.d.ts","sourceRoot":"","sources":["../../../../src/engine/network/convertPathToURL.js"],"names":[],"mappings":"AAuFA;;;;;;GAMG;AACH,uCAHW,MAAM,GACL,MAAM,CAcjB"}
@@ -1,3 +1,5 @@
1
+ import { assert } from "../../core/assert.js";
2
+
1
3
  const rx_url_schema = /[a-zA-Z0-9_\-]+\:\/\//;
2
4
 
3
5
  /**
@@ -21,70 +23,85 @@ const ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENV
21
23
  * @param {string} path
22
24
  * @return {string}
23
25
  */
24
- export function convertPathToURL(path) {
25
-
26
- if (!isGlobalPath(path)) {
26
+ function localPathToGlobal(path) {
27
+ /**
28
+ * @type {Window|DedicatedWorkerGlobalScope}
29
+ */
30
+ let scope;
31
+
32
+ if (ENVIRONMENT_IS_WEB) {
33
+ scope = window;
34
+ } else if (ENVIRONMENT_IS_WORKER) {
35
+ scope = self;
36
+ } else if (ENVIRONMENT_IS_NODE) {
37
+
38
+ let normalized_path = `${process.cwd()}/`.replace(/\\/g, '/');
39
+
40
+ // remove multiple sequential slashes
41
+ normalized_path = normalized_path.replace(/\/+/g, '/');
42
+
43
+ if (normalized_path[0] !== '/') {
44
+ // Windows drive letter must be prefixed with a slash.
45
+ normalized_path = `/${normalized_path}`;
46
+ }
27
47
 
28
- /**
29
- * @type {Window|DedicatedWorkerGlobalScope}
30
- */
31
- let scope;
48
+ scope = {
49
+ location: {
50
+ pathname: normalized_path,
51
+ host: '',
52
+ protocol: 'file:'
53
+ }
54
+ };
55
+ } else {
56
+ throw new Error('Unknown environment');
57
+ }
32
58
 
33
- if (ENVIRONMENT_IS_WEB) {
34
- scope = window;
35
- } else if (ENVIRONMENT_IS_WORKER) {
36
- scope = self;
37
- } else if (ENVIRONMENT_IS_NODE) {
59
+ const location = scope.location;
60
+ const pathname = location.pathname;
38
61
 
39
- let normalized_path = `${process.cwd()}/`.replace(/\\/g, '/');
62
+ let directoryPath;
40
63
 
41
- // remove multiple sequential slashes
42
- normalized_path = normalized_path.replace(/\/+/g, '/');
64
+ /*
65
+ path name contains file name also, there are two options here, "a/b" or "a/b/" second is a directory
66
+ we need to extract directory to load relative path
67
+ */
43
68
 
44
- if (normalized_path[0] !== '/') {
45
- // Windows drive letter must be prefixed with a slash.
46
- normalized_path = `/${normalized_path}`;
47
- }
69
+ if (pathname.endsWith('/')) {
70
+ //path is to a directory, strip last slash
71
+ directoryPath = pathname.substring(0, pathname.length - 1);
72
+ } else {
73
+ //path is to a file
74
+ const i = pathname.lastIndexOf('/');
48
75
 
49
- scope = {
50
- location: {
51
- pathname: normalized_path,
52
- host: '',
53
- protocol: 'file:'
54
- }
55
- };
76
+ if (i === -1) {
77
+ //root level file
78
+ directoryPath = ""
56
79
  } else {
57
- throw new Error('Unknown environment');
80
+ directoryPath = pathname.substring(0, i);
58
81
  }
82
+ }
59
83
 
60
- const location = scope.location;
61
- const pathname = location.pathname;
84
+ const urlBase = location.protocol + "//" + location.host + directoryPath + "/";
85
+ return urlBase + path;
86
+ }
62
87
 
63
- let directoryPath;
88
+ /**
89
+ * Given a path, which may be a local path, produce a fully qualified URL
90
+ * @example '/path' -> 'http://example.com/path'
91
+ * @example 'some/local/path' -> 'http://example.com/current_path/some/local/path'
92
+ * @param {string} path
93
+ * @return {string}
94
+ */
95
+ export function convertPathToURL(path) {
96
+ assert.isString(path, 'path');
64
97
 
65
- /*
66
- path name contains file name also, there are two options here, "a/b" or "a/b/" second is a directory
67
- we need to extract directory to load relative path
68
- */
98
+ const is_global = isGlobalPath(path);
69
99
 
70
- if (pathname.endsWith('/')) {
71
- //path is to a directory, strip last slash
72
- directoryPath = pathname.substring(0, pathname.length - 1);
73
- } else {
74
- //path is to a file
75
- const i = pathname.lastIndexOf('/');
76
-
77
- if (i === -1) {
78
- //root level file
79
- directoryPath = ""
80
- } else {
81
- directoryPath = pathname.substring(0, i);
82
- }
83
- }
100
+ let result = path;
84
101
 
85
- const urlBase = location.protocol + "//" + location.host + directoryPath + "/";
86
- path = urlBase + path;
102
+ if (!is_global) {
103
+ result = localPathToGlobal(path);
87
104
  }
88
105
 
89
- return path;
106
+ return result;
90
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SliceVisualiser.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/SliceVisualiser.js"],"names":[],"mappings":"AAMA;IAsBI;;OAEG;IACH,cAMC;IAED,aAgCC;IAED,eAkBC;IAED;;;;OAIG;IACH,cAHW,WAAW,cACX,MAAM,EAAE,QAkElB;;CAEJ;sBApKqB,qCAAqC"}
1
+ {"version":3,"file":"SliceVisualiser.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/fluid/SliceVisualiser.js"],"names":[],"mappings":"AAMA;IAsBI;;OAEG;IACH,cAMC;IAED,aAgCC;IAED,eAkBC;IAED;;;;OAIG;IACH,cAHW,WAAW,cACX,MAAM,EAAE,QAkElB;;CAEJ;sBAjKqB,qCAAqC"}
@@ -1,8 +1,8 @@
1
- import EmptyView from "../../../view/elements/EmptyView.js";
2
- import { float2uint8 } from "../../../core/binary/float2uint8.js";
1
+ import { float_to_uint8 } from "../../../core/binary/float_to_uint8.js";
3
2
  import { max2 } from "../../../core/math/max2.js";
4
- import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
5
3
  import { CanvasView } from "../../../view/elements/CanvasView.js";
4
+ import EmptyView from "../../../view/elements/EmptyView.js";
5
+ import { Sampler2D } from "../../graphics/texture/sampler/Sampler2D.js";
6
6
 
7
7
  export class SliceVisualiser extends EmptyView {
8
8
 
@@ -16,7 +16,7 @@ export class SliceVisualiser extends EmptyView {
16
16
  let i = 0;
17
17
 
18
18
  for (; i < channelCount; i++) {
19
- out[out_offset + i] = float2uint8(sample[i])
19
+ out[out_offset + i] = float_to_uint8(sample[i])
20
20
  }
21
21
 
22
22
  if (channelCount < 4) {
@@ -1 +1 @@
1
- {"version":3,"file":"CellFilterCache.d.ts","sourceRoot":"","sources":["../../../../../src/generation/filtering/numeric/CellFilterCache.js"],"names":[],"mappings":"AAIA;IAeI;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,eAAe,CAU3B;IA3BD;;;;OAIG;IACH,gBAAqC;IAErC;;;OAGG;IACH,OAFU,MAAM,CAEN;CAyDb;yCAxEwC,qCAAqC"}
1
+ {"version":3,"file":"CellFilterCache.d.ts","sourceRoot":"","sources":["../../../../../src/generation/filtering/numeric/CellFilterCache.js"],"names":[],"mappings":"AAIA;IAeI;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,eAAe,CAW3B;IA5BD;;;;OAIG;IACH,gBAAqC;IAErC;;;OAGG;IACH,OAFU,MAAM,CAEN;CA0Db;yCAzEwC,qCAAqC"}
@@ -29,6 +29,7 @@ export class CellFilterCache extends CellFilterUnaryOperation {
29
29
  const r = new CellFilterCache();
30
30
 
31
31
  r.source = source;
32
+ r.scale = scale;
32
33
 
33
34
  return r;
34
35
  }
@@ -1,7 +0,0 @@
1
- /**
2
- *
3
- * @param {number} v
4
- * @returns {number}
5
- */
6
- export function float2uint8(v: number): number;
7
- //# sourceMappingURL=float2uint8.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"float2uint8.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/float2uint8.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,CAIlB"}
@@ -1,7 +0,0 @@
1
- /**
2
- *
3
- * @param {number} v
4
- * @returns {number}
5
- */
6
- export function uint82float(v: number): number;
7
- //# sourceMappingURL=uint82float.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uint82float.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/uint82float.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+BAHW,MAAM,GACJ,MAAM,CAIlB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=uint82float.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uint82float.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/uint82float.spec.js"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { uint82float } from "./uint82float.js";
2
-
3
- test("correctness", () => {
4
- expect(uint82float(0)).toBe(0);
5
- expect(uint82float(1)).toBeCloseTo(1 / 255);
6
- expect(uint82float(255)).toBe(1);
7
- });
@@ -1,8 +0,0 @@
1
- /**
2
- * Randomly re-orders of items in-place
3
- * @template T
4
- * @param {function} random
5
- * @param {T[]} array
6
- */
7
- export function randomizeArrayElementOrder<T>(random: Function, array: T[]): void;
8
- //# sourceMappingURL=randomizeArrayElementOrder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"randomizeArrayElementOrder.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/randomizeArrayElementOrder.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,kFAcC"}
@@ -1,24 +0,0 @@
1
- import { randomIntegerBetween } from "../../math/random/randomIntegerBetween.js";
2
- import { array_swap_one } from "./array_swap_one.js";
3
-
4
- /**
5
- * Randomly re-orders of items in-place
6
- * @template T
7
- * @param {function} random
8
- * @param {T[]} array
9
- */
10
- export function randomizeArrayElementOrder(random, array) {
11
- const n = array.length;
12
-
13
- const lastValidIndex = n - 1;
14
-
15
- for (let i = 0; i < n; i++) {
16
- const t = randomIntegerBetween(random, 0, lastValidIndex);
17
-
18
- if (t === i) {
19
- continue;
20
- }
21
-
22
- array_swap_one(array, i, t);
23
- }
24
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=randomizeArrayElementOrder.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"randomizeArrayElementOrder.spec.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/randomizeArrayElementOrder.spec.js"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- /**
2
- * @param {Uint8Array} input
3
- * @param {number} width
4
- * @param {number} height
5
- * @param {number} channel_count
6
- */
7
- export function flipArrayInPlace(input: Uint8Array, width: number, height: number, channel_count?: number): void;
8
- //# sourceMappingURL=FlipArrayInPlace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FlipArrayInPlace.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/filter/FlipArrayInPlace.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wCALW,UAAU,SACV,MAAM,UACN,MAAM,kBACN,MAAM,QAyBhB"}
@@ -1,3 +0,0 @@
1
- export class SoftwareTextureCache {
2
- }
3
- //# sourceMappingURL=SoftwareTextureCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SoftwareTextureCache.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.js"],"names":[],"mappings":"AAAA;CAEC"}
@@ -1,3 +0,0 @@
1
- export class SoftwareTextureCache{
2
-
3
- }