@woosh/meep-engine 2.138.20 → 2.140.0
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/package.json +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.js +4 -4
- package/src/core/collection/PairUint32Map.d.ts +100 -0
- package/src/core/collection/PairUint32Map.d.ts.map +1 -0
- package/src/core/collection/PairUint32Map.js +321 -0
- package/src/core/collection/Uint32Map.d.ts +119 -0
- package/src/core/collection/Uint32Map.d.ts.map +1 -0
- package/src/core/collection/Uint32Map.js +345 -0
- package/src/core/collection/array/array_shuffle.d.ts +10 -3
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
- package/src/core/collection/array/array_shuffle.js +27 -22
- package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
- package/src/core/collection/heap/FibonacciHeap.js +586 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -1
- package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
- package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
- package/src/core/collection/heap/Uint32Heap4.js +490 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +30 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +93 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts +54 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.js +69 -0
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +24 -2
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.js +24 -1
- package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +148 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.js +451 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts +210 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/MeshShape3D.js +593 -0
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +46 -2
- package/src/core/geom/3d/shape/Triangle3D.d.ts +95 -0
- package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/Triangle3D.js +318 -0
- package/src/core/geom/3d/shape/UnionShape3D.js +13 -0
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +30 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +64 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +671 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts +28 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.js +48 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +387 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +35 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +140 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +31 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +97 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +41 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +124 -13
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +2 -2
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.js +2 -2
- package/src/core/geom/vec3/v3_negate_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_negate_array.js +2 -2
- package/src/core/geom/vec3/v3_quat3_apply.d.ts +29 -0
- package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply.js +39 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +30 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.js +41 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts +32 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_triple_cross_product.js +45 -0
- package/src/core/graph/csr/CSRGraph.d.ts +168 -0
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
- package/src/core/graph/csr/CSRGraph.js +319 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
- package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
- package/src/core/graph/metis/metis.d.ts +19 -0
- package/src/core/graph/metis/metis.d.ts.map +1 -1
- package/src/core/graph/metis/metis.js +20 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
- package/src/core/graph/metis/metis_cluster_bs.js +11 -0
- package/src/core/graph/metis/metis_options.d.ts +17 -2
- package/src/core/graph/metis/metis_options.d.ts.map +1 -1
- package/src/core/graph/metis/metis_options.js +17 -2
- package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
- package/src/core/graph/metis/native/MetisGraph.js +212 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/project_kway.js +43 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
- package/src/engine/EngineHarness.d.ts +3 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +3 -0
- package/src/engine/control/first-person/DESIGN.md +30 -6
- package/src/engine/control/first-person/DESIGN_EXTENSIONS.md +563 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +115 -9
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +211 -176
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +601 -8
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +349 -8
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +319 -23
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1789 -799
- package/src/engine/control/first-person/TODO.md +173 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Ability.js +119 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Mantle.js +188 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Slide.js +166 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallJump.js +131 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallRun.js +180 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
- package/src/engine/control/first-person/math/Spring.d.ts +56 -0
- package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/Spring.js +71 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +637 -120
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
- package/src/engine/control/first-person/test/buildTestPlayer.js +36 -0
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.js +27 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts +42 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.js +171 -0
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
- package/src/engine/physics/BULLET_REVIEW.md +945 -0
- package/src/engine/physics/CANNON_REVIEW.md +1300 -0
- package/src/engine/physics/JOLT_REVIEW.md +913 -0
- package/src/engine/physics/PLAN.md +461 -0
- package/src/engine/physics/RAPIER_REVIEW.md +934 -0
- package/src/engine/physics/REVIEW_001_ACTION_PLAN.md +642 -0
- package/src/engine/physics/body/BodyStorage.d.ts +187 -0
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
- package/src/engine/physics/body/BodyStorage.js +427 -0
- package/src/engine/physics/broadphase/PairList.d.ts +62 -0
- package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
- package/src/engine/physics/broadphase/PairList.js +97 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
- package/src/engine/physics/broadphase/generate_pairs.js +101 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts +299 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
- package/src/engine/physics/contact/ManifoldStore.js +608 -0
- package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
- package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
- package/src/engine/physics/ecs/BodyKind.js +24 -0
- package/src/engine/physics/ecs/Collider.d.ts +98 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
- package/src/engine/physics/ecs/Collider.js +136 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderFlags.js +15 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +628 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsSystem.js +1301 -0
- package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBody.js +240 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
- package/src/engine/physics/ecs/SleepState.d.ts +11 -0
- package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
- package/src/engine/physics/ecs/SleepState.js +12 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
- package/src/engine/physics/events/ContactEventBuffer.js +83 -0
- package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
- package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
- package/src/engine/physics/events/diff_manifolds.js +50 -0
- package/src/engine/physics/fluid/FluidField.d.ts +294 -16
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +510 -66
- package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +456 -95
- package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
- package/src/engine/physics/fluid/prototype.js +102 -91
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +48 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +92 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts +6 -6
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +76 -32
- package/src/engine/physics/gjk/gjk.d.ts +28 -2
- package/src/engine/physics/gjk/gjk.d.ts.map +1 -1
- package/src/engine/physics/gjk/gjk.js +421 -378
- package/src/engine/physics/gjk/minkowski_support.d.ts +37 -0
- package/src/engine/physics/gjk/minkowski_support.d.ts.map +1 -0
- package/src/engine/physics/gjk/minkowski_support.js +75 -0
- package/src/engine/physics/gjk/mpr.d.ts +56 -0
- package/src/engine/physics/gjk/mpr.d.ts.map +1 -0
- package/src/engine/physics/gjk/mpr.js +344 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +44 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
- package/src/engine/physics/inertia/world_inverse_inertia.js +77 -0
- package/src/engine/physics/integration/integrate_position.d.ts +34 -0
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_position.js +79 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts +55 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_velocity.js +160 -0
- package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
- package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
- package/src/engine/physics/integration/quat_integrate.js +62 -0
- package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
- package/src/engine/physics/island/IslandBuilder.js +411 -0
- package/src/engine/physics/island/union_find.d.ts +51 -0
- package/src/engine/physics/island/union_find.d.ts.map +1 -0
- package/src/engine/physics/island/union_find.js +76 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts +51 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/PosedShape.js +108 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_box_manifold.js +639 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts +30 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_contacts.js +462 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts +71 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.js +375 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts +91 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/compute_penetration.js +396 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts +35 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.js +80 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts +31 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.js +55 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +204 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +94 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts +37 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.js +37 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +17 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/narrowphase_step.js +1422 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.js +123 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts +48 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.js +143 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
- package/src/engine/physics/queries/overlap_shape.d.ts +51 -0
- package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -0
- package/src/engine/physics/queries/overlap_shape.js +183 -0
- package/src/engine/physics/queries/raycast.d.ts +20 -0
- package/src/engine/physics/queries/raycast.d.ts.map +1 -0
- package/src/engine/physics/queries/raycast.js +249 -0
- package/src/engine/physics/queries/shape_cast.d.ts +56 -0
- package/src/engine/physics/queries/shape_cast.d.ts.map +1 -0
- package/src/engine/physics/queries/shape_cast.js +387 -0
- package/src/engine/physics/solver/friction_cone.d.ts +16 -0
- package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
- package/src/engine/physics/solver/friction_cone.js +37 -0
- package/src/engine/physics/solver/solve_contacts.d.ts +122 -0
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
- package/src/engine/physics/solver/solve_contacts.js +1016 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
- package/src/engine/ecs/components/Motion.d.ts +0 -21
- package/src/engine/ecs/components/Motion.d.ts.map +0 -1
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
- package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
- package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
- package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
- package/src/engine/ecs/systems/MotionSystem.js +0 -29
- package/src/engine/physics/fluid/Fluid.d.ts +0 -26
- package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
- package/src/engine/physics/fluid/Fluid.js +0 -221
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
2
|
+
import {
|
|
3
|
+
tetrahedral_mesh_build_vertex_to_tets_map
|
|
4
|
+
} from "./tetrahedral_mesh_build_vertex_to_tets_map.js";
|
|
5
|
+
import { compute_tetrahedron_quality } from "./compute_tetrahedron_quality.js";
|
|
6
|
+
import {
|
|
7
|
+
tetrahedral_mesh_find_tets_around_edge
|
|
8
|
+
} from "./tetrahedral_mesh_find_tets_around_edge.js";
|
|
9
|
+
import { tetrahedral_mesh_flip_23 } from "./tetrahedral_mesh_flip_23.js";
|
|
10
|
+
import { tetrahedral_mesh_flip_32 } from "./tetrahedral_mesh_flip_32.js";
|
|
11
|
+
import {
|
|
12
|
+
tetrahedral_mesh_smooth_vertex
|
|
13
|
+
} from "./tetrahedral_mesh_smooth_vertex.js";
|
|
14
|
+
import {
|
|
15
|
+
tetrahedral_mesh_vertex_is_boundary
|
|
16
|
+
} from "./tetrahedral_mesh_vertex_is_boundary.js";
|
|
17
|
+
import { tetrahedron_compute_quality } from "./tetrahedron_compute_quality.js";
|
|
18
|
+
import { INVALID_NEIGHBOUR } from "./TetrahedralMesh.js";
|
|
19
|
+
|
|
20
|
+
// Face-vertex layout for a positively-oriented tet (identical to the
|
|
21
|
+
// table inside tetrahedral_mesh_flip_23.js). Inlined here so we can score
|
|
22
|
+
// a hypothetical 2-3 flip without doing-and-undoing it on the live mesh.
|
|
23
|
+
const FACE_VERTICES_BY_OPPOSITE = [
|
|
24
|
+
[1, 3, 2],
|
|
25
|
+
[0, 2, 3],
|
|
26
|
+
[0, 3, 1],
|
|
27
|
+
[0, 1, 2],
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
// Scratch for the 2-3 / 3-2 flip out-parameters. Module-level — the driver
|
|
31
|
+
// is not re-entrant.
|
|
32
|
+
const scratch_out_23 = new Uint32Array(3);
|
|
33
|
+
const scratch_out_32 = new Uint32Array(2);
|
|
34
|
+
const scratch_edge_ring = new Array(16);
|
|
35
|
+
const scratch_ring_closed = [0];
|
|
36
|
+
|
|
37
|
+
// The 6 unique vertex-pair (i, j) slots in a 4-vertex tet, enumerating
|
|
38
|
+
// every edge once. Used to iterate the 6 edges of a candidate tet during
|
|
39
|
+
// 3-2 flip search.
|
|
40
|
+
const EDGE_SLOT_PAIRS = [
|
|
41
|
+
[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3],
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Driver: improve the shape quality of an existing tetrahedral mesh by
|
|
46
|
+
* locally smoothing low-quality tets and applying 2-3 / 3-2 flips that
|
|
47
|
+
* monotonically increase the per-tet minimum quality.
|
|
48
|
+
*
|
|
49
|
+
* Algorithm — one pass:
|
|
50
|
+
* 1. Scan every live tet, compute its radius-ratio quality.
|
|
51
|
+
* 2. For each tet below `target_quality`, try in order:
|
|
52
|
+
* a. Laplacian smoothing on each non-boundary vertex. Accept the
|
|
53
|
+
* move only if the worst-of-the-1-ring quality strictly improves;
|
|
54
|
+
* otherwise revert the position.
|
|
55
|
+
* b. 2-3 flip across each of the tet's 4 internal faces. Tentatively
|
|
56
|
+
* apply the flip, score the 3 new tets; accept only if the
|
|
57
|
+
* minimum-of-three exceeds the original min-of-two. Otherwise
|
|
58
|
+
* apply the inverse 3-2 flip to roll back.
|
|
59
|
+
* 3. Repeat until no operation in a pass improves anything, or
|
|
60
|
+
* `max_passes` is reached.
|
|
61
|
+
*
|
|
62
|
+
* The "do then maybe undo" pattern for flips keeps the driver simple: no
|
|
63
|
+
* separate "preview the flip" code path. The cost is a wasted reverse-flip
|
|
64
|
+
* per rejected candidate. In practice most candidate flips on bad tets are
|
|
65
|
+
* either clearly beneficial (accepted) or clearly bad (rejected after one
|
|
66
|
+
* round-trip), so the overhead is small.
|
|
67
|
+
*
|
|
68
|
+
* Mesh topology and points are mutated in place. Surface vertices (any
|
|
69
|
+
* vertex incident to a face with INVALID_NEIGHBOUR) are NEVER moved by
|
|
70
|
+
* smoothing — moving them would change the surface shape, which is
|
|
71
|
+
* usually a hard constraint for the caller.
|
|
72
|
+
*
|
|
73
|
+
* @param {TetrahedralMesh} mesh — mutated in place
|
|
74
|
+
* @param {Float32Array|number[]} points — flat (x,y,z) positions, mutated
|
|
75
|
+
* @param {{
|
|
76
|
+
* target_quality?: number,
|
|
77
|
+
* max_passes?: number,
|
|
78
|
+
* smoothing_weight?: number,
|
|
79
|
+
* enable_flips?: boolean,
|
|
80
|
+
* enable_smoothing?: boolean,
|
|
81
|
+
* }} [options]
|
|
82
|
+
* @returns {{
|
|
83
|
+
* passes_run: number,
|
|
84
|
+
* smoothings_committed: number,
|
|
85
|
+
* smoothings_reverted: number,
|
|
86
|
+
* flips_23_committed: number,
|
|
87
|
+
* flips_23_rejected: number,
|
|
88
|
+
* flips_32_committed: number,
|
|
89
|
+
* flips_32_rejected: number,
|
|
90
|
+
* initial_min_quality: number,
|
|
91
|
+
* final_min_quality: number,
|
|
92
|
+
* }}
|
|
93
|
+
*/
|
|
94
|
+
export function tetrahedral_mesh_improve_quality(mesh, points, options = {}) {
|
|
95
|
+
assert.defined(mesh, 'mesh');
|
|
96
|
+
assert.defined(points, 'points');
|
|
97
|
+
|
|
98
|
+
const target_quality = options.target_quality ?? 0.1;
|
|
99
|
+
const max_passes = options.max_passes ?? 5;
|
|
100
|
+
const smoothing_weight = options.smoothing_weight ?? 0.5;
|
|
101
|
+
const enable_flips = options.enable_flips ?? true;
|
|
102
|
+
const enable_smoothing = options.enable_smoothing ?? true;
|
|
103
|
+
|
|
104
|
+
const stats = {
|
|
105
|
+
passes_run: 0,
|
|
106
|
+
smoothings_committed: 0,
|
|
107
|
+
smoothings_reverted: 0,
|
|
108
|
+
flips_23_committed: 0,
|
|
109
|
+
flips_23_rejected: 0,
|
|
110
|
+
flips_32_committed: 0,
|
|
111
|
+
flips_32_rejected: 0,
|
|
112
|
+
initial_min_quality: scan_min_quality(mesh, points),
|
|
113
|
+
final_min_quality: 1,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
for (let pass = 0; pass < max_passes; pass++) {
|
|
117
|
+
let any_improvement = false;
|
|
118
|
+
|
|
119
|
+
// Snapshot the live tet IDs so iteration is stable even as flips
|
|
120
|
+
// delete and re-introduce tet IDs underneath us.
|
|
121
|
+
const live = mesh.getLive();
|
|
122
|
+
|
|
123
|
+
// Build a vertex->tets cache once per pass. Used by the boundary
|
|
124
|
+
// check (flip-invariant — safe to use for the whole pass) and by
|
|
125
|
+
// the local quality eval (filtered through mesh.exists; may miss
|
|
126
|
+
// newly-flipped tets which is fine: the live-snapshot iteration
|
|
127
|
+
// already misses them too, and they'll be picked up next pass).
|
|
128
|
+
const vertex_to_tets = tetrahedral_mesh_build_vertex_to_tets_map(mesh);
|
|
129
|
+
|
|
130
|
+
for (let li = 0; li < live.length; li++) {
|
|
131
|
+
const tet = live[li];
|
|
132
|
+
if (!mesh.exists(tet)) continue;
|
|
133
|
+
|
|
134
|
+
let q = compute_tetrahedron_quality(mesh, points, tet);
|
|
135
|
+
if (q >= target_quality) continue;
|
|
136
|
+
|
|
137
|
+
// ---- Smoothing ---------------------------------------------------
|
|
138
|
+
if (enable_smoothing) {
|
|
139
|
+
for (let i = 0; i < 4; i++) {
|
|
140
|
+
if (!mesh.exists(tet)) break;
|
|
141
|
+
const v_id = mesh.getVertexIndex(tet, i);
|
|
142
|
+
if (tetrahedral_mesh_vertex_is_boundary(mesh, v_id, vertex_to_tets)) continue;
|
|
143
|
+
|
|
144
|
+
const v3 = v_id * 3;
|
|
145
|
+
const old_x = points[v3];
|
|
146
|
+
const old_y = points[v3 + 1];
|
|
147
|
+
const old_z = points[v3 + 2];
|
|
148
|
+
|
|
149
|
+
const old_min = local_min_quality_around_vertex(mesh, points, v_id, vertex_to_tets);
|
|
150
|
+
|
|
151
|
+
const moved = tetrahedral_mesh_smooth_vertex(mesh, points, v_id, smoothing_weight, vertex_to_tets);
|
|
152
|
+
if (!moved) continue;
|
|
153
|
+
|
|
154
|
+
const new_min = local_min_quality_around_vertex(mesh, points, v_id, vertex_to_tets);
|
|
155
|
+
if (new_min > old_min) {
|
|
156
|
+
stats.smoothings_committed++;
|
|
157
|
+
any_improvement = true;
|
|
158
|
+
// Re-fetch quality of `tet` — it may have improved.
|
|
159
|
+
q = compute_tetrahedron_quality(mesh, points, tet);
|
|
160
|
+
if (q >= target_quality) break;
|
|
161
|
+
} else {
|
|
162
|
+
points[v3] = old_x;
|
|
163
|
+
points[v3 + 1] = old_y;
|
|
164
|
+
points[v3 + 2] = old_z;
|
|
165
|
+
stats.smoothings_reverted++;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (!mesh.exists(tet)) continue;
|
|
171
|
+
q = compute_tetrahedron_quality(mesh, points, tet);
|
|
172
|
+
if (q >= target_quality) continue;
|
|
173
|
+
|
|
174
|
+
// ---- 2-3 flip across each internal face -------------------------
|
|
175
|
+
// We SCORE the candidate flip by computing what the 3 new tets'
|
|
176
|
+
// vertex IDs WOULD BE, evaluating quality from the indexed
|
|
177
|
+
// primitive — without touching mesh topology. The actual flip is
|
|
178
|
+
// only applied on accepted candidates, so the mesh never sees a
|
|
179
|
+
// bad transient state and we don't need to invert anything.
|
|
180
|
+
if (enable_flips) {
|
|
181
|
+
for (let face_slot = 0; face_slot < 4; face_slot++) {
|
|
182
|
+
if (!mesh.exists(tet)) break;
|
|
183
|
+
|
|
184
|
+
const enc = mesh.getNeighbour(tet, face_slot);
|
|
185
|
+
if (enc === INVALID_NEIGHBOUR) continue;
|
|
186
|
+
const neighbour_tet = enc >>> 2;
|
|
187
|
+
if (!mesh.exists(neighbour_tet)) continue;
|
|
188
|
+
const shared_i2 = enc & 3;
|
|
189
|
+
|
|
190
|
+
const q_before = Math.min(
|
|
191
|
+
compute_tetrahedron_quality(mesh, points, tet),
|
|
192
|
+
compute_tetrahedron_quality(mesh, points, neighbour_tet)
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
// Derive the would-be vertex IDs of the 3 new tets.
|
|
196
|
+
// d / e: the two apex vertices (the one opposite the
|
|
197
|
+
// shared face in each of tet and neighbour). p / q / r:
|
|
198
|
+
// the shared face's vertices in CCW-from-outside-tet
|
|
199
|
+
// order.
|
|
200
|
+
const d = mesh.getVertexIndex(tet, face_slot);
|
|
201
|
+
const e = mesh.getVertexIndex(neighbour_tet, shared_i2);
|
|
202
|
+
const face = FACE_VERTICES_BY_OPPOSITE[face_slot];
|
|
203
|
+
const p = mesh.getVertexIndex(tet, face[0]);
|
|
204
|
+
const q = mesh.getVertexIndex(tet, face[1]);
|
|
205
|
+
const r = mesh.getVertexIndex(tet, face[2]);
|
|
206
|
+
|
|
207
|
+
// Canonical layouts: T_α = (r, q, d, e); T_β = (p, r, d, e);
|
|
208
|
+
// T_γ = (q, p, d, e). Mirrors tetrahedral_mesh_flip_23.
|
|
209
|
+
const q_alpha = tetrahedron_compute_quality(points, r, q, d, e);
|
|
210
|
+
const q_beta = tetrahedron_compute_quality(points, p, r, d, e);
|
|
211
|
+
const q_gamma = tetrahedron_compute_quality(points, q, p, d, e);
|
|
212
|
+
const q_after = Math.min(q_alpha, q_beta, q_gamma);
|
|
213
|
+
|
|
214
|
+
if (q_after > q_before) {
|
|
215
|
+
// Commit: actually perform the flip.
|
|
216
|
+
tetrahedral_mesh_flip_23(mesh, tet, neighbour_tet, scratch_out_23);
|
|
217
|
+
stats.flips_23_committed++;
|
|
218
|
+
any_improvement = true;
|
|
219
|
+
// `tet` may have been re-used and now represents a
|
|
220
|
+
// different shape; stop probing its faces and let
|
|
221
|
+
// the next outer loop iteration pick up the new
|
|
222
|
+
// low-quality tets.
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
stats.flips_23_rejected++;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (!mesh.exists(tet)) continue;
|
|
231
|
+
q = compute_tetrahedron_quality(mesh, points, tet);
|
|
232
|
+
if (q >= target_quality) continue;
|
|
233
|
+
|
|
234
|
+
// ---- 3-2 flip on each edge whose ring has exactly 3 tets --------
|
|
235
|
+
// For each of the 6 edges of `tet`, walk the surrounding ring.
|
|
236
|
+
// If exactly 3 tets sit around that edge, we have a valid 3-2
|
|
237
|
+
// candidate. Score it analytically (using the same "compute
|
|
238
|
+
// ring layout from t1's canonical winding" rule as
|
|
239
|
+
// tetrahedral_mesh_flip_32) and commit only if the new pair's
|
|
240
|
+
// min quality beats the old triple's.
|
|
241
|
+
if (enable_flips) {
|
|
242
|
+
for (let ep = 0; ep < EDGE_SLOT_PAIRS.length; ep++) {
|
|
243
|
+
if (!mesh.exists(tet)) break;
|
|
244
|
+
|
|
245
|
+
const slot_a = EDGE_SLOT_PAIRS[ep][0];
|
|
246
|
+
const slot_b = EDGE_SLOT_PAIRS[ep][1];
|
|
247
|
+
const v_a = mesh.getVertexIndex(tet, slot_a);
|
|
248
|
+
const v_b = mesh.getVertexIndex(tet, slot_b);
|
|
249
|
+
|
|
250
|
+
const ring_count = tetrahedral_mesh_find_tets_around_edge(
|
|
251
|
+
scratch_edge_ring, 0, mesh, tet, v_a, v_b, scratch_ring_closed
|
|
252
|
+
);
|
|
253
|
+
// 3-2 flips are only defined on a CLOSED ring of
|
|
254
|
+
// exactly 3 tets. The ring walker may return 3 tets
|
|
255
|
+
// for an open chain on the mesh boundary (e.g. a
|
|
256
|
+
// vertex where two boundary faces meet at an edge);
|
|
257
|
+
// those aren't a valid 3-2 input — flip_32 would
|
|
258
|
+
// throw on them.
|
|
259
|
+
if (ring_count !== 3 || scratch_ring_closed[0] !== 1) continue;
|
|
260
|
+
|
|
261
|
+
const r0 = scratch_edge_ring[0];
|
|
262
|
+
const r1 = scratch_edge_ring[1];
|
|
263
|
+
const r2 = scratch_edge_ring[2];
|
|
264
|
+
|
|
265
|
+
const q_before_32 = Math.min(
|
|
266
|
+
compute_tetrahedron_quality(mesh, points, r0),
|
|
267
|
+
compute_tetrahedron_quality(mesh, points, r1),
|
|
268
|
+
compute_tetrahedron_quality(mesh, points, r2)
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
// Compute the 3-2 flip's would-be new tet vertex IDs.
|
|
272
|
+
// Mirrors the derivation in tetrahedral_mesh_flip_32:
|
|
273
|
+
// read r0's face opposite v_b in CCW-from-outside order,
|
|
274
|
+
// locate v_a within that triple, and the next two
|
|
275
|
+
// cyclic positions give the t1-side ring (v_X, v_Y) in
|
|
276
|
+
// CCW-from-v_a order. v_missing is the third ring vertex
|
|
277
|
+
// — present in r1 or r2 but not r0.
|
|
278
|
+
const slot_a_r0 = find_slot(mesh, r0, v_a);
|
|
279
|
+
const slot_b_r0 = find_slot(mesh, r0, v_b);
|
|
280
|
+
const face_opp_b = FACE_VERTICES_BY_OPPOSITE[slot_b_r0];
|
|
281
|
+
const f0 = mesh.getVertexIndex(r0, face_opp_b[0]);
|
|
282
|
+
const f1 = mesh.getVertexIndex(r0, face_opp_b[1]);
|
|
283
|
+
const f2 = mesh.getVertexIndex(r0, face_opp_b[2]);
|
|
284
|
+
let pos_a = -1;
|
|
285
|
+
if (f0 === v_a) pos_a = 0;
|
|
286
|
+
else if (f1 === v_a) pos_a = 1;
|
|
287
|
+
else if (f2 === v_a) pos_a = 2;
|
|
288
|
+
const face_array = [f0, f1, f2];
|
|
289
|
+
const v_X = face_array[(pos_a + 1) % 3];
|
|
290
|
+
const v_Y = face_array[(pos_a + 2) % 3];
|
|
291
|
+
|
|
292
|
+
// v_missing is the only ring vertex not in r0. It's in
|
|
293
|
+
// both r1 and r2; finding it requires walking another
|
|
294
|
+
// tet's vertices.
|
|
295
|
+
let v_missing = -1;
|
|
296
|
+
for (let i = 0; i < 4; i++) {
|
|
297
|
+
const v = mesh.getVertexIndex(r1, i);
|
|
298
|
+
if (v !== v_a && v !== v_b && v !== v_X && v !== v_Y) {
|
|
299
|
+
v_missing = v;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (v_missing < 0) continue; // shouldn't happen, but guard
|
|
304
|
+
|
|
305
|
+
// Canonical new layouts (mirrors flip_32):
|
|
306
|
+
// new_tet_a = (v_X, v_missing, v_Y, v_a)
|
|
307
|
+
// new_tet_b = (v_X, v_Y, v_missing, v_b)
|
|
308
|
+
const q_new_a = tetrahedron_compute_quality(points, v_X, v_missing, v_Y, v_a);
|
|
309
|
+
const q_new_b = tetrahedron_compute_quality(points, v_X, v_Y, v_missing, v_b);
|
|
310
|
+
const q_after_32 = Math.min(q_new_a, q_new_b);
|
|
311
|
+
|
|
312
|
+
if (q_after_32 > q_before_32) {
|
|
313
|
+
tetrahedral_mesh_flip_32(mesh, r0, r1, r2, scratch_out_32);
|
|
314
|
+
stats.flips_32_committed++;
|
|
315
|
+
any_improvement = true;
|
|
316
|
+
break; // tet's identity may now be one of the new tets
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
stats.flips_32_rejected++;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
stats.passes_run = pass + 1;
|
|
325
|
+
if (!any_improvement) break;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
stats.final_min_quality = scan_min_quality(mesh, points);
|
|
329
|
+
return stats;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Index of `vertex_id` within `tet`'s 4 slots, or -1 if absent.
|
|
334
|
+
*/
|
|
335
|
+
function find_slot(mesh, tet, vertex_id) {
|
|
336
|
+
for (let i = 0; i < 4; i++) {
|
|
337
|
+
if (mesh.getVertexIndex(tet, i) === vertex_id) return i;
|
|
338
|
+
}
|
|
339
|
+
return -1;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Min quality across every live tet in the mesh.
|
|
344
|
+
*/
|
|
345
|
+
function scan_min_quality(mesh, points) {
|
|
346
|
+
let min_q = 1;
|
|
347
|
+
mesh.forEach((tet, m) => {
|
|
348
|
+
const q = compute_tetrahedron_quality(m, points, tet);
|
|
349
|
+
if (q < min_q) min_q = q;
|
|
350
|
+
});
|
|
351
|
+
return min_q;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Min quality across all tets containing `v_id`. Used to score the local
|
|
356
|
+
* effect of moving (or undoing the move of) a single vertex.
|
|
357
|
+
*
|
|
358
|
+
* Reads the incident tets directly from the pass-level cache and filters
|
|
359
|
+
* out tets that have since been deleted. Cache entries whose vertex set
|
|
360
|
+
* no longer contains `v_id` (because a flip re-used the slot) are
|
|
361
|
+
* silently skipped — those tets are no longer part of `v_id`'s 1-ring
|
|
362
|
+
* anyway.
|
|
363
|
+
*/
|
|
364
|
+
function local_min_quality_around_vertex(mesh, points, v_id, vertex_to_tets) {
|
|
365
|
+
const tets = vertex_to_tets.get(v_id);
|
|
366
|
+
if (tets === undefined) return 1;
|
|
367
|
+
|
|
368
|
+
let min_q = 1;
|
|
369
|
+
for (let i = 0; i < tets.length; i++) {
|
|
370
|
+
const tet = tets[i];
|
|
371
|
+
if (!mesh.exists(tet)) continue;
|
|
372
|
+
// Tet may have been re-used by a flip with a different vertex set;
|
|
373
|
+
// confirm v_id is still incident before counting it.
|
|
374
|
+
let still_incident = false;
|
|
375
|
+
for (let s = 0; s < 4; s++) {
|
|
376
|
+
if (mesh.getVertexIndex(tet, s) === v_id) {
|
|
377
|
+
still_incident = true;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if (!still_incident) continue;
|
|
382
|
+
|
|
383
|
+
const q = compute_tetrahedron_quality(mesh, points, tet);
|
|
384
|
+
if (q < min_q) min_q = q;
|
|
385
|
+
}
|
|
386
|
+
return min_q;
|
|
387
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Move a vertex toward the centroid of its 1-ring neighbours (Laplacian
|
|
3
|
+
* smoothing), at the given weight: `w == 0` keeps the vertex where it is,
|
|
4
|
+
* `w == 1` snaps it to the centroid, `0 < w < 1` blends. Default `w = 1`.
|
|
5
|
+
*
|
|
6
|
+
* Mutates `points` in place. Does NOT touch the mesh topology.
|
|
7
|
+
*
|
|
8
|
+
* The 1-ring is computed by finding every tet that contains `vertex_id` and
|
|
9
|
+
* collecting the OTHER 3 vertices of each tet, deduplicated.
|
|
10
|
+
*
|
|
11
|
+
* If `vertex_to_tets_map` is provided (a `Map<vertex_id, tet_id[]>` from
|
|
12
|
+
* {@link tetrahedral_mesh_build_vertex_to_tets_map}), the incident-tet
|
|
13
|
+
* lookup runs in O(deg) instead of O(N). Entries pointing to deleted tets
|
|
14
|
+
* or to tets that no longer contain `vertex_id` (e.g. flipped) are
|
|
15
|
+
* silently filtered.
|
|
16
|
+
*
|
|
17
|
+
* Does NOT check whether the vertex sits on the mesh boundary — the caller
|
|
18
|
+
* is responsible for skipping boundary vertices (via
|
|
19
|
+
* {@link tetrahedral_mesh_vertex_is_boundary}) if surface preservation
|
|
20
|
+
* matters. Moving a boundary vertex changes the mesh's external shape.
|
|
21
|
+
*
|
|
22
|
+
* Returns `true` if the vertex was actually moved (i.e. it had ≥ 1 neighbour
|
|
23
|
+
* and the centroid differs from the current position), `false` otherwise
|
|
24
|
+
* (isolated vertex, or w == 0, or already at the centroid). The boolean
|
|
25
|
+
* lets a quality-improvement driver short-circuit on "nothing happened".
|
|
26
|
+
*
|
|
27
|
+
* @param {TetrahedralMesh} mesh
|
|
28
|
+
* @param {Float32Array|number[]} points flat (x,y,z) positions — mutated in place
|
|
29
|
+
* @param {number} vertex_id
|
|
30
|
+
* @param {number} [weight] move fraction, default 1.0
|
|
31
|
+
* @param {Map<number, number[]>} [vertex_to_tets_map] optional adjacency cache
|
|
32
|
+
* @returns {boolean} true if `points` was modified
|
|
33
|
+
*/
|
|
34
|
+
export function tetrahedral_mesh_smooth_vertex(mesh: TetrahedralMesh, points: Float32Array | number[], vertex_id: number, weight?: number, vertex_to_tets_map?: Map<number, number[]>): boolean;
|
|
35
|
+
//# sourceMappingURL=tetrahedral_mesh_smooth_vertex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_smooth_vertex.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,8EANW,YAAY,GAAC,MAAM,EAAE,aACrB,MAAM,WACN,MAAM,uBACN,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC,GACnB,OAAO,CAiGnB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
2
|
+
import {
|
|
3
|
+
tetrahedral_mesh_find_tets_attached_to_vertex
|
|
4
|
+
} from "./tetrahedral_mesh_find_tets_attached_to_vertex.js";
|
|
5
|
+
|
|
6
|
+
// Module-level scratch buffers, sized for typical vertex valence (~20-40
|
|
7
|
+
// incident tets, ~30-60 1-ring neighbours). Grow on demand. Re-used across
|
|
8
|
+
// calls — the function is therefore NOT re-entrant.
|
|
9
|
+
let scratch_tets = new Array(64);
|
|
10
|
+
let scratch_neighbours = new Array(128);
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Move a vertex toward the centroid of its 1-ring neighbours (Laplacian
|
|
14
|
+
* smoothing), at the given weight: `w == 0` keeps the vertex where it is,
|
|
15
|
+
* `w == 1` snaps it to the centroid, `0 < w < 1` blends. Default `w = 1`.
|
|
16
|
+
*
|
|
17
|
+
* Mutates `points` in place. Does NOT touch the mesh topology.
|
|
18
|
+
*
|
|
19
|
+
* The 1-ring is computed by finding every tet that contains `vertex_id` and
|
|
20
|
+
* collecting the OTHER 3 vertices of each tet, deduplicated.
|
|
21
|
+
*
|
|
22
|
+
* If `vertex_to_tets_map` is provided (a `Map<vertex_id, tet_id[]>` from
|
|
23
|
+
* {@link tetrahedral_mesh_build_vertex_to_tets_map}), the incident-tet
|
|
24
|
+
* lookup runs in O(deg) instead of O(N). Entries pointing to deleted tets
|
|
25
|
+
* or to tets that no longer contain `vertex_id` (e.g. flipped) are
|
|
26
|
+
* silently filtered.
|
|
27
|
+
*
|
|
28
|
+
* Does NOT check whether the vertex sits on the mesh boundary — the caller
|
|
29
|
+
* is responsible for skipping boundary vertices (via
|
|
30
|
+
* {@link tetrahedral_mesh_vertex_is_boundary}) if surface preservation
|
|
31
|
+
* matters. Moving a boundary vertex changes the mesh's external shape.
|
|
32
|
+
*
|
|
33
|
+
* Returns `true` if the vertex was actually moved (i.e. it had ≥ 1 neighbour
|
|
34
|
+
* and the centroid differs from the current position), `false` otherwise
|
|
35
|
+
* (isolated vertex, or w == 0, or already at the centroid). The boolean
|
|
36
|
+
* lets a quality-improvement driver short-circuit on "nothing happened".
|
|
37
|
+
*
|
|
38
|
+
* @param {TetrahedralMesh} mesh
|
|
39
|
+
* @param {Float32Array|number[]} points flat (x,y,z) positions — mutated in place
|
|
40
|
+
* @param {number} vertex_id
|
|
41
|
+
* @param {number} [weight] move fraction, default 1.0
|
|
42
|
+
* @param {Map<number, number[]>} [vertex_to_tets_map] optional adjacency cache
|
|
43
|
+
* @returns {boolean} true if `points` was modified
|
|
44
|
+
*/
|
|
45
|
+
export function tetrahedral_mesh_smooth_vertex(mesh, points, vertex_id, weight = 1.0, vertex_to_tets_map) {
|
|
46
|
+
assert.defined(mesh, 'mesh');
|
|
47
|
+
assert.defined(points, 'points');
|
|
48
|
+
assert.isNonNegativeInteger(vertex_id, 'vertex_id');
|
|
49
|
+
assert.isNumber(weight, 'weight');
|
|
50
|
+
|
|
51
|
+
if (weight === 0) return false;
|
|
52
|
+
|
|
53
|
+
// 1. Find tets containing the vertex.
|
|
54
|
+
let tet_count;
|
|
55
|
+
if (vertex_to_tets_map !== undefined) {
|
|
56
|
+
const cached = vertex_to_tets_map.get(vertex_id);
|
|
57
|
+
if (cached === undefined) return false;
|
|
58
|
+
if (scratch_tets.length < cached.length) {
|
|
59
|
+
scratch_tets = new Array(Math.max(cached.length, scratch_tets.length * 2));
|
|
60
|
+
}
|
|
61
|
+
// Filter stale entries (deleted tets, or tets that no longer
|
|
62
|
+
// contain vertex_id because a flip re-used the slot).
|
|
63
|
+
tet_count = 0;
|
|
64
|
+
for (let i = 0; i < cached.length; i++) {
|
|
65
|
+
const tet = cached[i];
|
|
66
|
+
if (!mesh.exists(tet)) continue;
|
|
67
|
+
let still_incident = false;
|
|
68
|
+
for (let s = 0; s < 4; s++) {
|
|
69
|
+
if (mesh.getVertexIndex(tet, s) === vertex_id) {
|
|
70
|
+
still_incident = true;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (still_incident) scratch_tets[tet_count++] = tet;
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
if (scratch_tets.length < mesh.count) {
|
|
78
|
+
scratch_tets = new Array(Math.max(mesh.count, scratch_tets.length * 2));
|
|
79
|
+
}
|
|
80
|
+
tet_count = tetrahedral_mesh_find_tets_attached_to_vertex(
|
|
81
|
+
scratch_tets, 0, mesh, vertex_id
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (tet_count === 0) return false;
|
|
86
|
+
|
|
87
|
+
// 2. Collect 1-ring neighbours (the other 3 vertices of each incident
|
|
88
|
+
// tet), deduplicated. Linear search dedup — fine for typical valences
|
|
89
|
+
// (the neighbour list rarely exceeds a few dozen).
|
|
90
|
+
let neighbour_count = 0;
|
|
91
|
+
for (let i = 0; i < tet_count; i++) {
|
|
92
|
+
const tet = scratch_tets[i];
|
|
93
|
+
for (let j = 0; j < 4; j++) {
|
|
94
|
+
const v = mesh.getVertexIndex(tet, j);
|
|
95
|
+
if (v === vertex_id) continue;
|
|
96
|
+
let already = false;
|
|
97
|
+
for (let k = 0; k < neighbour_count; k++) {
|
|
98
|
+
if (scratch_neighbours[k] === v) { already = true; break; }
|
|
99
|
+
}
|
|
100
|
+
if (!already) {
|
|
101
|
+
if (neighbour_count >= scratch_neighbours.length) {
|
|
102
|
+
scratch_neighbours.length = scratch_neighbours.length * 2;
|
|
103
|
+
}
|
|
104
|
+
scratch_neighbours[neighbour_count++] = v;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (neighbour_count === 0) return false;
|
|
110
|
+
|
|
111
|
+
// 3. Compute 1-ring centroid.
|
|
112
|
+
let cx = 0, cy = 0, cz = 0;
|
|
113
|
+
for (let i = 0; i < neighbour_count; i++) {
|
|
114
|
+
const v3 = scratch_neighbours[i] * 3;
|
|
115
|
+
cx += points[v3];
|
|
116
|
+
cy += points[v3 + 1];
|
|
117
|
+
cz += points[v3 + 2];
|
|
118
|
+
}
|
|
119
|
+
const inv_n = 1 / neighbour_count;
|
|
120
|
+
cx *= inv_n;
|
|
121
|
+
cy *= inv_n;
|
|
122
|
+
cz *= inv_n;
|
|
123
|
+
|
|
124
|
+
// 4. Blend toward centroid.
|
|
125
|
+
const v3 = vertex_id * 3;
|
|
126
|
+
const old_x = points[v3];
|
|
127
|
+
const old_y = points[v3 + 1];
|
|
128
|
+
const old_z = points[v3 + 2];
|
|
129
|
+
|
|
130
|
+
const new_x = old_x + weight * (cx - old_x);
|
|
131
|
+
const new_y = old_y + weight * (cy - old_y);
|
|
132
|
+
const new_z = old_z + weight * (cz - old_z);
|
|
133
|
+
|
|
134
|
+
if (new_x === old_x && new_y === old_y && new_z === old_z) return false;
|
|
135
|
+
|
|
136
|
+
points[v3] = new_x;
|
|
137
|
+
points[v3 + 1] = new_y;
|
|
138
|
+
points[v3 + 2] = new_z;
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return true if the given vertex lies on the boundary of the
|
|
3
|
+
* tetrahedral mesh — equivalently, if it sits on any face that has no
|
|
4
|
+
* neighbouring tet (INVALID_NEIGHBOUR).
|
|
5
|
+
*
|
|
6
|
+
* Used by quality-improvement passes to skip boundary vertices when
|
|
7
|
+
* smoothing or collapsing, because moving them would change the mesh's
|
|
8
|
+
* external surface (which usually represents some geometric constraint
|
|
9
|
+
* the caller wants preserved).
|
|
10
|
+
*
|
|
11
|
+
* Cost without `vertex_to_tets_map`: O(N) over the live tets, same as
|
|
12
|
+
* {@link tetrahedral_mesh_find_tets_attached_to_vertex} which it shares
|
|
13
|
+
* the same scan structure with.
|
|
14
|
+
*
|
|
15
|
+
* Cost with `vertex_to_tets_map`: O(deg(vertex)) — usually a small
|
|
16
|
+
* constant. For repeated calls over many vertices in a tight loop
|
|
17
|
+
* (e.g. a sliver-removal pass), build the map once via
|
|
18
|
+
* {@link tetrahedral_mesh_build_vertex_to_tets_map} and pass it in.
|
|
19
|
+
*
|
|
20
|
+
* Note: boundary status is invariant under interior 2-3 / 3-2 flips, so
|
|
21
|
+
* a once-per-pass cache stays valid for boundary queries even as the
|
|
22
|
+
* pass commits flips, as long as a freshly-snapshotted cache is built
|
|
23
|
+
* for each NEW pass.
|
|
24
|
+
*
|
|
25
|
+
* @param {TetrahedralMesh} mesh
|
|
26
|
+
* @param {number} vertex_id
|
|
27
|
+
* @param {Map<number, number[]>} [vertex_to_tets_map] optional cache
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export function tetrahedral_mesh_vertex_is_boundary(mesh: TetrahedralMesh, vertex_id: number, vertex_to_tets_map?: Map<number, number[]>): boolean;
|
|
31
|
+
//# sourceMappingURL=tetrahedral_mesh_vertex_is_boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_vertex_is_boundary.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,sFAJW,MAAM,uBACN,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC,GACnB,OAAO,CAkEnB"}
|