@woosh/meep-engine 2.109.1 → 2.109.2

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 (258) hide show
  1. package/build/meep.cjs +122 -186
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +122 -186
  4. package/package.json +1 -1
  5. package/src/core/binary/ctz32.d.ts.map +1 -1
  6. package/src/core/binary/ctz32.js +12 -11
  7. package/src/core/binary/reinterpret_int32_as_float32.d.ts +7 -0
  8. package/src/core/binary/reinterpret_int32_as_float32.d.ts.map +1 -0
  9. package/src/core/binary/reinterpret_int32_as_float32.js +14 -0
  10. package/src/core/binary/reverse_bits_uint32.d.ts +8 -0
  11. package/src/core/binary/reverse_bits_uint32.d.ts.map +1 -0
  12. package/src/core/binary/reverse_bits_uint32.js +17 -0
  13. package/src/core/binary/reverse_bits_uint32.spec.d.ts +2 -0
  14. package/src/core/binary/reverse_bits_uint32.spec.d.ts.map +1 -0
  15. package/src/core/binary/reverse_bits_uint32.spec.js +18 -0
  16. package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
  17. package/src/core/bvh2/bvh3/BVH.js +13 -18
  18. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.d.ts.map +1 -1
  19. package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.js +3 -1
  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 +6 -7
  22. package/src/core/bvh2/bvh3/ebvh_build_hierarchy.d.ts.map +1 -1
  23. package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +4 -0
  24. package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts +16 -0
  25. package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts.map +1 -0
  26. package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.js +130 -0
  27. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts +2 -0
  28. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts.map +1 -0
  29. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.js +1 -0
  30. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts +9 -0
  31. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts.map +1 -0
  32. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.js +31 -0
  33. package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts +9 -0
  34. package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts.map +1 -0
  35. package/src/core/collection/array/array_quick_sort_by_lookup_map.js +79 -0
  36. package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts +8 -0
  37. package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts.map +1 -0
  38. package/src/core/collection/array/{array_quick_sort_by_lookup.js → array_quick_sort_by_lookup_uint.js} +1 -1
  39. package/src/core/collection/array/array_shuffle.js +1 -1
  40. package/src/core/collection/array/array_swap_one.d.ts.map +1 -1
  41. package/src/core/collection/array/array_swap_one.js +6 -0
  42. package/src/core/events/signal/Signal.d.ts.map +1 -1
  43. package/src/core/events/signal/Signal.js +10 -10
  44. package/src/core/geom/2d/compute_triangle_area_2d.d.ts.map +1 -1
  45. package/src/core/geom/2d/compute_triangle_area_2d.js +5 -3
  46. package/src/core/geom/3d/Ray3.d.ts +6 -0
  47. package/src/core/geom/3d/Ray3.d.ts.map +1 -1
  48. package/src/core/geom/3d/Ray3.js +24 -0
  49. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts +16 -0
  50. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts.map +1 -0
  51. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.js +29 -0
  52. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts +2 -2
  53. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts.map +1 -1
  54. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.js +6 -6
  55. package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.d.ts +11 -0
  56. package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.d.ts.map +1 -0
  57. package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.js +61 -0
  58. package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts +2 -2
  59. package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts.map +1 -1
  60. package/src/core/geom/3d/eulerAnglesFromMatrix.js +28 -25
  61. package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts +2 -2
  62. package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts.map +1 -1
  63. package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +1 -1
  64. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts +2 -2
  65. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts.map +1 -1
  66. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.js +1 -1
  67. package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.js +2 -2
  68. package/src/core/geom/3d/sphere/sphere_intersects_ray.js +1 -1
  69. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
  70. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +24 -188
  71. package/src/core/geom/3d/tetrahedra/triangle/prototype.js +1 -1
  72. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts +11 -0
  73. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts.map +1 -0
  74. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.js +42 -0
  75. package/src/core/geom/3d/topology/samples/sampleFloodFill.js +2 -2
  76. package/src/core/geom/3d/topology/tm_face_area.js +2 -2
  77. package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.d.ts → compute_triangle_area_3d.d.ts} +2 -2
  78. package/src/core/geom/3d/triangle/compute_triangle_area_3d.d.ts.map +1 -0
  79. package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.js → compute_triangle_area_3d.js} +2 -4
  80. package/src/core/geom/Quaternion.d.ts.map +1 -1
  81. package/src/core/geom/Quaternion.js +13 -102
  82. package/src/core/geom/Quaternion.spec.js +2 -2
  83. package/src/core/geom/Vector1.d.ts.map +1 -1
  84. package/src/core/geom/Vector1.js +14 -6
  85. package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts +14 -0
  86. package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts.map +1 -0
  87. package/src/core/geom/vec3/{v3_shift_along_direction.js → v3_array_displace_in_direction.js} +1 -1
  88. package/src/core/geom/vec3/v3_displace_in_direction.d.ts +7 -7
  89. package/src/core/geom/vec3/v3_displace_in_direction.d.ts.map +1 -1
  90. package/src/core/geom/vec3/v3_displace_in_direction.js +20 -17
  91. package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts +2 -0
  92. package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts.map +1 -0
  93. package/src/core/geom/vec3/v3_displace_in_direction.spec.js +80 -0
  94. package/src/core/geom/vec4/v4_length.d.ts +10 -0
  95. package/src/core/geom/vec4/v4_length.d.ts.map +1 -0
  96. package/src/core/geom/vec4/v4_length.js +13 -0
  97. package/src/core/geom/vec4/v4_length_sqr.js +2 -1
  98. package/src/core/graph/eigen/matrix_eigenvalues_in_place.spec.js +31 -1
  99. package/src/core/math/FLT_EPSILON_64.d.ts +6 -0
  100. package/src/core/math/FLT_EPSILON_64.d.ts.map +1 -0
  101. package/src/core/math/FLT_EPSILON_64.js +5 -0
  102. package/src/core/math/gaussian.d.ts +2 -2
  103. package/src/core/math/gaussian.js +2 -2
  104. package/src/core/math/linalg/README.md +1 -0
  105. package/src/core/math/linalg/lu_factor_linear_system.d.ts +13 -0
  106. package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -0
  107. package/src/core/math/linalg/lu_factor_linear_system.js +112 -0
  108. package/src/core/math/linalg/lu_solve_linear_system.d.ts +14 -0
  109. package/src/core/math/linalg/lu_solve_linear_system.d.ts.map +1 -0
  110. package/src/core/math/linalg/lu_solve_linear_system.js +51 -0
  111. package/src/core/math/linalg/solve_linear_system.d.ts +14 -0
  112. package/src/core/math/linalg/solve_linear_system.d.ts.map +1 -0
  113. package/src/core/math/linalg/solve_linear_system.js +52 -0
  114. package/src/core/math/linalg/solve_linear_system.spec.d.ts +2 -0
  115. package/src/core/math/linalg/solve_linear_system.spec.d.ts.map +1 -0
  116. package/src/core/math/linalg/solve_linear_system.spec.js +70 -0
  117. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +10 -0
  118. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -0
  119. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +91 -0
  120. package/src/core/math/solveQuadratic.d.ts.map +1 -1
  121. package/src/core/math/solveQuadratic.js +2 -0
  122. package/src/core/math/statistics/gaussian_amplitude.d.ts +8 -0
  123. package/src/core/math/statistics/gaussian_amplitude.d.ts.map +1 -0
  124. package/src/core/math/statistics/gaussian_amplitude.js +13 -0
  125. package/src/core/math/statistics/halton_sequence.js +3 -3
  126. package/src/core/math/statistics/halton_sequence.spec.js +18 -0
  127. package/src/core/math/statistics/hammersley_sequence.d.ts +9 -0
  128. package/src/core/math/statistics/hammersley_sequence.d.ts.map +1 -0
  129. package/src/core/math/statistics/hammersley_sequence.js +25 -0
  130. package/src/core/math/statistics/hammersley_sequence_2d.d.ts +9 -0
  131. package/src/core/math/statistics/hammersley_sequence_2d.d.ts.map +1 -0
  132. package/src/core/math/statistics/hammersley_sequence_2d.js +17 -0
  133. package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts +8 -0
  134. package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts.map +1 -0
  135. package/src/core/math/statistics/radical_inverse_VdC_base_2.js +15 -0
  136. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts +2 -0
  137. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts.map +1 -0
  138. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.js +9 -0
  139. package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
  140. package/src/core/model/node-graph/node/NodeInstance.js +26 -12
  141. package/src/core/model/node-graph/node/NodeInstance.spec.d.ts +2 -0
  142. package/src/core/model/node-graph/node/NodeInstance.spec.d.ts.map +1 -0
  143. package/src/core/model/node-graph/node/NodeInstance.spec.js +82 -0
  144. package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
  145. package/src/core/model/node-graph/node/NodeInstancePortReference.js +9 -0
  146. package/src/core/model/node-graph/node/NodeInstancePortReference.spec.js +20 -0
  147. package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
  148. package/src/core/model/node-graph/node/Port.js +5 -12
  149. package/src/core/model/node-graph/node/PortDirection.d.ts.map +1 -1
  150. package/src/core/model/node-graph/node/PortDirection.js +7 -1
  151. package/src/engine/asset/CORS/CrossOriginConfig.d.ts.map +1 -1
  152. package/src/engine/asset/CORS/CrossOriginConfig.js +6 -4
  153. package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +2 -2
  154. package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.d.ts.map +1 -1
  155. package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.js +33 -3
  156. package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +9 -7
  157. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts +6 -0
  158. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts.map +1 -0
  159. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.js +18 -0
  160. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts +6 -0
  161. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts.map +1 -0
  162. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.js +266 -0
  163. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts +7 -0
  164. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts.map +1 -0
  165. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.js +19 -0
  166. package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -9
  167. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
  168. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +0 -2
  169. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +4 -27
  170. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
  171. package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +36 -158
  172. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts +13 -0
  173. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts.map +1 -0
  174. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.js +63 -0
  175. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +1 -0
  176. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
  177. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +25 -1
  178. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
  179. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +4 -29
  180. package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.d.ts → serialization/LightProbeVolumeSerializationAdapter.d.ts} +2 -2
  181. package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts.map +1 -0
  182. package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.js → serialization/LightProbeVolumeSerializationAdapter.js} +2 -2
  183. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts +13 -0
  184. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts.map +1 -0
  185. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.js +71 -0
  186. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts +2 -0
  187. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts.map +1 -0
  188. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.js +38 -0
  189. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts +1 -7
  190. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -1
  191. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +58 -147
  192. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts +13 -9
  193. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
  194. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +74 -54
  195. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +23 -5
  196. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
  197. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +211 -59
  198. package/src/engine/graphics/sh3/path_tracer/PathTracer.js +1 -1
  199. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts +15 -0
  200. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts.map +1 -0
  201. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.js +46 -0
  202. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts +14 -0
  203. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts.map +1 -0
  204. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.js +43 -0
  205. package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts.map +1 -0
  206. package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.js → geometry/compute_triangle_group_aabb3.js} +2 -2
  207. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts +12 -0
  208. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts.map +1 -0
  209. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.js +72 -0
  210. package/src/engine/graphics/sh3/path_tracer/geometry/sample_triangle_attribute.d.ts.map +1 -0
  211. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts +13 -0
  212. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts.map +1 -0
  213. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.js +48 -0
  214. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts +1 -0
  215. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts.map +1 -1
  216. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.js +4 -0
  217. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +1 -0
  218. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
  219. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.js +8 -5
  220. package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +24 -18
  221. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts +2 -2
  222. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts.map +1 -1
  223. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.js +1 -1
  224. package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.d.ts.map +1 -0
  225. package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.js → sampling/getBiasedNormalSample.js} +1 -1
  226. package/src/engine/graphics/sh3/path_tracer/sampling/random_in_hemisphere.d.ts.map +1 -0
  227. package/src/engine/graphics/sh3/path_tracer/{random_in_hemisphere.js → sampling/random_in_hemisphere.js} +1 -1
  228. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts +12 -0
  229. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts.map +1 -0
  230. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.js +46 -0
  231. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +2 -2
  232. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts +7 -0
  233. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts.map +1 -0
  234. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.js +69 -0
  235. package/src/engine/graphics/sh3/prototypeSH3Probe.js +29 -7
  236. package/src/engine/graphics/texture/formatToChannelCount.d.ts.map +1 -1
  237. package/src/engine/graphics/texture/formatToChannelCount.js +14 -1
  238. package/src/engine/graphics/three/three_object_replace_materials.d.ts +7 -0
  239. package/src/engine/graphics/three/three_object_replace_materials.d.ts.map +1 -0
  240. package/src/engine/graphics/three/three_object_replace_materials.js +13 -0
  241. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts +0 -8
  242. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts.map +0 -1
  243. package/src/core/geom/3d/triangle/computeTriangleSurfaceArea.d.ts.map +0 -1
  244. package/src/core/geom/vec3/v3_shift_along_direction.d.ts +0 -14
  245. package/src/core/geom/vec3/v3_shift_along_direction.d.ts.map +0 -1
  246. package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts +0 -2
  247. package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts.map +0 -1
  248. package/src/engine/graphics/filter/FlipArrayViaCanvas.js +0 -13
  249. package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts.map +0 -1
  250. package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.d.ts.map +0 -1
  251. package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.d.ts.map +0 -1
  252. package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.d.ts.map +0 -1
  253. package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts.map +0 -1
  254. /package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.d.ts → geometry/compute_triangle_group_aabb3.d.ts} +0 -0
  255. /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.d.ts → geometry/sample_triangle_attribute.d.ts} +0 -0
  256. /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.js → geometry/sample_triangle_attribute.js} +0 -0
  257. /package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.d.ts → sampling/getBiasedNormalSample.d.ts} +0 -0
  258. /package/src/engine/graphics/sh3/path_tracer/{random_in_hemisphere.d.ts → sampling/random_in_hemisphere.d.ts} +0 -0
