@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
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { BodyKind } from "../ecs/BodyKind.js";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_INITIAL_CAPACITY = 16;
|
|
5
|
+
const MIN_CAPACITY = 4;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Mask for the 8-bit generation field encoded in a packed body id.
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
const GENERATION_MASK = 0xFF;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Bit width of the generation field. The remaining bits are the body index;
|
|
15
|
+
* 24-bit indices give us 16M live bodies which is comfortably above the design
|
|
16
|
+
* target of "millions".
|
|
17
|
+
* @type {number}
|
|
18
|
+
*/
|
|
19
|
+
const GENERATION_BITS = 8;
|
|
20
|
+
|
|
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 = -1;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Pack a body index and generation into a single integer handle.
|
|
30
|
+
*
|
|
31
|
+
* @param {number} index
|
|
32
|
+
* @param {number} generation
|
|
33
|
+
* @returns {number}
|
|
34
|
+
*/
|
|
35
|
+
export function pack_body_id(index, generation) {
|
|
36
|
+
return (index << GENERATION_BITS) | (generation & GENERATION_MASK);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {number} packed
|
|
42
|
+
* @returns {number}
|
|
43
|
+
*/
|
|
44
|
+
export function body_id_index(packed) {
|
|
45
|
+
return packed >>> GENERATION_BITS;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param {number} packed
|
|
51
|
+
* @returns {number}
|
|
52
|
+
*/
|
|
53
|
+
export function body_id_generation(packed) {
|
|
54
|
+
return packed & GENERATION_MASK;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Structure-of-arrays pool for rigid bodies.
|
|
59
|
+
*
|
|
60
|
+
* Owns:
|
|
61
|
+
* - per-body identity (entity, generation, kind, flags),
|
|
62
|
+
* - a dense list of awake body indices (the simulation hot iteration target),
|
|
63
|
+
* - a min-heap of free body indices so reuse order is deterministic regardless
|
|
64
|
+
* of how interleaved allocate / free calls have been.
|
|
65
|
+
*
|
|
66
|
+
* The pool grows by doubling when the high-water mark reaches capacity; arrays
|
|
67
|
+
* are replaced wholesale on grow, so callers must not retain references to the
|
|
68
|
+
* raw typed arrays across allocate-after-grow boundaries.
|
|
69
|
+
*
|
|
70
|
+
* Determinism: allocate always reuses the lowest free index. Two pools given the
|
|
71
|
+
* same sequence of allocate/free calls observe identical body indices.
|
|
72
|
+
*
|
|
73
|
+
* @author Alex Goldring
|
|
74
|
+
* @copyright Company Named Limited (c) 2026
|
|
75
|
+
*/
|
|
76
|
+
export class BodyStorage {
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* @param {number} [initial_capacity]
|
|
81
|
+
*/
|
|
82
|
+
constructor(initial_capacity = DEFAULT_INITIAL_CAPACITY) {
|
|
83
|
+
assert.isNonNegativeInteger(initial_capacity, 'initial_capacity');
|
|
84
|
+
|
|
85
|
+
const cap = Math.max(MIN_CAPACITY, initial_capacity);
|
|
86
|
+
|
|
87
|
+
this.__capacity = cap;
|
|
88
|
+
// High-water mark of slot indices ever issued. Slots in [0, count) are
|
|
89
|
+
// either currently allocated or sitting on the free heap.
|
|
90
|
+
this.__count = 0;
|
|
91
|
+
|
|
92
|
+
this.__entities = new Int32Array(cap);
|
|
93
|
+
this.__generations = new Uint8Array(cap);
|
|
94
|
+
this.__kinds = new Uint8Array(cap);
|
|
95
|
+
this.__flags = new Uint32Array(cap);
|
|
96
|
+
|
|
97
|
+
// 1 = allocated, 0 = free. Cheaper than scanning the free heap.
|
|
98
|
+
this.__alive = new Uint8Array(cap);
|
|
99
|
+
|
|
100
|
+
// Awake set: dense list of awake body indices + reverse map.
|
|
101
|
+
this.__awake_list = new Uint32Array(cap);
|
|
102
|
+
this.__awake_pos = new Int32Array(cap);
|
|
103
|
+
this.__awake_count = 0;
|
|
104
|
+
|
|
105
|
+
// Min-heap of free body indices for deterministic reuse.
|
|
106
|
+
this.__free_heap = new Uint32Array(cap);
|
|
107
|
+
this.__free_count = 0;
|
|
108
|
+
|
|
109
|
+
// Initialise reverse map to BODY_INDEX_ABSENT.
|
|
110
|
+
this.__awake_pos.fill(BODY_INDEX_ABSENT);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Currently allocated body count (live, regardless of awake/sleeping).
|
|
115
|
+
* @returns {number}
|
|
116
|
+
*/
|
|
117
|
+
get size() {
|
|
118
|
+
return this.__count - this.__free_count;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Total slot capacity. Always a power of two by construction.
|
|
123
|
+
* @returns {number}
|
|
124
|
+
*/
|
|
125
|
+
get capacity() {
|
|
126
|
+
return this.__capacity;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Number of awake bodies.
|
|
131
|
+
* @returns {number}
|
|
132
|
+
*/
|
|
133
|
+
get awake_count() {
|
|
134
|
+
return this.__awake_count;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* High-water mark of slot indices ever issued. Useful when callers maintain
|
|
139
|
+
* per-slot side-tables.
|
|
140
|
+
* @returns {number}
|
|
141
|
+
*/
|
|
142
|
+
get high_water_mark() {
|
|
143
|
+
return this.__count;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Allocate a body slot for `entity`. The new body starts in the awake set
|
|
148
|
+
* with default kind {@link BodyKind.Dynamic} and zero flags; the caller
|
|
149
|
+
* may override these via {@link set_kind} / {@link set_flags}.
|
|
150
|
+
*
|
|
151
|
+
* @param {number} entity
|
|
152
|
+
* @returns {number} packed body id
|
|
153
|
+
*/
|
|
154
|
+
allocate(entity) {
|
|
155
|
+
let index;
|
|
156
|
+
|
|
157
|
+
if (this.__free_count > 0) {
|
|
158
|
+
index = this.__heap_pop();
|
|
159
|
+
} else {
|
|
160
|
+
if (this.__count === this.__capacity) {
|
|
161
|
+
this.__grow();
|
|
162
|
+
}
|
|
163
|
+
index = this.__count++;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
this.__entities[index] = entity;
|
|
167
|
+
this.__kinds[index] = BodyKind.Dynamic;
|
|
168
|
+
this.__flags[index] = 0;
|
|
169
|
+
this.__alive[index] = 1;
|
|
170
|
+
|
|
171
|
+
// Insert into awake set.
|
|
172
|
+
const awake_pos = this.__awake_count++;
|
|
173
|
+
this.__awake_list[awake_pos] = index;
|
|
174
|
+
this.__awake_pos[index] = awake_pos;
|
|
175
|
+
|
|
176
|
+
return pack_body_id(index, this.__generations[index]);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Release a body slot previously returned by {@link allocate}. Bumps the
|
|
181
|
+
* generation so any old packed id becomes stale.
|
|
182
|
+
*
|
|
183
|
+
* @param {number} packed_body_id
|
|
184
|
+
*/
|
|
185
|
+
free(packed_body_id) {
|
|
186
|
+
const index = body_id_index(packed_body_id);
|
|
187
|
+
|
|
188
|
+
assert.equal(this.is_valid(packed_body_id), true, 'free() called on stale or unknown body id');
|
|
189
|
+
|
|
190
|
+
// Remove from awake set if present.
|
|
191
|
+
const awake_pos = this.__awake_pos[index];
|
|
192
|
+
if (awake_pos !== BODY_INDEX_ABSENT) {
|
|
193
|
+
this.__awake_remove_at(awake_pos);
|
|
194
|
+
this.__awake_pos[index] = BODY_INDEX_ABSENT;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
this.__alive[index] = 0;
|
|
198
|
+
|
|
199
|
+
// Bump generation; wraps mod 256.
|
|
200
|
+
this.__generations[index] = (this.__generations[index] + 1) & GENERATION_MASK;
|
|
201
|
+
|
|
202
|
+
this.__heap_push(index);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @param {number} packed_body_id
|
|
208
|
+
* @returns {boolean}
|
|
209
|
+
*/
|
|
210
|
+
is_valid(packed_body_id) {
|
|
211
|
+
const index = body_id_index(packed_body_id);
|
|
212
|
+
if (index < 0 || index >= this.__count) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
if (this.__alive[index] !== 1) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
return this.__generations[index] === body_id_generation(packed_body_id);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @param {number} index body index (NOT a packed id)
|
|
223
|
+
* @returns {number} entity for the body, or -1 if the slot is free.
|
|
224
|
+
*/
|
|
225
|
+
entity_at(index) {
|
|
226
|
+
if (this.__alive[index] !== 1) {
|
|
227
|
+
return -1;
|
|
228
|
+
}
|
|
229
|
+
return this.__entities[index];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @param {number} index
|
|
234
|
+
* @returns {number}
|
|
235
|
+
*/
|
|
236
|
+
generation_at(index) {
|
|
237
|
+
return this.__generations[index];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* @param {number} index
|
|
242
|
+
* @returns {BodyKind|number}
|
|
243
|
+
*/
|
|
244
|
+
kind_at(index) {
|
|
245
|
+
return this.__kinds[index];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {number} index
|
|
250
|
+
* @param {BodyKind|number} kind
|
|
251
|
+
*/
|
|
252
|
+
set_kind(index, kind) {
|
|
253
|
+
this.__kinds[index] = kind;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @param {number} index
|
|
258
|
+
* @returns {number}
|
|
259
|
+
*/
|
|
260
|
+
flags_at(index) {
|
|
261
|
+
return this.__flags[index];
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @param {number} index
|
|
266
|
+
* @param {number} flags
|
|
267
|
+
*/
|
|
268
|
+
set_flags(index, flags) {
|
|
269
|
+
this.__flags[index] = flags;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Index of `index` in the awake list, or {@link BODY_INDEX_ABSENT} if asleep.
|
|
274
|
+
* @param {number} index
|
|
275
|
+
* @returns {number}
|
|
276
|
+
*/
|
|
277
|
+
awake_position_of(index) {
|
|
278
|
+
return this.__awake_pos[index];
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
*
|
|
283
|
+
* @param {number} index
|
|
284
|
+
* @returns {boolean}
|
|
285
|
+
*/
|
|
286
|
+
is_awake(index) {
|
|
287
|
+
return this.__awake_pos[index] !== BODY_INDEX_ABSENT;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Read the body index at position `i` in the dense awake list (0-based).
|
|
292
|
+
* @param {number} i
|
|
293
|
+
* @returns {number}
|
|
294
|
+
*/
|
|
295
|
+
awake_at(i) {
|
|
296
|
+
return this.__awake_list[i];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Add `index` to the awake set if not already present.
|
|
301
|
+
* @param {number} index
|
|
302
|
+
*/
|
|
303
|
+
mark_awake(index) {
|
|
304
|
+
if (this.__awake_pos[index] !== BODY_INDEX_ABSENT) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const pos = this.__awake_count++;
|
|
308
|
+
this.__awake_list[pos] = index;
|
|
309
|
+
this.__awake_pos[index] = pos;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Remove `index` from the awake set if present.
|
|
314
|
+
* @param {number} index
|
|
315
|
+
*/
|
|
316
|
+
mark_sleeping(index) {
|
|
317
|
+
const pos = this.__awake_pos[index];
|
|
318
|
+
if (pos === BODY_INDEX_ABSENT) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
this.__awake_remove_at(pos);
|
|
322
|
+
this.__awake_pos[index] = BODY_INDEX_ABSENT;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Swap-with-last removal at position `pos` in the dense awake list.
|
|
327
|
+
* @private
|
|
328
|
+
* @param {number} pos
|
|
329
|
+
*/
|
|
330
|
+
__awake_remove_at(pos) {
|
|
331
|
+
const last_pos = --this.__awake_count;
|
|
332
|
+
if (pos !== last_pos) {
|
|
333
|
+
const swapped_index = this.__awake_list[last_pos];
|
|
334
|
+
this.__awake_list[pos] = swapped_index;
|
|
335
|
+
this.__awake_pos[swapped_index] = pos;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @private
|
|
341
|
+
*/
|
|
342
|
+
__grow() {
|
|
343
|
+
const new_cap = this.__capacity << 1;
|
|
344
|
+
this.__capacity = new_cap;
|
|
345
|
+
|
|
346
|
+
const grow_int32 = (a) => {
|
|
347
|
+
const next = new Int32Array(new_cap);
|
|
348
|
+
next.set(a);
|
|
349
|
+
return next;
|
|
350
|
+
};
|
|
351
|
+
const grow_uint8 = (a) => {
|
|
352
|
+
const next = new Uint8Array(new_cap);
|
|
353
|
+
next.set(a);
|
|
354
|
+
return next;
|
|
355
|
+
};
|
|
356
|
+
const grow_uint32 = (a) => {
|
|
357
|
+
const next = new Uint32Array(new_cap);
|
|
358
|
+
next.set(a);
|
|
359
|
+
return next;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
this.__entities = grow_int32(this.__entities);
|
|
363
|
+
this.__generations = grow_uint8(this.__generations);
|
|
364
|
+
this.__kinds = grow_uint8(this.__kinds);
|
|
365
|
+
this.__flags = grow_uint32(this.__flags);
|
|
366
|
+
this.__alive = grow_uint8(this.__alive);
|
|
367
|
+
this.__awake_list = grow_uint32(this.__awake_list);
|
|
368
|
+
this.__free_heap = grow_uint32(this.__free_heap);
|
|
369
|
+
|
|
370
|
+
// Awake position has signed sentinel — needs fill on the grown portion.
|
|
371
|
+
const next_pos = new Int32Array(new_cap);
|
|
372
|
+
next_pos.set(this.__awake_pos);
|
|
373
|
+
next_pos.fill(BODY_INDEX_ABSENT, this.__awake_pos.length);
|
|
374
|
+
this.__awake_pos = next_pos;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// --- Min-heap of free indices --------------------------------------------
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @private
|
|
381
|
+
* @param {number} index
|
|
382
|
+
*/
|
|
383
|
+
__heap_push(index) {
|
|
384
|
+
const heap = this.__free_heap;
|
|
385
|
+
let i = this.__free_count++;
|
|
386
|
+
heap[i] = index;
|
|
387
|
+
|
|
388
|
+
while (i > 0) {
|
|
389
|
+
const parent = (i - 1) >>> 1;
|
|
390
|
+
if (heap[parent] > heap[i]) {
|
|
391
|
+
const tmp = heap[parent];
|
|
392
|
+
heap[parent] = heap[i];
|
|
393
|
+
heap[i] = tmp;
|
|
394
|
+
i = parent;
|
|
395
|
+
} else {
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @private
|
|
403
|
+
* @returns {number}
|
|
404
|
+
*/
|
|
405
|
+
__heap_pop() {
|
|
406
|
+
const heap = this.__free_heap;
|
|
407
|
+
const result = heap[0];
|
|
408
|
+
const new_count = --this.__free_count;
|
|
409
|
+
if (new_count > 0) {
|
|
410
|
+
heap[0] = heap[new_count];
|
|
411
|
+
let i = 0;
|
|
412
|
+
while (true) {
|
|
413
|
+
const l = (i << 1) + 1;
|
|
414
|
+
const r = l + 1;
|
|
415
|
+
let smallest = i;
|
|
416
|
+
if (l < new_count && heap[l] < heap[smallest]) smallest = l;
|
|
417
|
+
if (r < new_count && heap[r] < heap[smallest]) smallest = r;
|
|
418
|
+
if (smallest === i) break;
|
|
419
|
+
const tmp = heap[i];
|
|
420
|
+
heap[i] = heap[smallest];
|
|
421
|
+
heap[smallest] = tmp;
|
|
422
|
+
i = smallest;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
return result;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Growable Uint32Array list of `(idA, idB)` body-id pairs. Stride is 2 words
|
|
3
|
+
* per pair. `count` tracks the number of pairs; capacity grows by doubling.
|
|
4
|
+
*
|
|
5
|
+
* No allocation happens during {@link push} until capacity is exceeded. The
|
|
6
|
+
* intended usage is `clear()` at the top of each step and `push` for each
|
|
7
|
+
* candidate pair encountered during broadphase.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export class PairList {
|
|
13
|
+
/**
|
|
14
|
+
* @param {number} [initial_capacity] pairs (not words)
|
|
15
|
+
*/
|
|
16
|
+
constructor(initial_capacity?: number);
|
|
17
|
+
__capacity: number;
|
|
18
|
+
__count: number;
|
|
19
|
+
__data: Uint32Array;
|
|
20
|
+
/**
|
|
21
|
+
* @returns {number} number of pairs currently stored
|
|
22
|
+
*/
|
|
23
|
+
get count(): number;
|
|
24
|
+
/**
|
|
25
|
+
* @returns {number} pair capacity (doubles on overflow)
|
|
26
|
+
*/
|
|
27
|
+
get capacity(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Raw word buffer. `data[i*2 + 0]` is idA, `data[i*2 + 1]` is idB for the
|
|
30
|
+
* `i`-th pair, where `i < count`. Exposed for hot-loop iteration; valid
|
|
31
|
+
* until the next {@link push} that triggers a grow.
|
|
32
|
+
* @returns {Uint32Array}
|
|
33
|
+
*/
|
|
34
|
+
get data(): Uint32Array;
|
|
35
|
+
/**
|
|
36
|
+
* Reset to empty without releasing capacity.
|
|
37
|
+
*/
|
|
38
|
+
clear(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Append a pair. Caller is expected to have already canonicalised
|
|
41
|
+
* `idA < idB` if symmetric semantics are needed.
|
|
42
|
+
*
|
|
43
|
+
* @param {number} idA
|
|
44
|
+
* @param {number} idB
|
|
45
|
+
*/
|
|
46
|
+
push(idA: number, idB: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* @param {number} i pair index, `[0, count)`
|
|
49
|
+
* @returns {number}
|
|
50
|
+
*/
|
|
51
|
+
get_a(i: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* @param {number} i pair index, `[0, count)`
|
|
54
|
+
* @returns {number}
|
|
55
|
+
*/
|
|
56
|
+
get_b(i: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
private __grow;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=PairList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PairList.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/PairList.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH;IAEI;;OAEG;IACH,+BAFW,MAAM,EAMhB;IAHG,mBAA+C;IAC/C,gBAAgB;IAChB,oBAAkD;IAGtD;;OAEG;IACH,oBAEC;IAED;;OAEG;IACH,uBAEC;IAED;;;;;OAKG;IACH,wBAEC;IAED;;OAEG;IACH,cAEC;IAED;;;;;;OAMG;IACH,UAHW,MAAM,OACN,MAAM,QAUhB;IAED;;;OAGG;IACH,SAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;OAGG;IACH,SAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;OAEG;IACH,eAMC;CACJ"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Growable Uint32Array list of `(idA, idB)` body-id pairs. Stride is 2 words
|
|
3
|
+
* per pair. `count` tracks the number of pairs; capacity grows by doubling.
|
|
4
|
+
*
|
|
5
|
+
* No allocation happens during {@link push} until capacity is exceeded. The
|
|
6
|
+
* intended usage is `clear()` at the top of each step and `push` for each
|
|
7
|
+
* candidate pair encountered during broadphase.
|
|
8
|
+
*
|
|
9
|
+
* @author Alex Goldring
|
|
10
|
+
* @copyright Company Named Limited (c) 2026
|
|
11
|
+
*/
|
|
12
|
+
export class PairList {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {number} [initial_capacity] pairs (not words)
|
|
16
|
+
*/
|
|
17
|
+
constructor(initial_capacity = 64) {
|
|
18
|
+
this.__capacity = Math.max(1, initial_capacity);
|
|
19
|
+
this.__count = 0;
|
|
20
|
+
this.__data = new Uint32Array(this.__capacity * 2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @returns {number} number of pairs currently stored
|
|
25
|
+
*/
|
|
26
|
+
get count() {
|
|
27
|
+
return this.__count;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @returns {number} pair capacity (doubles on overflow)
|
|
32
|
+
*/
|
|
33
|
+
get capacity() {
|
|
34
|
+
return this.__capacity;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Raw word buffer. `data[i*2 + 0]` is idA, `data[i*2 + 1]` is idB for the
|
|
39
|
+
* `i`-th pair, where `i < count`. Exposed for hot-loop iteration; valid
|
|
40
|
+
* until the next {@link push} that triggers a grow.
|
|
41
|
+
* @returns {Uint32Array}
|
|
42
|
+
*/
|
|
43
|
+
get data() {
|
|
44
|
+
return this.__data;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Reset to empty without releasing capacity.
|
|
49
|
+
*/
|
|
50
|
+
clear() {
|
|
51
|
+
this.__count = 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Append a pair. Caller is expected to have already canonicalised
|
|
56
|
+
* `idA < idB` if symmetric semantics are needed.
|
|
57
|
+
*
|
|
58
|
+
* @param {number} idA
|
|
59
|
+
* @param {number} idB
|
|
60
|
+
*/
|
|
61
|
+
push(idA, idB) {
|
|
62
|
+
if (this.__count === this.__capacity) {
|
|
63
|
+
this.__grow();
|
|
64
|
+
}
|
|
65
|
+
const off = this.__count * 2;
|
|
66
|
+
this.__data[off] = idA;
|
|
67
|
+
this.__data[off + 1] = idB;
|
|
68
|
+
this.__count++;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @param {number} i pair index, `[0, count)`
|
|
73
|
+
* @returns {number}
|
|
74
|
+
*/
|
|
75
|
+
get_a(i) {
|
|
76
|
+
return this.__data[i * 2];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {number} i pair index, `[0, count)`
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
get_b(i) {
|
|
84
|
+
return this.__data[i * 2 + 1];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
__grow() {
|
|
91
|
+
const new_capacity = this.__capacity << 1;
|
|
92
|
+
const next = new Uint32Array(new_capacity * 2);
|
|
93
|
+
next.set(this.__data);
|
|
94
|
+
this.__data = next;
|
|
95
|
+
this.__capacity = new_capacity;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the world-space axis-aligned bounding box of a local AABB after a
|
|
3
|
+
* rigid transform (position + orientation).
|
|
4
|
+
*
|
|
5
|
+
* Math: an AABB transformed by a rotation `R` is bounded by another AABB whose
|
|
6
|
+
* centre is `R · c_local + t` and whose half-extent along each world axis `i`
|
|
7
|
+
* is `Σ_j |R_ij| · half_extent_local_j`. The element-wise-abs trick avoids
|
|
8
|
+
* rotating all 8 corners and projecting.
|
|
9
|
+
*
|
|
10
|
+
* Output layout matches existing AABB conventions: `[x0, y0, z0, x1, y1, z1]`
|
|
11
|
+
* with `(x0,y0,z0)` as the min corner.
|
|
12
|
+
*
|
|
13
|
+
* @param {number[]|Float32Array|Float64Array} result
|
|
14
|
+
* @param {number} result_offset
|
|
15
|
+
* @param {number} lx0 local min x
|
|
16
|
+
* @param {number} ly0 local min y
|
|
17
|
+
* @param {number} lz0 local min z
|
|
18
|
+
* @param {number} lx1 local max x
|
|
19
|
+
* @param {number} ly1 local max y
|
|
20
|
+
* @param {number} lz1 local max z
|
|
21
|
+
* @param {number} px translation x
|
|
22
|
+
* @param {number} py translation y
|
|
23
|
+
* @param {number} pz translation z
|
|
24
|
+
* @param {number} qx quaternion x (unit)
|
|
25
|
+
* @param {number} qy quaternion y
|
|
26
|
+
* @param {number} qz quaternion z
|
|
27
|
+
* @param {number} qw quaternion w
|
|
28
|
+
*/
|
|
29
|
+
export function aabb_transform_oriented(result: number[] | Float32Array | Float64Array, result_offset: number, lx0: number, ly0: number, lz0: number, lx1: number, ly1: number, lz1: number, px: number, py: number, pz: number, qx: number, qy: number, qz: number, qw: number): void;
|
|
30
|
+
//# sourceMappingURL=aabb_transform_oriented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aabb_transform_oriented.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/broadphase/aabb_transform_oriented.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,gDAhBW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAkEhB"}
|