@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,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]|Float32Array} result sh3
|
|
4
|
+
* @param {number[]} sh input
|
|
5
|
+
* @param {number[]} rotation 3x3 rotation matrix
|
|
6
|
+
*/
|
|
7
|
+
export function sh3_rotate(result: number[] | Float32Array, sh: number[], rotation: number[]): void;
|
|
8
|
+
//# sourceMappingURL=sh3_rotate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sh3_rotate.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_rotate.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,mCAJW,MAAM,EAAE,GAAC,YAAY,MACrB,MAAM,EAAE,YACR,MAAM,EAAE,QAqBlB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { sh_rotate_band1 } from "./sh_rotate_band1.js";
|
|
2
|
+
import { sh_rotate_band2 } from "./sh_rotate_band2.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {number[]|Float32Array} result sh3
|
|
7
|
+
* @param {number[]} sh input
|
|
8
|
+
* @param {number[]} rotation 3x3 rotation matrix
|
|
9
|
+
*/
|
|
10
|
+
export function sh3_rotate(result, sh, rotation) {
|
|
11
|
+
|
|
12
|
+
const b0 = sh[0];
|
|
13
|
+
const band1 = [sh[1], sh[2], sh[3]];
|
|
14
|
+
const b1 = sh_rotate_band1(band1, rotation);
|
|
15
|
+
const band2 = [sh[4], sh[5], sh[6], sh[7], sh[8]];
|
|
16
|
+
const b2 = sh_rotate_band2(band2, rotation);
|
|
17
|
+
|
|
18
|
+
result[0] = b0;
|
|
19
|
+
|
|
20
|
+
result[1] = b1[0];
|
|
21
|
+
result[2] = b1[1];
|
|
22
|
+
result[3] = b1[2];
|
|
23
|
+
|
|
24
|
+
result[4] = b2[0];
|
|
25
|
+
result[5] = b2[1];
|
|
26
|
+
result[6] = b2[2];
|
|
27
|
+
result[7] = b2[3];
|
|
28
|
+
result[8] = b2[4];
|
|
29
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { SH3_COEFFICIENTS } from "./SH3_COEFFICIENTS.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Sample value from a 3-band spherical harmonic defined by 9 coefficients
|
|
@@ -30,19 +30,19 @@ export function sh3_sample_by_direction(
|
|
|
30
30
|
const offset = harmonics_offset + dimension_count * i;
|
|
31
31
|
|
|
32
32
|
// band 0
|
|
33
|
-
channel_value = harmonics[offset] * 0
|
|
33
|
+
channel_value = harmonics[offset] * SH3_COEFFICIENTS[0];
|
|
34
34
|
|
|
35
35
|
// band 1
|
|
36
|
-
channel_value += harmonics[offset + 1] *
|
|
37
|
-
channel_value += harmonics[offset + 2] *
|
|
38
|
-
channel_value += harmonics[offset + 3] *
|
|
36
|
+
channel_value += harmonics[offset + 1] * SH3_COEFFICIENTS[1] * y;
|
|
37
|
+
channel_value += harmonics[offset + 2] * SH3_COEFFICIENTS[2] * z;
|
|
38
|
+
channel_value += harmonics[offset + 3] * SH3_COEFFICIENTS[3] * x;
|
|
39
39
|
|
|
40
40
|
// band 2
|
|
41
|
-
channel_value += harmonics[offset + 4] *
|
|
42
|
-
channel_value += harmonics[offset + 5] *
|
|
43
|
-
channel_value += harmonics[offset + 6] *
|
|
44
|
-
channel_value += harmonics[offset + 7] *
|
|
45
|
-
channel_value += harmonics[offset + 8] *
|
|
41
|
+
channel_value += harmonics[offset + 4] * SH3_COEFFICIENTS[4] * (x * y);
|
|
42
|
+
channel_value += harmonics[offset + 5] * SH3_COEFFICIENTS[5] * (y * z);
|
|
43
|
+
channel_value += harmonics[offset + 6] * SH3_COEFFICIENTS[6] * (3.0 * z * z - 1.0);
|
|
44
|
+
channel_value += harmonics[offset + 7] * SH3_COEFFICIENTS[7] * (x * z);
|
|
45
|
+
channel_value += harmonics[offset + 8] * SH3_COEFFICIENTS[8] * (x * x - y * y);
|
|
46
46
|
|
|
47
47
|
// write out
|
|
48
48
|
result[result_offset + i] = channel_value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sh_index.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh_index.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,4BAJW,MAAM,KACN,MAAM,GACL,MAAM,CAIjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* utilities to rotate very low order spherical harmonics (up to 3rd band)
|
|
3
|
+
* @param {number[]} band1 vec3
|
|
4
|
+
* @param {number[]} M 3x3 matrix
|
|
5
|
+
* @returns {number[]}
|
|
6
|
+
*/
|
|
7
|
+
export function sh_rotate_band1(band1: number[], M: number[]): number[];
|
|
8
|
+
//# sourceMappingURL=sh_rotate_band1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sh_rotate_band1.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh_rotate_band1.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,uCAJW,MAAM,EAAE,KACR,MAAM,EAAE,GACN,MAAM,EAAE,CAoCpB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mat3 } from "gl-matrix";
|
|
2
|
+
import { m3_multiply_vec3 } from "../../../mat3/m3_multiply_vec3.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* utilities to rotate very low order spherical harmonics (up to 3rd band)
|
|
6
|
+
* @param {number[]} band1 vec3
|
|
7
|
+
* @param {number[]} M 3x3 matrix
|
|
8
|
+
* @returns {number[]}
|
|
9
|
+
*/
|
|
10
|
+
export function sh_rotate_band1(band1, M) {
|
|
11
|
+
|
|
12
|
+
// inverse() is not constexpr -- so we pre-calculate it in mathematica
|
|
13
|
+
//
|
|
14
|
+
// constexpr float3 N0{ 1, 0, 0 };
|
|
15
|
+
// constexpr float3 N1{ 0, 1, 0 };
|
|
16
|
+
// constexpr float3 N2{ 0, 0, 1 };
|
|
17
|
+
//
|
|
18
|
+
// constexpr mat3f A1 = { // this is the projection of N0, N1, N2 to SH space
|
|
19
|
+
// float3{ -N0.y, N0.z, -N0.x },
|
|
20
|
+
// float3{ -N1.y, N1.z, -N1.x },
|
|
21
|
+
// float3{ -N2.y, N2.z, -N2.x }
|
|
22
|
+
// };
|
|
23
|
+
//
|
|
24
|
+
// const mat3f invA1 = inverse(A1);
|
|
25
|
+
|
|
26
|
+
const invA1TimesK = [
|
|
27
|
+
0, -1, 0,
|
|
28
|
+
0, 0, 1,
|
|
29
|
+
-1, 0, 0
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const R1OverK = [
|
|
33
|
+
-M[1], M[2], -M[0],
|
|
34
|
+
-M[4], M[5], -M[3],
|
|
35
|
+
-M[7], M[8], -M[6]
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
m3_multiply_vec3(invA1TimesK, invA1TimesK, band1);
|
|
40
|
+
|
|
41
|
+
mat3.multiply(R1OverK, R1OverK, invA1TimesK);
|
|
42
|
+
|
|
43
|
+
return R1OverK;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sh_rotate_band2.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh_rotate_band2.js"],"names":[],"mappings":"AAuCA;;;;;GAKG;AACH,uCAJW,MAAM,EAAE,KACR,MAAM,EAAE,GACP,MAAM,EAAE,CA0CnB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Math.sqrt(3)
|
|
3
|
+
* @type {number}
|
|
4
|
+
*/
|
|
5
|
+
const SQRT_3 = 1.7320508075688772;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {number[]|Float32Array} M 5x5 matrix
|
|
10
|
+
* @param {number[]} x vec5
|
|
11
|
+
* @return {number[]} vec5
|
|
12
|
+
*/
|
|
13
|
+
function multiply_5d(M, x) {
|
|
14
|
+
return [
|
|
15
|
+
M[0] * x[0] + M[5] * x[1] + M[10] * x[2] + M[15] * x[3] + M[20] * x[4],
|
|
16
|
+
M[1] * x[0] + M[6] * x[1] + M[11] * x[2] + M[16] * x[3] + M[21] * x[4],
|
|
17
|
+
M[2] * x[0] + M[7] * x[1] + M[12] * x[2] + M[17] * x[3] + M[22] * x[4],
|
|
18
|
+
M[3] * x[0] + M[8] * x[1] + M[13] * x[2] + M[18] * x[3] + M[23] * x[4],
|
|
19
|
+
M[4] * x[0] + M[9] * x[1] + M[14] * x[2] + M[19] * x[3] + M[24] * x[4]
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This projects a vec3 to SH2/k space (i.e. we premultiply by 1/k)
|
|
25
|
+
* these are second band SH factors, multiplied by 1/K ( K = Math.sqrt(15) / (2*Math.sqrt(Math.PI)) )
|
|
26
|
+
* @param {number[]|Float32Array} output
|
|
27
|
+
* @param {number} output_offset
|
|
28
|
+
* @param {number} x
|
|
29
|
+
* @param {number} y
|
|
30
|
+
* @param {number} z
|
|
31
|
+
*/
|
|
32
|
+
function project_v3_to_sh2k(output, output_offset, x, y, z) {
|
|
33
|
+
output[output_offset] = (y * x)
|
|
34
|
+
output[output_offset + 1] = -(y * z)
|
|
35
|
+
output[output_offset + 2] = 0.28867513459481287 * (3 * z * z - 1)
|
|
36
|
+
output[output_offset + 3] = -(z * x)
|
|
37
|
+
output[output_offset + 4] = 0.5 * (x * x - y * y)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param {number[]} band2 vec5
|
|
43
|
+
* @param {number[]} M mat3
|
|
44
|
+
* @return {number[]} vec5
|
|
45
|
+
*/
|
|
46
|
+
export function sh_rotate_band2(band2, M) {
|
|
47
|
+
const n = Math.SQRT1_2;
|
|
48
|
+
|
|
49
|
+
// Below we precompute (with help of Mathematica):
|
|
50
|
+
// constexpr float3 N0{ 1, 0, 0 };
|
|
51
|
+
// constexpr float3 N1{ 0, 0, 1 };
|
|
52
|
+
// constexpr float3 N2{ n, n, 0 };
|
|
53
|
+
// constexpr float3 N3{ n, 0, n };
|
|
54
|
+
// constexpr float3 N4{ 0, n, n };
|
|
55
|
+
// constexpr float M_SQRT_PI = 1.7724538509f;
|
|
56
|
+
// constexpr float M_SQRT_15 = 3.8729833462f;
|
|
57
|
+
// constexpr float k = M_SQRT_15 / (2.0f * M_SQRT_PI);
|
|
58
|
+
// --> k * inverse(mat5{project(N0), project(N1), project(N2), project(N3), project(N4)})
|
|
59
|
+
const invATimesK = [
|
|
60
|
+
0, 1, 2, 0, 0,
|
|
61
|
+
-1, 0, 0, 0, -2,
|
|
62
|
+
0, SQRT_3, 0, 0, 0,
|
|
63
|
+
1, 1, 0, -2, 0,
|
|
64
|
+
2, 1, 0, 0, 0
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
// this is: invA * k * band2
|
|
68
|
+
// 5x5 matrix by vec5 (this a lot of zeroes and constants, which the compiler should eliminate)
|
|
69
|
+
const invATimesKTimesBand2 = multiply_5d(invATimesK, band2);
|
|
70
|
+
|
|
71
|
+
// this is: mat5{project(N0), project(N1), project(N2), project(N3), project(N4)} / k
|
|
72
|
+
// (the 1/k comes from project(), see above)
|
|
73
|
+
const ROverK = new Float32Array(25);
|
|
74
|
+
|
|
75
|
+
project_v3_to_sh2k(ROverK, 0, M[0], M[1], M[2]) // M * N0
|
|
76
|
+
project_v3_to_sh2k(ROverK, 5, M[6], M[7], M[8]) // M * N1
|
|
77
|
+
project_v3_to_sh2k(ROverK, 10, n * (M[0] + M[3]), n * (M[1] + M[4]), n * (M[2] + M[5])) // M * N2
|
|
78
|
+
project_v3_to_sh2k(ROverK, 15, n * (M[0] + M[6]), n * (M[1] + M[7]), n * (M[2] + M[8])) // M * N3
|
|
79
|
+
project_v3_to_sh2k(ROverK, 20, n * (M[3] + M[6]), n * (M[4] + M[7]), n * (M[5] + M[8])) // M * N4;
|
|
80
|
+
|
|
81
|
+
// notice how "k" disappears
|
|
82
|
+
// this is: (R / k) * (invA * k) * band2 == R * invA * band2
|
|
83
|
+
const result = multiply_5d(ROverK, invATimesKTimesBand2);
|
|
84
|
+
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in_sphere3d_robust.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/sphere/in_sphere3d_robust.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,2CARW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"in_sphere3d_robust.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/sphere/in_sphere3d_robust.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,2CARW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAyClB"}
|
|
@@ -86,12 +86,26 @@ export class TetrahedralMesh {
|
|
|
86
86
|
* @private
|
|
87
87
|
*/
|
|
88
88
|
private __free_pointer;
|
|
89
|
+
/**
|
|
90
|
+
* Only valid when the mesh is compacted
|
|
91
|
+
* @return {number}
|
|
92
|
+
*/
|
|
93
|
+
get count(): number;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @return {boolean}
|
|
97
|
+
*/
|
|
98
|
+
get isCompacted(): boolean;
|
|
89
99
|
/**
|
|
90
100
|
* Traverse tetrahedrons
|
|
91
101
|
* @param {function(tet:number,mesh:TetrahedralMesh):*} visitor
|
|
92
102
|
* @param {*} [thisArg]
|
|
93
103
|
*/
|
|
94
104
|
forEach(visitor: any, thisArg?: any): void;
|
|
105
|
+
/**
|
|
106
|
+
* Clears all data from the mesh, making it contain 0 tetrahedrons
|
|
107
|
+
*/
|
|
108
|
+
clear(): void;
|
|
95
109
|
/**
|
|
96
110
|
*
|
|
97
111
|
* @param {number} capacity
|
|
@@ -112,6 +126,11 @@ export class TetrahedralMesh {
|
|
|
112
126
|
* @param {number} capacity
|
|
113
127
|
*/
|
|
114
128
|
growCapacity(capacity: number): void;
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param {number} capacity
|
|
132
|
+
*/
|
|
133
|
+
ensureCapacity(capacity: number): void;
|
|
115
134
|
/**
|
|
116
135
|
* NOTE: this method can be quite slow in cases of sparse allocation, please prefer not to use it
|
|
117
136
|
* @param {number} tet
|
|
@@ -128,7 +147,7 @@ export class TetrahedralMesh {
|
|
|
128
147
|
/**
|
|
129
148
|
* NOTE: the neighbour value must be encoded, see format specification for details
|
|
130
149
|
* @param {number} tetra_index
|
|
131
|
-
* @param {number} neighbour_index which neighbour to set (
|
|
150
|
+
* @param {number} neighbour_index which neighbour to set (00..11)
|
|
132
151
|
* @param {number} neighbour index of the neighbour encoded with the opposite corner
|
|
133
152
|
*/
|
|
134
153
|
setNeighbour(tetra_index: number, neighbour_index: number, neighbour: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,qCAFU,MAAM,CAEkD;AAElE;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,4BAFU,MAAM,CAEwB;AAoBxC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IACI;;;OAGG;IACH,2BAFW,MAAM,EAqDhB;IAhDG;;;;OAIG;IACH,iBAAsE;IAEtE;;;;OAIG;IACH,sBAAmD;IAEnD;;;;OAIG;IACH,eAAyC;IAEzC;;;;OAIG;IACH,mBAA8B;IAE9B;;;;OAIG;IACH,mBAAmB;IAEnB;;;;OAIG;IACH,eAAgB;IAEhB;;;;OAIG;IACH,uBAAuB;IAG3B;;;;OAIG;IACH,2CAQC;IAED;;;OAGG;IACH,sBAFW,MAAM,QA8BhB;IAED;;;OAGG;IACH,eAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,uBAFW,MAAM,
|
|
1
|
+
{"version":3,"file":"TetrahedralMesh.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/TetrahedralMesh.js"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,qCAFU,MAAM,CAEkD;AAElE;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;GAGG;AACH,4BAFU,MAAM,CAEwB;AAoBxC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IACI;;;OAGG;IACH,2BAFW,MAAM,EAqDhB;IAhDG;;;;OAIG;IACH,iBAAsE;IAEtE;;;;OAIG;IACH,sBAAmD;IAEnD;;;;OAIG;IACH,eAAyC;IAEzC;;;;OAIG;IACH,mBAA8B;IAE9B;;;;OAIG;IACH,mBAAmB;IAEnB;;;;OAIG;IACH,eAAgB;IAEhB;;;;OAIG;IACH,uBAAuB;IAG3B;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,2BAEC;IAED;;;;OAIG;IACH,2CAQC;IAED;;OAEG;IACH,cAWC;IAED;;;OAGG;IACH,sBAFW,MAAM,QA8BhB;IAED;;;OAGG;IACH,eAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,uBAFW,MAAM,QAchB;IAED;;;OAGG;IACH,yBAFW,MAAM,QAShB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACL,OAAO,CAiBlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,mBACN,MAAM,GACJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,mBACN,MAAM,aACN,MAAM,QAchB;IAGD;;;;;OAKG;IACH,0BAJW,MAAM,eACN,MAAM,GACJ,MAAM,CAYlB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,eACN,MAAM,UACN,MAAM,QAiBhB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,MAAM,GACL,OAAO,CAUlB;IAGD;;;;OAIG;IACH,YAFY,MAAM,CA4BjB;IAED;;;;;;;;OAQG;IACH,eAPW,MAAM,EAAE,GAAC,YAAY,KACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,GACJ,MAAM,CAqBlB;IAED;;;;OAIG;IACH,wBAFW,MAAM,QAmBhB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAmBhB;IAED;;;;;OAKG;IACH,2CAHW,MAAM,aACN,MAAM,QAwBhB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,EAAE,SACR,MAAM,GACJ,MAAM,CAsBlB;IAGD;;;;;OAKG;IACH,uBAHW,MAAM,qBACN,MAAM,QA6BhB;IAED;;;;OAIG;IACH,WAFa,MAAM,CA2ClB;IAED;;;OAGG;IACH,kBAFW,YAAY,QAUtB;IAED;;;OAGG;IACH,oBAFW,YAAY,QAiBtB;IAED;;;OAGG;IACH,oBAFY,MAAM,CAUjB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAQhB;IAGL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAN1C;6BArrB4B,iCAAiC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { tetrahedron_contains_point } from "./tetrahedron_contains_point.js";
|
|
2
|
-
import { typed_array_copy } from "../../../collection/array/typed/typed_array_copy.js";
|
|
3
|
-
import { max3 } from "../../../math/max3.js";
|
|
4
1
|
import { assert } from "../../../assert.js";
|
|
2
|
+
import { Base64 } from "../../../binary/Base64.js";
|
|
3
|
+
import { BinaryBuffer } from "../../../binary/BinaryBuffer.js";
|
|
5
4
|
import { array_copy } from "../../../collection/array/array_copy.js";
|
|
6
5
|
import { array_quick_sort_by_comparator } from "../../../collection/array/arrayQuickSort.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { typed_array_copy } from "../../../collection/array/typed/typed_array_copy.js";
|
|
7
|
+
import { max3 } from "../../../math/max3.js";
|
|
9
8
|
import { number_compare_descending } from "../../../primitives/numbers/number_compare_descending.js";
|
|
9
|
+
import { tetrahedron_contains_point } from "./tetrahedron_contains_point.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @readonly
|
|
@@ -133,6 +133,22 @@ export class TetrahedralMesh {
|
|
|
133
133
|
this.__free_pointer = 0;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Only valid when the mesh is compacted
|
|
138
|
+
* @return {number}
|
|
139
|
+
*/
|
|
140
|
+
get count() {
|
|
141
|
+
return this.__used_end;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @return {boolean}
|
|
147
|
+
*/
|
|
148
|
+
get isCompacted() {
|
|
149
|
+
return this.__free_pointer === 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
136
152
|
/**
|
|
137
153
|
* Traverse tetrahedrons
|
|
138
154
|
* @param {function(tet:number,mesh:TetrahedralMesh):*} visitor
|
|
@@ -148,6 +164,22 @@ export class TetrahedralMesh {
|
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Clears all data from the mesh, making it contain 0 tetrahedrons
|
|
169
|
+
*/
|
|
170
|
+
clear() {
|
|
171
|
+
|
|
172
|
+
// clear data
|
|
173
|
+
this.__data_uint32.fill(0, 0, this.__used_end);
|
|
174
|
+
|
|
175
|
+
// reset metadata
|
|
176
|
+
this.__used_end = 0;
|
|
177
|
+
this.__free_pointer = 0;
|
|
178
|
+
this.__free.splice(0, this.__free.length);
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
151
183
|
/**
|
|
152
184
|
*
|
|
153
185
|
* @param {number} capacity
|
|
@@ -203,6 +235,7 @@ export class TetrahedralMesh {
|
|
|
203
235
|
* @param {number} capacity
|
|
204
236
|
*/
|
|
205
237
|
growCapacity(capacity) {
|
|
238
|
+
assert.isNonNegativeInteger(capacity, 'capacity');
|
|
206
239
|
|
|
207
240
|
const existing_capacity = this.__capacity;
|
|
208
241
|
|
|
@@ -215,6 +248,19 @@ export class TetrahedralMesh {
|
|
|
215
248
|
this.setCapacity(new_capacity);
|
|
216
249
|
}
|
|
217
250
|
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* @param {number} capacity
|
|
254
|
+
*/
|
|
255
|
+
ensureCapacity(capacity) {
|
|
256
|
+
assert.isNonNegativeInteger(capacity, 'capacity');
|
|
257
|
+
if (this.__capacity >= capacity) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
this.growCapacity(capacity);
|
|
262
|
+
}
|
|
263
|
+
|
|
218
264
|
/**
|
|
219
265
|
* NOTE: this method can be quite slow in cases of sparse allocation, please prefer not to use it
|
|
220
266
|
* @param {number} tet
|
|
@@ -258,7 +304,7 @@ export class TetrahedralMesh {
|
|
|
258
304
|
/**
|
|
259
305
|
* NOTE: the neighbour value must be encoded, see format specification for details
|
|
260
306
|
* @param {number} tetra_index
|
|
261
|
-
* @param {number} neighbour_index which neighbour to set (
|
|
307
|
+
* @param {number} neighbour_index which neighbour to set (00..11)
|
|
262
308
|
* @param {number} neighbour index of the neighbour encoded with the opposite corner
|
|
263
309
|
*/
|
|
264
310
|
setNeighbour(tetra_index, neighbour_index, neighbour) {
|
|
@@ -617,7 +663,7 @@ export class TetrahedralMesh {
|
|
|
617
663
|
|
|
618
664
|
this.growCapacity(this.__used_end);
|
|
619
665
|
|
|
620
|
-
buffer.readUint32Array(this.__data_uint32, 0, this.__used_end);
|
|
666
|
+
buffer.readUint32Array(this.__data_uint32, 0, this.__used_end * LAYOUT_TETRA_WORD_COUNT);
|
|
621
667
|
|
|
622
668
|
buffer.readUint32Array(this.__free, 0, this.__free_pointer);
|
|
623
669
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TetrahedralMesh } from "./TetrahedralMesh.js";
|
|
2
1
|
import { jest } from "@jest/globals";
|
|
2
|
+
import { TetrahedralMesh } from "./TetrahedralMesh.js";
|
|
3
3
|
|
|
4
4
|
test("constructor does not throw", () => {
|
|
5
5
|
expect(() => new TetrahedralMesh(1)).not.toThrow();
|
|
@@ -219,7 +219,7 @@ test('Compaction is non-destructive when moving resident data from the very end
|
|
|
219
219
|
const b = mesh.allocate();
|
|
220
220
|
|
|
221
221
|
// force move "a" to free set
|
|
222
|
-
mesh.
|
|
222
|
+
mesh.delete(a);
|
|
223
223
|
|
|
224
224
|
expect(mesh.exists(b)).toBe(true);
|
|
225
225
|
expect(mesh.exists(a)).toBe(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_tetrahedral_mesh_buffer_geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build_tetrahedral_mesh_buffer_geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/build_tetrahedral_mesh_buffer_geometry.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,4FAHW,YAAY,GAAC,MAAM,EAAE,GACpB,cAAc,CAwEzB;+BA/E6E,OAAO"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { BufferGeometry, Float32BufferAttribute, Uint32BufferAttribute } from "three";
|
|
2
|
-
import { BitSet } from "../../../binary/BitSet.js";
|
|
3
2
|
import { assert } from "../../../assert.js";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* Useful as a visualisation tool, to display tetrahedral mesh
|
|
7
6
|
* @param {TetrahedralMesh} tetrahedra
|
|
8
7
|
* @param {Float32Array|number[]} points
|
|
9
8
|
* @return {BufferGeometry}
|
|
10
9
|
*/
|
|
11
|
-
export function build_tetrahedral_mesh_buffer_geometry(
|
|
12
|
-
|
|
10
|
+
export function build_tetrahedral_mesh_buffer_geometry(
|
|
11
|
+
tetrahedra,
|
|
12
|
+
points
|
|
13
|
+
) {
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
+
const lines = [];
|
|
15
16
|
|
|
16
17
|
const point_count = points.length / 3;
|
|
17
18
|
|
|
19
|
+
const occupancy = {};
|
|
20
|
+
|
|
18
21
|
assert.isNonNegativeInteger(point_count, 'point_count');
|
|
19
22
|
|
|
20
23
|
/**
|
|
@@ -39,13 +42,15 @@ export function build_tetrahedral_mesh_buffer_geometry(tetrahedra, points) {
|
|
|
39
42
|
v1 = a;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
const
|
|
45
|
+
const key = `${v0}_${v1}`;
|
|
43
46
|
|
|
44
|
-
if (occupancy.
|
|
47
|
+
if (occupancy.hasOwnProperty(key)) {
|
|
45
48
|
// already recorded
|
|
46
49
|
return;
|
|
47
50
|
}
|
|
48
51
|
|
|
52
|
+
occupancy[key] = true;
|
|
53
|
+
|
|
49
54
|
// no line record yet, create it
|
|
50
55
|
lines.push(v0, v1);
|
|
51
56
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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(mesh: TetrahedralMesh, points: number[], bounds: AABB3, resolution_x?: number, resolution_y?: number, resolution_z?: number): void;
|
|
13
|
+
//# sourceMappingURL=tetrahedral_mesh_build_from_grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_build_from_grid.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_build_from_grid.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,gFANW,MAAM,EAAE,gCAER,MAAM,iBACN,MAAM,iBACN,MAAM,QA6HhB"}
|