@@ -975,13 +975,6 @@ class SignalHandler {
975
975
  */
976
976
  SignalHandler.prototype.isSignalHandler = true;
977
977
 
978
- /**
979
- *
980
- * @author Alex Goldring
981
- * @copyright Alex Goldring 2014
982
- */
983
-
984
-
985
978
  /**
986
979
  * Common dispatch stack
987
980
  * @readonly
@@ -1598,11 +1591,12 @@ function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
1598
1591
  const l = handlers.length;
1599
1592
 
1600
1593
  for (let i = 0; i < l; i++) {
1601
- const signalHandler = handlers[i];
1594
+ const handler = handlers[i];
1602
1595
 
1603
- if (signalHandler.handle === f && signalHandler.context === ctx) {
1596
+ if (handler.handle === f && handler.context === ctx) {
1604
1597
  return i;
1605
1598
  }
1599
+
1606
1600
  }
1607
1601
 
1608
1602
  return -1;
@@ -1635,7 +1629,7 @@ function removeHandlerByHandler(signal, h) {
1635
1629
  */
1636
1630
  function removeHandlerByHandlerAndContext(signal, h, ctx) {
1637
1631
  const handlers = signal.handlers;
1638
- let i = findSignalHandlerIndexByHandleAndContext(handlers, h, ctx);
1632
+ const i = findSignalHandlerIndexByHandleAndContext(handlers, h, ctx);
1639
1633
 
1640
1634
  if (i >= 0) {
1641
1635
  handlers.splice(i, 1);
@@ -1645,6 +1639,12 @@ function removeHandlerByHandlerAndContext(signal, h, ctx) {
1645
1639
  return false;
1646
1640
  }
1647
1641
 
1642
+ /**
1643
+ *
1644
+ * @param {function} f
1645
+ * @param {*} context
1646
+ * @param {Array} args
1647
+ */
1648
1648
  function dispatchCallback(f, context, args) {
1649
1649
 
1650
1650
  try {
@@ -1936,6 +1936,30 @@ function v3_dot(x0, y0, z0, x1, y1, z1) {
1936
1936
  return (x0 * x1 + y0 * y1 + z0 * z1);
1937
1937
  }
1938
1938
 
1939
+ /**
1940
+ *
1941
+ * @param {number} x
1942
+ * @param {number} y
1943
+ * @param {number} z
1944
+ * @param {number} w
1945
+ * @returns {number}
1946
+ */
1947
+ function v4_length_sqr(x, y, z, w) {
1948
+ return x * x + y * y + z * z + w * w;
1949
+ }
1950
+
1951
+ /**
1952
+ *
1953
+ * @param {number} x
1954
+ * @param {number} y
1955
+ * @param {number} z
1956
+ * @param {number} w
1957
+ * @returns {number}
1958
+ */
1959
+ function v4_length(x, y, z, w) {
1960
+ return Math.sqrt(v4_length_sqr(x, y, z, w));
1961
+ }
1962
+
1939
1963
  /**
1940
1964
  *
1941
1965
  * @param {number} v
@@ -3600,7 +3624,7 @@ let Quaternion$1 = class Quaternion {
3600
3624
  const z = this.z;
3601
3625
  const w = this.w;
3602
3626
 
3603
- return Math.sqrt(x * x + y * y + z * z + w * w);
3627
+ return v4_length(x, y, z, w);
3604
3628
  }
3605
3629
 
3606
3630
  /**
@@ -3612,48 +3636,20 @@ let Quaternion$1 = class Quaternion {
3612
3636
  Quaternion.rotateTowards(this, this, other, max_delta);
3613
3637
  }
3614
3638
 
3615
- /**
3616
- *
3617
- * @param {Vector3} direction
3618
- * @param {Vector3} [up]
3619
- * @param {Vector3} [forward]
3620
- */
3621
- alignToDirection(direction, up = Vector3$1.up, forward = Vector3$1.forward) {
3622
-
3623
- const dot = up.dot(direction);
3624
-
3625
-
3626
- if (Math.abs(dot + 1) < 0.000001) {
3627
- // vector a and b point exactly in the opposite direction,
3628
- // so it is a 180 degrees turn around the up-axis
3629
- this.set(forward.x, forward.y, forward.z, Math.PI);
3630
- } else if (Math.abs(dot - 1) < 0.000001) {
3631
- // vector a and b point exactly in the same direction
3632
- // so we return the identity quaternion
3633
- this.set(0, 0, 0, 1);
3634
- }
3635
-
3636
- const angle = Math.acos(dot);
3637
-
3638
- axis.crossVectors(up, direction);
3639
- axis.normalize();
3640
-
3641
- this.fromAxisAngle(axis, angle);
3642
- }
3643
-
3644
3639
  /**
3645
3640
  *
3646
3641
  * @param {Vector3} source
3647
3642
  * @param {Vector3} target
3643
+ * @param {Vector3} [up]
3648
3644
  */
3649
- lookAt(source, target) {
3645
+ lookAt(source, target, up = Vector3$1.up) {
3650
3646
  const forward = new Vector3$1();
3651
3647
 
3652
3648
  forward.subVectors(target, source);
3653
3649
 
3654
3650
  forward.normalize();
3655
3651
 
3656
- this.alignToDirection(forward);
3652
+ this.lookRotation(forward, up);
3657
3653
  }
3658
3654
 
3659
3655
  /**
@@ -4036,22 +4032,23 @@ let Quaternion$1 = class Quaternion {
4036
4032
  const qW_1 = qW + l0;
4037
4033
 
4038
4034
  //normalize result
4039
- const l1 = Math.sqrt(p0 + qW_1 * qW_1);
4035
+ const l1 = 1 / Math.sqrt(p0 + qW_1 * qW_1);
4040
4036
 
4041
- const x = qX / l1;
4042
- const y = qY / l1;
4043
- const z = qZ / l1;
4044
- const w = qW / l1;
4037
+ const x = qX * l1;
4038
+ const y = qY * l1;
4039
+ const z = qZ * l1;
4040
+ const w = qW * l1;
4045
4041
 
4046
4042
  this.set(x, y, z, w);
4047
4043
  }
4048
4044
 
4049
4045
  /**
4046
+ * NOTE: Vectors need to be normalized
4050
4047
  * Based on blog post: http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
4051
4048
  * @param {Vector3} from
4052
4049
  * @param {Vector3} to
4053
4050
  */
4054
- fromUnitVectors2(from, to) {
4051
+ fromUnitVectors(from, to) {
4055
4052
 
4056
4053
  //quat quat::fromtwovectors(vec3 u, vec3 v)
4057
4054
  // {
@@ -4070,7 +4067,7 @@ let Quaternion$1 = class Quaternion {
4070
4067
 
4071
4068
  const uv_dot = v3_dot(ax, ay, az, bx, by, bz);
4072
4069
 
4073
- if (uv_dot === -1) {
4070
+ if (uv_dot < -0.9999999) {
4074
4071
  //to vector is opposite, produce a reversal quaternion
4075
4072
 
4076
4073
  tempvec3.crossVectors(Vector3$1.left, from);
@@ -4114,49 +4111,6 @@ let Quaternion$1 = class Quaternion {
4114
4111
  );
4115
4112
  }
4116
4113
 
4117
- /**
4118
- * Input vectors must be normalized
4119
- * @param {Vector3} from
4120
- * @param {Vector3} to
4121
- */
4122
- fromUnitVectors(from, to) {
4123
-
4124
- const dot = from.dot(to);
4125
-
4126
- let x, y, z, w;
4127
-
4128
- if (dot < -0.9999999) {
4129
- const tempvec3 = new Vector3$1();
4130
-
4131
- tempvec3.crossVectors(Vector3$1.left, from);
4132
-
4133
- if (tempvec3.lengthSqr() < 0.00001) {
4134
- tempvec3.crossVectors(Vector3$1.up, from);
4135
- }
4136
-
4137
- tempvec3.normalize();
4138
-
4139
- this.fromAxisAngle(tempvec3, Math.PI);
4140
- } else if (dot > 0.9999999) {
4141
- x = 0;
4142
- y = 0;
4143
- z = 0;
4144
- w = 1;
4145
-
4146
- this.set(x, y, z, w);
4147
- } else {
4148
- //cross product from x to
4149
-
4150
- x = from.y * to.z - from.z * to.y;
4151
- y = from.z * to.x - from.x * to.z;
4152
- z = from.x * to.y - from.y * to.x;
4153
- w = 1 + dot;
4154
-
4155
- this.set(x, y, z, w);
4156
- this.normalize();
4157
- }
4158
- }
4159
-
4160
4114
  /**
4161
4115
  * @deprecated
4162
4116
  * @param {Matrix4} m
@@ -4343,17 +4297,6 @@ let Quaternion$1 = class Quaternion {
4343
4297
  this.slerpQuaternions(this, other, t);
4344
4298
  }
4345
4299
 
4346
- /**
4347
- * @see https://github.com/gareth-cross/quat/blob/master/include/quaternion.hpp
4348
- * TODO implement
4349
- * @param {Quaternion} a
4350
- * @param {Quaternion} b
4351
- * @param {number} t
4352
- */
4353
- quaternionsInterpolateRungeKutta4(a, b, t) {
4354
- throw new Error('Not Implemented');
4355
- }
4356
-
4357
4300
  /**
4358
4301
  *
4359
4302
  * @param {function} handler
@@ -4673,13 +4616,6 @@ Quaternion$1.prototype.toArray = Quaternion$1.prototype.writeToArray;
4673
4616
  Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
4674
4617
 
4675
4618
 
4676
- /**
4677
- *
4678
- * @type {Vector3}
4679
- */
4680
- const axis = new Vector3$1();
4681
-
4682
-
4683
4619
  const tempvec3 = new Vector3$1();
4684
4620
 
4685
4621
  /**
@@ -50505,6 +50441,14 @@ class Vector1 extends Number {
50505
50441
  return this.set(clamp$1(this.x, low, high));
50506
50442
  }
50507
50443
 
50444
+ /**
50445
+ * Negate sign of the value, if value is 7, it will become -7 and vice versa
50446
+ * Zero is unaffected
50447
+ */
50448
+ negate() {
50449
+ this.set(-this.x);
50450
+ }
50451
+
50508
50452
  /**
50509
50453
  *
50510
50454
  * @param {Vector1|Vector2|Vector3|Vector4} other
@@ -50559,7 +50503,7 @@ class Vector1 extends Number {
50559
50503
  * @param {number[]} array
50560
50504
  * @param {number} offset
50561
50505
  */
50562
- readFromArray(array, offset=0) {
50506
+ readFromArray(array, offset = 0) {
50563
50507
  this.set(array[offset]);
50564
50508
  }
50565
50509
 
@@ -50568,11 +50512,11 @@ class Vector1 extends Number {
50568
50512
  * @param {number[]} array
50569
50513
  * @param {number} offset
50570
50514
  */
50571
- writeToArray(array, offset=0) {
50515
+ writeToArray(array, offset = 0) {
50572
50516
  array[offset] = this.x;
50573
50517
  }
50574
50518
 
50575
- asArray(){
50519
+ asArray() {
50576
50520
  return [this.x];
50577
50521
  }
50578
50522
 
@@ -52482,7 +52426,7 @@ class BVH {
52482
52426
  /**
52483
52427
  *
52484
52428
  * @param {number} id
52485
- * @param {number[]|ArrayLike<number>} aabb
52429
+ * @param {number[]|ArrayLike<number>|AABB3} aabb
52486
52430
  */
52487
52431
  node_set_aabb(id, aabb) {
52488
52432
 
@@ -52623,27 +52567,24 @@ class BVH {
52623
52567
  const float32 = this.__data_float32;
52624
52568
 
52625
52569
  const a_x0 = float32[address_a];
52626
- const b_x0 = float32[address_b];
52627
- const x0 = min2(a_x0, b_x0);
52628
-
52629
52570
  const a_y0 = float32[address_a + 1];
52630
- const b_y0 = float32[address_b + 1];
52631
- const y0 = min2(a_y0, b_y0);
52632
-
52633
52571
  const a_z0 = float32[address_a + 2];
52634
- const b_z0 = float32[address_b + 2];
52635
- const z0 = min2(a_z0, b_z0);
52636
-
52637
52572
  const a_x1 = float32[address_a + 3];
52638
- const b_x1 = float32[address_b + 3];
52639
- const x1 = max2(a_x1, b_x1);
52640
-
52641
52573
  const a_y1 = float32[address_a + 4];
52642
- const b_y1 = float32[address_b + 4];
52643
- const y1 = max2(a_y1, b_y1);
52644
-
52645
52574
  const a_z1 = float32[address_a + 5];
52575
+
52576
+ const b_x0 = float32[address_b];
52577
+ const b_y0 = float32[address_b + 1];
52578
+ const b_z0 = float32[address_b + 2];
52579
+ const b_x1 = float32[address_b + 3];
52580
+ const b_y1 = float32[address_b + 4];
52646
52581
  const b_z1 = float32[address_b + 5];
52582
+
52583
+ const x0 = min2(a_x0, b_x0);
52584
+ const y0 = min2(a_y0, b_y0);
52585
+ const z0 = min2(a_z0, b_z0);
52586
+ const x1 = max2(a_x1, b_x1);
52587
+ const y1 = max2(a_y1, b_y1);
52647
52588
  const z1 = max2(a_z1, b_z1);
52648
52589
 
52649
52590
 
@@ -52776,8 +52717,6 @@ class BVH {
52776
52717
  const uint32 = this.__data_uint32;
52777
52718
 
52778
52719
  do {
52779
- index = this.balance(index);
52780
-
52781
52720
  const address = index * ELEMENT_WORD_COUNT;
52782
52721
 
52783
52722
  const child1 = uint32[address + COLUMN_CHILD_1];
@@ -55141,7 +55080,7 @@ function mortonEncode_magicbits(x, y, z) {
55141
55080
  * @param {number} x
55142
55081
  * @param {number} y
55143
55082
  * @param {number} z
55144
- * @param {number[]} bounds
55083
+ * @param {number[]|AABB3} bounds
55145
55084
  * @returns {number}
55146
55085
  */
55147
55086
  function v3_morton_encode_bounded(x, y, z, bounds) {
@@ -59799,34 +59738,35 @@ function collectIteratorValueToArray(result, iterator) {
59799
59738
  * @return {number}
59800
59739
  */
59801
59740
  function ctz32(x) {
59741
+ let _x = x;
59802
59742
  let n = 0;
59803
59743
 
59804
- if ((x & 0xffff) === 0) {
59805
- x >>= 16;
59744
+ if ((_x & 0xffff) === 0) {
59745
+ _x >>= 16;
59806
59746
  n += 16;
59807
59747
  }
59808
59748
 
59809
- if ((x & 0xff) === 0) {
59810
- x >>= 8;
59749
+ if ((_x & 0xff) === 0) {
59750
+ _x >>= 8;
59811
59751
  n += 8;
59812
59752
  }
59813
59753
 
59814
- if ((x & 0xf) === 0) {
59815
- x >>= 4;
59754
+ if ((_x & 0xf) === 0) {
59755
+ _x >>= 4;
59816
59756
  n += 4;
59817
59757
  }
59818
59758
 
59819
- if ((x & 0x3) === 0) {
59820
- x >>= 2;
59759
+ if ((_x & 0x3) === 0) {
59760
+ _x >>= 2;
59821
59761
  n += 2;
59822
59762
  }
59823
59763
 
59824
- if ((x & 0x1) === 0) {
59825
- x >>= 1;
59764
+ if ((_x & 0x1) === 0) {
59765
+ _x >>= 1;
59826
59766
  n += 1;
59827
59767
  }
59828
59768
 
59829
- if (x === 0) {
59769
+ if (_x === 0) {
59830
59770
  n += 1;
59831
59771
  }
59832
59772
 
@@ -59860,6 +59800,7 @@ function invokeObjectHash(object) {
59860
59800
  * @param {number} index1
59861
59801
  */
59862
59802
  function array_swap_one(array, index0, index1) {
59803
+
59863
59804
  const t = array[index0];
59864
59805
 
59865
59806
  array[index0] = array[index1];
@@ -67565,8 +67506,12 @@ function formatToChannelCount(format) {
67565
67506
  case RGFormat:
67566
67507
  return 2;
67567
67508
  case RGBFormat:
67509
+ case RGB_S3TC_DXT1_Format:
67568
67510
  return 3;
67569
67511
  case RGBAFormat:
67512
+ case RGBA_S3TC_DXT1_Format:
67513
+ case RGBA_S3TC_DXT3_Format:
67514
+ case RGBA_S3TC_DXT5_Format:
67570
67515
  return 4;
67571
67516
  default:
67572
67517
  throw new Error(`Unsupported format '${format}'`);
@@ -67964,13 +67909,15 @@ const CrossOriginKind = {
67964
67909
  };
67965
67910
 
67966
67911
  class CrossOriginConfig {
67967
- constructor() {
67968
- this.kind = CrossOriginKind.Anonymous;
67969
- }
67970
-
67912
+ kind = CrossOriginKind.Anonymous;
67971
67913
  }
67972
67914
 
67973
67915
  const default_coc = new CrossOriginConfig();
67916
+
67917
+ /**
67918
+ * @readonly
67919
+ * @type {Readonly<CrossOriginConfig>}
67920
+ */
67974
67921
  CrossOriginConfig.default = Object.freeze(default_coc);
67975
67922
 
67976
67923
  /**
@@ -105101,13 +105048,6 @@ class EngineConfiguration {
105101
105048
  }
105102
105049
  }
105103
105050
 
105104
- //
105105
-
105106
-
105107
- function atan2(a, b) {
105108
- return Math.atan2(a, b);
105109
- }
105110
-
105111
105051
  /**
105112
105052
  *
105113
105053
  * @param {number[]} mat4
@@ -105119,15 +105059,9 @@ function coeff(mat4, row_index, column_index) {
105119
105059
  return mat4[row_index + column_index * 4];
105120
105060
  }
105121
105061
 
105122
- function sin(a) {
105123
- return Math.sin(a);
105124
- }
105125
-
105126
- function cos(a) {
105127
- return Math.cos(a);
105128
- }
105129
-
105130
- const EIGEN_PI = Math.PI;
105062
+ const sin = Math.sin;
105063
+ const cos = Math.cos;
105064
+ const atan2 = Math.atan2;
105131
105065
 
105132
105066
  /**
105133
105067
  *
@@ -105152,10 +105086,14 @@ const EIGEN_PI = Math.PI;
105152
105086
  * @param {number[]} res
105153
105087
  * @param {number[]|Float32Array|mat4} m4
105154
105088
  * @param {number} a0 axis index
105155
- * @param {number} a1
105156
- * @param {number} a2
105089
+ * @param {number} a1 axis index
105090
+ * @param {number} a2 axis index
105157
105091
  */
105158
- function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105092
+ function eulerAnglesFromMatrix(
105093
+ res, m4,
105094
+ a0, a1, a2
105095
+ ) {
105096
+
105159
105097
  const odd = ((a0 + 1) % 3 === a1) ? 0 : 1;
105160
105098
 
105161
105099
  const i = a0;
@@ -105164,11 +105102,12 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105164
105102
 
105165
105103
  if (a0 === a2) {
105166
105104
  res[0] = atan2(coeff(m4, j, i), coeff(m4, k, i));
105167
- if ((odd && res[0] < 0) || ((!odd) && res[0] > 0)) {
105105
+
105106
+ if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
105168
105107
  if (res[0] > 0) {
105169
- res[0] -= EIGEN_PI;
105108
+ res[0] -= Math.PI;
105170
105109
  } else {
105171
- res[0] += EIGEN_PI;
105110
+ res[0] += Math.PI;
105172
105111
  }
105173
105112
  const s2 = v2_magnitude(coeff(m4, j, i), coeff(m4, k, i));
105174
105113
  res[1] = -atan2(s2, coeff(m4, i, i));
@@ -105189,25 +105128,34 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105189
105128
 
105190
105129
  const s1 = sin(res[0]);
105191
105130
  const c1 = cos(res[0]);
105131
+
105192
105132
  res[2] = atan2(c1 * coeff(m4, j, k) - s1 * coeff(m4, k, k), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
105133
+
105193
105134
  } else {
105135
+
105194
105136
  res[0] = atan2(coeff(m4, j, k), coeff(m4, k, k));
105137
+
105195
105138
  const c2 = v2_magnitude(coeff(m4, i, i), coeff(m4, i, j));
105196
- if ((odd && res[0] < 0) || ((!odd) && res[0] > 0)) {
105139
+
105140
+ if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
105197
105141
  if (res[0] > 0) {
105198
- res[0] -= EIGEN_PI;
105142
+ res[0] -= Math.PI;
105199
105143
  } else {
105200
- res[0] += EIGEN_PI;
105144
+ res[0] += Math.PI;
105201
105145
  }
105202
105146
  res[1] = atan2(-coeff(m4, i, k), -c2);
105203
- } else
105147
+ } else {
105204
105148
  res[1] = atan2(-coeff(m4, i, k), c2);
105149
+ }
105150
+
105205
105151
  const s1 = sin(res[0]);
105206
105152
  const c1 = cos(res[0]);
105153
+
105207
105154
  res[2] = atan2(s1 * coeff(m4, k, i) - c1 * coeff(m4, j, i), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
105155
+
105208
105156
  }
105209
105157
 
105210
- if (!odd) {
105158
+ if (odd === 0) {
105211
105159
  // invert result
105212
105160
  res[0] = -res[0];
105213
105161
  res[1] = -res[1];
@@ -118052,18 +118000,6 @@ function v4_dot(
118052
118000
  return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
118053
118001
  }
118054
118002
 
118055
- /**
118056
- *
118057
- * @param {number} x
118058
- * @param {number} y
118059
- * @param {number} z
118060
- * @param {number} w
118061
- * @returns {number}
118062
- */
118063
- function v4_length_sqr(x, y, z, w) {
118064
- return x * x + y * y + z * z + w * w;
118065
- }
118066
-
118067
118003
  /**
118068
118004
  *
118069
118005
  * @param {number} x0
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.109.1",
8
+ "version": "2.109.2",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"ctz32.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/ctz32.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,yBAHW,MAAM,GACL,MAAM,CAmCjB"}
1
+ {"version":3,"file":"ctz32.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/ctz32.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,yBAHW,MAAM,GACL,MAAM,CAoCjB"}
@@ -5,34 +5,35 @@
5
5
  * @return {number}
6
6
  */
7
7
  export function ctz32(x) {
8
+ let _x = x;
8
9
  let n = 0;
9
10
 
10
- if ((x & 0xffff) === 0) {
11
- x >>= 16;
11
+ if ((_x & 0xffff) === 0) {
12
+ _x >>= 16;
12
13
  n += 16;
13
14
  }
14
15
 
15
- if ((x & 0xff) === 0) {
16
- x >>= 8;
16
+ if ((_x & 0xff) === 0) {
17
+ _x >>= 8;
17
18
  n += 8;
18
19
  }
19
20
 
20
- if ((x & 0xf) === 0) {
21
- x >>= 4;
21
+ if ((_x & 0xf) === 0) {
22
+ _x >>= 4;
22
23
  n += 4;
23
24
  }
24
25
 
25
- if ((x & 0x3) === 0) {
26
- x >>= 2;
26
+ if ((_x & 0x3) === 0) {
27
+ _x >>= 2;
27
28
  n += 2;
28
29
  }
29
30
 
30
- if ((x & 0x1) === 0) {
31
- x >>= 1;
31
+ if ((_x & 0x1) === 0) {
32
+ _x >>= 1;
32
33
  n += 1;
33
34
  }
34
35
 
35
- if (x === 0) {
36
+ if (_x === 0) {
36
37
  n += 1;
37
38
  }
38
39
 
@@ -0,0 +1,7 @@
1
+ /**
2
+ *
3
+ * @param {number} value
4
+ * @returns {number}
5
+ */
6
+ export function reinterpret_int32_as_float32(value: number): number;
7
+ //# sourceMappingURL=reinterpret_int32_as_float32.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reinterpret_int32_as_float32.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/reinterpret_int32_as_float32.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,oDAHW,MAAM,GACJ,MAAM,CAMlB"}
@@ -0,0 +1,14 @@
1
+ const b = new ArrayBuffer(4);
2
+ const b_f32 = new Float32Array(b);
3
+ const b_i32 = new Int32Array(b);
4
+
5
+ /**
6
+ *
7
+ * @param {number} value
8
+ * @returns {number}
9
+ */
10
+ export function reinterpret_int32_as_float32(value) {
11
+ b_i32[0] = value;
12
+
13
+ return b_f32[0];
14
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Reverses order of bits in an unsigned 32bit integer
3
+ * @example 1110 would become 0111
4
+ * @param {number} input
5
+ * @returns {number}
6
+ */
7
+ export function reverse_bits_uint32(input: number): number;
8
+ //# sourceMappingURL=reverse_bits_uint32.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reverse_bits_uint32.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/reverse_bits_uint32.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,2CAHW,MAAM,GACJ,MAAM,CAYlB"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Reverses order of bits in an unsigned 32bit integer
3
+ * @example 1110 would become 0111
4
+ * @param {number} input
5
+ * @returns {number}
6
+ */
7
+ export function reverse_bits_uint32(input) {
8
+ let x = input;
9
+
10
+ x = ((x << 16) | (x >>> 16))
11
+ x = ((x & 0x55555555) << 1) | ((x & 0xAAAAAAAA) >>> 1)
12
+ x = ((x & 0x33333333) << 2) | ((x & 0xCCCCCCCC) >>> 2)
13
+ x = ((x & 0x0F0F0F0F) << 4) | ((x & 0xF0F0F0F0) >>> 4)
14
+ x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >>> 8)
15
+
16
+ return x
17
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reverse_bits_uint32.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reverse_bits_uint32.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/reverse_bits_uint32.spec.js"],"names":[],"mappings":""}