@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.
- package/build/meep.cjs +122 -186
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +122 -186
- package/package.json +1 -1
- package/src/core/binary/ctz32.d.ts.map +1 -1
- package/src/core/binary/ctz32.js +12 -11
- package/src/core/binary/reinterpret_int32_as_float32.d.ts +7 -0
- package/src/core/binary/reinterpret_int32_as_float32.d.ts.map +1 -0
- package/src/core/binary/reinterpret_int32_as_float32.js +14 -0
- package/src/core/binary/reverse_bits_uint32.d.ts +8 -0
- package/src/core/binary/reverse_bits_uint32.d.ts.map +1 -0
- package/src/core/binary/reverse_bits_uint32.js +17 -0
- package/src/core/binary/reverse_bits_uint32.spec.d.ts +2 -0
- package/src/core/binary/reverse_bits_uint32.spec.d.ts.map +1 -0
- package/src/core/binary/reverse_bits_uint32.spec.js +18 -0
- package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/BVH.js +13 -18
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.js +3 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +6 -7
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +4 -0
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts +16 -0
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.js +130 -0
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts +2 -0
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.js +1 -0
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts +9 -0
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.js +31 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts +9 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_map.d.ts.map +1 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_map.js +79 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts +8 -0
- package/src/core/collection/array/array_quick_sort_by_lookup_uint.d.ts.map +1 -0
- package/src/core/collection/array/{array_quick_sort_by_lookup.js → array_quick_sort_by_lookup_uint.js} +1 -1
- package/src/core/collection/array/array_shuffle.js +1 -1
- package/src/core/collection/array/array_swap_one.d.ts.map +1 -1
- package/src/core/collection/array/array_swap_one.js +6 -0
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +10 -10
- package/src/core/geom/2d/compute_triangle_area_2d.d.ts.map +1 -1
- package/src/core/geom/2d/compute_triangle_area_2d.js +5 -3
- package/src/core/geom/3d/Ray3.d.ts +6 -0
- package/src/core/geom/3d/Ray3.d.ts.map +1 -1
- package/src/core/geom/3d/Ray3.js +24 -0
- package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts +16 -0
- package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_min.js +29 -0
- package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts +2 -2
- package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.js +6 -6
- package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.d.ts +11 -0
- package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_overlaps_ray_segment.js +61 -0
- package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts +2 -2
- package/src/core/geom/3d/eulerAnglesFromMatrix.d.ts.map +1 -1
- package/src/core/geom/3d/eulerAnglesFromMatrix.js +28 -25
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts.map +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +1 -1
- package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts +2 -2
- package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.d.ts.map +1 -1
- package/src/core/geom/3d/normal/octahedron/decode_octahedron_to_unit.js +1 -1
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.js +2 -2
- package/src/core/geom/3d/sphere/sphere_intersects_ray.js +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js +24 -188
- package/src/core/geom/3d/tetrahedra/triangle/prototype.js +1 -1
- package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts +11 -0
- package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/visualize_tetrahedral_mesh.js +42 -0
- package/src/core/geom/3d/topology/samples/sampleFloodFill.js +2 -2
- package/src/core/geom/3d/topology/tm_face_area.js +2 -2
- package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.d.ts → compute_triangle_area_3d.d.ts} +2 -2
- package/src/core/geom/3d/triangle/compute_triangle_area_3d.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/{computeTriangleSurfaceArea.js → compute_triangle_area_3d.js} +2 -4
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +13 -102
- package/src/core/geom/Quaternion.spec.js +2 -2
- package/src/core/geom/Vector1.d.ts.map +1 -1
- package/src/core/geom/Vector1.js +14 -6
- package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts +14 -0
- package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts.map +1 -0
- package/src/core/geom/vec3/{v3_shift_along_direction.js → v3_array_displace_in_direction.js} +1 -1
- package/src/core/geom/vec3/v3_displace_in_direction.d.ts +7 -7
- package/src/core/geom/vec3/v3_displace_in_direction.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_displace_in_direction.js +20 -17
- package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts +2 -0
- package/src/core/geom/vec3/v3_displace_in_direction.spec.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_displace_in_direction.spec.js +80 -0
- package/src/core/geom/vec4/v4_length.d.ts +10 -0
- package/src/core/geom/vec4/v4_length.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_length.js +13 -0
- package/src/core/geom/vec4/v4_length_sqr.js +2 -1
- package/src/core/graph/eigen/matrix_eigenvalues_in_place.spec.js +31 -1
- package/src/core/math/FLT_EPSILON_64.d.ts +6 -0
- package/src/core/math/FLT_EPSILON_64.d.ts.map +1 -0
- package/src/core/math/FLT_EPSILON_64.js +5 -0
- package/src/core/math/gaussian.d.ts +2 -2
- package/src/core/math/gaussian.js +2 -2
- package/src/core/math/linalg/README.md +1 -0
- package/src/core/math/linalg/lu_factor_linear_system.d.ts +13 -0
- package/src/core/math/linalg/lu_factor_linear_system.d.ts.map +1 -0
- package/src/core/math/linalg/lu_factor_linear_system.js +112 -0
- package/src/core/math/linalg/lu_solve_linear_system.d.ts +14 -0
- package/src/core/math/linalg/lu_solve_linear_system.d.ts.map +1 -0
- package/src/core/math/linalg/lu_solve_linear_system.js +51 -0
- package/src/core/math/linalg/solve_linear_system.d.ts +14 -0
- package/src/core/math/linalg/solve_linear_system.d.ts.map +1 -0
- package/src/core/math/linalg/solve_linear_system.js +52 -0
- package/src/core/math/linalg/solve_linear_system.spec.d.ts +2 -0
- package/src/core/math/linalg/solve_linear_system.spec.d.ts.map +1 -0
- package/src/core/math/linalg/solve_linear_system.spec.js +70 -0
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts +10 -0
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.d.ts.map +1 -0
- package/src/core/math/linalg/solve_linear_system_GEPP_2x2.js +91 -0
- package/src/core/math/solveQuadratic.d.ts.map +1 -1
- package/src/core/math/solveQuadratic.js +2 -0
- package/src/core/math/statistics/gaussian_amplitude.d.ts +8 -0
- package/src/core/math/statistics/gaussian_amplitude.d.ts.map +1 -0
- package/src/core/math/statistics/gaussian_amplitude.js +13 -0
- package/src/core/math/statistics/halton_sequence.js +3 -3
- package/src/core/math/statistics/halton_sequence.spec.js +18 -0
- package/src/core/math/statistics/hammersley_sequence.d.ts +9 -0
- package/src/core/math/statistics/hammersley_sequence.d.ts.map +1 -0
- package/src/core/math/statistics/hammersley_sequence.js +25 -0
- package/src/core/math/statistics/hammersley_sequence_2d.d.ts +9 -0
- package/src/core/math/statistics/hammersley_sequence_2d.d.ts.map +1 -0
- package/src/core/math/statistics/hammersley_sequence_2d.js +17 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts +8 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.d.ts.map +1 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.js +15 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts +2 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.d.ts.map +1 -0
- package/src/core/math/statistics/radical_inverse_VdC_base_2.spec.js +9 -0
- package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstance.js +26 -12
- package/src/core/model/node-graph/node/NodeInstance.spec.d.ts +2 -0
- package/src/core/model/node-graph/node/NodeInstance.spec.d.ts.map +1 -0
- package/src/core/model/node-graph/node/NodeInstance.spec.js +82 -0
- package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +9 -0
- package/src/core/model/node-graph/node/NodeInstancePortReference.spec.js +20 -0
- package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
- package/src/core/model/node-graph/node/Port.js +5 -12
- package/src/core/model/node-graph/node/PortDirection.d.ts.map +1 -1
- package/src/core/model/node-graph/node/PortDirection.js +7 -1
- package/src/engine/asset/CORS/CrossOriginConfig.d.ts.map +1 -1
- package/src/engine/asset/CORS/CrossOriginConfig.js +6 -4
- package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +2 -2
- package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.js +33 -3
- package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +9 -7
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts +6 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.d.ts.map +1 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_INFERNO.js +18 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts +6 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.d.ts.map +1 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_TURBO.js +266 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts +7 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.d.ts.map +1 -0
- package/src/engine/graphics/particles/particular/engine/parameter/sample/RGB_LUT_VIRIDIS.js +19 -0
- package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -9
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/gi/material/MaterialTransformer.js +0 -2
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts +4 -27
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +36 -158
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts +13 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeBaker.js +63 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +1 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +25 -1
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +4 -29
- package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.d.ts → serialization/LightProbeVolumeSerializationAdapter.d.ts} +2 -2
- package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/{LightProbeVolumeSerializationAdapter.js → serialization/LightProbeVolumeSerializationAdapter.js} +2 -2
- package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts +13 -0
- package/src/engine/graphics/sh3/lpv/sh3_bake_depth.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/sh3_bake_depth.js +71 -0
- package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts +2 -0
- package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/worker/lpv_build_worker.js +38 -0
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts +1 -7
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +58 -147
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts +13 -9
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +74 -54
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +23 -5
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +211 -59
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts +15 -0
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_along_ray.js +46 -0
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts +14 -0
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/build_bvh_nodes_distances_sqr_to_point.js +43 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/compute_triangle_group_aabb3.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.js → geometry/compute_triangle_group_aabb3.js} +2 -2
- package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts +12 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/construct_ray_hit_from_geometry.js +72 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/sample_triangle_attribute.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts +13 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/geometry/sort_triangles_by_distance_to_point.js +48 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/StandardMaterial.js +4 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +1 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.js +8 -5
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +24 -18
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts +2 -2
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.js → sampling/getBiasedNormalSample.js} +1 -1
- package/src/engine/graphics/sh3/path_tracer/sampling/random_in_hemisphere.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{random_in_hemisphere.js → sampling/random_in_hemisphere.js} +1 -1
- package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts +12 -0
- package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sort_bvh_nodes_by_distance_to_point.js +46 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts +7 -0
- package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/three_object_to_path_traced_scene.js +69 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +29 -7
- package/src/engine/graphics/texture/formatToChannelCount.d.ts.map +1 -1
- package/src/engine/graphics/texture/formatToChannelCount.js +14 -1
- package/src/engine/graphics/three/three_object_replace_materials.d.ts +7 -0
- package/src/engine/graphics/three/three_object_replace_materials.d.ts.map +1 -0
- package/src/engine/graphics/three/three_object_replace_materials.js +13 -0
- package/src/core/collection/array/array_quick_sort_by_lookup.d.ts +0 -8
- package/src/core/collection/array/array_quick_sort_by_lookup.d.ts.map +0 -1
- package/src/core/geom/3d/triangle/computeTriangleSurfaceArea.d.ts.map +0 -1
- package/src/core/geom/vec3/v3_shift_along_direction.d.ts +0 -14
- package/src/core/geom/vec3/v3_shift_along_direction.d.ts.map +0 -1
- package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts +0 -2
- package/src/engine/graphics/filter/FlipArrayViaCanvas.d.ts.map +0 -1
- package/src/engine/graphics/filter/FlipArrayViaCanvas.js +0 -13
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/compute_triangle_group_aabb3.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/getBiasedNormalSample.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts.map +0 -1
- /package/src/engine/graphics/sh3/path_tracer/{compute_triangle_group_aabb3.d.ts → geometry/compute_triangle_group_aabb3.d.ts} +0 -0
- /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.d.ts → geometry/sample_triangle_attribute.d.ts} +0 -0
- /package/src/engine/graphics/sh3/path_tracer/{sample_triangle_attribute.js → geometry/sample_triangle_attribute.js} +0 -0
- /package/src/engine/graphics/sh3/path_tracer/{getBiasedNormalSample.d.ts → sampling/getBiasedNormalSample.d.ts} +0 -0
- /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
|
|
1596
|
+
const handler = handlers[i];
|
|
1604
1597
|
|
|
1605
|
-
if (
|
|
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
|
-
|
|
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
|
|
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.
|
|
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
|
|
4044
|
-
const y = qY
|
|
4045
|
-
const z = qZ
|
|
4046
|
-
const w = qW
|
|
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
|
-
|
|
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
|
|
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
|
|
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 ((
|
|
59807
|
-
|
|
59746
|
+
if ((_x & 0xffff) === 0) {
|
|
59747
|
+
_x >>= 16;
|
|
59808
59748
|
n += 16;
|
|
59809
59749
|
}
|
|
59810
59750
|
|
|
59811
|
-
if ((
|
|
59812
|
-
|
|
59751
|
+
if ((_x & 0xff) === 0) {
|
|
59752
|
+
_x >>= 8;
|
|
59813
59753
|
n += 8;
|
|
59814
59754
|
}
|
|
59815
59755
|
|
|
59816
|
-
if ((
|
|
59817
|
-
|
|
59756
|
+
if ((_x & 0xf) === 0) {
|
|
59757
|
+
_x >>= 4;
|
|
59818
59758
|
n += 4;
|
|
59819
59759
|
}
|
|
59820
59760
|
|
|
59821
|
-
if ((
|
|
59822
|
-
|
|
59761
|
+
if ((_x & 0x3) === 0) {
|
|
59762
|
+
_x >>= 2;
|
|
59823
59763
|
n += 2;
|
|
59824
59764
|
}
|
|
59825
59765
|
|
|
59826
|
-
if ((
|
|
59827
|
-
|
|
59766
|
+
if ((_x & 0x1) === 0) {
|
|
59767
|
+
_x >>= 1;
|
|
59828
59768
|
n += 1;
|
|
59829
59769
|
}
|
|
59830
59770
|
|
|
59831
|
-
if (
|
|
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];
|
|
@@ -67567,8 +67508,12 @@ function formatToChannelCount(format) {
|
|
|
67567
67508
|
case RGFormat:
|
|
67568
67509
|
return 2;
|
|
67569
67510
|
case RGBFormat:
|
|
67511
|
+
case RGB_S3TC_DXT1_Format:
|
|
67570
67512
|
return 3;
|
|
67571
67513
|
case RGBAFormat:
|
|
67514
|
+
case RGBA_S3TC_DXT1_Format:
|
|
67515
|
+
case RGBA_S3TC_DXT3_Format:
|
|
67516
|
+
case RGBA_S3TC_DXT5_Format:
|
|
67572
67517
|
return 4;
|
|
67573
67518
|
default:
|
|
67574
67519
|
throw new Error(`Unsupported format '${format}'`);
|
|
@@ -67966,13 +67911,15 @@ const CrossOriginKind = {
|
|
|
67966
67911
|
};
|
|
67967
67912
|
|
|
67968
67913
|
class CrossOriginConfig {
|
|
67969
|
-
|
|
67970
|
-
this.kind = CrossOriginKind.Anonymous;
|
|
67971
|
-
}
|
|
67972
|
-
|
|
67914
|
+
kind = CrossOriginKind.Anonymous;
|
|
67973
67915
|
}
|
|
67974
67916
|
|
|
67975
67917
|
const default_coc = new CrossOriginConfig();
|
|
67918
|
+
|
|
67919
|
+
/**
|
|
67920
|
+
* @readonly
|
|
67921
|
+
* @type {Readonly<CrossOriginConfig>}
|
|
67922
|
+
*/
|
|
67976
67923
|
CrossOriginConfig.default = Object.freeze(default_coc);
|
|
67977
67924
|
|
|
67978
67925
|
/**
|
|
@@ -105103,13 +105050,6 @@ class EngineConfiguration {
|
|
|
105103
105050
|
}
|
|
105104
105051
|
}
|
|
105105
105052
|
|
|
105106
|
-
//
|
|
105107
|
-
|
|
105108
|
-
|
|
105109
|
-
function atan2(a, b) {
|
|
105110
|
-
return Math.atan2(a, b);
|
|
105111
|
-
}
|
|
105112
|
-
|
|
105113
105053
|
/**
|
|
105114
105054
|
*
|
|
105115
105055
|
* @param {number[]} mat4
|
|
@@ -105121,15 +105061,9 @@ function coeff(mat4, row_index, column_index) {
|
|
|
105121
105061
|
return mat4[row_index + column_index * 4];
|
|
105122
105062
|
}
|
|
105123
105063
|
|
|
105124
|
-
|
|
105125
|
-
|
|
105126
|
-
|
|
105127
|
-
|
|
105128
|
-
function cos(a) {
|
|
105129
|
-
return Math.cos(a);
|
|
105130
|
-
}
|
|
105131
|
-
|
|
105132
|
-
const EIGEN_PI = Math.PI;
|
|
105064
|
+
const sin = Math.sin;
|
|
105065
|
+
const cos = Math.cos;
|
|
105066
|
+
const atan2 = Math.atan2;
|
|
105133
105067
|
|
|
105134
105068
|
/**
|
|
105135
105069
|
*
|
|
@@ -105154,10 +105088,14 @@ const EIGEN_PI = Math.PI;
|
|
|
105154
105088
|
* @param {number[]} res
|
|
105155
105089
|
* @param {number[]|Float32Array|mat4} m4
|
|
105156
105090
|
* @param {number} a0 axis index
|
|
105157
|
-
* @param {number} a1
|
|
105158
|
-
* @param {number} a2
|
|
105091
|
+
* @param {number} a1 axis index
|
|
105092
|
+
* @param {number} a2 axis index
|
|
105159
105093
|
*/
|
|
105160
|
-
function eulerAnglesFromMatrix(
|
|
105094
|
+
function eulerAnglesFromMatrix(
|
|
105095
|
+
res, m4,
|
|
105096
|
+
a0, a1, a2
|
|
105097
|
+
) {
|
|
105098
|
+
|
|
105161
105099
|
const odd = ((a0 + 1) % 3 === a1) ? 0 : 1;
|
|
105162
105100
|
|
|
105163
105101
|
const i = a0;
|
|
@@ -105166,11 +105104,12 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
|
|
|
105166
105104
|
|
|
105167
105105
|
if (a0 === a2) {
|
|
105168
105106
|
res[0] = atan2(coeff(m4, j, i), coeff(m4, k, i));
|
|
105169
|
-
|
|
105107
|
+
|
|
105108
|
+
if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
|
|
105170
105109
|
if (res[0] > 0) {
|
|
105171
|
-
res[0] -=
|
|
105110
|
+
res[0] -= Math.PI;
|
|
105172
105111
|
} else {
|
|
105173
|
-
res[0] +=
|
|
105112
|
+
res[0] += Math.PI;
|
|
105174
105113
|
}
|
|
105175
105114
|
const s2 = v2_magnitude(coeff(m4, j, i), coeff(m4, k, i));
|
|
105176
105115
|
res[1] = -atan2(s2, coeff(m4, i, i));
|
|
@@ -105191,25 +105130,34 @@ function eulerAnglesFromMatrix(res, m4, a0, a1, a2) {
|
|
|
105191
105130
|
|
|
105192
105131
|
const s1 = sin(res[0]);
|
|
105193
105132
|
const c1 = cos(res[0]);
|
|
105133
|
+
|
|
105194
105134
|
res[2] = atan2(c1 * coeff(m4, j, k) - s1 * coeff(m4, k, k), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
|
|
105135
|
+
|
|
105195
105136
|
} else {
|
|
105137
|
+
|
|
105196
105138
|
res[0] = atan2(coeff(m4, j, k), coeff(m4, k, k));
|
|
105139
|
+
|
|
105197
105140
|
const c2 = v2_magnitude(coeff(m4, i, i), coeff(m4, i, j));
|
|
105198
|
-
|
|
105141
|
+
|
|
105142
|
+
if ((odd && res[0] < 0) || ((~odd) && res[0] > 0)) {
|
|
105199
105143
|
if (res[0] > 0) {
|
|
105200
|
-
res[0] -=
|
|
105144
|
+
res[0] -= Math.PI;
|
|
105201
105145
|
} else {
|
|
105202
|
-
res[0] +=
|
|
105146
|
+
res[0] += Math.PI;
|
|
105203
105147
|
}
|
|
105204
105148
|
res[1] = atan2(-coeff(m4, i, k), -c2);
|
|
105205
|
-
} else
|
|
105149
|
+
} else {
|
|
105206
105150
|
res[1] = atan2(-coeff(m4, i, k), c2);
|
|
105151
|
+
}
|
|
105152
|
+
|
|
105207
105153
|
const s1 = sin(res[0]);
|
|
105208
105154
|
const c1 = cos(res[0]);
|
|
105155
|
+
|
|
105209
105156
|
res[2] = atan2(s1 * coeff(m4, k, i) - c1 * coeff(m4, j, i), c1 * coeff(m4, j, j) - s1 * coeff(m4, k, j));
|
|
105157
|
+
|
|
105210
105158
|
}
|
|
105211
105159
|
|
|
105212
|
-
if (
|
|
105160
|
+
if (odd === 0) {
|
|
105213
105161
|
// invert result
|
|
105214
105162
|
res[0] = -res[0];
|
|
105215
105163
|
res[1] = -res[1];
|
|
@@ -118054,18 +118002,6 @@ function v4_dot(
|
|
|
118054
118002
|
return (x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1);
|
|
118055
118003
|
}
|
|
118056
118004
|
|
|
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
118005
|
/**
|
|
118070
118006
|
*
|
|
118071
118007
|
* @param {number} x0
|