@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,210 @@
|
|
|
1
|
+
import { combine_hash } from "../../../../core/collection/array/combine_hash.js";
|
|
2
|
+
import { v3_matrix4_multiply } from "../../../../core/geom/vec3/v3_matrix4_multiply.js";
|
|
3
|
+
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
4
|
+
import { AbstractFluidEffector } from "./AbstractFluidEffector.js";
|
|
5
|
+
|
|
6
|
+
const scratch_grid_pos = new Float32Array(3);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Splats a velocity impulse into a spherical region around a world-space position
|
|
10
|
+
* each step. Useful for fans, jets, point explosions, and unit-testing the projection
|
|
11
|
+
* step.
|
|
12
|
+
*
|
|
13
|
+
* Falloff is quadratic in the normalized distance — `(1 - r/R)²` — giving a smooth
|
|
14
|
+
* brush profile with zero gradient at the boundary, which projects more cleanly than a
|
|
15
|
+
* hard sphere.
|
|
16
|
+
*
|
|
17
|
+
* Everything is in WORLD units: {@link position} (point), {@link force} (direction
|
|
18
|
+
* vector), {@link radius} (scalar length). The `world_to_grid` matrix supplied to
|
|
19
|
+
* {@link apply} converts them at splat time. Works at any user-supplied radius
|
|
20
|
+
* including sub-cell: the effective kernel radius is internally floored at 1 grid
|
|
21
|
+
* cell so a small world-space radius still produces a roughly one-cell-wide splat
|
|
22
|
+
* instead of silently missing every cell.
|
|
23
|
+
*
|
|
24
|
+
* For moving sources that should leave a trail, see {@link WakeFluidEffector}.
|
|
25
|
+
*/
|
|
26
|
+
export class ImpulseFluidEffector extends AbstractFluidEffector {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Position in world coordinates.
|
|
30
|
+
* @type {[number, number, number]}
|
|
31
|
+
*/
|
|
32
|
+
position = [0, 0, 0];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Acceleration vector in WORLD units per second squared. Per-step deposit is
|
|
36
|
+
* `world_to_grid · force × dt × falloff_weight`. Same world-units convention as
|
|
37
|
+
* {@link GlobalFluidEffector.force} — gravity stays gravity across fields with
|
|
38
|
+
* different `cell_size`.
|
|
39
|
+
* @type {[number, number, number]}
|
|
40
|
+
*/
|
|
41
|
+
force = [0, 0, 0];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Influence radius in WORLD units. Cells past `radius` from the splat point are
|
|
45
|
+
* unaffected by the falloff. Internally floored to 1 grid cell so sub-cell
|
|
46
|
+
* world-radii still hit cells (the alternative is silently dropping the splat
|
|
47
|
+
* at fractional positions — see class docstring).
|
|
48
|
+
* @type {number}
|
|
49
|
+
*/
|
|
50
|
+
radius = 1;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @param {FluidField} field
|
|
54
|
+
* @param {number} dt
|
|
55
|
+
* @param {Float32Array|number[]} world_to_grid Column-major 4×4 affine from world
|
|
56
|
+
* to the target field's grid space.
|
|
57
|
+
*/
|
|
58
|
+
apply(field, dt, world_to_grid) {
|
|
59
|
+
if (this.radius <= 0) {
|
|
60
|
+
// Explicit no-op so callers can disable per-frame without zeroing force.
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const wfx = this.force[0];
|
|
65
|
+
const wfy = this.force[1];
|
|
66
|
+
const wfz = this.force[2];
|
|
67
|
+
|
|
68
|
+
if (wfx === 0 && wfy === 0 && wfz === 0) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const m = world_to_grid;
|
|
73
|
+
|
|
74
|
+
// Direction-transform the world force into grid units, then scale by dt.
|
|
75
|
+
const fx = (m[0] * wfx + m[4] * wfy + m[8] * wfz) * dt;
|
|
76
|
+
const fy = (m[1] * wfx + m[5] * wfy + m[9] * wfz) * dt;
|
|
77
|
+
const fz = (m[2] * wfx + m[6] * wfy + m[10] * wfz) * dt;
|
|
78
|
+
|
|
79
|
+
// Point-transform position into grid coords.
|
|
80
|
+
v3_matrix4_multiply(scratch_grid_pos, 0, this.position, 0, world_to_grid);
|
|
81
|
+
const px = scratch_grid_pos[0];
|
|
82
|
+
const py = scratch_grid_pos[1];
|
|
83
|
+
const pz = scratch_grid_pos[2];
|
|
84
|
+
|
|
85
|
+
// World radius → grid radius via the uniform-scale factor (length of the
|
|
86
|
+
// matrix's first basis vector). For non-uniform scale this assumes the user
|
|
87
|
+
// is OK with the x-axis scale standing in for all three.
|
|
88
|
+
const scale = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);
|
|
89
|
+
// Internal min-radius clamp: see class docstring.
|
|
90
|
+
const r = Math.max(1, this.radius * scale);
|
|
91
|
+
|
|
92
|
+
const res = field.getResolution();
|
|
93
|
+
const res_x = res[0];
|
|
94
|
+
const res_y = res[1];
|
|
95
|
+
const res_z = res[2];
|
|
96
|
+
const slice_size = res_x * res_y;
|
|
97
|
+
|
|
98
|
+
const x_min = Math.max(0, Math.floor(px - r));
|
|
99
|
+
const x_max = Math.min(res_x - 1, Math.ceil(px + r));
|
|
100
|
+
const y_min = Math.max(0, Math.floor(py - r));
|
|
101
|
+
const y_max = Math.min(res_y - 1, Math.ceil(py + r));
|
|
102
|
+
const z_min = Math.max(0, Math.floor(pz - r));
|
|
103
|
+
const z_max = Math.min(res_z - 1, Math.ceil(pz + r));
|
|
104
|
+
|
|
105
|
+
if (x_min > x_max || y_min > y_max || z_min > z_max) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const r_inv = 1 / r;
|
|
110
|
+
|
|
111
|
+
const vx = field.velocity_x;
|
|
112
|
+
const vy = field.velocity_y;
|
|
113
|
+
const vz = field.velocity_z;
|
|
114
|
+
const solid = field.solid;
|
|
115
|
+
|
|
116
|
+
for (let z = z_min; z <= z_max; z++) {
|
|
117
|
+
const dz = z - pz;
|
|
118
|
+
const z_off = z * slice_size;
|
|
119
|
+
|
|
120
|
+
for (let y = y_min; y <= y_max; y++) {
|
|
121
|
+
const dy = y - py;
|
|
122
|
+
const y_off = y * res_x;
|
|
123
|
+
|
|
124
|
+
for (let x = x_min; x <= x_max; x++) {
|
|
125
|
+
const dx = x - px;
|
|
126
|
+
|
|
127
|
+
const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
128
|
+
const t = dist * r_inv;
|
|
129
|
+
if (t >= 1) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const w = (1 - t) * (1 - t);
|
|
133
|
+
|
|
134
|
+
const c = z_off + y_off + x;
|
|
135
|
+
if (solid[c] !== 0) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
vx[c] += fx * w;
|
|
140
|
+
vy[c] += fy * w;
|
|
141
|
+
vz[c] += fz * w;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Pull world-space position off the entity Transform.
|
|
149
|
+
* @param {Transform} transform
|
|
150
|
+
*/
|
|
151
|
+
syncFromTransform(transform) {
|
|
152
|
+
const p = transform.position;
|
|
153
|
+
this.position[0] = p.x;
|
|
154
|
+
this.position[1] = p.y;
|
|
155
|
+
this.position[2] = p.z;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @param {AbstractFluidEffector} other
|
|
160
|
+
* @return {boolean}
|
|
161
|
+
*/
|
|
162
|
+
equals(other) {
|
|
163
|
+
if (other === this) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
if (!(other instanceof ImpulseFluidEffector)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
return this.radius === other.radius
|
|
170
|
+
&& this.position[0] === other.position[0]
|
|
171
|
+
&& this.position[1] === other.position[1]
|
|
172
|
+
&& this.position[2] === other.position[2]
|
|
173
|
+
&& this.force[0] === other.force[0]
|
|
174
|
+
&& this.force[1] === other.force[1]
|
|
175
|
+
&& this.force[2] === other.force[2];
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @return {number}
|
|
180
|
+
*/
|
|
181
|
+
hash() {
|
|
182
|
+
return combine_hash(
|
|
183
|
+
computeHashFloat(this.position[0]),
|
|
184
|
+
computeHashFloat(this.position[1]),
|
|
185
|
+
computeHashFloat(this.position[2]),
|
|
186
|
+
computeHashFloat(this.force[0]),
|
|
187
|
+
computeHashFloat(this.force[1]),
|
|
188
|
+
computeHashFloat(this.force[2]),
|
|
189
|
+
computeHashFloat(this.radius)
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* World-space box around `position` expanded by `radius`. Uses the user-supplied
|
|
195
|
+
* radius (in world units), not the internal min-radius clamp — broad-phase rejects
|
|
196
|
+
* with the same precision the user expressed.
|
|
197
|
+
*
|
|
198
|
+
* @param {AABB3} out
|
|
199
|
+
*/
|
|
200
|
+
getBoundingBox(out) {
|
|
201
|
+
const r = this.radius;
|
|
202
|
+
const px = this.position[0];
|
|
203
|
+
const py = this.position[1];
|
|
204
|
+
const pz = this.position[2];
|
|
205
|
+
out.setBounds(
|
|
206
|
+
px - r, py - r, pz - r,
|
|
207
|
+
px + r, py + r, pz + r
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -1,7 +1,68 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Imparts momentum into the fluid along the swept path of a moving source — the wake
|
|
3
|
+
* left by an agent passing through air or water.
|
|
4
|
+
*
|
|
5
|
+
* Each call to {@link apply} treats the segment from {@link previous_position} to
|
|
6
|
+
* {@link position} (both in WORLD coordinates) as a swept tube. The matrix
|
|
7
|
+
* `world_to_grid` converts both endpoints into the target field's grid space, and the
|
|
8
|
+
* effector splats `(position - previous_position) / dt * strength` into every fluid
|
|
9
|
+
* cell within the kernel of that grid-space segment, weighted by a smooth
|
|
10
|
+
* `(1 - d/R)²` falloff. After the splat the effector copies `position` into
|
|
11
|
+
* `previous_position` so the next call automatically tracks the next segment.
|
|
12
|
+
*
|
|
13
|
+
* Works at any user-supplied {@link radius}, including sub-cell. The kernel is
|
|
14
|
+
* internally floored at `1` grid cell — small user radii (bullets, arrows) still
|
|
15
|
+
* produce a roughly 1-cell-wide tube instead of silently missing every cell. The
|
|
16
|
+
* intent: users supply radii in world units without thinking about cell size; the
|
|
17
|
+
* effector picks the smallest physically meaningful footprint when the converted
|
|
18
|
+
* radius is below one cell.
|
|
19
|
+
*
|
|
20
|
+
* When the entity carrying a {@link FluidEffectorsComponent} also has a Transform,
|
|
21
|
+
* {@link FluidSystem} calls {@link syncFromTransform} on this effector each step —
|
|
22
|
+
* which pulls the latest world-space position off the transform. On the very first
|
|
23
|
+
* sync `previous_position` is seeded equal to `position` to suppress the spurious
|
|
24
|
+
* wake from `[0, 0, 0]`.
|
|
25
|
+
*
|
|
26
|
+
* For sources you position manually (no Transform on the entity, or no entity at
|
|
27
|
+
* all), call {@link reset_trail} once after the initial placement and after any
|
|
28
|
+
* teleport so the next apply doesn't splat a wake across the jump.
|
|
3
29
|
*/
|
|
4
30
|
export class WakeFluidEffector extends AbstractFluidEffector {
|
|
31
|
+
/**
|
|
32
|
+
* Current world-space position of the source. Updated each step from the entity
|
|
33
|
+
* Transform (via {@link syncFromTransform}) when one is available, otherwise set
|
|
34
|
+
* by user code before each step.
|
|
35
|
+
* @type {[number, number, number]}
|
|
36
|
+
*/
|
|
37
|
+
position: [number, number, number];
|
|
38
|
+
/**
|
|
39
|
+
* Position at the start of the swept segment, world space. {@link apply} copies
|
|
40
|
+
* `position` into this at the end of every successful splat. Caller normally
|
|
41
|
+
* doesn't touch it directly.
|
|
42
|
+
* @type {[number, number, number]}
|
|
43
|
+
*/
|
|
44
|
+
previous_position: [number, number, number];
|
|
45
|
+
/**
|
|
46
|
+
* Influence radius of the swept tube, in WORLD units. Converted to grid units via
|
|
47
|
+
* the `world_to_grid` matrix's uniform scale, then internally floored to 1 grid
|
|
48
|
+
* cell so sub-cell world-radii still hit cells (see class docstring).
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
radius: number;
|
|
52
|
+
/**
|
|
53
|
+
* Multiplier on the imparted velocity. `1` means an on-segment cell takes the
|
|
54
|
+
* source's full grid-space velocity (before falloff weighting). `< 1` softens the
|
|
55
|
+
* wake; `> 1` exaggerates it.
|
|
56
|
+
* @type {number}
|
|
57
|
+
*/
|
|
58
|
+
strength: number;
|
|
59
|
+
/**
|
|
60
|
+
* Snap {@link previous_position} to {@link position}. Call once after manual
|
|
61
|
+
* initial placement, and after any teleport, so the next {@link apply} doesn't
|
|
62
|
+
* splat a wake across the jump.
|
|
63
|
+
*/
|
|
64
|
+
reset_trail(): void;
|
|
65
|
+
#private;
|
|
5
66
|
}
|
|
6
67
|
import { AbstractFluidEffector } from "./AbstractFluidEffector.js";
|
|
7
68
|
//# sourceMappingURL=WakeFluidEffector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WakeFluidEffector.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/fluid/effector/WakeFluidEffector.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WakeFluidEffector.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/physics/fluid/effector/WakeFluidEffector.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IAEI;;;;;OAKG;IACH,UAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEb;IAErB;;;;;OAKG;IACH,mBAFU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAEJ;IAE9B;;;;;OAKG;IACH,QAFU,MAAM,CAEL;IAEX;;;;;OAKG;IACH,UAFU,MAAM,CAEH;IASb;;;;OAIG;IACH,oBAKC;;CAqNJ;sCA1SqC,4BAA4B"}
|
|
@@ -1,8 +1,302 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { combine_hash } from "../../../../core/collection/array/combine_hash.js";
|
|
2
|
+
import { v3_matrix4_multiply } from "../../../../core/geom/vec3/v3_matrix4_multiply.js";
|
|
3
|
+
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
4
|
+
import { AbstractFluidEffector } from "./AbstractFluidEffector.js";
|
|
5
|
+
|
|
6
|
+
const scratch_a = new Float32Array(3);
|
|
7
|
+
const scratch_b = new Float32Array(3);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Imparts momentum into the fluid along the swept path of a moving source — the wake
|
|
11
|
+
* left by an agent passing through air or water.
|
|
12
|
+
*
|
|
13
|
+
* Each call to {@link apply} treats the segment from {@link previous_position} to
|
|
14
|
+
* {@link position} (both in WORLD coordinates) as a swept tube. The matrix
|
|
15
|
+
* `world_to_grid` converts both endpoints into the target field's grid space, and the
|
|
16
|
+
* effector splats `(position - previous_position) / dt * strength` into every fluid
|
|
17
|
+
* cell within the kernel of that grid-space segment, weighted by a smooth
|
|
18
|
+
* `(1 - d/R)²` falloff. After the splat the effector copies `position` into
|
|
19
|
+
* `previous_position` so the next call automatically tracks the next segment.
|
|
20
|
+
*
|
|
21
|
+
* Works at any user-supplied {@link radius}, including sub-cell. The kernel is
|
|
22
|
+
* internally floored at `1` grid cell — small user radii (bullets, arrows) still
|
|
23
|
+
* produce a roughly 1-cell-wide tube instead of silently missing every cell. The
|
|
24
|
+
* intent: users supply radii in world units without thinking about cell size; the
|
|
25
|
+
* effector picks the smallest physically meaningful footprint when the converted
|
|
26
|
+
* radius is below one cell.
|
|
27
|
+
*
|
|
28
|
+
* When the entity carrying a {@link FluidEffectorsComponent} also has a Transform,
|
|
29
|
+
* {@link FluidSystem} calls {@link syncFromTransform} on this effector each step —
|
|
30
|
+
* which pulls the latest world-space position off the transform. On the very first
|
|
31
|
+
* sync `previous_position` is seeded equal to `position` to suppress the spurious
|
|
32
|
+
* wake from `[0, 0, 0]`.
|
|
33
|
+
*
|
|
34
|
+
* For sources you position manually (no Transform on the entity, or no entity at
|
|
35
|
+
* all), call {@link reset_trail} once after the initial placement and after any
|
|
36
|
+
* teleport so the next apply doesn't splat a wake across the jump.
|
|
37
|
+
*/
|
|
38
|
+
export class WakeFluidEffector extends AbstractFluidEffector {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Current world-space position of the source. Updated each step from the entity
|
|
42
|
+
* Transform (via {@link syncFromTransform}) when one is available, otherwise set
|
|
43
|
+
* by user code before each step.
|
|
44
|
+
* @type {[number, number, number]}
|
|
45
|
+
*/
|
|
46
|
+
position = [0, 0, 0];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Position at the start of the swept segment, world space. {@link apply} copies
|
|
50
|
+
* `position` into this at the end of every successful splat. Caller normally
|
|
51
|
+
* doesn't touch it directly.
|
|
52
|
+
* @type {[number, number, number]}
|
|
53
|
+
*/
|
|
54
|
+
previous_position = [0, 0, 0];
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Influence radius of the swept tube, in WORLD units. Converted to grid units via
|
|
58
|
+
* the `world_to_grid` matrix's uniform scale, then internally floored to 1 grid
|
|
59
|
+
* cell so sub-cell world-radii still hit cells (see class docstring).
|
|
60
|
+
* @type {number}
|
|
61
|
+
*/
|
|
62
|
+
radius = 1;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Multiplier on the imparted velocity. `1` means an on-segment cell takes the
|
|
66
|
+
* source's full grid-space velocity (before falloff weighting). `< 1` softens the
|
|
67
|
+
* wake; `> 1` exaggerates it.
|
|
68
|
+
* @type {number}
|
|
69
|
+
*/
|
|
70
|
+
strength = 1;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* True once syncFromTransform has been called at least once. Used to seed
|
|
74
|
+
* previous_position on the first sync, avoiding a spurious wake from the origin.
|
|
75
|
+
* @type {boolean}
|
|
76
|
+
*/
|
|
77
|
+
#initialized = false;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Snap {@link previous_position} to {@link position}. Call once after manual
|
|
81
|
+
* initial placement, and after any teleport, so the next {@link apply} doesn't
|
|
82
|
+
* splat a wake across the jump.
|
|
83
|
+
*/
|
|
84
|
+
reset_trail() {
|
|
85
|
+
this.previous_position[0] = this.position[0];
|
|
86
|
+
this.previous_position[1] = this.position[1];
|
|
87
|
+
this.previous_position[2] = this.position[2];
|
|
88
|
+
this.#initialized = true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Pull world-space position off the entity Transform. On the first call, also
|
|
93
|
+
* seeds `previous_position` to suppress a wake-from-origin.
|
|
94
|
+
* @param {Transform} transform
|
|
95
|
+
*/
|
|
96
|
+
syncFromTransform(transform) {
|
|
97
|
+
const p = transform.position;
|
|
98
|
+
this.position[0] = p.x;
|
|
99
|
+
this.position[1] = p.y;
|
|
100
|
+
this.position[2] = p.z;
|
|
101
|
+
if (!this.#initialized) {
|
|
102
|
+
this.previous_position[0] = p.x;
|
|
103
|
+
this.previous_position[1] = p.y;
|
|
104
|
+
this.previous_position[2] = p.z;
|
|
105
|
+
this.#initialized = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {FluidField} field
|
|
111
|
+
* @param {number} dt
|
|
112
|
+
* @param {Float32Array|number[]} world_to_grid Column-major 4×4 affine from world
|
|
113
|
+
* to the target field's grid space.
|
|
114
|
+
*/
|
|
115
|
+
apply(field, dt, world_to_grid) {
|
|
116
|
+
if (dt <= 0 || this.strength === 0 || this.radius <= 0) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const m = world_to_grid;
|
|
121
|
+
|
|
122
|
+
// World radius → grid radius via uniform scale (length of the matrix's
|
|
123
|
+
// first basis vector). For axis-aligned uniform-scale matrices this is
|
|
124
|
+
// exactly 1/cell_size. Effective kernel is then floored to 1 grid cell so
|
|
125
|
+
// sub-cell radii still hit cells regardless of where the segment falls.
|
|
126
|
+
// `radius <= 0` is handled separately as a no-op so users can explicitly
|
|
127
|
+
// disable.
|
|
128
|
+
const scale = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);
|
|
129
|
+
const r = Math.max(1, this.radius * scale);
|
|
130
|
+
|
|
131
|
+
// Convert both segment endpoints into grid space.
|
|
132
|
+
v3_matrix4_multiply(scratch_a, 0, this.previous_position, 0, world_to_grid);
|
|
133
|
+
v3_matrix4_multiply(scratch_b, 0, this.position, 0, world_to_grid);
|
|
134
|
+
|
|
135
|
+
const ax = scratch_a[0];
|
|
136
|
+
const ay = scratch_a[1];
|
|
137
|
+
const az = scratch_a[2];
|
|
138
|
+
const bx = scratch_b[0];
|
|
139
|
+
const by = scratch_b[1];
|
|
140
|
+
const bz = scratch_b[2];
|
|
141
|
+
|
|
142
|
+
const seg_dx = bx - ax;
|
|
143
|
+
const seg_dy = by - ay;
|
|
144
|
+
const seg_dz = bz - az;
|
|
145
|
+
|
|
146
|
+
const seg_len_sq = seg_dx * seg_dx + seg_dy * seg_dy + seg_dz * seg_dz;
|
|
147
|
+
if (seg_len_sq === 0) {
|
|
148
|
+
// Source didn't move in grid space — no wake. previous_position is already
|
|
149
|
+
// equal to position (or maps to the same grid cell), leave it alone.
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Source velocity * strength = impulse per step (added directly to velocity).
|
|
154
|
+
const inv_dt = 1 / dt;
|
|
155
|
+
const impulse_x = seg_dx * inv_dt * this.strength;
|
|
156
|
+
const impulse_y = seg_dy * inv_dt * this.strength;
|
|
157
|
+
const impulse_z = seg_dz * inv_dt * this.strength;
|
|
158
|
+
|
|
159
|
+
const res = field.getResolution();
|
|
160
|
+
const res_x = res[0];
|
|
161
|
+
const res_y = res[1];
|
|
162
|
+
const res_z = res[2];
|
|
163
|
+
const slice_size = res_x * res_y;
|
|
164
|
+
|
|
165
|
+
// AABB of the swept tube, clipped to grid.
|
|
166
|
+
const x_min = Math.max(0, Math.floor(Math.min(ax, bx) - r));
|
|
167
|
+
const x_max = Math.min(res_x - 1, Math.ceil(Math.max(ax, bx) + r));
|
|
168
|
+
const y_min = Math.max(0, Math.floor(Math.min(ay, by) - r));
|
|
169
|
+
const y_max = Math.min(res_y - 1, Math.ceil(Math.max(ay, by) + r));
|
|
170
|
+
const z_min = Math.max(0, Math.floor(Math.min(az, bz) - r));
|
|
171
|
+
const z_max = Math.min(res_z - 1, Math.ceil(Math.max(az, bz) + r));
|
|
172
|
+
|
|
173
|
+
if (x_min > x_max || y_min > y_max || z_min > z_max) {
|
|
174
|
+
// Swept tube doesn't intersect the field at all.
|
|
175
|
+
this.#advance_trail();
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const vx = field.velocity_x;
|
|
180
|
+
const vy = field.velocity_y;
|
|
181
|
+
const vz = field.velocity_z;
|
|
182
|
+
const solid = field.solid;
|
|
183
|
+
|
|
184
|
+
const r_inv = 1 / r;
|
|
185
|
+
const inv_seg_len_sq = 1 / seg_len_sq;
|
|
186
|
+
|
|
187
|
+
for (let z = z_min; z <= z_max; z++) {
|
|
188
|
+
const z_off = z * slice_size;
|
|
189
|
+
const cell_dz = z - az;
|
|
190
|
+
|
|
191
|
+
for (let y = y_min; y <= y_max; y++) {
|
|
192
|
+
const y_off = y * res_x;
|
|
193
|
+
const cell_dy = y - ay;
|
|
194
|
+
|
|
195
|
+
for (let x = x_min; x <= x_max; x++) {
|
|
196
|
+
const cell_dx = x - ax;
|
|
197
|
+
|
|
198
|
+
// Project (cell - a) onto segment direction; clamp to [0, 1].
|
|
199
|
+
let t = (cell_dx * seg_dx + cell_dy * seg_dy + cell_dz * seg_dz) * inv_seg_len_sq;
|
|
200
|
+
if (t < 0) t = 0;
|
|
201
|
+
else if (t > 1) t = 1;
|
|
202
|
+
|
|
203
|
+
// Perpendicular offset from the closest point on the segment.
|
|
204
|
+
const ndx = cell_dx - t * seg_dx;
|
|
205
|
+
const ndy = cell_dy - t * seg_dy;
|
|
206
|
+
const ndz = cell_dz - t * seg_dz;
|
|
207
|
+
|
|
208
|
+
const dist = Math.sqrt(ndx * ndx + ndy * ndy + ndz * ndz);
|
|
209
|
+
const tt = dist * r_inv;
|
|
210
|
+
if (tt >= 1) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const w = (1 - tt) * (1 - tt);
|
|
215
|
+
|
|
216
|
+
const c = z_off + y_off + x;
|
|
217
|
+
if (solid[c] !== 0) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
vx[c] += impulse_x * w;
|
|
222
|
+
vy[c] += impulse_y * w;
|
|
223
|
+
vz[c] += impulse_z * w;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
this.#advance_trail();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Shift `previous_position` to `position` so the next apply() picks up where this
|
|
233
|
+
* one left off.
|
|
234
|
+
*/
|
|
235
|
+
#advance_trail() {
|
|
236
|
+
this.previous_position[0] = this.position[0];
|
|
237
|
+
this.previous_position[1] = this.position[1];
|
|
238
|
+
this.previous_position[2] = this.position[2];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @param {AbstractFluidEffector} other
|
|
243
|
+
* @return {boolean}
|
|
244
|
+
*/
|
|
245
|
+
equals(other) {
|
|
246
|
+
if (other === this) {
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
if (!(other instanceof WakeFluidEffector)) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
return this.radius === other.radius
|
|
253
|
+
&& this.strength === other.strength
|
|
254
|
+
&& this.position[0] === other.position[0]
|
|
255
|
+
&& this.position[1] === other.position[1]
|
|
256
|
+
&& this.position[2] === other.position[2]
|
|
257
|
+
&& this.previous_position[0] === other.previous_position[0]
|
|
258
|
+
&& this.previous_position[1] === other.previous_position[1]
|
|
259
|
+
&& this.previous_position[2] === other.previous_position[2];
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* @return {number}
|
|
264
|
+
*/
|
|
265
|
+
hash() {
|
|
266
|
+
return combine_hash(
|
|
267
|
+
computeHashFloat(this.position[0]),
|
|
268
|
+
computeHashFloat(this.position[1]),
|
|
269
|
+
computeHashFloat(this.position[2]),
|
|
270
|
+
computeHashFloat(this.previous_position[0]),
|
|
271
|
+
computeHashFloat(this.previous_position[1]),
|
|
272
|
+
computeHashFloat(this.previous_position[2]),
|
|
273
|
+
computeHashFloat(this.radius),
|
|
274
|
+
computeHashFloat(this.strength)
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* World-space AABB of the swept segment, grown by `radius` in each direction.
|
|
280
|
+
* Uses the user-supplied radius (in world units), not the internal min-radius
|
|
281
|
+
* clamp.
|
|
282
|
+
*
|
|
283
|
+
* @param {AABB3} out
|
|
284
|
+
*/
|
|
285
|
+
getBoundingBox(out) {
|
|
286
|
+
const r = this.radius;
|
|
287
|
+
const px = this.position[0];
|
|
288
|
+
const py = this.position[1];
|
|
289
|
+
const pz = this.position[2];
|
|
290
|
+
const ppx = this.previous_position[0];
|
|
291
|
+
const ppy = this.previous_position[1];
|
|
292
|
+
const ppz = this.previous_position[2];
|
|
293
|
+
out.setBounds(
|
|
294
|
+
Math.min(px, ppx) - r,
|
|
295
|
+
Math.min(py, ppy) - r,
|
|
296
|
+
Math.min(pz, ppz) - r,
|
|
297
|
+
Math.max(px, ppx) + r,
|
|
298
|
+
Math.max(py, ppy) + r,
|
|
299
|
+
Math.max(pz, ppz) + r
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|