@woosh/meep-engine 2.138.20 → 2.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.js +4 -4
- package/src/core/collection/PairUint32Map.d.ts +100 -0
- package/src/core/collection/PairUint32Map.d.ts.map +1 -0
- package/src/core/collection/PairUint32Map.js +321 -0
- package/src/core/collection/Uint32Map.d.ts +119 -0
- package/src/core/collection/Uint32Map.d.ts.map +1 -0
- package/src/core/collection/Uint32Map.js +345 -0
- package/src/core/collection/array/array_shuffle.d.ts +10 -3
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
- package/src/core/collection/array/array_shuffle.js +27 -22
- package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
- package/src/core/collection/heap/FibonacciHeap.js +586 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -1
- package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
- package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
- package/src/core/collection/heap/Uint32Heap4.js +490 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts +30 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented.js +93 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts +54 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_to_matrix3.js +69 -0
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +24 -2
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.js +24 -1
- package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts +148 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/HeightMapShape3D.js +451 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts +210 -0
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/MeshShape3D.js +593 -0
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +46 -2
- package/src/core/geom/3d/shape/Triangle3D.d.ts +95 -0
- package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/Triangle3D.js +318 -0
- package/src/core/geom/3d/shape/UnionShape3D.js +13 -0
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +30 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +64 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +671 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts +28 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_build_vertex_to_tets_map.js +48 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +387 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +35 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +140 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +31 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +97 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +41 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +124 -13
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +2 -2
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.js +2 -2
- package/src/core/geom/vec3/v3_negate_array.d.ts +3 -3
- package/src/core/geom/vec3/v3_negate_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_negate_array.js +2 -2
- package/src/core/geom/vec3/v3_quat3_apply.d.ts +29 -0
- package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply.js +39 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +30 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quat3_apply_inverse.js +41 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts +32 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_triple_cross_product.js +45 -0
- package/src/core/graph/csr/CSRGraph.d.ts +168 -0
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
- package/src/core/graph/csr/CSRGraph.js +319 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
- package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
- package/src/core/graph/metis/metis.d.ts +19 -0
- package/src/core/graph/metis/metis.d.ts.map +1 -1
- package/src/core/graph/metis/metis.js +20 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
- package/src/core/graph/metis/metis_cluster_bs.js +11 -0
- package/src/core/graph/metis/metis_options.d.ts +17 -2
- package/src/core/graph/metis/metis_options.d.ts.map +1 -1
- package/src/core/graph/metis/metis_options.js +17 -2
- package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
- package/src/core/graph/metis/native/MetisGraph.js +212 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/project_kway.js +43 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
- package/src/engine/EngineHarness.d.ts +3 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +3 -0
- package/src/engine/control/first-person/DESIGN.md +30 -6
- package/src/engine/control/first-person/DESIGN_EXTENSIONS.md +563 -0
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +115 -9
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +211 -176
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +601 -8
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +349 -8
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +319 -23
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +1789 -799
- package/src/engine/control/first-person/TODO.md +173 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Ability.js +119 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Mantle.js +188 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Slide.js +166 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallJump.js +131 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallRun.js +180 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
- package/src/engine/control/first-person/math/Spring.d.ts +56 -0
- package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/Spring.js +71 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +637 -120
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
- package/src/engine/control/first-person/test/buildTestPlayer.js +36 -0
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.js +27 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts +42 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/CapsuleGeometry.js +171 -0
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
- package/src/engine/physics/BULLET_REVIEW.md +945 -0
- package/src/engine/physics/CANNON_REVIEW.md +1300 -0
- package/src/engine/physics/JOLT_REVIEW.md +913 -0
- package/src/engine/physics/PLAN.md +461 -0
- package/src/engine/physics/RAPIER_REVIEW.md +934 -0
- package/src/engine/physics/REVIEW_001_ACTION_PLAN.md +642 -0
- package/src/engine/physics/body/BodyStorage.d.ts +187 -0
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
- package/src/engine/physics/body/BodyStorage.js +427 -0
- package/src/engine/physics/broadphase/PairList.d.ts +62 -0
- package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
- package/src/engine/physics/broadphase/PairList.js +97 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
- package/src/engine/physics/broadphase/generate_pairs.js +101 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts +299 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
- package/src/engine/physics/contact/ManifoldStore.js +608 -0
- package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
- package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
- package/src/engine/physics/ecs/BodyKind.js +24 -0
- package/src/engine/physics/ecs/Collider.d.ts +98 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
- package/src/engine/physics/ecs/Collider.js +136 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderFlags.js +15 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +628 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsSystem.js +1301 -0
- package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBody.js +240 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
- package/src/engine/physics/ecs/SleepState.d.ts +11 -0
- package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
- package/src/engine/physics/ecs/SleepState.js +12 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
- package/src/engine/physics/events/ContactEventBuffer.js +83 -0
- package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
- package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
- package/src/engine/physics/events/diff_manifolds.js +50 -0
- package/src/engine/physics/fluid/FluidField.d.ts +294 -16
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +510 -66
- package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +456 -95
- package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
- package/src/engine/physics/fluid/prototype.js +102 -91
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +48 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +92 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts +6 -6
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +76 -32
- package/src/engine/physics/gjk/gjk.d.ts +28 -2
- package/src/engine/physics/gjk/gjk.d.ts.map +1 -1
- package/src/engine/physics/gjk/gjk.js +421 -378
- package/src/engine/physics/gjk/minkowski_support.d.ts +37 -0
- package/src/engine/physics/gjk/minkowski_support.d.ts.map +1 -0
- package/src/engine/physics/gjk/minkowski_support.js +75 -0
- package/src/engine/physics/gjk/mpr.d.ts +56 -0
- package/src/engine/physics/gjk/mpr.d.ts.map +1 -0
- package/src/engine/physics/gjk/mpr.js +344 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +44 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
- package/src/engine/physics/inertia/world_inverse_inertia.js +77 -0
- package/src/engine/physics/integration/integrate_position.d.ts +34 -0
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_position.js +79 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts +55 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_velocity.js +160 -0
- package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
- package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
- package/src/engine/physics/integration/quat_integrate.js +62 -0
- package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
- package/src/engine/physics/island/IslandBuilder.js +411 -0
- package/src/engine/physics/island/union_find.d.ts +51 -0
- package/src/engine/physics/island/union_find.d.ts.map +1 -0
- package/src/engine/physics/island/union_find.js +76 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts +51 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/PosedShape.js +108 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_box_manifold.js +639 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts +30 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_triangle_contact.js +811 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_contacts.js +462 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts +71 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_triangle_contact.js +375 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts +91 -0
- package/src/engine/physics/narrowphase/compute_penetration.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/compute_penetration.js +396 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts +35 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/aabb_world_to_local.js +80 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts +31 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/decompose_to_triangles.js +55 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/heightmap_enumerate_triangles.js +204 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts +42 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/mesh_enumerate_triangles.js +94 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts +37 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/decomposition/triangle_buffer_layout.js +37 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +17 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/narrowphase_step.js +1422 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.js +123 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts +48 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_triangle_contact.js +143 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
- package/src/engine/physics/queries/overlap_shape.d.ts +51 -0
- package/src/engine/physics/queries/overlap_shape.d.ts.map +1 -0
- package/src/engine/physics/queries/overlap_shape.js +183 -0
- package/src/engine/physics/queries/raycast.d.ts +20 -0
- package/src/engine/physics/queries/raycast.d.ts.map +1 -0
- package/src/engine/physics/queries/raycast.js +249 -0
- package/src/engine/physics/queries/shape_cast.d.ts +56 -0
- package/src/engine/physics/queries/shape_cast.d.ts.map +1 -0
- package/src/engine/physics/queries/shape_cast.js +387 -0
- package/src/engine/physics/solver/friction_cone.d.ts +16 -0
- package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
- package/src/engine/physics/solver/friction_cone.js +37 -0
- package/src/engine/physics/solver/solve_contacts.d.ts +122 -0
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
- package/src/engine/physics/solver/solve_contacts.js +1016 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
- package/src/engine/ecs/components/Motion.d.ts +0 -21
- package/src/engine/ecs/components/Motion.d.ts.map +0 -1
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
- package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
- package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
- package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
- package/src/engine/ecs/systems/MotionSystem.js +0 -29
- package/src/engine/physics/fluid/Fluid.d.ts +0 -26
- package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
- package/src/engine/physics/fluid/Fluid.js +0 -221
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the Minkowski-difference support point for two convex shapes.
|
|
3
|
+
*
|
|
4
|
+
* `support_{A−B}(d) = support_A(+d) − support_B(−d)`
|
|
5
|
+
*
|
|
6
|
+
* This is the bread-and-butter operation of both GJK and MPR — every
|
|
7
|
+
* iteration of either algorithm calls it once with a search direction
|
|
8
|
+
* to extend the simplex or portal. Factoring it lets the two
|
|
9
|
+
* algorithms share the per-call scratch buffers (the support results
|
|
10
|
+
* for A and B before the subtraction) so a build that imports both
|
|
11
|
+
* doesn't carry duplicate state.
|
|
12
|
+
*
|
|
13
|
+
* The supplied direction need not be unit — we normalise here, since
|
|
14
|
+
* the {@link AbstractShape3D#support} contract assumes a unit vector
|
|
15
|
+
* and shape support implementations (sphere especially) don't bother
|
|
16
|
+
* to renormalise internally.
|
|
17
|
+
*
|
|
18
|
+
* NOTE: EPA (`expanding_polytope_algorithm.js`) computes the Minkowski
|
|
19
|
+
* support inline rather than calling this. Its convention is the
|
|
20
|
+
* opposite sign (B−A rather than A−B), and it skips the normalisation
|
|
21
|
+
* because the search directions it constructs from face normals are
|
|
22
|
+
* already unit-length. The narrowphase consumer of EPA's output then
|
|
23
|
+
* negates the result to get the contact normal in the "B → A" stored
|
|
24
|
+
* convention. Folding EPA onto this helper would require both flipping
|
|
25
|
+
* its sign convention and changing the narrowphase call site — not
|
|
26
|
+
* worth the churn for one call site.
|
|
27
|
+
*
|
|
28
|
+
* @param {Float64Array|number[]} result 3-vector destination
|
|
29
|
+
* @param {number} result_offset
|
|
30
|
+
* @param {AbstractShape3D} shape_a
|
|
31
|
+
* @param {AbstractShape3D} shape_b
|
|
32
|
+
* @param {number} dir_x search direction (any non-zero magnitude)
|
|
33
|
+
* @param {number} dir_y
|
|
34
|
+
* @param {number} dir_z
|
|
35
|
+
*/
|
|
36
|
+
export function minkowski_support(result: Float64Array | number[], result_offset: number, shape_a: AbstractShape3D, shape_b: AbstractShape3D, dir_x: number, dir_y: number, dir_z: number): void;
|
|
37
|
+
//# sourceMappingURL=minkowski_support.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minkowski_support.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/gjk/minkowski_support.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,0CARW,YAAY,GAAC,MAAM,EAAE,iBACrB,MAAM,6DAGN,MAAM,SACN,MAAM,SACN,MAAM,QA2BhB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { v3_length } from "../../../core/geom/vec3/v3_length.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compute the Minkowski-difference support point for two convex shapes.
|
|
5
|
+
*
|
|
6
|
+
* `support_{A−B}(d) = support_A(+d) − support_B(−d)`
|
|
7
|
+
*
|
|
8
|
+
* This is the bread-and-butter operation of both GJK and MPR — every
|
|
9
|
+
* iteration of either algorithm calls it once with a search direction
|
|
10
|
+
* to extend the simplex or portal. Factoring it lets the two
|
|
11
|
+
* algorithms share the per-call scratch buffers (the support results
|
|
12
|
+
* for A and B before the subtraction) so a build that imports both
|
|
13
|
+
* doesn't carry duplicate state.
|
|
14
|
+
*
|
|
15
|
+
* The supplied direction need not be unit — we normalise here, since
|
|
16
|
+
* the {@link AbstractShape3D#support} contract assumes a unit vector
|
|
17
|
+
* and shape support implementations (sphere especially) don't bother
|
|
18
|
+
* to renormalise internally.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: EPA (`expanding_polytope_algorithm.js`) computes the Minkowski
|
|
21
|
+
* support inline rather than calling this. Its convention is the
|
|
22
|
+
* opposite sign (B−A rather than A−B), and it skips the normalisation
|
|
23
|
+
* because the search directions it constructs from face normals are
|
|
24
|
+
* already unit-length. The narrowphase consumer of EPA's output then
|
|
25
|
+
* negates the result to get the contact normal in the "B → A" stored
|
|
26
|
+
* convention. Folding EPA onto this helper would require both flipping
|
|
27
|
+
* its sign convention and changing the narrowphase call site — not
|
|
28
|
+
* worth the churn for one call site.
|
|
29
|
+
*
|
|
30
|
+
* @param {Float64Array|number[]} result 3-vector destination
|
|
31
|
+
* @param {number} result_offset
|
|
32
|
+
* @param {AbstractShape3D} shape_a
|
|
33
|
+
* @param {AbstractShape3D} shape_b
|
|
34
|
+
* @param {number} dir_x search direction (any non-zero magnitude)
|
|
35
|
+
* @param {number} dir_y
|
|
36
|
+
* @param {number} dir_z
|
|
37
|
+
*/
|
|
38
|
+
export function minkowski_support(
|
|
39
|
+
result, result_offset,
|
|
40
|
+
shape_a,
|
|
41
|
+
shape_b,
|
|
42
|
+
dir_x, dir_y, dir_z
|
|
43
|
+
) {
|
|
44
|
+
const len = v3_length(dir_x, dir_y, dir_z);
|
|
45
|
+
|
|
46
|
+
if (len > 0) {
|
|
47
|
+
// normalise
|
|
48
|
+
|
|
49
|
+
const inv = 1 / len;
|
|
50
|
+
|
|
51
|
+
dir_x *= inv;
|
|
52
|
+
dir_y *= inv;
|
|
53
|
+
dir_z *= inv;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
shape_a.support(scratch_support_a, 0, dir_x, dir_y, dir_z);
|
|
58
|
+
shape_b.support(scratch_support_b, 0, -dir_x, -dir_y, -dir_z);
|
|
59
|
+
|
|
60
|
+
result[result_offset] = scratch_support_a[0] - scratch_support_b[0];
|
|
61
|
+
result[result_offset + 1] = scratch_support_a[1] - scratch_support_b[1];
|
|
62
|
+
result[result_offset + 2] = scratch_support_a[2] - scratch_support_b[2];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Per-shape scratch buffers for the support-function results before
|
|
67
|
+
* they're subtracted into the Minkowski-difference point. Module-scoped
|
|
68
|
+
* because the physics step is single-threaded; both GJK and MPR run
|
|
69
|
+
* sequentially within one narrowphase iteration.
|
|
70
|
+
*
|
|
71
|
+
* Float64 — matches the precision-sweep treatment of the rest of the
|
|
72
|
+
* solver path.
|
|
73
|
+
*/
|
|
74
|
+
const scratch_support_a = new Float64Array(3);
|
|
75
|
+
const scratch_support_b = new Float64Array(3);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minkowski Portal Refinement (XenoCollide, Gary Snethen, GDC 2009).
|
|
3
|
+
*
|
|
4
|
+
* Determines whether two convex shapes overlap and, if so, returns the
|
|
5
|
+
* Minimum Translation Vector (MTV) that would separate them. The
|
|
6
|
+
* algorithm runs in two phases:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Portal discovery.** Starting from an interior point V0 of the
|
|
9
|
+
* Minkowski difference (the difference of the two body centres),
|
|
10
|
+
* find three vertices V1, V2, V3 on the Mink-diff boundary that
|
|
11
|
+
* form a triangle the ray V0→origin pierces. If at any point a
|
|
12
|
+
* support hyperplane separates V0 from the origin, the shapes
|
|
13
|
+
* can't overlap and we return false.
|
|
14
|
+
*
|
|
15
|
+
* 2. **Portal refinement.** Iteratively replace one of V1, V2, V3
|
|
16
|
+
* with a new support V4 found in the direction of the portal
|
|
17
|
+
* face's outward normal. When V4 doesn't bring the portal any
|
|
18
|
+
* closer to the origin (within `MPR_TOLERANCE`), the portal face
|
|
19
|
+
* *is* the closest face on the Mink-diff to the origin; its
|
|
20
|
+
* outward normal is the MTV direction and the perpendicular
|
|
21
|
+
* distance from the origin to the face is the penetration depth.
|
|
22
|
+
*
|
|
23
|
+
* Compared to GJK+EPA on the same overlap:
|
|
24
|
+
* - One algorithm produces both the overlap test and the MTV (EPA is
|
|
25
|
+
* a separate pass after GJK).
|
|
26
|
+
* - Better behaviour on smooth or high-vertex-count shapes — EPA's
|
|
27
|
+
* polytope-expansion can stall on curved surfaces because each new
|
|
28
|
+
* support produces a face with no flat region to converge on; MPR's
|
|
29
|
+
* portal stays a single triangle and just slides toward the origin.
|
|
30
|
+
* - Tends to converge in 5–15 iterations on typical inputs vs. EPA's
|
|
31
|
+
* 32+ on smooth pairs.
|
|
32
|
+
*
|
|
33
|
+
* **Output convention matches EPA** ({@link expanding_polytope_algorithm}):
|
|
34
|
+
* `result[result_offset .. result_offset+2]` is the MTV vector —
|
|
35
|
+
* direction is "from A's surface into B" (i.e. the direction you'd
|
|
36
|
+
* translate B by to separate the shapes), magnitude is the depth.
|
|
37
|
+
* The caller reads depth as `√(x² + y² + z²)` and normalises to get
|
|
38
|
+
* the unit normal. This makes MPR a drop-in replacement for EPA at
|
|
39
|
+
* any narrowphase call site.
|
|
40
|
+
*
|
|
41
|
+
* On failure modes:
|
|
42
|
+
* - Returns `false` if the shapes don't overlap.
|
|
43
|
+
* - On a degenerate Mink-diff (shapes touching at a point, perfectly
|
|
44
|
+
* coincident centres with collinear support points), returns
|
|
45
|
+
* `true` with a small fallback MTV — same approach as EPA's
|
|
46
|
+
* non-convergent fallback. The narrowphase consumer already
|
|
47
|
+
* filters non-positive / non-finite depths.
|
|
48
|
+
*
|
|
49
|
+
* @param {Float64Array} result destination buffer for the MTV vector
|
|
50
|
+
* @param {number} result_offset
|
|
51
|
+
* @param {PosedShape} shape_a
|
|
52
|
+
* @param {PosedShape} shape_b
|
|
53
|
+
* @returns {boolean} true on overlap
|
|
54
|
+
*/
|
|
55
|
+
export function mpr(result: Float64Array, result_offset: number, shape_a: PosedShape, shape_b: PosedShape): boolean;
|
|
56
|
+
//# sourceMappingURL=mpr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mpr.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/gjk/mpr.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,4BANW,YAAY,iBACZ,MAAM,6CAGJ,OAAO,CAuPnB"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { v3_length } from "../../../core/geom/vec3/v3_length.js";
|
|
2
|
+
import { minkowski_support } from "./minkowski_support.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Maximum portal-refinement iterations. The portal must converge to
|
|
6
|
+
* within {@link MPR_TOLERANCE} of the closest face before this many
|
|
7
|
+
* iterations or we accept whatever it has and return it as an
|
|
8
|
+
* approximation — same graceful-degradation strategy as EPA, but
|
|
9
|
+
* generally MPR converges in 5–15 iterations on the shapes it does
|
|
10
|
+
* well on (smooth curves, mixed convex bodies).
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
const MPR_MAX_ITERATIONS = 64;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Convergence threshold on the portal-normal direction. When the new
|
|
17
|
+
* support point is within this distance of the current portal plane
|
|
18
|
+
* (measured along the portal normal), we declare convergence and use
|
|
19
|
+
* the portal as the closest-face approximation of the MTV.
|
|
20
|
+
* @type {number}
|
|
21
|
+
*/
|
|
22
|
+
const MPR_TOLERANCE = 1e-4;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Tolerance for collinearity / coincidence degeneracies during portal
|
|
26
|
+
* discovery. Picked to be safely below practical world-distance noise
|
|
27
|
+
* but large enough that real coincidences (shapes sharing a centre)
|
|
28
|
+
* trip it.
|
|
29
|
+
* @type {number}
|
|
30
|
+
*/
|
|
31
|
+
const MPR_EPSILON = 1e-10;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Portal vertices in the Minkowski-difference space.
|
|
35
|
+
* V0 is an interior point of the Mink-diff (the difference of the two
|
|
36
|
+
* bodies' centres); V1, V2, V3 are the portal triangle's vertices; V4
|
|
37
|
+
* is the candidate new vertex during refinement.
|
|
38
|
+
*/
|
|
39
|
+
const V0 = new Float64Array(3);
|
|
40
|
+
const V1 = new Float64Array(3);
|
|
41
|
+
const V2 = new Float64Array(3);
|
|
42
|
+
const V3 = new Float64Array(3);
|
|
43
|
+
const V4 = new Float64Array(3);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Minkowski Portal Refinement (XenoCollide, Gary Snethen, GDC 2009).
|
|
47
|
+
*
|
|
48
|
+
* Determines whether two convex shapes overlap and, if so, returns the
|
|
49
|
+
* Minimum Translation Vector (MTV) that would separate them. The
|
|
50
|
+
* algorithm runs in two phases:
|
|
51
|
+
*
|
|
52
|
+
* 1. **Portal discovery.** Starting from an interior point V0 of the
|
|
53
|
+
* Minkowski difference (the difference of the two body centres),
|
|
54
|
+
* find three vertices V1, V2, V3 on the Mink-diff boundary that
|
|
55
|
+
* form a triangle the ray V0→origin pierces. If at any point a
|
|
56
|
+
* support hyperplane separates V0 from the origin, the shapes
|
|
57
|
+
* can't overlap and we return false.
|
|
58
|
+
*
|
|
59
|
+
* 2. **Portal refinement.** Iteratively replace one of V1, V2, V3
|
|
60
|
+
* with a new support V4 found in the direction of the portal
|
|
61
|
+
* face's outward normal. When V4 doesn't bring the portal any
|
|
62
|
+
* closer to the origin (within `MPR_TOLERANCE`), the portal face
|
|
63
|
+
* *is* the closest face on the Mink-diff to the origin; its
|
|
64
|
+
* outward normal is the MTV direction and the perpendicular
|
|
65
|
+
* distance from the origin to the face is the penetration depth.
|
|
66
|
+
*
|
|
67
|
+
* Compared to GJK+EPA on the same overlap:
|
|
68
|
+
* - One algorithm produces both the overlap test and the MTV (EPA is
|
|
69
|
+
* a separate pass after GJK).
|
|
70
|
+
* - Better behaviour on smooth or high-vertex-count shapes — EPA's
|
|
71
|
+
* polytope-expansion can stall on curved surfaces because each new
|
|
72
|
+
* support produces a face with no flat region to converge on; MPR's
|
|
73
|
+
* portal stays a single triangle and just slides toward the origin.
|
|
74
|
+
* - Tends to converge in 5–15 iterations on typical inputs vs. EPA's
|
|
75
|
+
* 32+ on smooth pairs.
|
|
76
|
+
*
|
|
77
|
+
* **Output convention matches EPA** ({@link expanding_polytope_algorithm}):
|
|
78
|
+
* `result[result_offset .. result_offset+2]` is the MTV vector —
|
|
79
|
+
* direction is "from A's surface into B" (i.e. the direction you'd
|
|
80
|
+
* translate B by to separate the shapes), magnitude is the depth.
|
|
81
|
+
* The caller reads depth as `√(x² + y² + z²)` and normalises to get
|
|
82
|
+
* the unit normal. This makes MPR a drop-in replacement for EPA at
|
|
83
|
+
* any narrowphase call site.
|
|
84
|
+
*
|
|
85
|
+
* On failure modes:
|
|
86
|
+
* - Returns `false` if the shapes don't overlap.
|
|
87
|
+
* - On a degenerate Mink-diff (shapes touching at a point, perfectly
|
|
88
|
+
* coincident centres with collinear support points), returns
|
|
89
|
+
* `true` with a small fallback MTV — same approach as EPA's
|
|
90
|
+
* non-convergent fallback. The narrowphase consumer already
|
|
91
|
+
* filters non-positive / non-finite depths.
|
|
92
|
+
*
|
|
93
|
+
* @param {Float64Array} result destination buffer for the MTV vector
|
|
94
|
+
* @param {number} result_offset
|
|
95
|
+
* @param {PosedShape} shape_a
|
|
96
|
+
* @param {PosedShape} shape_b
|
|
97
|
+
* @returns {boolean} true on overlap
|
|
98
|
+
*/
|
|
99
|
+
export function mpr(result, result_offset, shape_a, shape_b) {
|
|
100
|
+
// ── Step 1: interior point V0 = centerA − centerB ───────────────────
|
|
101
|
+
//
|
|
102
|
+
// PosedShape carries the body's world-space position; the centre of
|
|
103
|
+
// its underlying shape (in body-local space) is the origin, so the
|
|
104
|
+
// world centre is just (px, py, pz). The difference of two body
|
|
105
|
+
// centres lies inside the Mink-diff for any convex pair whose shape
|
|
106
|
+
// origins are interior to their geometry — true for spheres,
|
|
107
|
+
// boxes, capsules, and any closed mesh whose bounding box contains
|
|
108
|
+
// its centroid.
|
|
109
|
+
V0[0] = shape_a.px - shape_b.px;
|
|
110
|
+
V0[1] = shape_a.py - shape_b.py;
|
|
111
|
+
V0[2] = shape_a.pz - shape_b.pz;
|
|
112
|
+
|
|
113
|
+
// If the two centres coincide exactly, V0 is at the origin and we
|
|
114
|
+
// can't direction-find from it. Perturb to break the symmetry —
|
|
115
|
+
// any direction works; the algorithm will converge to the same
|
|
116
|
+
// answer regardless of which we pick.
|
|
117
|
+
if (V0[0] === 0 && V0[1] === 0 && V0[2] === 0) {
|
|
118
|
+
V0[0] = MPR_EPSILON;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ── Step 2: first support V1 in direction −V0 (toward the origin) ──
|
|
122
|
+
minkowski_support(V1, 0, shape_a, shape_b, -V0[0], -V0[1], -V0[2]);
|
|
123
|
+
|
|
124
|
+
// If V1 isn't past the origin along −V0, the origin lies outside
|
|
125
|
+
// the Mink-diff and the shapes are separated.
|
|
126
|
+
if (V1[0] * -V0[0] + V1[1] * -V0[1] + V1[2] * -V0[2] < 0) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// ── Step 3: portal discovery ────────────────────────────────────────
|
|
131
|
+
//
|
|
132
|
+
// Find V2 in a direction perpendicular to the V0–V1 axis. n = V1 × V0
|
|
133
|
+
// is perpendicular to both; if it degenerates to zero, V0 and V1
|
|
134
|
+
// are collinear with the origin, which means the origin lies on
|
|
135
|
+
// the segment from V0 to V1 (since V0 is interior and V1 is past
|
|
136
|
+
// the origin) — definite overlap, emit a fallback MTV along V1.
|
|
137
|
+
let nx = V1[1] * V0[2] - V1[2] * V0[1];
|
|
138
|
+
let ny = V1[2] * V0[0] - V1[0] * V0[2];
|
|
139
|
+
let nz = V1[0] * V0[1] - V1[1] * V0[0];
|
|
140
|
+
|
|
141
|
+
if (nx * nx + ny * ny + nz * nz < MPR_EPSILON) {
|
|
142
|
+
// Collinear degeneracy: project the answer along V1.
|
|
143
|
+
const v1_len = v3_length(V1[0], V1[1], V1[2]);
|
|
144
|
+
if (v1_len > MPR_EPSILON) {
|
|
145
|
+
result[result_offset] = V1[0];
|
|
146
|
+
result[result_offset + 1] = V1[1];
|
|
147
|
+
result[result_offset + 2] = V1[2];
|
|
148
|
+
} else {
|
|
149
|
+
// V1 at origin — shapes touching exactly. Emit a tiny MTV.
|
|
150
|
+
result[result_offset] = MPR_EPSILON;
|
|
151
|
+
result[result_offset + 1] = 0;
|
|
152
|
+
result[result_offset + 2] = 0;
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
minkowski_support(V2, 0, shape_a, shape_b, nx, ny, nz);
|
|
158
|
+
|
|
159
|
+
if (V2[0] * nx + V2[1] * ny + V2[2] * nz < 0) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Compute the portal-triangle normal (V1 − V0) × (V2 − V0) and
|
|
164
|
+
// orient it away from V0 (so it points roughly toward the origin).
|
|
165
|
+
let v1mv0_x = V1[0] - V0[0], v1mv0_y = V1[1] - V0[1], v1mv0_z = V1[2] - V0[2];
|
|
166
|
+
let v2mv0_x = V2[0] - V0[0], v2mv0_y = V2[1] - V0[1], v2mv0_z = V2[2] - V0[2];
|
|
167
|
+
nx = v1mv0_y * v2mv0_z - v1mv0_z * v2mv0_y;
|
|
168
|
+
ny = v1mv0_z * v2mv0_x - v1mv0_x * v2mv0_z;
|
|
169
|
+
nz = v1mv0_x * v2mv0_y - v1mv0_y * v2mv0_x;
|
|
170
|
+
|
|
171
|
+
// If the normal points along +V0 (back toward V0's side), swap V1/V2
|
|
172
|
+
// and flip — we want the portal facing away from V0 toward the
|
|
173
|
+
// origin.
|
|
174
|
+
if (nx * V0[0] + ny * V0[1] + nz * V0[2] > 0) {
|
|
175
|
+
const tx = V1[0], ty = V1[1], tz = V1[2];
|
|
176
|
+
V1[0] = V2[0]; V1[1] = V2[1]; V1[2] = V2[2];
|
|
177
|
+
V2[0] = tx; V2[1] = ty; V2[2] = tz;
|
|
178
|
+
nx = -nx; ny = -ny; nz = -nz;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Portal-discovery iteration. We keep refining V3 until the
|
|
182
|
+
// tetrahedron V0–V1–V2–V3 actually contains the origin.
|
|
183
|
+
let discovered = false;
|
|
184
|
+
for (let i = 0; i < MPR_MAX_ITERATIONS; i++) {
|
|
185
|
+
minkowski_support(V3, 0, shape_a, shape_b, nx, ny, nz);
|
|
186
|
+
|
|
187
|
+
if (V3[0] * nx + V3[1] * ny + V3[2] * nz < 0) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Test if origin lies outside plane V0–V1–V3 (V2's side).
|
|
192
|
+
// n_013 = (V1 − V0) × (V3 − V0) — points away from V2 if portal
|
|
193
|
+
// is consistently oriented.
|
|
194
|
+
const v3mv0_x = V3[0] - V0[0], v3mv0_y = V3[1] - V0[1], v3mv0_z = V3[2] - V0[2];
|
|
195
|
+
const n013_x = v1mv0_y * v3mv0_z - v1mv0_z * v3mv0_y;
|
|
196
|
+
const n013_y = v1mv0_z * v3mv0_x - v1mv0_x * v3mv0_z;
|
|
197
|
+
const n013_z = v1mv0_x * v3mv0_y - v1mv0_y * v3mv0_x;
|
|
198
|
+
|
|
199
|
+
// origin's signed distance from plane V0-V1-V3 along n013 is
|
|
200
|
+
// dot(−V0, n013), since the plane passes through V0.
|
|
201
|
+
if (-V0[0] * n013_x - V0[1] * n013_y - V0[2] * n013_z > 0) {
|
|
202
|
+
// origin outside V0-V1-V3 plane on the V2 side — replace V2
|
|
203
|
+
V2[0] = V3[0]; V2[1] = V3[1]; V2[2] = V3[2];
|
|
204
|
+
v2mv0_x = v3mv0_x; v2mv0_y = v3mv0_y; v2mv0_z = v3mv0_z;
|
|
205
|
+
nx = n013_x; ny = n013_y; nz = n013_z;
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Test if origin lies outside plane V0-V2-V3 (V1's side).
|
|
210
|
+
const n023_x = v2mv0_y * v3mv0_z - v2mv0_z * v3mv0_y;
|
|
211
|
+
const n023_y = v2mv0_z * v3mv0_x - v2mv0_x * v3mv0_z;
|
|
212
|
+
const n023_z = v2mv0_x * v3mv0_y - v2mv0_y * v3mv0_x;
|
|
213
|
+
|
|
214
|
+
if (-V0[0] * n023_x - V0[1] * n023_y - V0[2] * n023_z < 0) {
|
|
215
|
+
// origin outside V0-V2-V3 plane on V1's side — replace V1
|
|
216
|
+
V1[0] = V3[0]; V1[1] = V3[1]; V1[2] = V3[2];
|
|
217
|
+
v1mv0_x = v3mv0_x; v1mv0_y = v3mv0_y; v1mv0_z = v3mv0_z;
|
|
218
|
+
// New portal normal: (V1' - V0) × (V2 - V0) where V1' is the new V1 (= old V3)
|
|
219
|
+
nx = v3mv0_y * v2mv0_z - v3mv0_z * v2mv0_y;
|
|
220
|
+
ny = v3mv0_z * v2mv0_x - v3mv0_x * v2mv0_z;
|
|
221
|
+
nz = v3mv0_x * v2mv0_y - v3mv0_y * v2mv0_x;
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Origin is inside the tetrahedron V0-V1-V2-V3 — portal found.
|
|
226
|
+
discovered = true;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (!discovered) {
|
|
231
|
+
// Ran out of portal-discovery iterations — treat as a near-miss.
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ── Step 4: portal refinement ───────────────────────────────────────
|
|
236
|
+
//
|
|
237
|
+
// Now we know V0–V1–V2–V3 is a valid tetrahedron containing the
|
|
238
|
+
// origin. Iteratively replace one of V1/V2/V3 with a new support
|
|
239
|
+
// V4 (found in the direction of the portal triangle's outward
|
|
240
|
+
// normal). When V4 doesn't extend the portal further, the portal
|
|
241
|
+
// face is the closest Mink-diff face to the origin and its normal
|
|
242
|
+
// is the MTV.
|
|
243
|
+
for (let i = 0; i < MPR_MAX_ITERATIONS; i++) {
|
|
244
|
+
// Portal face normal = (V2 - V1) × (V3 - V1)
|
|
245
|
+
const e1_x = V2[0] - V1[0], e1_y = V2[1] - V1[1], e1_z = V2[2] - V1[2];
|
|
246
|
+
const e2_x = V3[0] - V1[0], e2_y = V3[1] - V1[1], e2_z = V3[2] - V1[2];
|
|
247
|
+
let pn_x = e1_y * e2_z - e1_z * e2_y;
|
|
248
|
+
let pn_y = e1_z * e2_x - e1_x * e2_z;
|
|
249
|
+
let pn_z = e1_x * e2_y - e1_y * e2_x;
|
|
250
|
+
const pn_len = v3_length(pn_x, pn_y, pn_z);
|
|
251
|
+
if (pn_len < MPR_EPSILON) {
|
|
252
|
+
// Degenerate portal (collinear vertices) — return the
|
|
253
|
+
// current state as a fallback approximation.
|
|
254
|
+
result[result_offset] = pn_x;
|
|
255
|
+
result[result_offset + 1] = pn_y;
|
|
256
|
+
result[result_offset + 2] = pn_z;
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
const inv_pn = 1 / pn_len;
|
|
260
|
+
pn_x *= inv_pn; pn_y *= inv_pn; pn_z *= inv_pn;
|
|
261
|
+
|
|
262
|
+
// Perpendicular distance from the origin to the portal plane,
|
|
263
|
+
// = dot(V1, portal_normal). This is the candidate depth on
|
|
264
|
+
// every iteration; we accept it once V4 fails to push the
|
|
265
|
+
// portal further.
|
|
266
|
+
const portal_dist = V1[0] * pn_x + V1[1] * pn_y + V1[2] * pn_z;
|
|
267
|
+
|
|
268
|
+
// New support V4 in the portal normal direction.
|
|
269
|
+
minkowski_support(V4, 0, shape_a, shape_b, pn_x, pn_y, pn_z);
|
|
270
|
+
|
|
271
|
+
const v4_dist = V4[0] * pn_x + V4[1] * pn_y + V4[2] * pn_z;
|
|
272
|
+
|
|
273
|
+
// Convergence: V4 doesn't extend the portal beyond the current
|
|
274
|
+
// face (within tolerance). Emit MTV = normal × depth.
|
|
275
|
+
if (v4_dist - portal_dist < MPR_TOLERANCE) {
|
|
276
|
+
result[result_offset] = pn_x * portal_dist;
|
|
277
|
+
result[result_offset + 1] = pn_y * portal_dist;
|
|
278
|
+
result[result_offset + 2] = pn_z * portal_dist;
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// V4 didn't pass the origin along the portal normal — the
|
|
283
|
+
// shapes aren't actually overlapping (shouldn't happen after
|
|
284
|
+
// successful portal discovery, but defensive).
|
|
285
|
+
if (v4_dist < 0) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Replace one of V1, V2, V3 with V4 such that the new portal
|
|
290
|
+
// still contains the V0→origin ray. The split is determined by
|
|
291
|
+
// three cross-product / dot tests against V4 × V0: signs of
|
|
292
|
+
// (Vi · (V4 × V0)) place V0 in one of the three sub-portals.
|
|
293
|
+
//
|
|
294
|
+
// The branch structure here mirrors libccd / bullet's MPR
|
|
295
|
+
// (`btMprExpandPortal`).
|
|
296
|
+
const c_x = V4[1] * V0[2] - V4[2] * V0[1];
|
|
297
|
+
const c_y = V4[2] * V0[0] - V4[0] * V0[2];
|
|
298
|
+
const c_z = V4[0] * V0[1] - V4[1] * V0[0];
|
|
299
|
+
|
|
300
|
+
const d1 = V1[0] * c_x + V1[1] * c_y + V1[2] * c_z;
|
|
301
|
+
|
|
302
|
+
if (d1 >= 0) {
|
|
303
|
+
const d2 = V2[0] * c_x + V2[1] * c_y + V2[2] * c_z;
|
|
304
|
+
if (d2 >= 0) {
|
|
305
|
+
// origin sits in sub-portal between V4 and V1 — drop V1
|
|
306
|
+
V1[0] = V4[0]; V1[1] = V4[1]; V1[2] = V4[2];
|
|
307
|
+
} else {
|
|
308
|
+
// sub-portal between V4 and V3 — drop V3
|
|
309
|
+
V3[0] = V4[0]; V3[1] = V4[1]; V3[2] = V4[2];
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
const d3 = V3[0] * c_x + V3[1] * c_y + V3[2] * c_z;
|
|
313
|
+
if (d3 >= 0) {
|
|
314
|
+
// sub-portal between V4 and V2 — drop V2
|
|
315
|
+
V2[0] = V4[0]; V2[1] = V4[1]; V2[2] = V4[2];
|
|
316
|
+
} else {
|
|
317
|
+
// sub-portal between V4 and V1 (other side) — drop V1
|
|
318
|
+
V1[0] = V4[0]; V1[1] = V4[1]; V1[2] = V4[2];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Refinement ran out of iterations — emit the current portal face
|
|
324
|
+
// as the best-known MTV, same graceful-degradation as EPA.
|
|
325
|
+
const e1_x = V2[0] - V1[0], e1_y = V2[1] - V1[1], e1_z = V2[2] - V1[2];
|
|
326
|
+
const e2_x = V3[0] - V1[0], e2_y = V3[1] - V1[1], e2_z = V3[2] - V1[2];
|
|
327
|
+
let pn_x = e1_y * e2_z - e1_z * e2_y;
|
|
328
|
+
let pn_y = e1_z * e2_x - e1_x * e2_z;
|
|
329
|
+
let pn_z = e1_x * e2_y - e1_y * e2_x;
|
|
330
|
+
const pn_len = v3_length(pn_x, pn_y, pn_z);
|
|
331
|
+
if (pn_len < MPR_EPSILON) {
|
|
332
|
+
result[result_offset] = 0;
|
|
333
|
+
result[result_offset + 1] = 0;
|
|
334
|
+
result[result_offset + 2] = 0;
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
const inv_pn = 1 / pn_len;
|
|
338
|
+
pn_x *= inv_pn; pn_y *= inv_pn; pn_z *= inv_pn;
|
|
339
|
+
const portal_dist = V1[0] * pn_x + V1[1] * pn_y + V1[2] * pn_z;
|
|
340
|
+
result[result_offset] = pn_x * portal_dist;
|
|
341
|
+
result[result_offset + 1] = pn_y * portal_dist;
|
|
342
|
+
result[result_offset + 2] = pn_z * portal_dist;
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply the world-frame inverse inertia tensor of a rigid body to a world-space
|
|
3
|
+
* vector and write the result.
|
|
4
|
+
*
|
|
5
|
+
* Body-frame inverse inertia is supplied as a diagonal in principal axes
|
|
6
|
+
* (a Vector3-like with `.x .y .z`). World inverse inertia is
|
|
7
|
+
* `I_w⁻¹ = R · diag · R^T` where `R` is the body's orientation. We compute
|
|
8
|
+
* `result = R · diag · R^T · v` without materialising the full 3x3 matrix:
|
|
9
|
+
*
|
|
10
|
+
* 1. `v_body = R^T · v` (rotate v into body frame)
|
|
11
|
+
* 2. scale component-wise by the diagonal
|
|
12
|
+
* 3. `result = R · v_body_scaled`
|
|
13
|
+
*
|
|
14
|
+
* Quaternion-rotate-vector uses the standard `q · v · q*` identity. Inverse
|
|
15
|
+
* rotation uses the conjugate quaternion.
|
|
16
|
+
*
|
|
17
|
+
* Sphere short-circuit: if the inverse inertia is isotropic (ix === iy === iz),
|
|
18
|
+
* the rotation cancels and `result = ix * v`. Skip the trig and save the work.
|
|
19
|
+
*
|
|
20
|
+
* Decoupled from RigidBody / Transform on purpose — callers pass only what
|
|
21
|
+
* is actually read. Lets `compute_penetration` and other standalone
|
|
22
|
+
* geometry helpers reuse this without manufacturing a body.
|
|
23
|
+
*
|
|
24
|
+
* @param {number[]|Float64Array} result length >= 3
|
|
25
|
+
* @param {number} result_offset
|
|
26
|
+
* @param {{x: number, y: number, z: number}} inv_inertia_local
|
|
27
|
+
* Body-frame inverse inertia diagonal (typically `rb.inverseInertiaLocal`).
|
|
28
|
+
* @param {{x: number, y: number, z: number, w: number}} rotation
|
|
29
|
+
* Body orientation as a unit quaternion (typically `transform.rotation`).
|
|
30
|
+
* @param {number} vx
|
|
31
|
+
* @param {number} vy
|
|
32
|
+
* @param {number} vz
|
|
33
|
+
*/
|
|
34
|
+
export function world_inverse_inertia_apply(result: number[] | Float64Array, result_offset: number, inv_inertia_local: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
z: number;
|
|
38
|
+
}, rotation: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
z: number;
|
|
42
|
+
w: number;
|
|
43
|
+
}, vx: number, vy: number, vz: number): void;
|
|
44
|
+
//# sourceMappingURL=world_inverse_inertia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world_inverse_inertia.d.ts","sourceRoot":"","sources":["../../../../../src/engine/physics/inertia/world_inverse_inertia.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,oDAVW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,qBACN;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,YAEjC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,MAE5C,MAAM,MACN,MAAM,MACN,MAAM,QA6ChB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply the world-frame inverse inertia tensor of a rigid body to a world-space
|
|
3
|
+
* vector and write the result.
|
|
4
|
+
*
|
|
5
|
+
* Body-frame inverse inertia is supplied as a diagonal in principal axes
|
|
6
|
+
* (a Vector3-like with `.x .y .z`). World inverse inertia is
|
|
7
|
+
* `I_w⁻¹ = R · diag · R^T` where `R` is the body's orientation. We compute
|
|
8
|
+
* `result = R · diag · R^T · v` without materialising the full 3x3 matrix:
|
|
9
|
+
*
|
|
10
|
+
* 1. `v_body = R^T · v` (rotate v into body frame)
|
|
11
|
+
* 2. scale component-wise by the diagonal
|
|
12
|
+
* 3. `result = R · v_body_scaled`
|
|
13
|
+
*
|
|
14
|
+
* Quaternion-rotate-vector uses the standard `q · v · q*` identity. Inverse
|
|
15
|
+
* rotation uses the conjugate quaternion.
|
|
16
|
+
*
|
|
17
|
+
* Sphere short-circuit: if the inverse inertia is isotropic (ix === iy === iz),
|
|
18
|
+
* the rotation cancels and `result = ix * v`. Skip the trig and save the work.
|
|
19
|
+
*
|
|
20
|
+
* Decoupled from RigidBody / Transform on purpose — callers pass only what
|
|
21
|
+
* is actually read. Lets `compute_penetration` and other standalone
|
|
22
|
+
* geometry helpers reuse this without manufacturing a body.
|
|
23
|
+
*
|
|
24
|
+
* @param {number[]|Float64Array} result length >= 3
|
|
25
|
+
* @param {number} result_offset
|
|
26
|
+
* @param {{x: number, y: number, z: number}} inv_inertia_local
|
|
27
|
+
* Body-frame inverse inertia diagonal (typically `rb.inverseInertiaLocal`).
|
|
28
|
+
* @param {{x: number, y: number, z: number, w: number}} rotation
|
|
29
|
+
* Body orientation as a unit quaternion (typically `transform.rotation`).
|
|
30
|
+
* @param {number} vx
|
|
31
|
+
* @param {number} vy
|
|
32
|
+
* @param {number} vz
|
|
33
|
+
*/
|
|
34
|
+
export function world_inverse_inertia_apply(
|
|
35
|
+
result, result_offset,
|
|
36
|
+
inv_inertia_local, rotation,
|
|
37
|
+
vx, vy, vz
|
|
38
|
+
) {
|
|
39
|
+
const ix = inv_inertia_local.x, iy = inv_inertia_local.y, iz = inv_inertia_local.z;
|
|
40
|
+
|
|
41
|
+
if (ix === iy && iy === iz) {
|
|
42
|
+
// Isotropic — rotation cancels.
|
|
43
|
+
result[result_offset] = vx * ix;
|
|
44
|
+
result[result_offset + 1] = vy * ix;
|
|
45
|
+
result[result_offset + 2] = vz * ix;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const qx = rotation.x, qy = rotation.y, qz = rotation.z, qw = rotation.w;
|
|
50
|
+
|
|
51
|
+
// Step 1: v_body = R^T · v. R^T corresponds to applying the conjugate
|
|
52
|
+
// quaternion (-qx, -qy, -qz, qw). Inlined for V8 inliner — see
|
|
53
|
+
// PosedShape.support and core/geom/vec3/v3_quat3_apply_inverse.js
|
|
54
|
+
// for the canonical form.
|
|
55
|
+
const cx = -qx, cy = -qy, cz = -qz;
|
|
56
|
+
const tx = qw * vx + cy * vz - cz * vy;
|
|
57
|
+
const ty = qw * vy + cz * vx - cx * vz;
|
|
58
|
+
const tz = qw * vz + cx * vy - cy * vx;
|
|
59
|
+
const tw = -cx * vx - cy * vy - cz * vz;
|
|
60
|
+
const vbx = tx * qw + tw * qx + ty * qz - tz * qy;
|
|
61
|
+
const vby = ty * qw + tw * qy + tz * qx - tx * qz;
|
|
62
|
+
const vbz = tz * qw + tw * qz + tx * qy - ty * qx;
|
|
63
|
+
|
|
64
|
+
// Step 2: scale by the principal-frame diagonal.
|
|
65
|
+
const sx = vbx * ix;
|
|
66
|
+
const sy = vby * iy;
|
|
67
|
+
const sz = vbz * iz;
|
|
68
|
+
|
|
69
|
+
// Step 3: result = R · scaled = q · scaled · q*. Inlined likewise.
|
|
70
|
+
const ux = qw * sx + qy * sz - qz * sy;
|
|
71
|
+
const uy = qw * sy + qz * sx - qx * sz;
|
|
72
|
+
const uz = qw * sz + qx * sy - qy * sx;
|
|
73
|
+
const uw = -qx * sx - qy * sy - qz * sz;
|
|
74
|
+
result[result_offset] = ux * qw + uw * (-qx) + uy * (-qz) - uz * (-qy);
|
|
75
|
+
result[result_offset + 1] = uy * qw + uw * (-qy) + uz * (-qx) - ux * (-qz);
|
|
76
|
+
result[result_offset + 2] = uz * qw + uw * (-qz) + ux * (-qy) - uy * (-qx);
|
|
77
|
+
}
|