@woosh/meep-engine 2.109.1 → 2.109.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 (276) hide show
  1. package/build/meep.cjs +126 -186
  2. package/build/meep.min.js +1 -1
  3. package/build/meep.module.js +126 -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/bvh_query_leaves_ray_segment.d.ts +18 -0
  28. package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray_segment.d.ts.map +1 -0
  29. package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray_segment.js +94 -0
  30. package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.d.ts +18 -0
  31. package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.d.ts.map +1 -0
  32. package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.js +100 -0
  33. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts +2 -0
  34. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts.map +1 -0
  35. package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.js +1 -0
  36. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts +9 -0
  37. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts.map +1 -0
  38. package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.js +31 -0
  39. package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts +9 -0
  40. package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts.map +1 -0
  41. package/src/core/collection/array/array_quick_sort_by_lookup_map.js +79 -0
  42. package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts +8 -0
  43. package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts.map +1 -0
  44. package/src/core/collection/array/{array_quick_sort_by_lookup.js → array_quick_sort_by_lookup_uint.js} +1 -1
  45. package/src/core/collection/array/array_shuffle.js +1 -1
  46. package/src/core/collection/array/array_swap_one.d.ts.map +1 -1
  47. package/src/core/collection/array/array_swap_one.js +6 -0
  48. package/src/core/collection/map/HashMap.js +2 -2
  49. package/src/core/events/signal/Signal.d.ts.map +1 -1
  50. package/src/core/events/signal/Signal.js +10 -10
  51. package/src/core/geom/2d/compute_triangle_area_2d.d.ts.map +1 -1
  52. package/src/core/geom/2d/compute_triangle_area_2d.js +5 -3
  53. package/src/core/geom/3d/Ray3.d.ts +6 -0
  54. package/src/core/geom/3d/Ray3.d.ts.map +1 -1
  55. package/src/core/geom/3d/Ray3.js +24 -0
  56. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts +16 -0
  57. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts.map +1 -0
  58. package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.js +29 -0
  59. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts +2 -2
  60. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts.map +1 -1
  61. package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.js +6 -6
  62. package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.d.ts +21 -0
  63. package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.d.ts.map +1 -0
  64. package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.js +67 -0
  65. package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts +2 -2
  66. package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts.map +1 -1
  67. package/src/core/geom/3d/eulerAnglesFromMatrix.js +28 -25
  68. package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts +2 -2
  69. package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts.map +1 -1
  70. package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +1 -1
  71. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts +2 -2
  72. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts.map +1 -1
  73. package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.js +1 -1
  74. package/src/core/geom/3d/ray/ray3_interval_array_apply_matrix4.d.ts +11 -0
  75. package/src/core/geom/3d/ray/ray3_interval_array_apply_matrix4.d.ts.map +1 -0
  76. package/src/core/geom/3d/ray/ray3_interval_array_apply_matrix4.js +61 -0
  77. package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.js +2 -2
  78. package/src/core/geom/3d/sphere/sphere_intersects_ray.js +1 -1
  79. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
  80. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +24 -188
  81. package/src/core/geom/3d/tetrahedra/triangle/prototype.js +1 -1
  82. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts +11 -0
  83. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts.map +1 -0
  84. package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.js +42 -0
  85. package/src/core/geom/3d/topology/samples/sampleFloodFill.js +2 -2
  86. package/src/core/geom/3d/topology/tm_face_area.js +2 -2
  87. package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.d.ts → compute_triangle_area_3d.d.ts} +2 -2
  88. package/src/core/geom/3d/triangle/compute_triangle_area_3d.d.ts.map +1 -0
  89. package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.js → compute_triangle_area_3d.js} +2 -4
  90. package/src/core/geom/Quaternion.d.ts.map +1 -1
  91. package/src/core/geom/Quaternion.js +13 -102
  92. package/src/core/geom/Quaternion.spec.js +2 -2
  93. package/src/core/geom/Vector1.d.ts.map +1 -1
  94. package/src/core/geom/Vector1.js +14 -6
  95. package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts +14 -0
  96. package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts.map +1 -0
  97. package/src/core/geom/vec3/{v3_shift_along_direction.js → v3_array_displace_in_direction.js} +1 -1
  98. package/src/core/geom/vec3/v3_displace_in_direction.d.ts +7 -7
  99. package/src/core/geom/vec3/v3_displace_in_direction.d.ts.map +1 -1
  100. package/src/core/geom/vec3/v3_displace_in_direction.js +20 -17
  101. package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts +2 -0
  102. package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts.map +1 -0
  103. package/src/core/geom/vec3/v3_displace_in_direction.spec.js +80 -0
  104. package/src/core/geom/vec4/v4_length.d.ts +10 -0
  105. package/src/core/geom/vec4/v4_length.d.ts.map +1 -0
  106. package/src/core/geom/vec4/v4_length.js +13 -0
  107. package/src/core/geom/vec4/v4_length_sqr.js +2 -1
  108. package/src/core/graph/eigen/matrix_eigenvalues_in_place.spec.js +31 -1
  109. package/src/core/math/FLT_EPSILON_64.d.ts +6 -0
  110. package/src/core/math/FLT_EPSILON_64.d.ts.map +1 -0
  111. package/src/core/math/FLT_EPSILON_64.js +5 -0
  112. package/src/core/math/gaussian.d.ts +2 -2
  113. package/src/core/math/gaussian.js +2 -2
  114. package/src/core/math/linalg/README.md +1 -0
  115. package/src/core/math/linalg/lu_factor_linear_system.d.ts +13 -0
  116. package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -0
  117. package/src/core/math/linalg/lu_factor_linear_system.js +112 -0
  118. package/src/core/math/linalg/lu_solve_linear_system.d.ts +14 -0
  119. package/src/core/math/linalg/lu_solve_linear_system.d.ts.map +1 -0
  120. package/src/core/math/linalg/lu_solve_linear_system.js +51 -0
  121. package/src/core/math/linalg/solve_linear_system.d.ts +14 -0
  122. package/src/core/math/linalg/solve_linear_system.d.ts.map +1 -0
  123. package/src/core/math/linalg/solve_linear_system.js +52 -0
  124. package/src/core/math/linalg/solve_linear_system.spec.d.ts +2 -0
  125. package/src/core/math/linalg/solve_linear_system.spec.d.ts.map +1 -0
  126. package/src/core/math/linalg/solve_linear_system.spec.js +70 -0
  127. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +10 -0
  128. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -0
  129. package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +91 -0
  130. package/src/core/math/max4.d.ts +10 -0
  131. package/src/core/math/max4.d.ts.map +1 -0
  132. package/src/core/math/max4.js +24 -0
  133. package/src/core/math/min4.d.ts +10 -0
  134. package/src/core/math/min4.d.ts.map +1 -0
  135. package/src/core/math/min4.js +23 -0
  136. package/src/core/math/solveQuadratic.d.ts.map +1 -1
  137. package/src/core/math/solveQuadratic.js +2 -0
  138. package/src/core/math/statistics/gaussian_amplitude.d.ts +8 -0
  139. package/src/core/math/statistics/gaussian_amplitude.d.ts.map +1 -0
  140. package/src/core/math/statistics/gaussian_amplitude.js +13 -0
  141. package/src/core/math/statistics/halton_sequence.js +3 -3
  142. package/src/core/math/statistics/halton_sequence.spec.js +18 -0
  143. package/src/core/math/statistics/hammersley_sequence.d.ts +9 -0
  144. package/src/core/math/statistics/hammersley_sequence.d.ts.map +1 -0
  145. package/src/core/math/statistics/hammersley_sequence.js +25 -0
  146. package/src/core/math/statistics/hammersley_sequence_2d.d.ts +9 -0
  147. package/src/core/math/statistics/hammersley_sequence_2d.d.ts.map +1 -0
  148. package/src/core/math/statistics/hammersley_sequence_2d.js +17 -0
  149. package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts +8 -0
  150. package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts.map +1 -0
  151. package/src/core/math/statistics/radical_inverse_VdC_base_2.js +15 -0
  152. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts +2 -0
  153. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts.map +1 -0
  154. package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.js +9 -0
  155. package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
  156. package/src/core/model/node-graph/node/NodeInstance.js +26 -12
  157. package/src/core/model/node-graph/node/NodeInstance.spec.d.ts +2 -0
  158. package/src/core/model/node-graph/node/NodeInstance.spec.d.ts.map +1 -0
  159. package/src/core/model/node-graph/node/NodeInstance.spec.js +82 -0
  160. package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
  161. package/src/core/model/node-graph/node/NodeInstancePortReference.js +9 -0
  162. package/src/core/model/node-graph/node/NodeInstancePortReference.spec.js +20 -0
  163. package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
  164. package/src/core/model/node-graph/node/Port.js +5 -12
  165. package/src/core/model/node-graph/node/PortDirection.d.ts.map +1 -1
  166. package/src/core/model/node-graph/node/PortDirection.js +7 -1
  167. package/src/engine/asset/CORS/CrossOriginConfig.d.ts.map +1 -1
  168. package/src/engine/asset/CORS/CrossOriginConfig.js +6 -4
  169. package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.d.ts.map +1 -1
  170. package/src/engine/graphics/geometry/buffered/computeBufferAttributeHash.js +9 -5
  171. package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +2 -2
  172. package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.d.ts.map +1 -1
  173. package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.js +33 -3
  174. package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +12 -9
  175. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts +6 -0
  176. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts.map +1 -0
  177. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.js +18 -0
  178. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts +6 -0
  179. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts.map +1 -0
  180. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.js +266 -0
  181. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts +7 -0
  182. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts.map +1 -0
  183. package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.js +19 -0
  184. package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -9
  185. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
  186. package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +0 -2
  187. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +4 -27
  188. package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
  189. package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +36 -158
  190. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts +13 -0
  191. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts.map +1 -0
  192. package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.js +63 -0
  193. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +1 -0
  194. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
  195. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +25 -1
  196. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
  197. package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +4 -29
  198. package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.d.ts → serialization/LightProbeVolumeSerializationAdapter.d.ts} +2 -2
  199. package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts.map +1 -0
  200. package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.js → serialization/LightProbeVolumeSerializationAdapter.js} +2 -2
  201. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts +13 -0
  202. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts.map +1 -0
  203. package/src/engine/graphics/sh3/lpv/sh3_bake_depth.js +71 -0
  204. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts +2 -0
  205. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts.map +1 -0
  206. package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.js +38 -0
  207. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts +1 -7
  208. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -1
  209. package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +34 -148
  210. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts +13 -9
  211. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
  212. package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +75 -55
  213. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +23 -5
  214. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
  215. package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +201 -72
  216. package/src/engine/graphics/sh3/path_tracer/PathTracer.js +1 -1
  217. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts +15 -0
  218. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts.map +1 -0
  219. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.js +46 -0
  220. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts +14 -0
  221. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts.map +1 -0
  222. package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.js +43 -0
  223. package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts.map +1 -0
  224. package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.js → geometry/compute_triangle_group_aabb3.js} +2 -2
  225. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts +12 -0
  226. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts.map +1 -0
  227. package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.js +72 -0
  228. package/src/engine/graphics/sh3/path_tracer/geometry/sample_triangle_attribute.d.ts.map +1 -0
  229. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts +13 -0
  230. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts.map +1 -0
  231. package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.js +48 -0
  232. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts +1 -0
  233. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts.map +1 -1
  234. package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.js +4 -0
  235. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +1 -0
  236. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
  237. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.js +8 -5
  238. package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +27 -21
  239. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts +2 -2
  240. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts.map +1 -1
  241. package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.js +1 -1
  242. package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.d.ts.map +1 -0
  243. package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.js → sampling/getBiasedNormalSample.js} +1 -1
  244. package/src/engine/graphics/sh3/path_tracer/sampling/random_in_hemisphere.d.ts.map +1 -0
  245. package/src/engine/graphics/sh3/path_tracer/{random_in_hemisphere.js → sampling/random_in_hemisphere.js} +1 -1
  246. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts +12 -0
  247. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts.map +1 -0
  248. package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.js +46 -0
  249. package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +2 -2
  250. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts +7 -0
  251. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts.map +1 -0
  252. package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.js +69 -0
  253. package/src/engine/graphics/sh3/prototypeSH3Probe.js +29 -7
  254. package/src/engine/graphics/texture/formatToChannelCount.d.ts.map +1 -1
  255. package/src/engine/graphics/texture/formatToChannelCount.js +14 -1
  256. package/src/engine/graphics/three/three_object_replace_materials.d.ts +7 -0
  257. package/src/engine/graphics/three/three_object_replace_materials.d.ts.map +1 -0
  258. package/src/engine/graphics/three/three_object_replace_materials.js +13 -0
  259. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts +0 -8
  260. package/src/core/collection/array/array_quick_sort_by_lookup.d.ts.map +0 -1
  261. package/src/core/geom/3d/triangle/computeTriangleSurfaceArea.d.ts.map +0 -1
  262. package/src/core/geom/vec3/v3_shift_along_direction.d.ts +0 -14
  263. package/src/core/geom/vec3/v3_shift_along_direction.d.ts.map +0 -1
  264. package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts +0 -2
  265. package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts.map +0 -1
  266. package/src/engine/graphics/filter/FlipArrayViaCanvas.js +0 -13
  267. package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts.map +0 -1
  268. package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.d.ts.map +0 -1
  269. package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.d.ts.map +0 -1
  270. package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.d.ts.map +0 -1
  271. package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts.map +0 -1
  272. /package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.d.ts → geometry/compute_triangle_group_aabb3.d.ts} +0 -0
  273. /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.d.ts → geometry/sample_triangle_attribute.d.ts} +0 -0
  274. /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.js → geometry/sample_triangle_attribute.js} +0 -0
  275. /package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.d.ts → sampling/getBiasedNormalSample.d.ts} +0 -0
  276. /package/src/engine/graphics/sh3/path_tracer/{random_in_hemisphere.d.ts → sampling/random_in_hemisphere.d.ts} +0 -0
