@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,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inverse-rotate a 3-D vector by a unit quaternion: `result = q* · v · q`,
|
|
3
|
+
* where `q* = (-qx, -qy, -qz, qw)` is the conjugate.
|
|
4
|
+
*
|
|
5
|
+
* Geometrically: if {@link v3_quat3_apply} rotates a body-local vector
|
|
6
|
+
* into world space (`v_world = q · v_local · q*`), this is the inverse —
|
|
7
|
+
* it takes a world-space vector and writes it in body-local coordinates.
|
|
8
|
+
* For unit quaternions the conjugate IS the inverse, so the two
|
|
9
|
+
* functions are exact inverses of each other.
|
|
10
|
+
*
|
|
11
|
+
* Implementation: the conjugate's `xyz` are negated relative to `q`.
|
|
12
|
+
* Expanding `c · v · c*` with `(cx, cy, cz, cw) = (-qx, -qy, -qz, qw)`
|
|
13
|
+
* and simplifying produces the closed form below — different sign
|
|
14
|
+
* pattern than {@link v3_quat3_apply}, NOT just a call with negated
|
|
15
|
+
* components (the optimisation matters for hot-path callers such as
|
|
16
|
+
* `PosedShape.support` and the per-triangle concave dispatch in
|
|
17
|
+
* `narrowphase_step`).
|
|
18
|
+
*
|
|
19
|
+
* @param {number[]|Float32Array|Float64Array} out
|
|
20
|
+
* @param {number} out_offset offset into `out`; receives 3 floats
|
|
21
|
+
* @param {number} vx
|
|
22
|
+
* @param {number} vy
|
|
23
|
+
* @param {number} vz
|
|
24
|
+
* @param {number} qx unit quaternion x
|
|
25
|
+
* @param {number} qy
|
|
26
|
+
* @param {number} qz
|
|
27
|
+
* @param {number} qw unit quaternion w (last)
|
|
28
|
+
*/
|
|
29
|
+
export function v3_quat3_apply_inverse(out, out_offset, vx, vy, vz, qx, qy, qz, qw) {
|
|
30
|
+
// t = q* · v (conjugate · v, v as pure quaternion w=0)
|
|
31
|
+
// Conjugate xyz negated; expanded:
|
|
32
|
+
const tx = qw * vx - qy * vz + qz * vy;
|
|
33
|
+
const ty = qw * vy - qz * vx + qx * vz;
|
|
34
|
+
const tz = qw * vz - qx * vy + qy * vx;
|
|
35
|
+
const tw = qx * vx + qy * vy + qz * vz; // note: +, conjugate-w stays qw
|
|
36
|
+
|
|
37
|
+
// result = t · q (q is the conjugate-of-conjugate)
|
|
38
|
+
out[out_offset] = tx * qw + tw * qx + ty * qz - tz * qy;
|
|
39
|
+
out[out_offset + 1] = ty * qw + tw * qy + tz * qx - tx * qz;
|
|
40
|
+
out[out_offset + 2] = tz * qw + tw * qz + tx * qy - ty * qx;
|
|
41
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the triple cross product `(a × b) × a` in 3D.
|
|
3
|
+
*
|
|
4
|
+
* Identity used in GJK and related Voronoi-region searches: given an
|
|
5
|
+
* edge `a` from a simplex and the vector `b` from one endpoint toward
|
|
6
|
+
* the origin (or any other "where do we want to go" reference), the
|
|
7
|
+
* triple cross gives a direction PERPENDICULAR to `a` that lies in
|
|
8
|
+
* the plane of `(a, b)` and points toward `b`. This is the right
|
|
9
|
+
* search direction to extend the simplex away from the edge toward
|
|
10
|
+
* the origin without re-entering territory already covered.
|
|
11
|
+
*
|
|
12
|
+
* Sign convention: `result = (a × b) × a` (not `a × (b × a)` — the
|
|
13
|
+
* triple cross product is not associative).
|
|
14
|
+
*
|
|
15
|
+
* The function is allocation-free: `result` is a caller-provided
|
|
16
|
+
* typed array (or array-like) that receives the three components
|
|
17
|
+
* starting at `result_offset`. `a` and `b` are passed as raw scalar
|
|
18
|
+
* components, matching the convention of {@link v3_compute_triangle_normal}
|
|
19
|
+
* and the rest of the scalar-input vec3 helpers.
|
|
20
|
+
*
|
|
21
|
+
* @param {number[]|Float32Array|Float64Array} result destination
|
|
22
|
+
* @param {number} result_offset offset into `result` where the
|
|
23
|
+
* three output components are written
|
|
24
|
+
* @param {number} ax first input vector x
|
|
25
|
+
* @param {number} ay first input vector y
|
|
26
|
+
* @param {number} az first input vector z
|
|
27
|
+
* @param {number} bx second input vector x
|
|
28
|
+
* @param {number} by second input vector y
|
|
29
|
+
* @param {number} bz second input vector z
|
|
30
|
+
*/
|
|
31
|
+
export function v3_triple_cross_product(result: number[] | Float32Array | Float64Array, result_offset: number, ax: number, ay: number, az: number, bx: number, by: number, bz: number): void;
|
|
32
|
+
//# sourceMappingURL=v3_triple_cross_product.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_triple_cross_product.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_triple_cross_product.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,gDAVW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,MAEN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAgBhB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the triple cross product `(a × b) × a` in 3D.
|
|
3
|
+
*
|
|
4
|
+
* Identity used in GJK and related Voronoi-region searches: given an
|
|
5
|
+
* edge `a` from a simplex and the vector `b` from one endpoint toward
|
|
6
|
+
* the origin (or any other "where do we want to go" reference), the
|
|
7
|
+
* triple cross gives a direction PERPENDICULAR to `a` that lies in
|
|
8
|
+
* the plane of `(a, b)` and points toward `b`. This is the right
|
|
9
|
+
* search direction to extend the simplex away from the edge toward
|
|
10
|
+
* the origin without re-entering territory already covered.
|
|
11
|
+
*
|
|
12
|
+
* Sign convention: `result = (a × b) × a` (not `a × (b × a)` — the
|
|
13
|
+
* triple cross product is not associative).
|
|
14
|
+
*
|
|
15
|
+
* The function is allocation-free: `result` is a caller-provided
|
|
16
|
+
* typed array (or array-like) that receives the three components
|
|
17
|
+
* starting at `result_offset`. `a` and `b` are passed as raw scalar
|
|
18
|
+
* components, matching the convention of {@link v3_compute_triangle_normal}
|
|
19
|
+
* and the rest of the scalar-input vec3 helpers.
|
|
20
|
+
*
|
|
21
|
+
* @param {number[]|Float32Array|Float64Array} result destination
|
|
22
|
+
* @param {number} result_offset offset into `result` where the
|
|
23
|
+
* three output components are written
|
|
24
|
+
* @param {number} ax first input vector x
|
|
25
|
+
* @param {number} ay first input vector y
|
|
26
|
+
* @param {number} az first input vector z
|
|
27
|
+
* @param {number} bx second input vector x
|
|
28
|
+
* @param {number} by second input vector y
|
|
29
|
+
* @param {number} bz second input vector z
|
|
30
|
+
*/
|
|
31
|
+
export function v3_triple_cross_product(
|
|
32
|
+
result, result_offset,
|
|
33
|
+
ax, ay, az,
|
|
34
|
+
bx, by, bz
|
|
35
|
+
) {
|
|
36
|
+
// First: t = a × b
|
|
37
|
+
const tx = ay * bz - az * by;
|
|
38
|
+
const ty = az * bx - ax * bz;
|
|
39
|
+
const tz = ax * by - ay * bx;
|
|
40
|
+
|
|
41
|
+
// Then: t × a
|
|
42
|
+
result[result_offset] = ty * az - tz * ay;
|
|
43
|
+
result[result_offset + 1] = tz * ax - tx * az;
|
|
44
|
+
result[result_offset + 2] = tx * ay - ty * ax;
|
|
45
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compressed Sparse Row representation of a weighted graph.
|
|
3
|
+
*
|
|
4
|
+
* The four parallel typed arrays — `edge_addresses`, `adjacency`,
|
|
5
|
+
* `edge_weights`, `vertex_weights` — share a single `ArrayBuffer` so that
|
|
6
|
+
* they are co-located in memory. This gives the allocator one allocation
|
|
7
|
+
* instead of four, the GC one reference to track, and the cache one
|
|
8
|
+
* contiguous region to prefetch when walking adjacency rows.
|
|
9
|
+
*
|
|
10
|
+
* Layout inside the buffer (all uint32, 4 bytes each):
|
|
11
|
+
* [0] edge_addresses, length vertex_count + 1
|
|
12
|
+
* [vertex_count + 1] adjacency, length adjacency_length
|
|
13
|
+
* [+adjacency_length] edge_weights, length adjacency_length
|
|
14
|
+
* [+adjacency_length] vertex_weights, length vertex_count
|
|
15
|
+
*
|
|
16
|
+
* Conventions match `mesh_to_metis_graph`:
|
|
17
|
+
* - `edge_addresses[v]` = start of vertex v's adjacency in `adjacency`
|
|
18
|
+
* - `edge_addresses[v + 1]` = end (exclusive)
|
|
19
|
+
* - `adjacency[k]` = neighbour vertex id
|
|
20
|
+
* - `edge_weights[k]` = weight of that edge
|
|
21
|
+
* - `vertex_weights[v]` = vertex weight (default 1)
|
|
22
|
+
*
|
|
23
|
+
* The class deliberately exposes the raw typed arrays as fields rather than
|
|
24
|
+
* via accessor methods. Hot loops in graph algorithms want
|
|
25
|
+
* `for (let k = xadj[v]; k < xadj[v+1]; k++) { ... adj[k] ... }` patterns; a
|
|
26
|
+
* callback-based iterator API would force a closure allocation per outer
|
|
27
|
+
* iteration and defeat V8's inlining.
|
|
28
|
+
*
|
|
29
|
+
* @author Alex Goldring
|
|
30
|
+
* @copyright Company Named Limited (c) 2026
|
|
31
|
+
*/
|
|
32
|
+
export class CSRGraph {
|
|
33
|
+
/**
|
|
34
|
+
* Construct a CSRGraph from existing arrays by COPYING into a new
|
|
35
|
+
* shared-buffer instance. The input arrays are not retained.
|
|
36
|
+
*
|
|
37
|
+
* `vertex_weights` is optional — if not provided, the new graph keeps the
|
|
38
|
+
* default all-1s vertex weights and `total_vertex_weight = vertex_count`.
|
|
39
|
+
*
|
|
40
|
+
* @param {number} vertex_count
|
|
41
|
+
* @param {ArrayLike<number>} edge_addresses length vertex_count + 1
|
|
42
|
+
* @param {ArrayLike<number>} adjacency length edge_addresses[vertex_count]
|
|
43
|
+
* @param {ArrayLike<number>} edge_weights parallel to adjacency
|
|
44
|
+
* @param {ArrayLike<number>} [vertex_weights] optional; length vertex_count
|
|
45
|
+
* @returns {CSRGraph}
|
|
46
|
+
*/
|
|
47
|
+
static fromArrays(vertex_count: number, edge_addresses: ArrayLike<number>, adjacency: ArrayLike<number>, edge_weights: ArrayLike<number>, vertex_weights?: ArrayLike<number>): CSRGraph;
|
|
48
|
+
/**
|
|
49
|
+
* @param {number} vertex_count
|
|
50
|
+
* @param {number} adjacency_length total length of the adjacency list
|
|
51
|
+
* (each undirected edge appears twice for symmetric graphs)
|
|
52
|
+
*/
|
|
53
|
+
constructor(vertex_count: number, adjacency_length: number);
|
|
54
|
+
/** @type {number} */
|
|
55
|
+
vertex_count: number;
|
|
56
|
+
/** @type {number} */
|
|
57
|
+
adjacency_length: number;
|
|
58
|
+
/**
|
|
59
|
+
* Single backing buffer for all four arrays.
|
|
60
|
+
* @type {ArrayBuffer}
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
private __data_buffer;
|
|
64
|
+
/**
|
|
65
|
+
* CSR row pointers. Length = vertex_count + 1; the final entry equals
|
|
66
|
+
* adjacency_length.
|
|
67
|
+
* @type {Uint32Array}
|
|
68
|
+
*/
|
|
69
|
+
edge_addresses: Uint32Array;
|
|
70
|
+
/**
|
|
71
|
+
* CSR column indices — neighbour vertex ids.
|
|
72
|
+
* @type {Uint32Array}
|
|
73
|
+
*/
|
|
74
|
+
adjacency: Uint32Array;
|
|
75
|
+
/**
|
|
76
|
+
* Edge weights parallel to `adjacency`.
|
|
77
|
+
* @type {Uint32Array}
|
|
78
|
+
*/
|
|
79
|
+
edge_weights: Uint32Array;
|
|
80
|
+
/**
|
|
81
|
+
* Per-vertex weight. Initialised to all-1s; overwrite via direct
|
|
82
|
+
* indexing or `vertex_weights.set(...)` if your domain needs non-uniform
|
|
83
|
+
* weights. Remember to call `refresh_total_vertex_weight()` after.
|
|
84
|
+
* @type {Uint32Array}
|
|
85
|
+
*/
|
|
86
|
+
vertex_weights: Uint32Array;
|
|
87
|
+
/**
|
|
88
|
+
* Cached `Σ vertex_weights[v]`. Kept in sync via `refresh_total_vertex_weight()`.
|
|
89
|
+
* @type {number}
|
|
90
|
+
*/
|
|
91
|
+
total_vertex_weight: number;
|
|
92
|
+
/**
|
|
93
|
+
* The underlying shared buffer. Useful for fast bulk operations and for
|
|
94
|
+
* passing the graph between Web Workers via transfer.
|
|
95
|
+
* @returns {ArrayBuffer}
|
|
96
|
+
*/
|
|
97
|
+
get arrayBuffer(): ArrayBuffer;
|
|
98
|
+
/**
|
|
99
|
+
* Degree of vertex `vertex` (number of outgoing edges in the CSR).
|
|
100
|
+
* @param {number} vertex
|
|
101
|
+
* @returns {number}
|
|
102
|
+
*/
|
|
103
|
+
degree_of(vertex: number): number;
|
|
104
|
+
/**
|
|
105
|
+
* Sum of all entries in `edge_weights[0..adjacency_length)`.
|
|
106
|
+
* Each undirected edge contributes twice for a symmetric graph.
|
|
107
|
+
* @returns {number}
|
|
108
|
+
*/
|
|
109
|
+
sum_of_edge_weights(): number;
|
|
110
|
+
/**
|
|
111
|
+
* Recompute and store `total_vertex_weight` from the current `vertex_weights`.
|
|
112
|
+
*/
|
|
113
|
+
refresh_total_vertex_weight(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Shrink `adjacency` and `edge_weights` in place to `new_adjacency_length`.
|
|
116
|
+
*
|
|
117
|
+
* Use after a worst-case allocation has been partially filled (e.g. during
|
|
118
|
+
* coarse-graph contraction where the exact edge count is only known after
|
|
119
|
+
* the merge pass). Reallocates the shared buffer at the smaller size and
|
|
120
|
+
* recreates all four typed-array views; existing references to
|
|
121
|
+
* `this.adjacency` etc. are invalidated.
|
|
122
|
+
*
|
|
123
|
+
* Vertex-side data (`edge_addresses`, `vertex_weights`) and
|
|
124
|
+
* `total_vertex_weight` are preserved.
|
|
125
|
+
*
|
|
126
|
+
* No-op if `new_adjacency_length === adjacency_length`.
|
|
127
|
+
*
|
|
128
|
+
* @param {number} new_adjacency_length must be <= current `adjacency_length`
|
|
129
|
+
*/
|
|
130
|
+
truncate_adjacency(new_adjacency_length: number): void;
|
|
131
|
+
/**
|
|
132
|
+
* Copy the contents of `other` into `this`. Other must have matching
|
|
133
|
+
* `vertex_count` and `adjacency_length` (so the layouts align).
|
|
134
|
+
*
|
|
135
|
+
* Performed as a single bulk Uint32Array `.set()` thanks to the shared
|
|
136
|
+
* buffer layout — significantly faster than copying the four arrays
|
|
137
|
+
* individually.
|
|
138
|
+
*
|
|
139
|
+
* @param {CSRGraph} other
|
|
140
|
+
*/
|
|
141
|
+
copy(other: CSRGraph): void;
|
|
142
|
+
/**
|
|
143
|
+
* Deep copy. Returns a new `CSRGraph` with independent buffers.
|
|
144
|
+
* @returns {CSRGraph}
|
|
145
|
+
*/
|
|
146
|
+
clone(): CSRGraph;
|
|
147
|
+
/**
|
|
148
|
+
* Structural equality — same shape and same buffer contents.
|
|
149
|
+
* @param {CSRGraph} other
|
|
150
|
+
* @returns {boolean}
|
|
151
|
+
*/
|
|
152
|
+
equals(other: CSRGraph): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* 32-bit hash mixing the metadata fields and the entire buffer contents.
|
|
155
|
+
* Uses meep's standard `(h*31 + element)` convention via `uint32_array_hash`.
|
|
156
|
+
*
|
|
157
|
+
* @returns {number}
|
|
158
|
+
*/
|
|
159
|
+
hash(): number;
|
|
160
|
+
/**
|
|
161
|
+
* Type-check marker — avoids `instanceof` across module realms while still
|
|
162
|
+
* letting us assert "is a CSRGraph" cheaply.
|
|
163
|
+
* @readonly
|
|
164
|
+
* @type {boolean}
|
|
165
|
+
*/
|
|
166
|
+
readonly isCSRGraph: boolean;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=CSRGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CSRGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/csr/CSRGraph.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAsPI;;;;;;;;;;;;;OAaG;IACH,gCAPW,MAAM,kBACN,UAAU,MAAM,CAAC,aACjB,UAAU,MAAM,CAAC,gBACjB,UAAU,MAAM,CAAC,mBACjB,UAAU,MAAM,CAAC,GACf,QAAQ,CAgBpB;IAjRD;;;;OAIG;IACH,0BAJW,MAAM,oBACN,MAAM,EA8DhB;IAvDG,qBAAqB;IACrB,cADW,MAAM,CACe;IAChC,qBAAqB;IACrB,kBADW,MAAM,CACuB;IAOxC;;;;OAIG;IACH,sBAA4D;IAI5D;;;;OAIG;IACH,gBAFU,WAAW,CAEmE;IAGxF;;;OAGG;IACH,WAFU,WAAW,CAE8D;IAGnF;;;OAGG;IACH,cAFU,WAAW,CAEiE;IAGtF;;;;;OAKG;IACH,gBAFU,WAAW,CAE+D;IAGpF;;;OAGG;IACH,qBAFU,MAAM,CAEuB;IAG3C;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,uBAFa,MAAM,CAUlB;IAED;;OAEG;IACH,oCAQC;IAED;;;;;;;;;;;;;;;OAeG;IACH,yCAFW,MAAM,QA6ChB;IAED;;;;;;;;;OASG;IACH,YAFW,QAAQ,QASlB;IAED;;;OAGG;IACH,SAFa,QAAQ,CAMpB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAsBnB;IAED;;;;;OAKG;IACH,QAFa,MAAM,CAUlB;IAiCL;;;;;OAKG;IACH,qBAFU,OAAO,CAEY;CAR5B"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
import { is_typed_array_equals } from "../../collection/array/typed/is_typed_array_equals.js";
|
|
3
|
+
import { uint32_array_hash } from "../../collection/array/typed/uint32_array_hash.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compressed Sparse Row representation of a weighted graph.
|
|
7
|
+
*
|
|
8
|
+
* The four parallel typed arrays — `edge_addresses`, `adjacency`,
|
|
9
|
+
* `edge_weights`, `vertex_weights` — share a single `ArrayBuffer` so that
|
|
10
|
+
* they are co-located in memory. This gives the allocator one allocation
|
|
11
|
+
* instead of four, the GC one reference to track, and the cache one
|
|
12
|
+
* contiguous region to prefetch when walking adjacency rows.
|
|
13
|
+
*
|
|
14
|
+
* Layout inside the buffer (all uint32, 4 bytes each):
|
|
15
|
+
* [0] edge_addresses, length vertex_count + 1
|
|
16
|
+
* [vertex_count + 1] adjacency, length adjacency_length
|
|
17
|
+
* [+adjacency_length] edge_weights, length adjacency_length
|
|
18
|
+
* [+adjacency_length] vertex_weights, length vertex_count
|
|
19
|
+
*
|
|
20
|
+
* Conventions match `mesh_to_metis_graph`:
|
|
21
|
+
* - `edge_addresses[v]` = start of vertex v's adjacency in `adjacency`
|
|
22
|
+
* - `edge_addresses[v + 1]` = end (exclusive)
|
|
23
|
+
* - `adjacency[k]` = neighbour vertex id
|
|
24
|
+
* - `edge_weights[k]` = weight of that edge
|
|
25
|
+
* - `vertex_weights[v]` = vertex weight (default 1)
|
|
26
|
+
*
|
|
27
|
+
* The class deliberately exposes the raw typed arrays as fields rather than
|
|
28
|
+
* via accessor methods. Hot loops in graph algorithms want
|
|
29
|
+
* `for (let k = xadj[v]; k < xadj[v+1]; k++) { ... adj[k] ... }` patterns; a
|
|
30
|
+
* callback-based iterator API would force a closure allocation per outer
|
|
31
|
+
* iteration and defeat V8's inlining.
|
|
32
|
+
*
|
|
33
|
+
* @author Alex Goldring
|
|
34
|
+
* @copyright Company Named Limited (c) 2026
|
|
35
|
+
*/
|
|
36
|
+
export class CSRGraph {
|
|
37
|
+
/**
|
|
38
|
+
* @param {number} vertex_count
|
|
39
|
+
* @param {number} adjacency_length total length of the adjacency list
|
|
40
|
+
* (each undirected edge appears twice for symmetric graphs)
|
|
41
|
+
*/
|
|
42
|
+
constructor(vertex_count, adjacency_length) {
|
|
43
|
+
assert.isNonNegativeInteger(vertex_count, 'vertex_count');
|
|
44
|
+
assert.isNonNegativeInteger(adjacency_length, 'adjacency_length');
|
|
45
|
+
|
|
46
|
+
/** @type {number} */
|
|
47
|
+
this.vertex_count = vertex_count;
|
|
48
|
+
/** @type {number} */
|
|
49
|
+
this.adjacency_length = adjacency_length;
|
|
50
|
+
|
|
51
|
+
// Total uint32 slots: (vertex_count + 1) for edge_addresses,
|
|
52
|
+
// adjacency_length × 2 for adjacency and edge_weights,
|
|
53
|
+
// vertex_count for vertex_weights.
|
|
54
|
+
const total_uint32_slots = (vertex_count + 1) + (adjacency_length * 2) + vertex_count;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Single backing buffer for all four arrays.
|
|
58
|
+
* @type {ArrayBuffer}
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
this.__data_buffer = new ArrayBuffer(total_uint32_slots * 4);
|
|
62
|
+
|
|
63
|
+
let byte_offset = 0;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* CSR row pointers. Length = vertex_count + 1; the final entry equals
|
|
67
|
+
* adjacency_length.
|
|
68
|
+
* @type {Uint32Array}
|
|
69
|
+
*/
|
|
70
|
+
this.edge_addresses = new Uint32Array(this.__data_buffer, byte_offset, vertex_count + 1);
|
|
71
|
+
byte_offset += (vertex_count + 1) * 4;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* CSR column indices — neighbour vertex ids.
|
|
75
|
+
* @type {Uint32Array}
|
|
76
|
+
*/
|
|
77
|
+
this.adjacency = new Uint32Array(this.__data_buffer, byte_offset, adjacency_length);
|
|
78
|
+
byte_offset += adjacency_length * 4;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Edge weights parallel to `adjacency`.
|
|
82
|
+
* @type {Uint32Array}
|
|
83
|
+
*/
|
|
84
|
+
this.edge_weights = new Uint32Array(this.__data_buffer, byte_offset, adjacency_length);
|
|
85
|
+
byte_offset += adjacency_length * 4;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Per-vertex weight. Initialised to all-1s; overwrite via direct
|
|
89
|
+
* indexing or `vertex_weights.set(...)` if your domain needs non-uniform
|
|
90
|
+
* weights. Remember to call `refresh_total_vertex_weight()` after.
|
|
91
|
+
* @type {Uint32Array}
|
|
92
|
+
*/
|
|
93
|
+
this.vertex_weights = new Uint32Array(this.__data_buffer, byte_offset, vertex_count);
|
|
94
|
+
this.vertex_weights.fill(1);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Cached `Σ vertex_weights[v]`. Kept in sync via `refresh_total_vertex_weight()`.
|
|
98
|
+
* @type {number}
|
|
99
|
+
*/
|
|
100
|
+
this.total_vertex_weight = vertex_count;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The underlying shared buffer. Useful for fast bulk operations and for
|
|
105
|
+
* passing the graph between Web Workers via transfer.
|
|
106
|
+
* @returns {ArrayBuffer}
|
|
107
|
+
*/
|
|
108
|
+
get arrayBuffer() {
|
|
109
|
+
return this.__data_buffer;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Degree of vertex `vertex` (number of outgoing edges in the CSR).
|
|
114
|
+
* @param {number} vertex
|
|
115
|
+
* @returns {number}
|
|
116
|
+
*/
|
|
117
|
+
degree_of(vertex) {
|
|
118
|
+
return this.edge_addresses[vertex + 1] - this.edge_addresses[vertex];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sum of all entries in `edge_weights[0..adjacency_length)`.
|
|
123
|
+
* Each undirected edge contributes twice for a symmetric graph.
|
|
124
|
+
* @returns {number}
|
|
125
|
+
*/
|
|
126
|
+
sum_of_edge_weights() {
|
|
127
|
+
const edge_weights = this.edge_weights;
|
|
128
|
+
const n = this.adjacency_length;
|
|
129
|
+
let sum = 0;
|
|
130
|
+
for (let i = 0; i < n; i++) {
|
|
131
|
+
sum += edge_weights[i];
|
|
132
|
+
}
|
|
133
|
+
return sum;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Recompute and store `total_vertex_weight` from the current `vertex_weights`.
|
|
138
|
+
*/
|
|
139
|
+
refresh_total_vertex_weight() {
|
|
140
|
+
const vertex_weights = this.vertex_weights;
|
|
141
|
+
const n = this.vertex_count;
|
|
142
|
+
let sum = 0;
|
|
143
|
+
for (let i = 0; i < n; i++) {
|
|
144
|
+
sum += vertex_weights[i];
|
|
145
|
+
}
|
|
146
|
+
this.total_vertex_weight = sum;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Shrink `adjacency` and `edge_weights` in place to `new_adjacency_length`.
|
|
151
|
+
*
|
|
152
|
+
* Use after a worst-case allocation has been partially filled (e.g. during
|
|
153
|
+
* coarse-graph contraction where the exact edge count is only known after
|
|
154
|
+
* the merge pass). Reallocates the shared buffer at the smaller size and
|
|
155
|
+
* recreates all four typed-array views; existing references to
|
|
156
|
+
* `this.adjacency` etc. are invalidated.
|
|
157
|
+
*
|
|
158
|
+
* Vertex-side data (`edge_addresses`, `vertex_weights`) and
|
|
159
|
+
* `total_vertex_weight` are preserved.
|
|
160
|
+
*
|
|
161
|
+
* No-op if `new_adjacency_length === adjacency_length`.
|
|
162
|
+
*
|
|
163
|
+
* @param {number} new_adjacency_length must be <= current `adjacency_length`
|
|
164
|
+
*/
|
|
165
|
+
truncate_adjacency(new_adjacency_length) {
|
|
166
|
+
assert.isNonNegativeInteger(new_adjacency_length, 'new_adjacency_length');
|
|
167
|
+
assert.lessThanOrEqual(new_adjacency_length, this.adjacency_length, 'truncate_adjacency cannot grow');
|
|
168
|
+
|
|
169
|
+
if (new_adjacency_length === this.adjacency_length) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Keep references to the OLD views — they remain valid because the old
|
|
174
|
+
// buffer stays alive until we drop the last reference to it (which
|
|
175
|
+
// happens implicitly when we reassign this.__data_buffer at the end).
|
|
176
|
+
// We can copy DIRECTLY from old views into new views with no
|
|
177
|
+
// intermediate snapshot, since the two buffers don't overlap.
|
|
178
|
+
const old_edge_addresses = this.edge_addresses;
|
|
179
|
+
const old_adjacency = this.adjacency;
|
|
180
|
+
const old_edge_weights = this.edge_weights;
|
|
181
|
+
const old_vertex_weights = this.vertex_weights;
|
|
182
|
+
|
|
183
|
+
const total_uint32_slots = (this.vertex_count + 1) + (new_adjacency_length * 2) + this.vertex_count;
|
|
184
|
+
const new_buffer = new ArrayBuffer(total_uint32_slots * 4);
|
|
185
|
+
|
|
186
|
+
let byte_offset = 0;
|
|
187
|
+
const new_edge_addresses = new Uint32Array(new_buffer, byte_offset, this.vertex_count + 1);
|
|
188
|
+
byte_offset += (this.vertex_count + 1) * 4;
|
|
189
|
+
const new_adjacency = new Uint32Array(new_buffer, byte_offset, new_adjacency_length);
|
|
190
|
+
byte_offset += new_adjacency_length * 4;
|
|
191
|
+
const new_edge_weights = new Uint32Array(new_buffer, byte_offset, new_adjacency_length);
|
|
192
|
+
byte_offset += new_adjacency_length * 4;
|
|
193
|
+
const new_vertex_weights = new Uint32Array(new_buffer, byte_offset, this.vertex_count);
|
|
194
|
+
|
|
195
|
+
// Direct old-view → new-view copies. `subarray` is a view, not a copy,
|
|
196
|
+
// so the only data movement is the underlying `.set()`.
|
|
197
|
+
new_edge_addresses.set(old_edge_addresses);
|
|
198
|
+
new_adjacency.set(old_adjacency.subarray(0, new_adjacency_length));
|
|
199
|
+
new_edge_weights.set(old_edge_weights.subarray(0, new_adjacency_length));
|
|
200
|
+
new_vertex_weights.set(old_vertex_weights);
|
|
201
|
+
|
|
202
|
+
this.__data_buffer = new_buffer;
|
|
203
|
+
this.edge_addresses = new_edge_addresses;
|
|
204
|
+
this.adjacency = new_adjacency;
|
|
205
|
+
this.edge_weights = new_edge_weights;
|
|
206
|
+
this.vertex_weights = new_vertex_weights;
|
|
207
|
+
this.adjacency_length = new_adjacency_length;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Copy the contents of `other` into `this`. Other must have matching
|
|
212
|
+
* `vertex_count` and `adjacency_length` (so the layouts align).
|
|
213
|
+
*
|
|
214
|
+
* Performed as a single bulk Uint32Array `.set()` thanks to the shared
|
|
215
|
+
* buffer layout — significantly faster than copying the four arrays
|
|
216
|
+
* individually.
|
|
217
|
+
*
|
|
218
|
+
* @param {CSRGraph} other
|
|
219
|
+
*/
|
|
220
|
+
copy(other) {
|
|
221
|
+
assert.equal(other.isCSRGraph, true, 'other.isCSRGraph !== true');
|
|
222
|
+
assert.equal(this.vertex_count, other.vertex_count, 'vertex_count mismatch');
|
|
223
|
+
assert.equal(this.adjacency_length, other.adjacency_length, 'adjacency_length mismatch');
|
|
224
|
+
|
|
225
|
+
new Uint32Array(this.__data_buffer).set(new Uint32Array(other.__data_buffer));
|
|
226
|
+
this.total_vertex_weight = other.total_vertex_weight;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Deep copy. Returns a new `CSRGraph` with independent buffers.
|
|
231
|
+
* @returns {CSRGraph}
|
|
232
|
+
*/
|
|
233
|
+
clone() {
|
|
234
|
+
const out = new CSRGraph(this.vertex_count, this.adjacency_length);
|
|
235
|
+
out.copy(this);
|
|
236
|
+
return out;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Structural equality — same shape and same buffer contents.
|
|
241
|
+
* @param {CSRGraph} other
|
|
242
|
+
* @returns {boolean}
|
|
243
|
+
*/
|
|
244
|
+
equals(other) {
|
|
245
|
+
if (this === other) {
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
if (other === null || other === undefined || other.isCSRGraph !== true) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
if (this.vertex_count !== other.vertex_count) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
if (this.adjacency_length !== other.adjacency_length) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
if (this.total_vertex_weight !== other.total_vertex_weight) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
return is_typed_array_equals(
|
|
261
|
+
new Uint32Array(this.__data_buffer),
|
|
262
|
+
new Uint32Array(other.__data_buffer)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* 32-bit hash mixing the metadata fields and the entire buffer contents.
|
|
268
|
+
* Uses meep's standard `(h*31 + element)` convention via `uint32_array_hash`.
|
|
269
|
+
*
|
|
270
|
+
* @returns {number}
|
|
271
|
+
*/
|
|
272
|
+
hash() {
|
|
273
|
+
let h = this.vertex_count;
|
|
274
|
+
h = ((h << 5) - h) + this.adjacency_length;
|
|
275
|
+
h = ((h << 5) - h) + this.total_vertex_weight;
|
|
276
|
+
const buffer_view = new Uint32Array(this.__data_buffer);
|
|
277
|
+
const buffer_hash = uint32_array_hash(buffer_view, 0, buffer_view.length);
|
|
278
|
+
h = ((h << 5) - h) + buffer_hash;
|
|
279
|
+
return h | 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Construct a CSRGraph from existing arrays by COPYING into a new
|
|
284
|
+
* shared-buffer instance. The input arrays are not retained.
|
|
285
|
+
*
|
|
286
|
+
* `vertex_weights` is optional — if not provided, the new graph keeps the
|
|
287
|
+
* default all-1s vertex weights and `total_vertex_weight = vertex_count`.
|
|
288
|
+
*
|
|
289
|
+
* @param {number} vertex_count
|
|
290
|
+
* @param {ArrayLike<number>} edge_addresses length vertex_count + 1
|
|
291
|
+
* @param {ArrayLike<number>} adjacency length edge_addresses[vertex_count]
|
|
292
|
+
* @param {ArrayLike<number>} edge_weights parallel to adjacency
|
|
293
|
+
* @param {ArrayLike<number>} [vertex_weights] optional; length vertex_count
|
|
294
|
+
* @returns {CSRGraph}
|
|
295
|
+
*/
|
|
296
|
+
static fromArrays(vertex_count, edge_addresses, adjacency, edge_weights, vertex_weights) {
|
|
297
|
+
const adjacency_length = edge_addresses[vertex_count];
|
|
298
|
+
const out = new CSRGraph(vertex_count, adjacency_length);
|
|
299
|
+
|
|
300
|
+
out.edge_addresses.set(edge_addresses);
|
|
301
|
+
out.adjacency.set(adjacency);
|
|
302
|
+
out.edge_weights.set(edge_weights);
|
|
303
|
+
|
|
304
|
+
if (vertex_weights !== undefined) {
|
|
305
|
+
out.vertex_weights.set(vertex_weights);
|
|
306
|
+
out.refresh_total_vertex_weight();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return out;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Type-check marker — avoids `instanceof` across module realms while still
|
|
315
|
+
* letting us assert "is a CSRGraph" cheaply.
|
|
316
|
+
* @readonly
|
|
317
|
+
* @type {boolean}
|
|
318
|
+
*/
|
|
319
|
+
CSRGraph.prototype.isCSRGraph = true;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Delegates to the deprecated `metis_cluster_bs`, which uses the
|
|
3
|
+
* WASM-backed `Metis.INSTANCE`. Replace with the native equivalent:
|
|
4
|
+
*
|
|
5
|
+
* import { metis_partition_kway } from "./native/metis_partition_kway.js";
|
|
6
|
+
* import { mesh_to_metis_graph } from "./mesh_to_metis_graph.js";
|
|
7
|
+
*
|
|
8
|
+
* const csr = mesh_to_metis_graph(Array.from(mesh.getFaces()));
|
|
9
|
+
* const k = Math.ceil(face_count / patch_size);
|
|
10
|
+
* const partition = metis_partition_kway(face_count, k, csr.edge_addresses,
|
|
11
|
+
* csr.adjacency, csr.edge_weights, { seed: 0xCAFE });
|
|
12
|
+
*
|
|
13
|
+
* The native call is synchronous, so this becomes a non-async wrapper.
|
|
2
14
|
*
|
|
3
15
|
* @param {Uint32Array} result
|
|
4
16
|
* @param {TopoMesh} mesh
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster_mesh_metis.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/cluster_mesh_metis.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"cluster_mesh_metis.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/metis/cluster_mesh_metis.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AACH,2CALW,WAAW,8BAEX,MAAM,GACJ,MAAM,CAqBlB"}
|
|
@@ -2,6 +2,18 @@ import { mesh_to_metis_graph } from "./mesh_to_metis_graph.js";
|
|
|
2
2
|
import { metis_cluster_bs } from "./metis_cluster_bs.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated Delegates to the deprecated `metis_cluster_bs`, which uses the
|
|
6
|
+
* WASM-backed `Metis.INSTANCE`. Replace with the native equivalent:
|
|
7
|
+
*
|
|
8
|
+
* import { metis_partition_kway } from "./native/metis_partition_kway.js";
|
|
9
|
+
* import { mesh_to_metis_graph } from "./mesh_to_metis_graph.js";
|
|
10
|
+
*
|
|
11
|
+
* const csr = mesh_to_metis_graph(Array.from(mesh.getFaces()));
|
|
12
|
+
* const k = Math.ceil(face_count / patch_size);
|
|
13
|
+
* const partition = metis_partition_kway(face_count, k, csr.edge_addresses,
|
|
14
|
+
* csr.adjacency, csr.edge_weights, { seed: 0xCAFE });
|
|
15
|
+
*
|
|
16
|
+
* The native call is synchronous, so this becomes a non-async wrapper.
|
|
5
17
|
*
|
|
6
18
|
* @param {Uint32Array} result
|
|
7
19
|
* @param {TopoMesh} mesh
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use the native JS implementation at
|
|
3
|
+
* `./native/metis_partition_kway.js` instead.
|
|
4
|
+
*
|
|
5
|
+
* This class wraps the WASM-compiled METIS via a worker. It depends on
|
|
6
|
+
* `libs/metis/metis.js` being served by the host app and on a `micron_partition`
|
|
7
|
+
* global being defined inside that script. The native equivalent has no such
|
|
8
|
+
* dependencies, is synchronous (no worker round-trip), and tracks the latest
|
|
9
|
+
* `KarypisLab/METIS` master rather than the 2013-era 5.1.0 release.
|
|
10
|
+
*
|
|
11
|
+
* Migration:
|
|
12
|
+
* - Was: `await Metis.INSTANCE.partition(nv, k, xadj, adj, ewgt, options)`
|
|
13
|
+
* - Now: `metis_partition_kway(nv, k, xadj, adj, ewgt, { seed, niter, ufactor })`
|
|
14
|
+
*
|
|
15
|
+
* The native function returns the partition array directly (synchronously);
|
|
16
|
+
* wrap in `Promise.resolve(...)` if you need a promise-returning surface.
|
|
17
|
+
*/
|
|
1
18
|
export class Metis {
|
|
2
19
|
service: OnDemandWorkerManager;
|
|
3
20
|
/**
|
|
21
|
+
* @deprecated Use `metis_partition_kway` from
|
|
22
|
+
* `./native/metis_partition_kway.js` instead.
|
|
4
23
|
*
|
|
5
24
|
* @param {number} n_vertices
|
|
6
25
|
* @param {number} n_parts
|