@woosh/meep-engine 2.107.0 → 2.108.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/bundle-worker-image-decoder.js +1 -1
- package/build/meep.cjs +255 -172
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +255 -173
- package/editor/tools/paint/TerrainHeightPaintTool.js +5 -5
- package/package.json +1 -1
- package/src/core/binary/float_to_uint8.d.ts +7 -0
- package/src/core/binary/float_to_uint8.d.ts.map +1 -0
- package/src/core/binary/{float2uint8.js → float_to_uint8.js} +1 -1
- package/src/core/binary/int32_to_binary_string.d.ts +3 -2
- package/src/core/binary/int32_to_binary_string.d.ts.map +1 -1
- package/src/core/binary/int32_to_binary_string.js +18 -14
- package/src/core/binary/split_by_3.spec.d.ts +2 -0
- package/src/core/binary/split_by_3.spec.d.ts.map +1 -0
- package/src/core/binary/split_by_3.spec.js +22 -0
- package/src/core/binary/to_half_float_uint16.d.ts.map +1 -1
- package/src/core/binary/to_half_float_uint16.js +7 -5
- package/src/core/binary/uint8_to_float.d.ts +7 -0
- package/src/core/binary/uint8_to_float.d.ts.map +1 -0
- package/src/core/binary/{uint82float.js → uint8_to_float.js} +1 -1
- package/src/core/binary/uint8_to_float.spec.d.ts +2 -0
- package/src/core/binary/uint8_to_float.spec.d.ts.map +1 -0
- package/src/core/binary/uint8_to_float.spec.js +7 -0
- package/src/core/codegen/codeToBlob.d.ts +8 -0
- package/src/core/codegen/codeToBlob.d.ts.map +1 -0
- package/src/core/codegen/codeToBlob.js +36 -0
- package/src/core/codegen/codeToURL.d.ts +8 -0
- package/src/core/codegen/codeToURL.d.ts.map +1 -0
- package/src/core/codegen/codeToURL.js +22 -0
- package/src/core/collection/array/array_shuffle.d.ts +8 -0
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -0
- package/src/core/collection/array/array_shuffle.js +22 -0
- package/src/core/collection/array/array_shuffle.spec.d.ts +2 -0
- package/src/core/collection/array/array_shuffle.spec.d.ts.map +1 -0
- package/src/core/collection/array/{randomizeArrayElementOrder.spec.js → array_shuffle.spec.js} +4 -4
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorRandom.js +2 -2
- package/src/core/collection/array/randomMultipleFromArray.js +2 -2
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +16 -11
- package/src/core/color/hsv/hsv2rgb.js +4 -4
- package/src/core/color/hsv/rgb2hsv.d.ts +3 -3
- package/src/core/color/hsv/rgb2hsv.d.ts.map +1 -1
- package/src/core/color/hsv/rgb2hsv.js +11 -18
- package/src/core/color/rgb2uint24.js +4 -4
- package/src/core/color/rgb_to_luminance.d.ts +9 -0
- package/src/core/color/rgb_to_luminance.d.ts.map +1 -0
- package/src/core/color/rgb_to_luminance.js +10 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts +1 -0
- package/src/core/color/sRGB/linear_to_sRGB.d.ts.map +1 -1
- package/src/core/color/sRGB/linear_to_sRGB.js +4 -4
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +4 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_ray.js +3 -3
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +14 -14
- package/src/core/geom/3d/sphere/harmonics/README.md +16 -2
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts +6 -0
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/SH3_COEFFICIENTS.js +17 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.js +21 -9
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts +3 -3
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +35 -206
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.js +29 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.js +10 -10
- package/src/core/geom/3d/sphere/harmonics/sh_index.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_index.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_index.js +9 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band1.js +44 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_rotate_band2.js +86 -0
- package/src/core/geom/3d/sphere/in_sphere3d_robust.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/in_sphere3d_robust.js +2 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts +20 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +53 -7
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.spec.js +2 -2
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.d.ts +1 -1
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js +12 -7
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts +13 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js +135 -0
- package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +38 -24
- package/src/core/geom/3d/tetrahedra/{compute_circumsphere.d.ts → tetrahedron_compute_circumsphere.d.ts} +3 -5
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/{compute_circumsphere.js → tetrahedron_compute_circumsphere.js} +2 -4
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +3 -1
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +4 -3
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts +8 -0
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_multiply_vec3.js +21 -0
- package/src/core/geom/random/randomPointInSphere.d.ts +1 -1
- package/src/core/geom/random/randomPointInSphere.js +2 -2
- package/src/core/geom/random/randomPointOnSphere.d.ts +3 -3
- package/src/core/geom/random/randomPointOnSphere.d.ts.map +1 -1
- package/src/core/geom/random/randomPointOnSphere.js +5 -9
- package/src/core/geom/vec2/v2_cross_product.d.ts +15 -0
- package/src/core/geom/vec2/v2_cross_product.d.ts.map +1 -0
- package/src/core/geom/vec2/v2_cross_product.js +21 -0
- package/src/core/geom/vec3/v3_slerp.d.ts +1 -0
- package/src/core/geom/vec3/v3_slerp.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_slerp.js +1 -0
- package/src/core/graph/MultiNode.d.ts +1 -1
- package/src/core/graph/MultiNode.js +1 -1
- package/src/core/graph/WeightedEdge.d.ts +6 -4
- package/src/core/graph/WeightedEdge.d.ts.map +1 -1
- package/src/core/graph/WeightedEdge.js +3 -0
- package/src/core/graph/coloring/colorizeGraph.js +19 -19
- package/src/core/graph/convert_graph_to_dot_string.d.ts +1 -1
- package/src/core/graph/convert_graph_to_dot_string.d.ts.map +1 -1
- package/src/core/graph/convert_graph_to_dot_string.js +10 -6
- package/src/core/graph/graph_compute_adjacency_matrix.d.ts +9 -0
- package/src/core/graph/graph_compute_adjacency_matrix.d.ts.map +1 -0
- package/src/core/graph/{graph_adjacency_matrix.js → graph_compute_adjacency_matrix.js} +1 -2
- package/src/core/graph/graph_compute_degree_matrix.d.ts +10 -0
- package/src/core/graph/graph_compute_degree_matrix.d.ts.map +1 -0
- package/src/core/graph/graph_compute_degree_matrix.js +23 -0
- package/src/core/graph/graph_compute_distance_matrix.d.ts +13 -0
- package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -0
- package/src/core/graph/graph_compute_distance_matrix.js +103 -0
- package/src/core/graph/{graph_laplacian_matrix.d.ts → graph_compute_laplacian_matrix.d.ts} +2 -2
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts.map +1 -0
- package/src/core/graph/{graph_laplacian_matrix.js → graph_compute_laplacian_matrix.js} +6 -6
- package/src/core/graph/graph_k_means_cluster.d.ts.map +1 -1
- package/src/core/graph/graph_k_means_cluster.js +4 -119
- package/src/core/graph/{coarsen_graph.d.ts → mn_graph_coarsen.d.ts} +2 -2
- package/src/core/graph/mn_graph_coarsen.d.ts.map +1 -0
- package/src/core/graph/{coarsen_graph.js → mn_graph_coarsen.js} +1 -1
- package/src/core/graph/mn_graph_coarsen.spec.d.ts +2 -0
- package/src/core/graph/mn_graph_coarsen.spec.d.ts.map +1 -0
- package/src/core/graph/{coarsen_graph.spec.js → mn_graph_coarsen.spec.js} +4 -4
- package/src/core/graph/mn_graph_collapse_weighted_edge.d.ts +1 -0
- package/src/core/graph/mn_graph_collapse_weighted_edge.d.ts.map +1 -1
- package/src/core/graph/mn_graph_collapse_weighted_edge.js +7 -1
- package/src/core/math/physics/brdf/brdf_burley.d.ts.map +1 -1
- package/src/core/math/physics/brdf/brdf_burley.js +9 -1
- package/src/core/math/physics/brdf/{D_GGX.d.ts → diffuse_GGX.d.ts} +2 -2
- package/src/core/math/physics/brdf/diffuse_GGX.d.ts.map +1 -0
- package/src/core/math/physics/brdf/{D_GGX.js → diffuse_GGX.js} +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick.d.ts +3 -0
- package/src/core/math/physics/brdf/fresnel_Schlick.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick.js +3 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +9 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +12 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.d.ts +9 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.d.ts.map +1 -0
- package/src/core/math/physics/brdf/fresnel_Schlick_original.js +10 -0
- package/src/core/math/physics/bsdf/bsdf_schlick.d.ts.map +1 -1
- package/src/core/math/physics/bsdf/bsdf_schlick.js +3 -11
- package/src/core/math/physics/ior_to_reflectivity.d.ts +7 -0
- package/src/core/math/physics/ior_to_reflectivity.d.ts.map +1 -0
- package/src/core/math/physics/ior_to_reflectivity.js +9 -0
- package/src/core/math/physics/pdf/README.md +1 -0
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +16 -0
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -0
- package/src/core/math/physics/pdf/pdf_GGX.js +25 -0
- package/src/core/math/physics/reflectivity_to_ior.d.ts +7 -0
- package/src/core/math/physics/reflectivity_to_ior.d.ts.map +1 -0
- package/src/core/math/physics/reflectivity_to_ior.js +8 -0
- package/src/core/process/task/util/randomCountTask.js +3 -3
- package/src/core/process/worker/WorkerBuilder.d.ts.map +1 -1
- package/src/core/process/worker/WorkerBuilder.js +5 -35
- package/src/engine/EngineHarness.d.ts +10 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +22 -11
- package/src/engine/asset/loaders/ArrayBufferLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/ArrayBufferLoader.js +17 -10
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts +25 -11
- package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
- package/src/engine/asset/loaders/image/png/PNGReader.js +38 -24
- package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/TextureAttachmensByMaterialType.js +5 -0
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +4 -4
- package/src/engine/graphics/GraphicsEngine.js +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +4 -0
- package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.js +2 -3
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts +6 -0
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +22 -11
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +7 -7
- package/src/engine/graphics/impostors/octahedral/bake/prepare_bake_material.js +3 -3
- package/src/engine/graphics/render/forward_plus/model/DirectionalLight.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/DirectionalLight.js +25 -25
- package/src/engine/graphics/sh3/SH3VisualisationMaterial.d.ts.map +1 -1
- package/src/engine/graphics/sh3/SH3VisualisationMaterial.js +9 -6
- package/src/engine/graphics/sh3/fromCubeRenderTarget.d.ts +9 -0
- package/src/engine/graphics/sh3/fromCubeRenderTarget.d.ts.map +1 -0
- package/src/engine/graphics/sh3/fromCubeRenderTarget.js +145 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.d.ts +8 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/sh3/gi/tetrahedral_mesh_to_texture.js +51 -0
- package/src/engine/graphics/sh3/{LightProbeVolume.d.ts → lpv/LightProbeVolume.d.ts} +18 -7
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +340 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts +18 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/LightProbeVolumeSerializationAdapter.js +44 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +12 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +122 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.d.ts +29 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/ProbeRenderer.js +35 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts +27 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js +158 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts +11 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/build_probes_for_scene.js +127 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts +12 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lpv/probe_volume_to_textures.js +89 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts +90 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +352 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts +5 -91
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +41 -477
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts +1 -0
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.js +6 -3
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +38 -62
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/random_in_hemisphere.js +7 -1
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts +2 -2
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples.js +20 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/generate_stratified_samples_2d.js +31 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts +9 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/sampling/make_stratified_sample.js +21 -0
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts +3 -0
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/SoftwareTextureCache.js +3 -0
- package/src/engine/graphics/sh3/path_tracer/texture/apply_texture_clamping_to_coordinate.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/{apply_texture_clamping_to_coordinate.js → texture/apply_texture_clamping_to_coordinate.js} +2 -2
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts +11 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +86 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts +10 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/texture/sample_texture.js +55 -0
- package/src/engine/graphics/sh3/path_tracer/vec3_uint8_to_float.js +4 -4
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +145 -185
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts +5 -5
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts.map +1 -1
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js +8 -8
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.d.ts +13 -0
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.d.ts.map +1 -0
- package/src/engine/graphics/sh3/visualise_spherical_harmonic_sphere.js +54 -0
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts +2 -2
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts.map +1 -1
- package/src/engine/graphics/texture/AttributeDataTexture.js +11 -11
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +2 -2
- package/src/engine/input/ecs/systems/InputControllerSystem.js +1 -1
- package/src/engine/network/convertPathToURL.d.ts +3 -1
- package/src/engine/network/convertPathToURL.d.ts.map +1 -1
- package/src/engine/network/convertPathToURL.js +68 -51
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +4 -4
- package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
- package/src/generation/filtering/numeric/CellFilterCache.js +1 -0
- package/src/view/elements/ColorPickerView.d.ts.map +1 -1
- package/src/view/elements/ColorPickerView.js +7 -7
- package/src/core/binary/float2uint8.d.ts +0 -7
- package/src/core/binary/float2uint8.d.ts.map +0 -1
- package/src/core/binary/uint82float.d.ts +0 -7
- package/src/core/binary/uint82float.d.ts.map +0 -1
- package/src/core/binary/uint82float.spec.d.ts +0 -2
- package/src/core/binary/uint82float.spec.d.ts.map +0 -1
- package/src/core/binary/uint82float.spec.js +0 -7
- package/src/core/collection/array/randomizeArrayElementOrder.d.ts +0 -8
- package/src/core/collection/array/randomizeArrayElementOrder.d.ts.map +0 -1
- package/src/core/collection/array/randomizeArrayElementOrder.js +0 -24
- package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts +0 -2
- package/src/core/collection/array/randomizeArrayElementOrder.spec.d.ts.map +0 -1
- package/src/core/geom/3d/tetrahedra/compute_circumsphere.d.ts.map +0 -1
- package/src/core/graph/coarsen_graph.d.ts.map +0 -1
- package/src/core/graph/coarsen_graph.spec.d.ts +0 -2
- package/src/core/graph/coarsen_graph.spec.d.ts.map +0 -1
- package/src/core/graph/graph_adjacency_matrix.d.ts +0 -9
- package/src/core/graph/graph_adjacency_matrix.d.ts.map +0 -1
- package/src/core/graph/graph_degree_matrix.d.ts +0 -9
- package/src/core/graph/graph_degree_matrix.d.ts.map +0 -1
- package/src/core/graph/graph_degree_matrix.js +0 -18
- package/src/core/graph/graph_laplacian_matrix.d.ts.map +0 -1
- package/src/core/math/physics/brdf/D_GGX.d.ts.map +0 -1
- package/src/engine/graphics/sh3/LightProbeVolume.d.ts.map +0 -1
- package/src/engine/graphics/sh3/LightProbeVolume.js +0 -609
- package/src/engine/graphics/sh3/path_tracer/apply_texture_clamping_to_coordinate.d.ts.map +0 -1
- package/src/engine/graphics/sh3/visualise_probe.d.ts +0 -12
- package/src/engine/graphics/sh3/visualise_probe.d.ts.map +0 -1
- package/src/engine/graphics/sh3/visualise_probe.js +0 -40
- /package/src/engine/graphics/sh3/path_tracer/{apply_texture_clamping_to_coordinate.d.ts → texture/apply_texture_clamping_to_coordinate.d.ts} +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Special case of tetrahedral mesh generation using a regular 3d grid, useful for generating light probe volumes
|
|
3
|
+
* This is a special case of tetrahedral tessellation, we can handle it much easier due to regular nature of the point distribution
|
|
4
|
+
* Note that if resolution in every dimension should be >= 2
|
|
5
|
+
* @param {TetrahedralMesh} mesh
|
|
6
|
+
* @param {number[]} points point data is written here
|
|
7
|
+
* @param {AABB3} bounds
|
|
8
|
+
* @param {number} resolution_x how many points to generate on the grid in X axis
|
|
9
|
+
* @param {number} resolution_y how many points to generate on the grid in Y axis
|
|
10
|
+
* @param {number} resolution_z how many points to generate on the grid in Y axis
|
|
11
|
+
*/
|
|
12
|
+
export function tetrahedral_mesh_build_from_grid(
|
|
13
|
+
mesh, points,
|
|
14
|
+
bounds,
|
|
15
|
+
resolution_x = 2, resolution_y = 2, resolution_z = 2,
|
|
16
|
+
) {
|
|
17
|
+
|
|
18
|
+
console.error("Implementation is incomplete"); // FIXME
|
|
19
|
+
|
|
20
|
+
mesh.clear();
|
|
21
|
+
|
|
22
|
+
const tetrahedron_count = (resolution_x - 1) * (resolution_y - 1) * (resolution_z - 1) * 6;
|
|
23
|
+
|
|
24
|
+
// we know how many tetrahedrons will be created, so we can avoid some re-allocations by ensuring there's enough capacity
|
|
25
|
+
mesh.ensureCapacity(tetrahedron_count);
|
|
26
|
+
|
|
27
|
+
const bounds_extents_x = bounds.getExtentsX();
|
|
28
|
+
const bounds_extents_y = bounds.getExtentsY();
|
|
29
|
+
const bounds_extents_z = bounds.getExtentsZ();
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param {number} x
|
|
34
|
+
* @param {number} y
|
|
35
|
+
* @param {number} z
|
|
36
|
+
* @return {number}
|
|
37
|
+
*/
|
|
38
|
+
function vertex_position_to_index(x, y, z) {
|
|
39
|
+
|
|
40
|
+
return z * resolution_y * resolution_x + y * resolution_x + x;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// generate points
|
|
44
|
+
for (let z = 0; z < resolution_z; z++) {
|
|
45
|
+
for (let y = 0; y < resolution_y; y++) {
|
|
46
|
+
for (let x = 0; x < resolution_x; x++) {
|
|
47
|
+
|
|
48
|
+
const index = vertex_position_to_index(x, y, z);
|
|
49
|
+
|
|
50
|
+
const index3 = index * 3;
|
|
51
|
+
|
|
52
|
+
const x_norm = x / (resolution_x - 1);
|
|
53
|
+
const y_norm = y / (resolution_y - 1);
|
|
54
|
+
const z_norm = z / (resolution_z - 1);
|
|
55
|
+
|
|
56
|
+
points[index3] = bounds.x0 + x_norm * bounds_extents_x;
|
|
57
|
+
points[index3 + 1] = bounds.y0 + y_norm * bounds_extents_y;
|
|
58
|
+
points[index3 + 2] = bounds.z0 + z_norm * bounds_extents_z;
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @param {number} v0
|
|
67
|
+
* @param {number} v1
|
|
68
|
+
* @param {number} v2
|
|
69
|
+
* @param {number} v3
|
|
70
|
+
* @return {number}
|
|
71
|
+
*/
|
|
72
|
+
function make_cell(v0, v1, v2, v3) {
|
|
73
|
+
|
|
74
|
+
const tet_0 = mesh.allocate();
|
|
75
|
+
|
|
76
|
+
mesh.setVertexIndex(tet_0, 0, v0);
|
|
77
|
+
mesh.setVertexIndex(tet_0, 1, v1);
|
|
78
|
+
mesh.setVertexIndex(tet_0, 2, v2);
|
|
79
|
+
mesh.setVertexIndex(tet_0, 3, v3);
|
|
80
|
+
|
|
81
|
+
return tet_0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// NOTE: it's possible to tessellate each box into 5 tetrahedrons instead of 6, but orientation becomes inconsistent if we do that
|
|
85
|
+
// reference http://www.iue.tuwien.ac.at/phd/wessner/node32.html
|
|
86
|
+
|
|
87
|
+
for (let z = 1; z < resolution_z; z++) {
|
|
88
|
+
for (let y = 1; y < resolution_y; y++) {
|
|
89
|
+
for (let x = 1; x < resolution_x; x++) {
|
|
90
|
+
const p000 = vertex_position_to_index(x - 1, y - 1, z - 1);
|
|
91
|
+
const p001 = vertex_position_to_index(x - 1, y - 1, z);
|
|
92
|
+
const p010 = vertex_position_to_index(x - 1, y, z - 1);
|
|
93
|
+
const p011 = vertex_position_to_index(x - 1, y, z);
|
|
94
|
+
const p100 = vertex_position_to_index(x, y - 1, z - 1);
|
|
95
|
+
const p101 = vertex_position_to_index(x, y - 1, z);
|
|
96
|
+
const p110 = vertex_position_to_index(x, y, z - 1);
|
|
97
|
+
const p111 = vertex_position_to_index(x, y, z);
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
// Tessellate the grid volume into six tetrahedra per grid cell.
|
|
101
|
+
|
|
102
|
+
// prism 1
|
|
103
|
+
const tet_0 = make_cell(p111, p110, p010, p000);
|
|
104
|
+
const tet_1 = make_cell(p111, p101, p110, p000);
|
|
105
|
+
const tet_2 = make_cell(p110, p101, p100, p000);
|
|
106
|
+
|
|
107
|
+
// prism 2
|
|
108
|
+
const tet_3 = make_cell(p111, p011, p010, p000);
|
|
109
|
+
const tet_4 = make_cell(p111, p101, p011, p000);
|
|
110
|
+
const tet_5 = make_cell(p011, p101, p001, p000);
|
|
111
|
+
|
|
112
|
+
// link newly created tetrahedrons
|
|
113
|
+
// TODO implement
|
|
114
|
+
|
|
115
|
+
if (x > 1) {
|
|
116
|
+
// link to previous voxel
|
|
117
|
+
// TODO implement
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (y > 1) {
|
|
121
|
+
// link to previous voxel
|
|
122
|
+
// TODO implement
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (z > 1) {
|
|
126
|
+
// link to previous voxel
|
|
127
|
+
// TODO implement
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { EngineHarness } from "../../../../engine/EngineHarness.js";
|
|
2
|
-
import { compute_delaunay_tetrahedral_mesh } from "./delaunay/compute_delaunay_tetrahedral_mesh.js";
|
|
3
1
|
import { LineBasicMaterial } from "three";
|
|
4
|
-
import { ShadedGeometry } from "../../../../engine/graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
5
|
-
import { DrawMode } from "../../../../engine/graphics/ecs/mesh-v2/DrawMode.js";
|
|
6
2
|
import Entity from "../../../../engine/ecs/Entity.js";
|
|
7
3
|
import { Transform } from "../../../../engine/ecs/transform/Transform.js";
|
|
4
|
+
import { EngineHarness } from "../../../../engine/EngineHarness.js";
|
|
5
|
+
import { DrawMode } from "../../../../engine/graphics/ecs/mesh-v2/DrawMode.js";
|
|
6
|
+
import { ShadedGeometry } from "../../../../engine/graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
8
7
|
import { ShadedGeometrySystem } from "../../../../engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
9
|
-
import { GizmoRenderingPlugin } from "../../../../engine/graphics/render/gizmo/GizmoRenderingPlugin.js";
|
|
10
8
|
import { Gizmo } from "../../../../engine/graphics/render/gizmo/Gizmo.js";
|
|
11
|
-
import {
|
|
9
|
+
import { GizmoRenderingPlugin } from "../../../../engine/graphics/render/gizmo/GizmoRenderingPlugin.js";
|
|
12
10
|
import { seededRandom } from "../../../math/random/seededRandom.js";
|
|
13
|
-
import {
|
|
11
|
+
import { number_pretty_print } from "../../../primitives/numbers/number_pretty_print.js";
|
|
14
12
|
import { delay } from "../../../process/delay.js";
|
|
13
|
+
import { AABB3 } from "../aabb/AABB3.js";
|
|
14
|
+
import { make_justified_point_grid } from "../util/make_justified_point_grid.js";
|
|
15
|
+
import { build_tetrahedral_mesh_buffer_geometry } from "./build_tetrahedral_mesh_buffer_geometry.js";
|
|
16
|
+
import { compute_delaunay_tetrahedral_mesh } from "./delaunay/compute_delaunay_tetrahedral_mesh.js";
|
|
15
17
|
import { TetrahedralMesh } from "./TetrahedralMesh.js";
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -44,26 +46,37 @@ async function main(engine) {
|
|
|
44
46
|
|
|
45
47
|
const random = seededRandom();
|
|
46
48
|
|
|
47
|
-
for (let i = 0; i < 600; i++) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
// for (let i = 0; i < 600; i++) {
|
|
50
|
+
// points.push(
|
|
51
|
+
// randomFloatBetween(random, -100, 100),
|
|
52
|
+
// randomFloatBetween(random, 0, 150),
|
|
53
|
+
// randomFloatBetween(random, -100, 100),
|
|
54
|
+
// );
|
|
55
|
+
// }
|
|
56
|
+
|
|
57
|
+
make_justified_point_grid(
|
|
58
|
+
new AABB3(-100, 0, -100, 100, 150, 100),
|
|
59
|
+
20,
|
|
60
|
+
(x, y, z) => {
|
|
61
|
+
points.push(x, y, z);
|
|
62
|
+
}
|
|
63
|
+
);
|
|
58
64
|
|
|
59
65
|
await delay(1000);
|
|
60
66
|
|
|
61
67
|
const tetrahedra = new TetrahedralMesh();
|
|
62
|
-
|
|
63
|
-
console.profile('mesh build');
|
|
68
|
+
console.time('mesh build');
|
|
69
|
+
// console.profile('mesh build');
|
|
64
70
|
compute_delaunay_tetrahedral_mesh(tetrahedra, points, points.length / 3);
|
|
65
|
-
|
|
66
|
-
//
|
|
71
|
+
// tetrahedral_mesh_build_from_grid(
|
|
72
|
+
// tetrahedra,
|
|
73
|
+
// points,
|
|
74
|
+
// new AABB3(-100, 0, -100, 100, 100, 100),
|
|
75
|
+
// 64, 32, 64
|
|
76
|
+
// )
|
|
77
|
+
// console.profileEnd('mesh build');
|
|
78
|
+
console.timeEnd('mesh build');
|
|
79
|
+
console.log(`Mesh build for ${number_pretty_print(points.length / 3)} points`)
|
|
67
80
|
|
|
68
81
|
console.log(tetrahedra);
|
|
69
82
|
|
|
@@ -75,7 +88,6 @@ async function main(engine) {
|
|
|
75
88
|
const geometry = build_tetrahedral_mesh_buffer_geometry(tetrahedra, points);
|
|
76
89
|
|
|
77
90
|
|
|
78
|
-
|
|
79
91
|
new Entity()
|
|
80
92
|
.add(ShadedGeometry.from(geometry, new LineBasicMaterial({ color: 0xFF0000 }), DrawMode.LineSegments))
|
|
81
93
|
.add(Transform.fromJSON({
|
|
@@ -88,7 +100,9 @@ async function main(engine) {
|
|
|
88
100
|
|
|
89
101
|
Gizmo.color = [1, 1, 1, 1];
|
|
90
102
|
|
|
91
|
-
|
|
103
|
+
const point_count = points.length;
|
|
104
|
+
|
|
105
|
+
for (let i = 0; i < point_count; i += 3) {
|
|
92
106
|
|
|
93
107
|
Gizmo.draw_solid_sphere([
|
|
94
108
|
points[i] * scale[0] + offset[0],
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Compute the circumcenter (center[3]) and radius squared (method
|
|
3
|
-
* return value) of a tetrahedron defined by the four points x1, x2,
|
|
4
|
-
* x3, and x4.
|
|
2
|
+
* Compute the circumcenter (center[3]) and radius squared (method return value) of a tetrahedron defined by the four points x1, x2, x3, and x4.
|
|
5
3
|
*
|
|
6
4
|
* @see https://github.com/Kitware/VTK/blob/ac3fd8005bce7b3da4423c305f61ffd9df9695ef/Common/DataModel/vtkTetra.cxx
|
|
7
5
|
* @param {number[]} result [center_x, center_y, center_z, radius_squared]
|
|
@@ -11,5 +9,5 @@
|
|
|
11
9
|
* @param {number} c
|
|
12
10
|
* @param {number} d
|
|
13
11
|
*/
|
|
14
|
-
export function
|
|
15
|
-
//# sourceMappingURL=
|
|
12
|
+
export function tetrahedron_compute_circumsphere(result: number[], points: number[], a: number, b: number, c: number, d: number): void;
|
|
13
|
+
//# sourceMappingURL=tetrahedron_compute_circumsphere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedron_compute_circumsphere.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_circumsphere.js"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,yDAPW,MAAM,EAAE,UACR,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QA+EhB"}
|
package/src/core/geom/3d/tetrahedra/{compute_circumsphere.js → tetrahedron_compute_circumsphere.js}
RENAMED
|
@@ -6,9 +6,7 @@ const SMALL_NUMBER = 1e-12;
|
|
|
6
6
|
const VTK_MAX_WARNS = 3;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Compute the circumcenter (center[3]) and radius squared (method
|
|
10
|
-
* return value) of a tetrahedron defined by the four points x1, x2,
|
|
11
|
-
* x3, and x4.
|
|
9
|
+
* Compute the circumcenter (center[3]) and radius squared (method return value) of a tetrahedron defined by the four points x1, x2, x3, and x4.
|
|
12
10
|
*
|
|
13
11
|
* @see https://github.com/Kitware/VTK/blob/ac3fd8005bce7b3da4423c305f61ffd9df9695ef/Common/DataModel/vtkTetra.cxx
|
|
14
12
|
* @param {number[]} result [center_x, center_y, center_z, radius_squared]
|
|
@@ -18,7 +16,7 @@ const VTK_MAX_WARNS = 3;
|
|
|
18
16
|
* @param {number} c
|
|
19
17
|
* @param {number} d
|
|
20
18
|
*/
|
|
21
|
-
export function
|
|
19
|
+
export function tetrahedron_compute_circumsphere(
|
|
22
20
|
result,
|
|
23
21
|
points,
|
|
24
22
|
a, b, c, d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tetrahedron_compute_signed_volume.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tetrahedron_compute_signed_volume.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js"],"names":[],"mappings":"AAkCA;;;;;;;;;GASG;AACH,0DAPW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,KACvC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CA0ClB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const ONE_OVER_SIX = 1.0 / 6.0;
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Compute signed volume of a tetrahedron with the last point at the origin
|
|
3
5
|
* @see "EFFICIENT FEATURE EXTRACTION FOR 2D/3D OBJECTS IN MESH REPRESENTATION" by Cha Zhang and Tsuhan Chen
|
|
@@ -25,7 +27,7 @@ function triangle_compute_signed_volume(
|
|
|
25
27
|
const v213 = bx * ay * cz;
|
|
26
28
|
const v123 = ax * by * cz;
|
|
27
29
|
|
|
28
|
-
return
|
|
30
|
+
return ONE_OVER_SIX * (-v321 + v231 + v312 - v132 - v213 + v123);
|
|
29
31
|
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector3.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector3.js"],"names":[],"mappings":";AAmBA;
|
|
1
|
+
{"version":3,"file":"Vector3.d.ts","sourceRoot":"","sources":["../../../../src/core/geom/Vector3.js"],"names":[],"mappings":";AAmBA;IAstBI;;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IACH,oBAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAkBhB;IAED;;;;;OAKG;IACH,+BAJW,MAAM,OACN,MAAM,SACN,MAAM,QAuBhB;IAED;;;;;OAKG;IACH,6CAFa,OAAO,CASnB;IAED;;;;MAEC;IAED;;;OAGG;IACH,eAFW;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAC;QAAC,CAAC,EAAC,MAAM,CAAA;KAAC,GAAC,MAAM,QAS/C;IAED,mBAEC;IAED;;;;OAIG;IACH,2CAIC;IAED;;;;OAIG;IACH,6CAMC;IAED;;;;OAIG;IACH,kDAIC;IAED;;;;OAIG;IACH,oDAMC;IAED;;;;OAIG;IACH,kEAEC;IAED;;;;OAIG;IACH,oEAEC;IAED,eAMC;IAeD,mBAEC;IAdD,gBAEC;IAcD,mBAEC;IAdD,gBAEC;IAcD,mBAEC;IAdD,gBAEC;IAoEL,gBApmBiB,MAAM,CAomBG;IAC1B,mBAt8Be,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,UAq8BM;IAC3B,iBA17Be,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,UAy7BI;IA2DzB;;;OAGG;IACH,oBAFU,OAAO,CAEU;IAvHvB,sDAMC;CA4CJ;;qBAWS,OAAO;oBAOP,OAAO;0BAOP,OAAO;mBAMP,OAAO;qBAMP,OAAO;qBAMP,OAAO;sBAMP,OAAO;wBAMP,OAAO;qBAMP,OAAO;yBAYP,MAAM;;;mBAtjCG,4BAA4B;uBAOxB,kBAAkB"}
|
package/src/core/geom/Vector3.js
CHANGED
|
@@ -598,6 +598,7 @@ class Vector3 {
|
|
|
598
598
|
const y = this.y;
|
|
599
599
|
const z = this.z;
|
|
600
600
|
|
|
601
|
+
// This is just 3x3 matrix multiplication
|
|
601
602
|
const _x = m4[0] * x + m4[4] * y + m4[8] * z;
|
|
602
603
|
const _y = m4[1] * x + m4[5] * y + m4[9] * z;
|
|
603
604
|
const _z = m4[2] * x + m4[6] * y + m4[10] * z;
|
|
@@ -795,10 +796,10 @@ class Vector3 {
|
|
|
795
796
|
}
|
|
796
797
|
|
|
797
798
|
/**
|
|
798
|
-
*
|
|
799
|
+
* Convert spherical coordinates to cartesian
|
|
799
800
|
* @param {number} radius
|
|
800
|
-
* @param {number} phi
|
|
801
|
-
* @param {number} theta
|
|
801
|
+
* @param {number} phi Also known as Azimuth
|
|
802
|
+
* @param {number} theta Also known as Elevation
|
|
802
803
|
*/
|
|
803
804
|
setFromSphericalCoords(radius, phi, theta) {
|
|
804
805
|
assert.isNumber(radius, 'radius');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"m3_multiply_vec3.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/mat3/m3_multiply_vec3.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oEAcC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {mat3} out
|
|
4
|
+
* @param {mat3} a
|
|
5
|
+
* @param {vec3} v
|
|
6
|
+
*/
|
|
7
|
+
export function m3_multiply_vec3(out, a, v) {
|
|
8
|
+
const x = v[0];
|
|
9
|
+
const y = v[1];
|
|
10
|
+
const z = v[2];
|
|
11
|
+
|
|
12
|
+
out[0] = x * a[0];
|
|
13
|
+
out[1] = x * a[1];
|
|
14
|
+
out[2] = x * a[2];
|
|
15
|
+
out[3] = y * a[3];
|
|
16
|
+
out[4] = y * a[4];
|
|
17
|
+
out[5] = y * a[5];
|
|
18
|
+
out[6] = z * a[6];
|
|
19
|
+
out[7] = z * a[7];
|
|
20
|
+
out[8] = z * a[8];
|
|
21
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PI2 } from "../../math/PI2.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Unit sphere with Radius = 1
|
|
5
5
|
* @see based on python code suggested here: https://stackoverflow.com/questions/5408276/sampling-uniformly-distributed-random-points-inside-a-spherical-volume
|
|
6
6
|
* @param {function} random
|
|
7
7
|
* @param {number[]} result
|
|
@@ -17,7 +17,7 @@ export function randomPointInSphere(random, result, result_offset) {
|
|
|
17
17
|
const theta = Math.acos(cosTheta);
|
|
18
18
|
|
|
19
19
|
// compute radius
|
|
20
|
-
const r = Math.cbrt(u)
|
|
20
|
+
const r = Math.cbrt(u);
|
|
21
21
|
|
|
22
22
|
const sinTheta = Math.sin(theta);
|
|
23
23
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Unit sphere sampling
|
|
3
3
|
* @see based on python code suggested here: https://stackoverflow.com/questions/5408276/sampling-uniformly-distributed-random-points-inside-a-spherical-volume
|
|
4
4
|
* @param {function} random
|
|
5
|
-
* @param {number[]} result
|
|
5
|
+
* @param {number[]|Float32Array} result
|
|
6
6
|
* @param {number} result_offset
|
|
7
7
|
*/
|
|
8
|
-
export function randomPointOnSphere(random: Function, result: number[], result_offset: number): void;
|
|
8
|
+
export function randomPointOnSphere(random: Function, result: number[] | Float32Array, result_offset: number): void;
|
|
9
9
|
//# sourceMappingURL=randomPointOnSphere.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomPointOnSphere.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/random/randomPointOnSphere.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,8DAHW,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"randomPointOnSphere.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/random/randomPointOnSphere.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,8DAHW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,QAoBhB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Unit sphere sampling
|
|
3
3
|
* @see based on python code suggested here: https://stackoverflow.com/questions/5408276/sampling-uniformly-distributed-random-points-inside-a-spherical-volume
|
|
4
4
|
* @param {function} random
|
|
5
|
-
* @param {number[]} result
|
|
5
|
+
* @param {number[]|Float32Array} result
|
|
6
6
|
* @param {number} result_offset
|
|
7
7
|
*/
|
|
8
8
|
export function randomPointOnSphere(random, result, result_offset) {
|
|
@@ -14,14 +14,10 @@ export function randomPointOnSphere(random, result, result_offset) {
|
|
|
14
14
|
|
|
15
15
|
const sinTheta = Math.sin(theta);
|
|
16
16
|
|
|
17
|
-
const r = 0.5;
|
|
18
|
-
|
|
19
17
|
//compute coordinates
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const y = rst * Math.sin(phi);
|
|
24
|
-
const z = r * cosTheta;
|
|
18
|
+
const x = sinTheta * Math.cos(phi);
|
|
19
|
+
const y = sinTheta * Math.sin(phi);
|
|
20
|
+
const z = cosTheta;
|
|
25
21
|
|
|
26
22
|
//write the result
|
|
27
23
|
result[result_offset] = x;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Not really a cross-product, since that doesn't exist in 2d.
|
|
3
|
+
* We imagine Z to be 0, and essentially do a 3d vector cross product
|
|
4
|
+
* Also known as "perpendicular dot product"
|
|
5
|
+
* Also known as "exterior product"
|
|
6
|
+
* Also known as "determinant"
|
|
7
|
+
* Also known as "wedge product"
|
|
8
|
+
* @param {number} x0
|
|
9
|
+
* @param {number} y0
|
|
10
|
+
* @param {number} x1
|
|
11
|
+
* @param {number} y1
|
|
12
|
+
* @return {number}
|
|
13
|
+
*/
|
|
14
|
+
export function v2_cross_product(x0: number, y0: number, x1: number, y1: number): number;
|
|
15
|
+
//# sourceMappingURL=v2_cross_product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2_cross_product.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_cross_product.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,qCANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,MAAM,CASjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Not really a cross-product, since that doesn't exist in 2d.
|
|
3
|
+
* We imagine Z to be 0, and essentially do a 3d vector cross product
|
|
4
|
+
* Also known as "perpendicular dot product"
|
|
5
|
+
* Also known as "exterior product"
|
|
6
|
+
* Also known as "determinant"
|
|
7
|
+
* Also known as "wedge product"
|
|
8
|
+
* @param {number} x0
|
|
9
|
+
* @param {number} y0
|
|
10
|
+
* @param {number} x1
|
|
11
|
+
* @param {number} y1
|
|
12
|
+
* @return {number}
|
|
13
|
+
*/
|
|
14
|
+
export function v2_cross_product(
|
|
15
|
+
x0, y0,
|
|
16
|
+
x1, y1
|
|
17
|
+
) {
|
|
18
|
+
|
|
19
|
+
return x0 * y1 - y0 * x1;
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v3_slerp.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_slerp.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"v3_slerp.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_slerp.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,+CARW,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,YACN,MAAM,QAkChB"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
*/
|
|
4
|
+
export class WeightedEdge<T> extends Edge<any> {
|
|
2
5
|
/**
|
|
3
6
|
*
|
|
4
7
|
* @param {WeightedEdge} e
|
|
5
8
|
* @returns {number}
|
|
6
9
|
*/
|
|
7
|
-
static extractWeight(e: WeightedEdge): number;
|
|
10
|
+
static extractWeight(e: WeightedEdge<any>): number;
|
|
8
11
|
/**
|
|
9
12
|
*
|
|
10
13
|
* @param {WeightedEdge} e
|
|
11
14
|
* @returns {number}
|
|
12
15
|
*/
|
|
13
|
-
static extractNegativeWeight(e: WeightedEdge): number;
|
|
14
|
-
constructor(a: N, b: N);
|
|
16
|
+
static extractNegativeWeight(e: WeightedEdge<any>): number;
|
|
15
17
|
/**
|
|
16
18
|
*
|
|
17
19
|
* @type {number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WeightedEdge.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/WeightedEdge.js"],"names":[],"mappings":"AAEA;IAOI;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"WeightedEdge.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/WeightedEdge.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAOI;;;;OAIG;IACH,4CAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,oDAFa,MAAM,CAIlB;IAtBD;;;OAGG;IACH,QAFU,MAAM,CAEL;CAmBd;qBA7BoB,WAAW"}
|