@woosh/meep-engine 2.138.19 → 2.139.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 +2 -1
- 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/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/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/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/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 +673 -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 +365 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +31 -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 +112 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +22 -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 +55 -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 +22 -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 +49 -0
- 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/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 +6 -4
- 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 +102 -9
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +38 -3
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +533 -4
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +315 -6
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +220 -22
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +858 -241
- package/src/engine/control/first-person/TODO.md +127 -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 +158 -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 +550 -119
- 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 +28 -0
- package/src/engine/ecs/EntityManager.d.ts +2 -2
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +13 -8
- package/src/engine/ecs/System.d.ts.map +1 -1
- package/src/engine/ecs/System.js +2 -2
- 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/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/PLAN.md +236 -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/aabb_transform_oriented.d.ts +30 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +1 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.js +93 -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 +226 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
- package/src/engine/physics/contact/ManifoldStore.js +499 -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 +520 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsSystem.js +1159 -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 +455 -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_solve_pressure_unmasked_legacy.d.ts +20 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +83 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +26 -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 +70 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +8 -10
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +29 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
- package/src/engine/physics/inertia/world_inverse_inertia.js +79 -0
- package/src/engine/physics/integration/integrate_position.d.ts +16 -0
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_position.js +48 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts +25 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_velocity.js +79 -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 +59 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/PosedShape.js +110 -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 +543 -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 +508 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +11 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/narrowphase_step.js +382 -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 +130 -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/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/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/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 +36 -0
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
- package/src/engine/physics/solver/solve_contacts.js +598 -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
|
@@ -20,7 +20,6 @@ import HeadsUpDisplaySystem from "../../../ecs/gui/hud/HeadsUpDisplaySystem.js";
|
|
|
20
20
|
import ViewportPositionSystem from "../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
21
21
|
import { InverseKinematicsSystem } from "../../../ecs/ik/InverseKinematicsSystem.js";
|
|
22
22
|
import AnimationSystem from "../../../ecs/systems/AnimationSystem.js";
|
|
23
|
-
import MotionSystem from "../../../ecs/systems/MotionSystem.js";
|
|
24
23
|
import ScriptSystem from "../../../ecs/systems/ScriptSystem.js";
|
|
25
24
|
import TimerSystem from "../../../ecs/systems/TimerSystem.js";
|
|
26
25
|
import ClingToTerrainSystem from "../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
@@ -91,7 +90,6 @@ function makeConfig(engine) {
|
|
|
91
90
|
new ScriptSystem(),
|
|
92
91
|
new FacingDirectionSystem(),
|
|
93
92
|
new PathFollowingSystem(),
|
|
94
|
-
new MotionSystem(),
|
|
95
93
|
new AttachmentSystem(),
|
|
96
94
|
new TimerSystem(),
|
|
97
95
|
guiSystem,
|
|
@@ -19,7 +19,6 @@ import HeadsUpDisplaySystem from "../../../../ecs/gui/hud/HeadsUpDisplaySystem.j
|
|
|
19
19
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
20
20
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
21
21
|
import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
|
|
22
|
-
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
23
22
|
import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
|
|
24
23
|
import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
|
|
25
24
|
import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
@@ -91,7 +90,6 @@ function makeConfig(engine) {
|
|
|
91
90
|
new ScriptSystem(),
|
|
92
91
|
new FacingDirectionSystem(),
|
|
93
92
|
new PathFollowingSystem(),
|
|
94
|
-
new MotionSystem(),
|
|
95
93
|
new AttachmentSystem(),
|
|
96
94
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
97
95
|
new SoundControllerSystem(),
|
|
@@ -25,7 +25,6 @@ import HeadsUpDisplaySystem from "../../../../ecs/gui/hud/HeadsUpDisplaySystem.j
|
|
|
25
25
|
import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositionSystem.js";
|
|
26
26
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
27
27
|
import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
|
|
28
|
-
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
29
28
|
import RenderSystem from "../../../../ecs/systems/RenderSystem.js";
|
|
30
29
|
import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
|
|
31
30
|
import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
|
|
@@ -82,7 +81,6 @@ function makeConfig(engine) {
|
|
|
82
81
|
new ScriptSystem(),
|
|
83
82
|
new FacingDirectionSystem(),
|
|
84
83
|
new PathFollowingSystem(),
|
|
85
|
-
new MotionSystem(),
|
|
86
84
|
new AttachmentSystem(),
|
|
87
85
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
88
86
|
new SoundControllerSystem(),
|
|
@@ -34,7 +34,6 @@ import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSys
|
|
|
34
34
|
import Renderable from "../../../../ecs/renderable/Renderable.js";
|
|
35
35
|
import RenderSystem from "../../../../ecs/renderable/RenderSystem.js";
|
|
36
36
|
import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
|
|
37
|
-
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
38
37
|
import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
|
|
39
38
|
import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
|
|
40
39
|
import Team from "../../../../ecs/team/Team.js";
|
|
@@ -110,7 +109,6 @@ function makeConfig(engine) {
|
|
|
110
109
|
new ScriptSystem(),
|
|
111
110
|
new FacingDirectionSystem(),
|
|
112
111
|
new PathFollowingSystem(),
|
|
113
|
-
new MotionSystem(),
|
|
114
112
|
new AttachmentSystem(),
|
|
115
113
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
116
114
|
new SoundControllerSystem(),
|
|
@@ -29,7 +29,6 @@ import ViewportPositionSystem from "../../../../ecs/gui/position/ViewportPositio
|
|
|
29
29
|
import { InverseKinematicsSystem } from "../../../../ecs/ik/InverseKinematicsSystem.js";
|
|
30
30
|
import RenderSystem from "../../../../ecs/renderable/RenderSystem.js";
|
|
31
31
|
import AnimationSystem from "../../../../ecs/systems/AnimationSystem.js";
|
|
32
|
-
import MotionSystem from "../../../../ecs/systems/MotionSystem.js";
|
|
33
32
|
import ScriptSystem from "../../../../ecs/systems/ScriptSystem.js";
|
|
34
33
|
import TimerSystem from "../../../../ecs/systems/TimerSystem.js";
|
|
35
34
|
import ClingToTerrainSystem from "../../../../ecs/terrain/ecs/cling/ClingToTerrainSystem.js";
|
|
@@ -88,7 +87,6 @@ function makeConfig(engine) {
|
|
|
88
87
|
new ScriptSystem(),
|
|
89
88
|
new FacingDirectionSystem(),
|
|
90
89
|
new PathFollowingSystem(),
|
|
91
|
-
new MotionSystem(),
|
|
92
90
|
new AttachmentSystem(),
|
|
93
91
|
new SoundEmitterSystem(assetManager, sound.destination, sound.context),
|
|
94
92
|
new SoundControllerSystem(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find_path_on_grid_astar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/grid/find_path_on_grid_astar.js"],"names":[],"mappings":"AAoMA;;;;;;;;;GASG;AACH,+CARW,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,YAAY,SAC5C,MAAM,UACN,MAAM,SACN,MAAM,QACN,MAAM,eACN,MAAM,GACJ,MAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"find_path_on_grid_astar.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/grid/find_path_on_grid_astar.js"],"names":[],"mappings":"AAoMA;;;;;;;;;GASG;AACH,+CARW,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,YAAY,SAC5C,MAAM,UACN,MAAM,SACN,MAAM,QACN,MAAM,eACN,MAAM,GACJ,MAAO,MAAM,CAAC,CAqG1B"}
|
|
@@ -241,6 +241,13 @@ export function find_path_on_grid_astar(
|
|
|
241
241
|
// Grab the lowest f(x) to process next. Heap keeps this sorted for us.
|
|
242
242
|
const currentNode = open.pop_min();
|
|
243
243
|
|
|
244
|
+
// Lazy-push: a node may be in the heap multiple times if its g-score was improved after an earlier
|
|
245
|
+
// push. The lowest-score entry is popped first; later popped duplicates land on an already-closed
|
|
246
|
+
// node and must be skipped.
|
|
247
|
+
if (closed.get(currentNode)) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
|
|
244
251
|
if (currentNode === goal) {
|
|
245
252
|
// End case - result has been found, return the traced path.
|
|
246
253
|
return compute_path(currentNode, g_score, width, height);
|
|
@@ -285,8 +292,10 @@ export function find_path_on_grid_astar(
|
|
|
285
292
|
|
|
286
293
|
const refined_heuristic = cost_so_far + remaining_heuristic;
|
|
287
294
|
|
|
288
|
-
//
|
|
289
|
-
|
|
295
|
+
// Lazy push: always insert. If neighbor was already on the open list, the older (worse-score)
|
|
296
|
+
// entry will be skipped when popped (see closed-check at the top of the loop). This avoids
|
|
297
|
+
// an O(n) find_index_by_id scan per relaxation.
|
|
298
|
+
open.insert(neighbor, refined_heuristic);
|
|
290
299
|
}
|
|
291
300
|
|
|
292
301
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt_mesh_face_find_path.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/mesh/bt_mesh_face_find_path.js"],"names":[],"mappings":"AAsHA;;;;;;;;;;;GAWG;AACH,+CANW,MAAM,EAAE,GAAC,WAAW,iBACpB,MAAM,gBACN,MAAM,6BAEJ,MAAM,
|
|
1
|
+
{"version":3,"file":"bt_mesh_face_find_path.d.ts","sourceRoot":"","sources":["../../../../../src/engine/navigation/mesh/bt_mesh_face_find_path.js"],"names":[],"mappings":"AAsHA;;;;;;;;;;;GAWG;AACH,+CANW,MAAM,EAAE,GAAC,WAAW,iBACpB,MAAM,gBACN,MAAM,6BAEJ,MAAM,CAoFlB"}
|
|
@@ -156,6 +156,13 @@ export function bt_mesh_face_find_path(
|
|
|
156
156
|
|
|
157
157
|
const current_node = open.pop_min();
|
|
158
158
|
|
|
159
|
+
// Lazy-push: a node may be in the heap multiple times if its g-score was improved after an earlier
|
|
160
|
+
// push. The lowest-score entry is popped first; later popped duplicates land on an already-closed
|
|
161
|
+
// node and must be skipped.
|
|
162
|
+
if (closed.has(current_node)) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
|
|
159
166
|
if (current_node === goal_face_id) {
|
|
160
167
|
// Reached the goal
|
|
161
168
|
return construct_path(output, goal_face_id, g_score, topology);
|
|
@@ -190,7 +197,10 @@ export function bt_mesh_face_find_path(
|
|
|
190
197
|
|
|
191
198
|
const refined_heuristic = cost_so_far + remaining_heuristic;
|
|
192
199
|
|
|
193
|
-
|
|
200
|
+
// Lazy push: always insert. If neighbor was already on the open list, the older (worse-score)
|
|
201
|
+
// entry will be skipped when popped (see closed-check at the top of the loop). This avoids
|
|
202
|
+
// an O(n) find_index_by_id scan per relaxation.
|
|
203
|
+
open.insert(neighbor, refined_heuristic);
|
|
194
204
|
|
|
195
205
|
}
|
|
196
206
|
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Physics engine — state of play
|
|
2
|
+
|
|
3
|
+
Tracker for what's built, what's pending, and what's deferred.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Deterministic JS rigid-body physics engine for the meep ECS. Target: game
|
|
10
|
+
scenarios with up to millions of mostly-sleeping bodies, deterministic replays
|
|
11
|
+
for netcode and reproducible debugging, broad shape coverage for common game
|
|
12
|
+
collisions. Pure JS — no WASM, no SIMD, no worker threads.
|
|
13
|
+
|
|
14
|
+
Architectural references for design choices:
|
|
15
|
+
- **Jolt** — pre-allocated body pool, active-list iteration, two-tree
|
|
16
|
+
broadphase (static + dynamic).
|
|
17
|
+
- **Bullet** — `btPersistentManifold` cache layout with up to 4 points.
|
|
18
|
+
- **Box2D / Catto** — sequential impulse with warm-starting, Sutherland-Hodgman
|
|
19
|
+
face clipping for box-box.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Done
|
|
24
|
+
|
|
25
|
+
### Foundations
|
|
26
|
+
- `RigidBody`, `Collider`, `BodyKind`, `RigidBodyFlags`, `ColliderFlags`,
|
|
27
|
+
`SleepState`, `PhysicsEvents`.
|
|
28
|
+
- `BodyStorage`: SoA pool, generation-tracked stable IDs, dense awake list,
|
|
29
|
+
min-heap free for deterministic ID reuse.
|
|
30
|
+
- `PhysicsSystem`: full public API surface (gravity, force/impulse with and
|
|
31
|
+
without application point, torque, velocity setter, wake/sleep, contact
|
|
32
|
+
filter callback).
|
|
33
|
+
- Binary serialization adapters for `RigidBody` and `Collider` (transient
|
|
34
|
+
runtime state deliberately excluded).
|
|
35
|
+
- `PairUint32Map`: open-addressed Robin Hood + Fibonacci hash for the
|
|
36
|
+
pair → manifold-slot index (the one new collection added to `core/collection/`).
|
|
37
|
+
|
|
38
|
+
### Pipeline (`PhysicsSystem.fixedUpdate`)
|
|
39
|
+
1. Velocity integration (semi-implicit Euler, linear + angular, gravity,
|
|
40
|
+
damping, world-frame inverse-inertia for torque)
|
|
41
|
+
2. Per-collider broadphase refit with fat AABB (Box2D-style velocity-padded
|
|
42
|
+
slack)
|
|
43
|
+
3. Pair generation: per-leaf query against both BVHs (static + dynamic),
|
|
44
|
+
canonical `(min, max)` pairs, dedup via manifold touched flag
|
|
45
|
+
4. Wake propagation for sleeping bodies in the pair list
|
|
46
|
+
5. Narrowphase cross-product over collider lists
|
|
47
|
+
6. Sequential-impulse solver (Catto-style, warm-start, friction, Baumgarte)
|
|
48
|
+
7. Position integration (linear + quaternion)
|
|
49
|
+
8. Sleep test (per-body velocity² below threshold for ≥ 0.5 s)
|
|
50
|
+
9. Manifold diff → `ContactBegin` / `Stay` / `End` event dispatch
|
|
51
|
+
10. `manifolds.advance_frame()` — roll touched bits, evict grace-expired slots
|
|
52
|
+
|
|
53
|
+
### Shape coverage
|
|
54
|
+
| Pair | Path | Manifold |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| sphere-sphere | closed-form | 1 point |
|
|
57
|
+
| sphere-box | closed-form (handles centre-inside-box) | 1 point |
|
|
58
|
+
| capsule-sphere | point-on-segment closed-form | 1 point |
|
|
59
|
+
| capsule-capsule | segment-segment closest pair | 1 point |
|
|
60
|
+
| capsule-box | iterative segment-vs-OBB (primary) + cap-centre sphere-vs-OBB at each endpoint | up to 3 |
|
|
61
|
+
| box-box face-face | SAT + Sutherland-Hodgman clipping | up to 4 |
|
|
62
|
+
| box-box edge-edge | SAT + midpoint fallback | 1 point |
|
|
63
|
+
| anything else | GJK + EPA | 1 point (may fail on smooth shapes) |
|
|
64
|
+
|
|
65
|
+
### Solver
|
|
66
|
+
- Sequential impulse with warm-starting (10 velocity iterations by default).
|
|
67
|
+
- Coulomb friction with disk-clamped tangent impulses.
|
|
68
|
+
- Baumgarte position correction folded into the velocity solve.
|
|
69
|
+
- Full angular Jacobian (`I_w⁻¹ = R · diag · R^T`) and angular impulse
|
|
70
|
+
application.
|
|
71
|
+
- Public force/impulse-at-point API (`applyForceAt`, `applyImpulseAt`,
|
|
72
|
+
`applyTorque`).
|
|
73
|
+
|
|
74
|
+
### Sleep + events
|
|
75
|
+
- Per-island **atomic sleep**: an island sleeps when `max(|v|² + |ω|²)`
|
|
76
|
+
across all members stays below the threshold long enough; the whole
|
|
77
|
+
island sleeps in the same frame. Replaces the per-body chatter on
|
|
78
|
+
weakly-connected piles.
|
|
79
|
+
- **Atomic wake**: members of a sleeping island are threaded into a
|
|
80
|
+
circular doubly-linked list (`sleep_group_next` / `sleep_group_prev`);
|
|
81
|
+
waking any one member walks the chain and wakes the rest in the same
|
|
82
|
+
call. A 100-block stack hit at the base wakes top-down in one frame
|
|
83
|
+
rather than over 100 frames of broadphase propagation.
|
|
84
|
+
- `DisableSleep` on any island member exempts the whole island.
|
|
85
|
+
- ContactBegin / Stay / End buffer + dispatch through both
|
|
86
|
+
`PhysicsSystem.onContactBegin/Stay/End` Signals and the per-entity
|
|
87
|
+
`entity.sendEvent(PhysicsEvents.ContactBegin, ...)` channel (when a
|
|
88
|
+
dataset is attached).
|
|
89
|
+
|
|
90
|
+
### Islands
|
|
91
|
+
- **Union-find** with path halving + union by min-index over the awake-body
|
|
92
|
+
+ touched-contact graph (`engine/physics/island/union_find.js`).
|
|
93
|
+
- **`IslandBuilder`** produces deterministic CSR-style output: bodies and
|
|
94
|
+
manifold slots grouped by island, sorted ascending within and across
|
|
95
|
+
islands. Static / kinematic bodies are constraint anchors only — they
|
|
96
|
+
don't merge islands, so disjoint piles on the same floor are separate
|
|
97
|
+
islands.
|
|
98
|
+
- **Solver iterates per island**: impulse convergence happens inside an
|
|
99
|
+
island without waiting on unrelated bodies' Gauss-Seidel updates, and
|
|
100
|
+
disconnected awake bodies don't pay each other's solver cost.
|
|
101
|
+
|
|
102
|
+
### Compound bodies
|
|
103
|
+
- A body has 0..N attached colliders. Each collider has its own world
|
|
104
|
+
transform and its own BVH leaf.
|
|
105
|
+
- Same-entity colliders, child-entity colliders (via `ParentEntity`), or
|
|
106
|
+
hybrids all supported.
|
|
107
|
+
- `ColliderObserverSystem` auto-attaches colliders via the dataset when
|
|
108
|
+
paired with `PhysicsSystem` in an EntityManager.
|
|
109
|
+
- Narrowphase runs the cross-product over both bodies' collider lists per
|
|
110
|
+
body-pair, accumulates candidates, reduces to ≤4 contacts by
|
|
111
|
+
depth + spread.
|
|
112
|
+
|
|
113
|
+
### Public queries
|
|
114
|
+
- `raycast(origin, dir, max_dist, filter?)` — nearest broadphase AABB hit
|
|
115
|
+
across both trees.
|
|
116
|
+
|
|
117
|
+
### Determinism
|
|
118
|
+
- Direct typed-array writes on hot paths (bypassing `Vector3#set`'s observer
|
|
119
|
+
dispatch) — Transform writes still go through `set()` because external
|
|
120
|
+
systems subscribe (TransformAttachment, EntityNode, FogOfWarRevealer,
|
|
121
|
+
ViewportPosition).
|
|
122
|
+
- Active body iteration sorted by body index.
|
|
123
|
+
- Pair canonicalisation `(min, max)`.
|
|
124
|
+
- Min-heap free list for slot reuse.
|
|
125
|
+
- No `Math.random` anywhere in the simulation step.
|
|
126
|
+
- Same-runtime bit-exact determinism by design; cross-runtime is a known
|
|
127
|
+
future seam.
|
|
128
|
+
|
|
129
|
+
### Migration
|
|
130
|
+
- `Motion` / `MotionSystem` / `MotionSerializationAdapter` relocated from
|
|
131
|
+
the meep core (`engine/ecs/`) to the game-domain layer
|
|
132
|
+
(`mir-engine/model/game/ecs/`). meep no longer ships the legacy shim.
|
|
133
|
+
|
|
134
|
+
### Bonus utilities
|
|
135
|
+
- `core/geom/3d/line/line3_closest_points_segment_segment.js` — generally
|
|
136
|
+
useful 3D segment-segment closest-pair via Ericson §5.1.9.
|
|
137
|
+
- `core/collection/PairUint32Map.js` — non-allocating
|
|
138
|
+
`Map<(u32, u32) → u32>` with Robin Hood + Fibonacci hash.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Limitations / Known caveats
|
|
143
|
+
|
|
144
|
+
- **Multi-collider material precision**: solver reads friction/restitution
|
|
145
|
+
from the first-attached collider of each body. Mixed-material compound
|
|
146
|
+
bodies lose accuracy here. The contact-filter callback's `colliderA/B`
|
|
147
|
+
arguments are similarly the body's primary collider, not the specific
|
|
148
|
+
collider in contact.
|
|
149
|
+
- **EPA on smooth shapes**: degenerates (no flat face to converge on).
|
|
150
|
+
Mitigated by closed-form paths for sphere/cube/capsule pairs; exotic
|
|
151
|
+
convex shapes vs spheres can still fail.
|
|
152
|
+
- **Box-box edge-edge contact**: single midpoint contact rather than
|
|
153
|
+
multi-point. Skewed-orientation cube collisions are stable-enough but
|
|
154
|
+
not as precise as face-face.
|
|
155
|
+
- **CCD floor only**: speculative margin via the fattened AABB prevents
|
|
156
|
+
most tunnelling. No per-body swept shape-cast for very fast objects.
|
|
157
|
+
- **Cross-runtime determinism is not guaranteed**: `Math.sin/cos/exp/log`
|
|
158
|
+
are ULP-correct but not bit-exact across V8 / SpiderMonkey / JSC.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Backlog (planned, in scope)
|
|
163
|
+
|
|
164
|
+
### Stability
|
|
165
|
+
- [ ] **Edge-edge multi-point manifold** for skewed box contacts.
|
|
166
|
+
- [ ] **Per-contact source-collider tracking** so multi-material compound
|
|
167
|
+
bodies get accurate per-contact friction/restitution. Requires
|
|
168
|
+
stashing the collider identity in the manifold contact stride.
|
|
169
|
+
|
|
170
|
+
### Performance / Scale
|
|
171
|
+
- [ ] **TGS (Temporal Gauss-Seidel) substepping**: optional alternative
|
|
172
|
+
to PGS for high-quality stacking with large mass ratios.
|
|
173
|
+
- [ ] **Per-body linear CCD shape-cast**: optional opt-in for fast-moving
|
|
174
|
+
bodies where speculative margin isn't enough.
|
|
175
|
+
- [ ] **Per-island parallel solve**: today's island data layout would
|
|
176
|
+
allow worker-based solving once `SharedArrayBuffer` is available.
|
|
177
|
+
Out-of-scope unless / until SAB is universally usable.
|
|
178
|
+
|
|
179
|
+
### Features
|
|
180
|
+
- [ ] **Joints**: distance, hinge, ball-socket, prismatic. The solver loop
|
|
181
|
+
is already set up to iterate `contacts ∪ joints`; only constraint
|
|
182
|
+
pre-step + warm-start hook is missing.
|
|
183
|
+
- [ ] **Convex hull shape** with eigen-based principal-axes inertia
|
|
184
|
+
derivation. Hooks `matrix_eigenvalues_in_place` from the existing
|
|
185
|
+
linalg layer.
|
|
186
|
+
- [ ] **Cylinder / cone shapes** (closed-form pairs against the existing
|
|
187
|
+
family + GJK+EPA fallback for general convex).
|
|
188
|
+
|
|
189
|
+
### API polish
|
|
190
|
+
- [ ] **`overlapShape(shape, position, rotation, filter?)`** public query
|
|
191
|
+
(broadphase + narrowphase) for AOE and selection use cases.
|
|
192
|
+
- [ ] **`castShape(shape, from, to, rotation, filter?)`** for character
|
|
193
|
+
controllers and kinematic shape sweeps.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Future / out-of-scope
|
|
198
|
+
|
|
199
|
+
These are explicit architectural exclusions or post-v1 explorations.
|
|
200
|
+
|
|
201
|
+
### Architecture
|
|
202
|
+
- **Cross-runtime bit-exact determinism**: a soft-float library would
|
|
203
|
+
replace `Math.sin/cos/exp/log/pow` in the hot path. The codebase is
|
|
204
|
+
already structured to make this a swap-in at `quat_integrate.js` and
|
|
205
|
+
tangent-basis construction in `build_manifold.js`. Not pursued because
|
|
206
|
+
the same-runtime determinism we have covers the common cases (single-
|
|
207
|
+
device replay, networked lockstep where all clients run the same JS
|
|
208
|
+
engine).
|
|
209
|
+
- **WASM / SIMD**: the engine targets pure-JS portability. SIMD would
|
|
210
|
+
invalidate the determinism story (V8 doesn't expose deterministic
|
|
211
|
+
Float64x2 ops).
|
|
212
|
+
- **Multi-threaded solver**: workers don't share memory cheaply without
|
|
213
|
+
`SharedArrayBuffer` plus the COOP/COEP HTTP headers, which are not
|
|
214
|
+
always available. Single-threaded is good-enough for the awake-body
|
|
215
|
+
budget that matters.
|
|
216
|
+
|
|
217
|
+
### Simulation extensions
|
|
218
|
+
- **Soft body / cloth / fluids**: the SoA layout in `BodyStorage` and the
|
|
219
|
+
manifold cache are rigid-body shaped. A soft-body system would be a
|
|
220
|
+
parallel subsystem, not an extension.
|
|
221
|
+
- **Reduced-coordinate articulations** (MuJoCo / Featherstone-style):
|
|
222
|
+
game-physics audience runs in maximal coordinates by convention. Not
|
|
223
|
+
on the roadmap.
|
|
224
|
+
|
|
225
|
+
### Game-side
|
|
226
|
+
- **Vehicle physics** (suspensions, drivetrains): a domain layer that
|
|
227
|
+
sits on top of the rigid-body primitives, not in `meep/`.
|
|
228
|
+
- **Character controllers**: same — `engine/control/first-person/` is the
|
|
229
|
+
natural home.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Notable design files
|
|
234
|
+
|
|
235
|
+
- Original design plan: `C:\Users\Alex\.claude\plans\let-s-plan-to-implement-transient-harp.md`
|
|
236
|
+
- This file (state of play): `engine/physics/PLAN.md`
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pack a body index and generation into a single integer handle.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} index
|
|
5
|
+
* @param {number} generation
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
export function pack_body_id(index: number, generation: number): number;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {number} packed
|
|
12
|
+
* @returns {number}
|
|
13
|
+
*/
|
|
14
|
+
export function body_id_index(packed: number): number;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {number} packed
|
|
18
|
+
* @returns {number}
|
|
19
|
+
*/
|
|
20
|
+
export function body_id_generation(packed: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* Sentinel returned by {@link BodyStorage#awake_position_of} and friends when a
|
|
23
|
+
* body is not in the awake set.
|
|
24
|
+
* @type {number}
|
|
25
|
+
*/
|
|
26
|
+
export const BODY_INDEX_ABSENT: number;
|
|
27
|
+
/**
|
|
28
|
+
* Structure-of-arrays pool for rigid bodies.
|
|
29
|
+
*
|
|
30
|
+
* Owns:
|
|
31
|
+
* - per-body identity (entity, generation, kind, flags),
|
|
32
|
+
* - a dense list of awake body indices (the simulation hot iteration target),
|
|
33
|
+
* - a min-heap of free body indices so reuse order is deterministic regardless
|
|
34
|
+
* of how interleaved allocate / free calls have been.
|
|
35
|
+
*
|
|
36
|
+
* The pool grows by doubling when the high-water mark reaches capacity; arrays
|
|
37
|
+
* are replaced wholesale on grow, so callers must not retain references to the
|
|
38
|
+
* raw typed arrays across allocate-after-grow boundaries.
|
|
39
|
+
*
|
|
40
|
+
* Determinism: allocate always reuses the lowest free index. Two pools given the
|
|
41
|
+
* same sequence of allocate/free calls observe identical body indices.
|
|
42
|
+
*
|
|
43
|
+
* @author Alex Goldring
|
|
44
|
+
* @copyright Company Named Limited (c) 2026
|
|
45
|
+
*/
|
|
46
|
+
export class BodyStorage {
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {number} [initial_capacity]
|
|
50
|
+
*/
|
|
51
|
+
constructor(initial_capacity?: number);
|
|
52
|
+
__capacity: number;
|
|
53
|
+
__count: number;
|
|
54
|
+
__entities: Int32Array;
|
|
55
|
+
__generations: Uint8Array;
|
|
56
|
+
__kinds: Uint8Array;
|
|
57
|
+
__flags: Uint32Array;
|
|
58
|
+
__alive: Uint8Array;
|
|
59
|
+
__awake_list: Uint32Array;
|
|
60
|
+
__awake_pos: Int32Array;
|
|
61
|
+
__awake_count: number;
|
|
62
|
+
__free_heap: Uint32Array;
|
|
63
|
+
__free_count: number;
|
|
64
|
+
/**
|
|
65
|
+
* Currently allocated body count (live, regardless of awake/sleeping).
|
|
66
|
+
* @returns {number}
|
|
67
|
+
*/
|
|
68
|
+
get size(): number;
|
|
69
|
+
/**
|
|
70
|
+
* Total slot capacity. Always a power of two by construction.
|
|
71
|
+
* @returns {number}
|
|
72
|
+
*/
|
|
73
|
+
get capacity(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Number of awake bodies.
|
|
76
|
+
* @returns {number}
|
|
77
|
+
*/
|
|
78
|
+
get awake_count(): number;
|
|
79
|
+
/**
|
|
80
|
+
* High-water mark of slot indices ever issued. Useful when callers maintain
|
|
81
|
+
* per-slot side-tables.
|
|
82
|
+
* @returns {number}
|
|
83
|
+
*/
|
|
84
|
+
get high_water_mark(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Allocate a body slot for `entity`. The new body starts in the awake set
|
|
87
|
+
* with default kind {@link BodyKind.Dynamic} and zero flags; the caller
|
|
88
|
+
* may override these via {@link set_kind} / {@link set_flags}.
|
|
89
|
+
*
|
|
90
|
+
* @param {number} entity
|
|
91
|
+
* @returns {number} packed body id
|
|
92
|
+
*/
|
|
93
|
+
allocate(entity: number): number;
|
|
94
|
+
/**
|
|
95
|
+
* Release a body slot previously returned by {@link allocate}. Bumps the
|
|
96
|
+
* generation so any old packed id becomes stale.
|
|
97
|
+
*
|
|
98
|
+
* @param {number} packed_body_id
|
|
99
|
+
*/
|
|
100
|
+
free(packed_body_id: number): void;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @param {number} packed_body_id
|
|
104
|
+
* @returns {boolean}
|
|
105
|
+
*/
|
|
106
|
+
is_valid(packed_body_id: number): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* @param {number} index body index (NOT a packed id)
|
|
109
|
+
* @returns {number} entity for the body, or -1 if the slot is free.
|
|
110
|
+
*/
|
|
111
|
+
entity_at(index: number): number;
|
|
112
|
+
/**
|
|
113
|
+
* @param {number} index
|
|
114
|
+
* @returns {number}
|
|
115
|
+
*/
|
|
116
|
+
generation_at(index: number): number;
|
|
117
|
+
/**
|
|
118
|
+
* @param {number} index
|
|
119
|
+
* @returns {BodyKind|number}
|
|
120
|
+
*/
|
|
121
|
+
kind_at(index: number): BodyKind | number;
|
|
122
|
+
/**
|
|
123
|
+
* @param {number} index
|
|
124
|
+
* @param {BodyKind|number} kind
|
|
125
|
+
*/
|
|
126
|
+
set_kind(index: number, kind: BodyKind | number): void;
|
|
127
|
+
/**
|
|
128
|
+
* @param {number} index
|
|
129
|
+
* @returns {number}
|
|
130
|
+
*/
|
|
131
|
+
flags_at(index: number): number;
|
|
132
|
+
/**
|
|
133
|
+
* @param {number} index
|
|
134
|
+
* @param {number} flags
|
|
135
|
+
*/
|
|
136
|
+
set_flags(index: number, flags: number): void;
|
|
137
|
+
/**
|
|
138
|
+
* Index of `index` in the awake list, or {@link BODY_INDEX_ABSENT} if asleep.
|
|
139
|
+
* @param {number} index
|
|
140
|
+
* @returns {number}
|
|
141
|
+
*/
|
|
142
|
+
awake_position_of(index: number): number;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @param {number} index
|
|
146
|
+
* @returns {boolean}
|
|
147
|
+
*/
|
|
148
|
+
is_awake(index: number): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Read the body index at position `i` in the dense awake list (0-based).
|
|
151
|
+
* @param {number} i
|
|
152
|
+
* @returns {number}
|
|
153
|
+
*/
|
|
154
|
+
awake_at(i: number): number;
|
|
155
|
+
/**
|
|
156
|
+
* Add `index` to the awake set if not already present.
|
|
157
|
+
* @param {number} index
|
|
158
|
+
*/
|
|
159
|
+
mark_awake(index: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Remove `index` from the awake set if present.
|
|
162
|
+
* @param {number} index
|
|
163
|
+
*/
|
|
164
|
+
mark_sleeping(index: number): void;
|
|
165
|
+
/**
|
|
166
|
+
* Swap-with-last removal at position `pos` in the dense awake list.
|
|
167
|
+
* @private
|
|
168
|
+
* @param {number} pos
|
|
169
|
+
*/
|
|
170
|
+
private __awake_remove_at;
|
|
171
|
+
/**
|
|
172
|
+
* @private
|
|
173
|
+
*/
|
|
174
|
+
private __grow;
|
|
175
|
+
/**
|
|
176
|
+
* @private
|
|
177
|
+
* @param {number} index
|
|
178
|
+
*/
|
|
179
|
+
private __heap_push;
|
|
180
|
+
/**
|
|
181
|
+
* @private
|
|
182
|
+
* @returns {number}
|
|
183
|
+
*/
|
|
184
|
+
private __heap_pop;
|
|
185
|
+
}
|
|
186
|
+
import { BodyKind } from "../ecs/BodyKind.js";
|
|
187
|
+
//# sourceMappingURL=BodyStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BodyStorage.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/body/BodyStorage.js"],"names":[],"mappings":"AA2BA;;;;;;GAMG;AACH,oCAJW,MAAM,cACN,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,sCAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CAIlB;AAlCD;;;;GAIG;AACH,gCAFU,MAAM,CAEoB;AA+BpC;;;;;;;;;;;;;;;;;;GAkBG;AACH;IAEI;;;OAGG;IACH,+BAFW,MAAM,EA+BhB;IAxBG,mBAAqB;IAGrB,gBAAgB;IAEhB,uBAAqC;IACrC,0BAAwC;IACxC,oBAAkC;IAClC,qBAAmC;IAGnC,oBAAkC;IAGlC,0BAAwC;IACxC,wBAAsC;IACtC,sBAAsB;IAGtB,yBAAuC;IACvC,qBAAqB;IAMzB;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,0BAEC;IAED;;;;OAIG;IACH,8BAEC;IAED;;;;;;;OAOG;IACH,iBAHW,MAAM,GACJ,MAAM,CAyBlB;IAED;;;;;OAKG;IACH,qBAFW,MAAM,QAoBhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,OAAO,CAWnB;IAED;;;OAGG;IACH,iBAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;OAGG;IACH,qBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,QAAQ,GAAC,MAAM,CAI3B;IAED;;;OAGG;IACH,gBAHW,MAAM,QACN,QAAQ,GAAC,MAAM,QAIzB;IAED;;;OAGG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,iBAHW,MAAM,SACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,kBAFW,MAAM,QAShB;IAED;;;OAGG;IACH,qBAFW,MAAM,QAShB;IAED;;;;OAIG;IACH,0BAOC;IAED;;OAEG;IACH,eAiCC;IAID;;;OAGG;IACH,oBAgBC;IAED;;;OAGG;IACH,mBAqBC;CACJ;yBAzawB,oBAAoB"}
|