package/build/meep.cjs CHANGED
@@ -977,13 +977,6 @@ class SignalHandler {
977
977
  */
978
978
  SignalHandler.prototype.isSignalHandler = true;
979
979
 
980
- /**
981
- *
982
- * @author Alex Goldring
983
- * @copyright Alex Goldring 2014
984
- */
985
-
986
-
987
980
  /**
988
981
  * Common dispatch stack
989
982
  * @readonly
@@ -1600,11 +1593,12 @@ function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
1600
1593
  const l = handlers.length;
1601
1594
 
1602
1595
  for (let i = 0; i < l; i++) {
1603
- const signalHandler = handlers[i];
1596
+ const handler = handlers[i];
1604
1597
 
1605
- if (signalHandler.handle === f && signalHandler.context === ctx) {
1598
+ if (handler.handle === f && handler.context === ctx) {
1606
1599
  return i;
1607
1600
  }
1601
+
1608
1602
  }
1609
1603
 
1610
1604
  return -1;
@@ -1637,7 +1631,7 @@ function removeHandlerByHandler(signal, h) {
1637
1631
  */
1638
1632
  function removeHandlerByHandlerAndContext(signal, h, ctx) {
1639
1633
  const handlers = signal.handlers;
1640
- let i = findSignalHandlerIndexByHandleAndContext(handlers, h, ctx);
1634
+ const i = findSignalHandlerIndexByHandleAndContext(handlers, h, ctx);
1641
1635
 
1642
1636
  if (i >= 0) {
1643
1637
  handlers.splice(i, 1);
@@ -1647,6 +1641,12 @@ function removeHandlerByHandlerAndContext(signal, h, ctx) {
1647
1641
  return false;
1648
1642
  }
1649
1643
 
1644
+ /**
1645
+ *
1646
+ * @param {function} f
1647
+ * @param {*} context
1648
+ * @param {Array} args
1649
+ */
1650
1650
  function dispatchCallback(f, context, args) {
1651
1651
 
1652
1652
  try {
@@ -1938,6 +1938,30 @@ function v3_dot(x0, y0, z0, x1, y1, z1) {
1938
1938
  return (x0 * x1 + y0 * y1 + z0 * z1);
1939
1939
  }
1940
1940
 
1941
+ /**
1942
+ *
1943
+ * @param {number} x
1944
+ * @param {number} y
1945
+ * @param {number} z
1946
+ * @param {number} w
1947
+ * @returns {number}
1948
+ */
1949
+ function v4_length_sqr(x, y, z, w) {
1950
+ return x * x + y * y + z * z + w * w;
1951
+ }
1952
+
1953
+ /**
1954
+ *
1955
+ * @param {number} x
1956
+ * @param {number} y
1957
+ * @param {number} z
1958
+ * @param {number} w
1959
+ * @returns {number}
1960
+ */
1961
+ function v4_length(x, y, z, w) {
1962
+ return Math.sqrt(v4_length_sqr(x, y, z, w));
1963
+ }
1964
+
1941
1965
  /**
1942
1966
  *
1943
1967
  * @param {number} v
@@ -3602,7 +3626,7 @@ let Quaternion$1 = class Quaternion {
3602
3626
  const z = this.z;
3603
3627
  const w = this.w;
3604
3628
 
3605
- return Math.sqrt(x * x + y * y + z * z + w * w);
3629
+ return v4_length(x, y, z, w);
3606
3630
  }
3607
3631
 
3608
3632
  /**
@@ -3614,48 +3638,20 @@ let Quaternion$1 = class Quaternion {
3614
3638
  Quaternion.rotateTowards(this, this, other, max_delta);
3615
3639
  }
3616
3640
 
3617
- /**
3618
- *
3619
- * @param {Vector3} direction
3620
- * @param {Vector3} [up]
3621
- * @param {Vector3} [forward]
3622
- */
3623
- alignToDirection(direction, up = Vector3$1.up, forward = Vector3$1.forward) {
3624
-
3625
- const dot = up.dot(direction);
3626
-
3627
-
3628
- if (Math.abs(dot + 1) < 0.000001) {
3629
- // vector a and b point exactly in the opposite direction,
3630
- // so it is a 180 degrees turn around the up-axis
3631
- this.set(forward.x, forward.y, forward.z, Math.PI);
3632
- } else if (Math.abs(dot - 1) < 0.000001) {
3633
- // vector a and b point exactly in the same direction
3634
- // so we return the identity quaternion
3635
- this.set(0, 0, 0, 1);
3636
- }
3637
-
3638
- const angle = Math.acos(dot);
3639
-
3640
- axis.crossVectors(up, direction);
3641
- axis.normalize();
3642
-
3643
- this.fromAxisAngle(axis, angle);
3644
- }
3645
-
3646
3641
  /**
3647
3642
  *
3648
3643
  * @param {Vector3} source
3649
3644
  * @param {Vector3} target
3645
+ * @param {Vector3} [up]
3650
3646
  */
3651
- lookAt(source, target) {
3647
+ lookAt(source, target, up = Vector3$1.up) {
3652
3648
  const forward = new Vector3$1();
3653
3649
 
3654
3650
  forward.subVectors(target, source);
3655
3651
 
3656
3652
  forward.normalize();
3657
3653
 
3658
- this.alignToDirection(forward);
3654
+ this.lookRotation(forward, up);
3659
3655
  }
3660
3656
 
3661
3657
  /**
@@ -4038,22 +4034,23 @@ let Quaternion$1 = class Quaternion {
4038
4034
  const qW_1 = qW + l0;
4039
4035
 
4040
4036
  //normalize result
4041
- const l1 = Math.sqrt(p0 + qW_1 * qW_1);
4037
+ const l1 = 1 / Math.sqrt(p0 + qW_1 * qW_1);
4042
4038
 
4043
- const x = qX / l1;
4044
- const y = qY / l1;
4045
- const z = qZ / l1;
4046
- const w = qW / l1;
4039
+ const x = qX * l1;
4040
+ const y = qY * l1;
4041
+ const z = qZ * l1;
4042
+ const w = qW * l1;
4047
4043
 
4048
4044
  this.set(x, y, z, w);
4049
4045
  }
4050
4046
 
4051
4047
  /**
4048
+ * NOTE: Vectors need to be normalized
4052
4049
  * Based on blog post: http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
4053
4050
  * @param {Vector3} from
4054
4051
  * @param {Vector3} to
4055
4052
  */
4056
- fromUnitVectors2(from, to) {
4053
+ fromUnitVectors(from, to) {
4057
4054
 
4058
4055
  //quat quat::fromtwovectors(vec3 u, vec3 v)
4059
4056
  // {
@@ -4072,7 +4069,7 @@ let Quaternion$1 = class Quaternion {
4072
4069
 
4073
4070
  const uv_dot = v3_dot(ax, ay, az, bx, by, bz);
4074
4071
 
4075
- if (uv_dot === -1) {
4072
+ if (uv_dot < -0.9999999) {
4076
4073
  //to vector is opposite, produce a reversal quaternion
4077
4074
 
4078
4075
  tempvec3.crossVectors(Vector3$1.left, from);
@@ -4116,49 +4113,6 @@ let Quaternion$1 = class Quaternion {
4116
4113
  );
4117
4114
  }
4118
4115
 
4119
- /**
4120
- * Input vectors must be normalized
4121
- * @param {Vector3} from
4122
- * @param {Vector3} to
4123
- */
4124
- fromUnitVectors(from, to) {
4125
-
4126
- const dot = from.dot(to);
4127
-
4128
- let x, y, z, w;
4129
-
4130
- if (dot < -0.9999999) {
4131
- const tempvec3 = new Vector3$1();
4132
-
4133
- tempvec3.crossVectors(Vector3$1.left, from);
4134
-
4135
- if (tempvec3.lengthSqr() < 0.00001) {
4136
- tempvec3.crossVectors(Vector3$1.up, from);
4137
- }
4138
-
4139
- tempvec3.normalize();
4140
-
4141
- this.fromAxisAngle(tempvec3, Math.PI);
4142
- } else if (dot > 0.9999999) {
4143
- x = 0;
4144
- y = 0;
4145
- z = 0;
4146
- w = 1;
4147
-
4148
- this.set(x, y, z, w);
4149
- } else {
4150
- //cross product from x to
4151
-
4152
- x = from.y * to.z - from.z * to.y;
4153
- y = from.z * to.x - from.x * to.z;
4154
- z = from.x * to.y - from.y * to.x;
4155
- w = 1 + dot;
4156
-
4157
- this.set(x, y, z, w);
4158
- this.normalize();
4159
- }
4160
- }
4161
-
4162
4116
  /**
4163
4117
  * @deprecated
4164
4118
  * @param {Matrix4} m
@@ -4345,17 +4299,6 @@ let Quaternion$1 = class Quaternion {
4345
4299
  this.slerpQuaternions(this, other, t);
4346
4300
  }
4347
4301
 
4348
- /**
4349
- * @see https://github.com/gareth-cross/quat/blob/master/include/quaternion.hpp
4350
- * TODO implement
4351
- * @param {Quaternion} a
4352
- * @param {Quaternion} b
4353
- * @param {number} t
4354
- */
4355
- quaternionsInterpolateRungeKutta4(a, b, t) {
4356
- throw new Error('Not Implemented');
4357
- }
4358
-
4359
4302
  /**
4360
4303
  *
4361
4304
  * @param {function} handler
@@ -4675,13 +4618,6 @@ Quaternion$1.prototype.toArray = Quaternion$1.prototype.writeToArray;
4675
4618
  Quaternion$1.identity = Object.freeze(new Quaternion$1(0, 0, 0, 1));
4676
4619
 
4677
4620
 
4678
- /**
4679
- *
4680
- * @type {Vector3}
4681
- */
4682
- const axis = new Vector3$1();
4683
-
4684
-
4685
4621
  const tempvec3 = new Vector3$1();
4686
4622
 
4687
4623
  /**
@@ -50507,6 +50443,14 @@ class Vector1 extends Number {
50507
50443
  return this.set(clamp$1(this.x, low, high));
50508
50444
  }
50509
50445
 
50446
+ /**
50447
+ * Negate sign of the value, if value is 7, it will become -7 and vice versa
50448
+ * Zero is unaffected
50449
+ */
50450
+ negate() {
50451
+ this.set(-this.x);
50452
+ }
50453
+
50510
50454
  /**
50511
50455
  *
50512
50456
  * @param {Vector1|Vector2|Vector3|Vector4} other
@@ -50561,7 +50505,7 @@ class Vector1 extends Number {
50561
50505
  * @param {number[]} array
50562
50506
  * @param {number} offset
50563
50507
  */
50564
- readFromArray(array, offset=0) {
50508
+ readFromArray(array, offset = 0) {
50565
50509
  this.set(array[offset]);
50566
50510
  }
50567
50511
 
@@ -50570,11 +50514,11 @@ class Vector1 extends Number {
50570
50514
  * @param {number[]} array
50571
50515
  * @param {number} offset
50572
50516
  */
50573
- writeToArray(array, offset=0) {
50517
+ writeToArray(array, offset = 0) {
50574
50518
  array[offset] = this.x;
50575
50519
  }
50576
50520
 
50577
- asArray(){
50521
+ asArray() {
50578
50522
  return [this.x];
50579
50523
  }
50580
50524
 
@@ -52484,7 +52428,7 @@ class BVH {
52484
52428
  /**
52485
52429
  *
52486
52430
  * @param {number} id
52487
- * @param {number[]|ArrayLike<number>} aabb
52431
+ * @param {number[]|ArrayLike<number>|AABB3} aabb
52488
52432
  */
52489
52433
  node_set_aabb(id, aabb) {
52490
52434
 
@@ -52625,27 +52569,24 @@ class BVH {
52625
52569
  const float32 = this.__data_float32;
52626
52570
 
52627
52571
  const a_x0 = float32[address_a];
52628
- const b_x0 = float32[address_b];
52629
- const x0 = min2(a_x0, b_x0);
52630
-
52631
52572
  const a_y0 = float32[address_a + 1];
52632
- const b_y0 = float32[address_b + 1];
52633
- const y0 = min2(a_y0, b_y0);
52634
-
52635
52573
  const a_z0 = float32[address_a + 2];
52636
- const b_z0 = float32[address_b + 2];
52637
- const z0 = min2(a_z0, b_z0);
52638
-
52639
52574
  const a_x1 = float32[address_a + 3];
52640
- const b_x1 = float32[address_b + 3];
52641
- const x1 = max2(a_x1, b_x1);
52642
-
52643
52575
  const a_y1 = float32[address_a + 4];
52644
- const b_y1 = float32[address_b + 4];
52645
- const y1 = max2(a_y1, b_y1);
52646
-
52647
52576
  const a_z1 = float32[address_a + 5];
52577
+
52578
+ const b_x0 = float32[address_b];
52579
+ const b_y0 = float32[address_b + 1];
52580
+ const b_z0 = float32[address_b + 2];
52581
+ const b_x1 = float32[address_b + 3];
52582
+ const b_y1 = float32[address_b + 4];
52648
52583
  const b_z1 = float32[address_b + 5];
52584
+
52585
+ const x0 = min2(a_x0, b_x0);
52586
+ const y0 = min2(a_y0, b_y0);
52587
+ const z0 = min2(a_z0, b_z0);
52588
+ const x1 = max2(a_x1, b_x1);
52589
+ const y1 = max2(a_y1, b_y1);
52649
52590
  const z1 = max2(a_z1, b_z1);
52650
52591
 
52651
52592
 
@@ -52778,8 +52719,6 @@ class BVH {
52778
52719
  const uint32 = this.__data_uint32;
52779
52720
 
52780
52721
  do {
52781
- index = this.balance(index);
52782
-
52783
52722
  const address = index * ELEMENT_WORD_COUNT;
52784
52723
 
52785
52724
  const child1 = uint32[address + COLUMN_CHILD_1];
@@ -55143,7 +55082,7 @@ function mortonEncode_magicbits(x, y, z) {
55143
55082
  * @param {number} x
55144
55083
  * @param {number} y
55145
55084
  * @param {number} z
55146
- * @param {number[]} bounds
55085
+ * @param {number[]|AABB3} bounds
55147
55086
  * @returns {number}
55148
55087
  */
55149
55088
  function v3_morton_encode_bounded(x, y, z, bounds) {
@@ -59801,34 +59740,35 @@ function collectIteratorValueToArray(result, iterator) {
59801
59740
  * @return {number}
59802
59741
  */
59803
59742
  function ctz32(x) {
59743
+ let _x = x;
59804
59744
  let n = 0;
59805
59745
 
59806
- if ((x & 0xffff) === 0) {
59807
- x >>= 16;
59746
+ if ((_x & 0xffff) === 0) {
59747
+ _x >>= 16;
59808
59748
  n += 16;
59809
59749
  }
59810
59750
 
59811
- if ((x & 0xff) === 0) {
59812
- x >>= 8;
59751
+ if ((_x & 0xff) === 0) {
59752
+ _x >>= 8;
59813
59753
  n += 8;
59814
59754
  }
59815
59755
 
59816
- if ((x & 0xf) === 0) {
59817
- x >>= 4;
59756
+ if ((_x & 0xf) === 0) {
59757
+ _x >>= 4;
59818
59758
  n += 4;
59819
59759
  }
59820
59760
 
59821
- if ((x & 0x3) === 0) {
59822
- x >>= 2;
59761
+ if ((_x & 0x3) === 0) {
59762
+ _x >>= 2;
59823
59763
  n += 2;
59824
59764
  }
59825
59765
 
59826
- if ((x & 0x1) === 0) {
59827
- x >>= 1;
59766
+ if ((_x & 0x1) === 0) {
59767
+ _x >>= 1;
59828
59768
  n += 1;
59829
59769
  }
59830
59770
 
59831
- if (x === 0) {
59771
+ if (_x === 0) {
59832
59772
  n += 1;
59833
59773
  }
59834
59774
 
@@ -59862,6 +59802,7 @@ function invokeObjectHash(object) {
59862
59802
  * @param {number} index1
59863
59803
  */
59864
59804
  function array_swap_one(array, index0, index1) {
59805
+
59865
59806
  const t = array[index0];
59866
59807
 
59867
59808
  array[index0] = array[index1];
@@ -60200,8 +60141,12 @@ class HashMap {
60200
60141
  return true;
60201
60142
  }
60202
60143
 
60144
+ // assert.equal(record.hash, this.#build_key_hash(record.key), `Key hash has diverged for key ${record.key}, likely key was mutated or hash function is unstable`);
60145
+
60203
60146
  const result = this.keyEqualityFunction(record.key, key);
60204
60147
 
60148
+ // assert.isBoolean(result, `result(a=${record.key},b=${key})`);
60149
+
60205
60150
  return result;
60206
60151
  }
60207
60152
 
@@ -67567,8 +67512,12 @@ function formatToChannelCount(format) {
67567
67512
  case RGFormat:
67568
67513
  return 2;
67569
67514
  case RGBFormat:
67515
+ case RGB_S3TC_DXT1_Format:
67570
67516
  return 3;
67571
67517
  case RGBAFormat:
67518
+ case RGBA_S3TC_DXT1_Format:
67519
+ case RGBA_S3TC_DXT3_Format:
67520
+ case RGBA_S3TC_DXT5_Format:
67572
67521
  return 4;
67573
67522
  default:
67574
67523
  throw new Error(`Unsupported format '${format}'`);
@@ -67966,13 +67915,15 @@ const CrossOriginKind = {
67966
67915
  };
67967
67916
 
67968
67917
  class CrossOriginConfig {
67969
- constructor() {
67970
- this.kind = CrossOriginKind.Anonymous;
67971
- }
67972
-
67918
+ kind = CrossOriginKind.Anonymous;
67973
67919
  }
67974
67920
 
67975
67921
  const default_coc = new CrossOriginConfig();
67922
+
67923
+ /**
67924
+ * @readonly
67925
+ * @type {Readonly<CrossOriginConfig>}
67926
+ */
67976
67927
  CrossOriginConfig.default = Object.freeze(default_coc);
67977
67928
 
67978
67929
  /**
@@ -105103,13 +105054,6 @@ class EngineConfiguration {
105103
105054
  }
105104
105055
  }
105105
105056
 
105106
- //
105107
-
105108
-
105109
- function atan2(a, b) {
105110
- return Math.atan2(a, b);
105111
- }
105112
-
105113
105057
  /**
105114
105058
  *
105115
105059
  * @param {number[]} mat4
@@ -105121,15 +105065,9 @@ function coeff(mat4, row_index, column_index) {
105121
105065
  return mat4[row_index + column_index * 4];
105122
105066
  }
105123
105067
 
105124
- function sin(a) {
105125
- return Math.sin(a);
105126
- }
105127
-
105128
- function cos(a) {
105129
- return Math.cos(a);
105130
- }
105131
-
105132
- const EIGEN_PI = Math.PI;
105068
+ const sin = Math.sin;
105069
+ const cos = Math.cos;
105070
+ const atan2 = Math.atan2;
105133
105071
 
105134
105072
  /**
105135
105073
  *
@@ -105154,10 +105092,14 @@ const EIGEN_PI = Math.PI;
105154
105092
  * @param {number[]} res
105155
105093
  * @param {number[]|Float32Array|mat4} m4
105156
105094
  * @param {number} a0 axis index
105157
- * @param {number} a1
105158
- * @param {number} a2
105095
+ * @param {number} a1 axis index
105096
+ * @param {number} a2 axis index
105159
105097
  */
105160
- function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105098
+ function eulerAnglesFromMatrix(
105099
+ res, m4,
105100
+ a0, a1, a2
105101
+ ) {
105102
+
105161
105103
  const odd = ((a0 + 1) % 3 === a1) ? 0 : 1;
105162
105104
 
105163
105105
  const i = a0;
@@ -105166,11 +105108,12 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105166
105108
 
105167
105109
  if (a0 === a2) {
105168
105110
  res[0] = atan2(coeff(m4, j, i), coeff(m4, k, i));
105169
- if ((odd && res[0] < 0) || ((!odd) && res[0] > 0)) {
105111
+
105112
+ if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
105170
105113
  if (res[0] > 0) {
105171
- res[0] -= EIGEN_PI;
105114
+ res[0] -= Math.PI;
105172
105115
  } else {
105173
- res[0] += EIGEN_PI;
105116
+ res[0] += Math.PI;
105174
105117
  }
105175
105118
  const s2 = v2_magnitude(coeff(m4, j, i), coeff(m4, k, i));
105176
105119
  res[1] = -atan2(s2, coeff(m4, i, i));
@@ -105191,25 +105134,34 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
105191
105134
 
105192
105135
  const s1 = sin(res[0]);
105193
105136
  const c1 = cos(res[0]);
105137
+
105194
105138
  res[2] = atan2(c1 * coeff(m4, j, k) - s1 * coeff(m4, k, k), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
105139
+
105195
105140
  } else {
105141
+
105196
105142
  res[0] = atan2(coeff(m4, j, k), coeff(m4, k, k));
105143
+
105197
105144
  const c2 = v2_magnitude(coeff(m4, i, i), coeff(m4, i, j));
105198
- if ((odd && res[0] < 0) || ((!odd) && res[0] > 0)) {
105145
+
105146
+ if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
105199
105147
  if (res[0] > 0) {
105200
- res[0] -= EIGEN_PI;
105148
+ res[0] -= Math.PI;
105201
105149
  } else {
105202
- res[0] += EIGEN_PI;
105150
+ res[0] += Math.PI;
105203
105151
  }
105204
105152
  res[1] = atan2(-coeff(m4, i, k), -c2);
105205
- } else
105153
+ } else {
105206
105154
  res[1] = atan2(-coeff(m4, i, k), c2);
105155
+ }
105156
+
105207
105157
  const s1 = sin(res[0]);
105208
105158
  const c1 = cos(res[0]);
105159
+
105209
105160
  res[2] = atan2(s1 * coeff(m4, k, i) - c1 * coeff(m4, j, i), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
105161
+
105210
105162
  }
105211
105163
 
105212
- if (!odd) {
105164
+ if (odd === 0) {
105213
105165
  // invert result
105214
105166
  res[0] = -res[0];
105215
105167
  res[1] = -res[1];
@@ -118054,18 +118006,6 @@ function v4_dot(
118054
118006
  return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
118055
118007
  }
118056
118008
 
118057
- /**
118058
- *
118059
- * @param {number} x
118060
- * @param {number} y
118061
- * @param {number} z
118062
- * @param {number} w
118063
- * @returns {number}
118064
- */
118065
- function v4_length_sqr(x, y, z, w) {
118066
- return x * x + y * y + z * z + w * w;
118067
- }
118068
-
118069
118009
  /**
118070
118010
  *
118071
118011
  * @param {number} x0