@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
|
@@ -208,3 +208,15 @@ export class CapsuleShape3D extends AbstractShape3D {
|
|
|
208
208
|
return ((a << 5) - a + b) | 0;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Fast type-check marker, mirroring `UnitSphereShape3D.prototype.isUnitSphereShape3D`
|
|
214
|
+
* and `BoxShape3D.prototype.isBoxShape3D`. Lets the physics narrowphase
|
|
215
|
+
* dispatch capsule-sphere / capsule-capsule / capsule-box pairs to
|
|
216
|
+
* closed-form helpers (capsule = Minkowski sum of segment + sphere; all
|
|
217
|
+
* three reduce to point-or-segment distance queries that GJK+EPA struggles
|
|
218
|
+
* with on a smooth surface).
|
|
219
|
+
* @readonly
|
|
220
|
+
* @type {boolean}
|
|
221
|
+
*/
|
|
222
|
+
CapsuleShape3D.prototype.isCapsuleShape3D = true;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heightmap shape, intended primarily for terrain.
|
|
3
|
+
*
|
|
4
|
+
* The shape is a closed solid bounded below by the plane perpendicular to
|
|
5
|
+
* {@link orientation} (the "floor") and above by a height-field surface
|
|
6
|
+
* defined by a {@link Sampler2D}. Heights are sampled with Catmull-Rom
|
|
7
|
+
* filtering ({@link Sampler2D#sampleChannelCatmullRomUV}), matching what
|
|
8
|
+
* the terrain system uses for geometry construction.
|
|
9
|
+
*
|
|
10
|
+
* Local frame layout:
|
|
11
|
+
* - The orientation vector defines the local "up" axis (unit).
|
|
12
|
+
* - An orthonormal basis (u, v, n=orientation) is built from it.
|
|
13
|
+
* - Footprint extends along the basis-u axis over [-size.x/2, +size.x/2]
|
|
14
|
+
* and along the basis-v axis over [-size.z/2, +size.z/2].
|
|
15
|
+
* - The surface height (along orientation) at heightmap-UV (u01, v01) is
|
|
16
|
+
* `sampler.sampleChannelCatmullRomUV(u01, v01, 0)`.
|
|
17
|
+
* - The solid volume occupies `h ∈ [0, sampledHeight(u01, v01)]` along the
|
|
18
|
+
* orientation axis, with `0` being the floor at body-local origin.
|
|
19
|
+
* - `size.y` is the maximum height value of the heightfield (used for the
|
|
20
|
+
* bounding box). Sampler values are NOT clamped to it.
|
|
21
|
+
*
|
|
22
|
+
* NON-CONVEX. {@link support} throws — GJK/EPA cannot be run against a
|
|
23
|
+
* heightmap directly. The physics narrowphase must dispatch a dedicated
|
|
24
|
+
* grid-traversal path when one of the colliders is a heightmap.
|
|
25
|
+
*
|
|
26
|
+
* @author Alex Goldring
|
|
27
|
+
* @copyright Company Named Limited (c) 2026
|
|
28
|
+
*/
|
|
29
|
+
export class HeightMapShape3D extends AbstractShape3D {
|
|
30
|
+
/**
|
|
31
|
+
* Convenience constructor.
|
|
32
|
+
* @param {Sampler2D} sampler
|
|
33
|
+
* @param {number} size_x footprint extent along basis-u
|
|
34
|
+
* @param {number} size_y maximum heightmap height (along orientation)
|
|
35
|
+
* @param {number} size_z footprint extent along basis-v
|
|
36
|
+
* @param {Vector3} [orientation] defaults to +Y
|
|
37
|
+
* @returns {HeightMapShape3D}
|
|
38
|
+
*/
|
|
39
|
+
static from(sampler: Sampler2D, size_x: number, size_y: number, size_z: number, orientation?: Vector3): HeightMapShape3D;
|
|
40
|
+
/**
|
|
41
|
+
* Unit vector defining the local "up" axis (the direction the
|
|
42
|
+
* heightmap's surface faces). Default is +Y.
|
|
43
|
+
* @readonly
|
|
44
|
+
* @type {Vector3}
|
|
45
|
+
*/
|
|
46
|
+
readonly orientation: Vector3;
|
|
47
|
+
/**
|
|
48
|
+
* Bounding-box extents in the heightmap-local (u, height, v) frame.
|
|
49
|
+
* size.x — footprint extent along basis-u (perpendicular to orientation)
|
|
50
|
+
* size.y — maximum heightmap height (extent along orientation)
|
|
51
|
+
* size.z — footprint extent along basis-v (perpendicular to orientation)
|
|
52
|
+
* @readonly
|
|
53
|
+
* @type {Vector3}
|
|
54
|
+
*/
|
|
55
|
+
readonly size: Vector3;
|
|
56
|
+
/**
|
|
57
|
+
* Sampler holding height values. Float32 backing recommended so the
|
|
58
|
+
* Terrain system's height texture plugs in directly. Single-channel
|
|
59
|
+
* sampler is the common case; only channel 0 is read.
|
|
60
|
+
* @type {Sampler2D | null}
|
|
61
|
+
*/
|
|
62
|
+
sampler: Sampler2D | null;
|
|
63
|
+
/**
|
|
64
|
+
* Cached orthonormal basis [u_x,u_y,u_z, v_x,v_y,v_z, n_x,n_y,n_z]
|
|
65
|
+
* built from {@link orientation}. Updated lazily by {@link _ensure_basis}.
|
|
66
|
+
* @private
|
|
67
|
+
* @type {Float64Array}
|
|
68
|
+
*/
|
|
69
|
+
private _basis;
|
|
70
|
+
_basis_orientation_x: number;
|
|
71
|
+
_basis_orientation_y: number;
|
|
72
|
+
_basis_orientation_z: number;
|
|
73
|
+
/**
|
|
74
|
+
* Recompute the orthonormal basis (u, v, n) if {@link orientation} changed.
|
|
75
|
+
*
|
|
76
|
+
* Construction chosen so that the default orientation +Y produces the
|
|
77
|
+
* intuitive mapping `u = +X, v = +Z, n = +Y` — i.e. size.x runs along
|
|
78
|
+
* body X, size.z along body Z. We project body +X onto the plane
|
|
79
|
+
* perpendicular to n (the orientation), with a fall-back to projecting
|
|
80
|
+
* body +Z when n is too close to colinear with +X.
|
|
81
|
+
* @private
|
|
82
|
+
*/
|
|
83
|
+
private _ensure_basis;
|
|
84
|
+
/**
|
|
85
|
+
* Sample the surface height at heightmap UV coordinates.
|
|
86
|
+
* Uses Catmull-Rom filtering to match the terrain system's geometry construction.
|
|
87
|
+
* @param {number} u01 horizontal UV, in [0, 1]
|
|
88
|
+
* @param {number} v01 vertical UV, in [0, 1]
|
|
89
|
+
* @returns {number} height along orientation axis
|
|
90
|
+
*/
|
|
91
|
+
sample_height_at_uv(u01: number, v01: number): number;
|
|
92
|
+
/**
|
|
93
|
+
* Project a body-local position to the surface and sample the height there.
|
|
94
|
+
* The returned height is in the orientation-axis direction.
|
|
95
|
+
* Positions outside the footprint sample the clamped UV (sampler clamps).
|
|
96
|
+
* @param {number} px body-local x
|
|
97
|
+
* @param {number} py body-local y
|
|
98
|
+
* @param {number} pz body-local z
|
|
99
|
+
* @returns {number}
|
|
100
|
+
*/
|
|
101
|
+
sample_height_at_position(px: number, py: number, pz: number): number;
|
|
102
|
+
compute_bounding_box(result: any): void;
|
|
103
|
+
contains_point(point: any): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Approximate signed distance: difference between the point's height
|
|
106
|
+
* (along orientation) and the surface height sampled at the point's
|
|
107
|
+
* footprint UV. POSITIVE = above surface, NEGATIVE = below.
|
|
108
|
+
*
|
|
109
|
+
* Locally correct when the surface is flat; biased when the surface
|
|
110
|
+
* has significant slope. Sufficient for cling/raycast queries that
|
|
111
|
+
* walk down to the surface.
|
|
112
|
+
*/
|
|
113
|
+
signed_distance_at_point(point: any): number;
|
|
114
|
+
/**
|
|
115
|
+
* Project a reference point onto the surface along the orientation axis.
|
|
116
|
+
* The footprint UV is clamped, so points outside the footprint produce
|
|
117
|
+
* the nearest edge-of-footprint surface sample (approximate).
|
|
118
|
+
*/
|
|
119
|
+
nearest_point_on_surface(result: any, reference: any): void;
|
|
120
|
+
/**
|
|
121
|
+
* Heightmaps are non-convex; GJK/EPA cannot work against them directly.
|
|
122
|
+
* The physics narrowphase must dispatch a grid-traversal path that
|
|
123
|
+
* decomposes the heightmap into per-cell triangle pairs and tests each
|
|
124
|
+
* against the other shape (analogous to Bullet's btHeightfieldTerrainShape
|
|
125
|
+
* × btConcaveShape interface).
|
|
126
|
+
*
|
|
127
|
+
* This throws rather than returning a degenerate result so the call
|
|
128
|
+
* site is forced to handle heightmaps explicitly.
|
|
129
|
+
*/
|
|
130
|
+
support(result: any, result_offset: any, direction_x: any, direction_y: any, direction_z: any): void;
|
|
131
|
+
sample_random_point_in_volume(result: any, result_offset: any, random: any): void;
|
|
132
|
+
/**
|
|
133
|
+
* @param {HeightMapShape3D} other
|
|
134
|
+
* @returns {boolean}
|
|
135
|
+
*/
|
|
136
|
+
equals(other: HeightMapShape3D): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Fast type-check marker, matching the pattern on every other concrete
|
|
139
|
+
* AbstractShape3D subclass. The physics narrowphase reads this to dispatch
|
|
140
|
+
* the heightmap-vs-X grid-traversal path.
|
|
141
|
+
* @readonly
|
|
142
|
+
* @type {boolean}
|
|
143
|
+
*/
|
|
144
|
+
readonly isHeightMapShape3D: boolean;
|
|
145
|
+
}
|
|
146
|
+
import { AbstractShape3D } from "./AbstractShape3D.js";
|
|
147
|
+
import { Vector3 } from "../../Vector3.js";
|
|
148
|
+
//# sourceMappingURL=HeightMapShape3D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeightMapShape3D.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/shape/HeightMapShape3D.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH;IA4CI;;;;;;;;OAQG;IACH,wCANW,MAAM,UACN,MAAM,UACN,MAAM,gBACN,OAAO,GACL,gBAAgB,CAmB5B;IAlEG;;;;;OAKG;IACH,sBAFU,OAAO,CAEsB;IAEvC;;;;;;;OAOG;IACH,eAFU,OAAO,CAEe;IAEhC;;;;;OAKG;IACH,SAFU,YAAY,IAAI,CAEP;IAEnB;;;;;OAKG;IACH,eAAiC;IAGjC,6BAA+B;IAC/B,6BAA+B;IAC/B,6BAA+B;IA+BnC;;;;;;;;;OASG;IACH,sBA+CC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,8BALW,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAelB;IAED,wCA8BC;IAED,oCA2BC;IAED;;;;;;;;OAQG;IACH,6CAmBC;IAED;;;;OAIG;IACH,4DA2BC;IAED;;;;;;;;;OASG;IACH,qGAEC;IAED,kFAiBC;IA6CD;;;OAGG;IACH,cAHW,gBAAgB,GACd,OAAO,CAgBnB;IAcL;;;;;;OAMG;IACH,6BAFU,OAAO,CAE4B;CAT5C;gCA3a+B,sBAAsB;wBAD9B,kBAAkB"}
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { assert } from "../../../assert.js";
|
|
2
|
+
import { clamp } from "../../../math/clamp.js";
|
|
3
|
+
import { v3_length } from "../../vec3/v3_length.js";
|
|
4
|
+
import { Vector3 } from "../../Vector3.js";
|
|
5
|
+
import { AbstractShape3D } from "./AbstractShape3D.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Heightmap shape, intended primarily for terrain.
|
|
9
|
+
*
|
|
10
|
+
* The shape is a closed solid bounded below by the plane perpendicular to
|
|
11
|
+
* {@link orientation} (the "floor") and above by a height-field surface
|
|
12
|
+
* defined by a {@link Sampler2D}. Heights are sampled with Catmull-Rom
|
|
13
|
+
* filtering ({@link Sampler2D#sampleChannelCatmullRomUV}), matching what
|
|
14
|
+
* the terrain system uses for geometry construction.
|
|
15
|
+
*
|
|
16
|
+
* Local frame layout:
|
|
17
|
+
* - The orientation vector defines the local "up" axis (unit).
|
|
18
|
+
* - An orthonormal basis (u, v, n=orientation) is built from it.
|
|
19
|
+
* - Footprint extends along the basis-u axis over [-size.x/2, +size.x/2]
|
|
20
|
+
* and along the basis-v axis over [-size.z/2, +size.z/2].
|
|
21
|
+
* - The surface height (along orientation) at heightmap-UV (u01, v01) is
|
|
22
|
+
* `sampler.sampleChannelCatmullRomUV(u01, v01, 0)`.
|
|
23
|
+
* - The solid volume occupies `h ∈ [0, sampledHeight(u01, v01)]` along the
|
|
24
|
+
* orientation axis, with `0` being the floor at body-local origin.
|
|
25
|
+
* - `size.y` is the maximum height value of the heightfield (used for the
|
|
26
|
+
* bounding box). Sampler values are NOT clamped to it.
|
|
27
|
+
*
|
|
28
|
+
* NON-CONVEX. {@link support} throws — GJK/EPA cannot be run against a
|
|
29
|
+
* heightmap directly. The physics narrowphase must dispatch a dedicated
|
|
30
|
+
* grid-traversal path when one of the colliders is a heightmap.
|
|
31
|
+
*
|
|
32
|
+
* @author Alex Goldring
|
|
33
|
+
* @copyright Company Named Limited (c) 2026
|
|
34
|
+
*/
|
|
35
|
+
export class HeightMapShape3D extends AbstractShape3D {
|
|
36
|
+
constructor() {
|
|
37
|
+
super();
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Unit vector defining the local "up" axis (the direction the
|
|
41
|
+
* heightmap's surface faces). Default is +Y.
|
|
42
|
+
* @readonly
|
|
43
|
+
* @type {Vector3}
|
|
44
|
+
*/
|
|
45
|
+
this.orientation = new Vector3(0, 1, 0);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Bounding-box extents in the heightmap-local (u, height, v) frame.
|
|
49
|
+
* size.x — footprint extent along basis-u (perpendicular to orientation)
|
|
50
|
+
* size.y — maximum heightmap height (extent along orientation)
|
|
51
|
+
* size.z — footprint extent along basis-v (perpendicular to orientation)
|
|
52
|
+
* @readonly
|
|
53
|
+
* @type {Vector3}
|
|
54
|
+
*/
|
|
55
|
+
this.size = new Vector3(1, 1, 1);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Sampler holding height values. Float32 backing recommended so the
|
|
59
|
+
* Terrain system's height texture plugs in directly. Single-channel
|
|
60
|
+
* sampler is the common case; only channel 0 is read.
|
|
61
|
+
* @type {Sampler2D | null}
|
|
62
|
+
*/
|
|
63
|
+
this.sampler = null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Cached orthonormal basis [u_x,u_y,u_z, v_x,v_y,v_z, n_x,n_y,n_z]
|
|
67
|
+
* built from {@link orientation}. Updated lazily by {@link _ensure_basis}.
|
|
68
|
+
* @private
|
|
69
|
+
* @type {Float64Array}
|
|
70
|
+
*/
|
|
71
|
+
this._basis = new Float64Array(9);
|
|
72
|
+
|
|
73
|
+
// last-seen orientation components, used to detect dirty basis
|
|
74
|
+
this._basis_orientation_x = NaN;
|
|
75
|
+
this._basis_orientation_y = NaN;
|
|
76
|
+
this._basis_orientation_z = NaN;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Convenience constructor.
|
|
81
|
+
* @param {Sampler2D} sampler
|
|
82
|
+
* @param {number} size_x footprint extent along basis-u
|
|
83
|
+
* @param {number} size_y maximum heightmap height (along orientation)
|
|
84
|
+
* @param {number} size_z footprint extent along basis-v
|
|
85
|
+
* @param {Vector3} [orientation] defaults to +Y
|
|
86
|
+
* @returns {HeightMapShape3D}
|
|
87
|
+
*/
|
|
88
|
+
static from(sampler, size_x, size_y, size_z, orientation) {
|
|
89
|
+
assert.isNumber(size_x, "size_x");
|
|
90
|
+
assert.isNumber(size_y, "size_y");
|
|
91
|
+
assert.isNumber(size_z, "size_z");
|
|
92
|
+
assert.greaterThanOrEqual(size_x, 0, "size_x");
|
|
93
|
+
assert.greaterThanOrEqual(size_y, 0, "size_y");
|
|
94
|
+
assert.greaterThanOrEqual(size_z, 0, "size_z");
|
|
95
|
+
|
|
96
|
+
const r = new HeightMapShape3D();
|
|
97
|
+
r.sampler = sampler;
|
|
98
|
+
r.size.set(size_x, size_y, size_z);
|
|
99
|
+
|
|
100
|
+
if (orientation !== undefined) {
|
|
101
|
+
r.orientation.set(orientation.x, orientation.y, orientation.z);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return r;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Recompute the orthonormal basis (u, v, n) if {@link orientation} changed.
|
|
109
|
+
*
|
|
110
|
+
* Construction chosen so that the default orientation +Y produces the
|
|
111
|
+
* intuitive mapping `u = +X, v = +Z, n = +Y` — i.e. size.x runs along
|
|
112
|
+
* body X, size.z along body Z. We project body +X onto the plane
|
|
113
|
+
* perpendicular to n (the orientation), with a fall-back to projecting
|
|
114
|
+
* body +Z when n is too close to colinear with +X.
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
_ensure_basis() {
|
|
118
|
+
const nx = this.orientation[0];
|
|
119
|
+
const ny = this.orientation[1];
|
|
120
|
+
const nz = this.orientation[2];
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
nx === this._basis_orientation_x
|
|
124
|
+
&& ny === this._basis_orientation_y
|
|
125
|
+
&& nz === this._basis_orientation_z
|
|
126
|
+
) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// tangent u = normalize(project body +X onto plane perpendicular to n)
|
|
131
|
+
// fall back to body +Z if n is too colinear with +X
|
|
132
|
+
let u_x, u_y, u_z;
|
|
133
|
+
|
|
134
|
+
if (Math.abs(nx) < 0.9) {
|
|
135
|
+
// u = (+X) - (n . +X) * n = (1 - nx*nx, -nx*ny, -nx*nz)
|
|
136
|
+
u_x = 1 - nx * nx;
|
|
137
|
+
u_y = -nx * ny;
|
|
138
|
+
u_z = -nx * nz;
|
|
139
|
+
} else {
|
|
140
|
+
// u = (+Z) - (n . +Z) * n = (-nz*nx, -nz*ny, 1 - nz*nz)
|
|
141
|
+
u_x = -nz * nx;
|
|
142
|
+
u_y = -nz * ny;
|
|
143
|
+
u_z = 1 - nz * nz;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const u_inv = 1 / v3_length(u_x, u_y, u_z);
|
|
147
|
+
u_x *= u_inv;
|
|
148
|
+
u_y *= u_inv;
|
|
149
|
+
u_z *= u_inv;
|
|
150
|
+
|
|
151
|
+
// v = u × n (for n=+Y, u=+X this gives v=+Z, the intuitive choice)
|
|
152
|
+
const v_x = u_y * nz - u_z * ny;
|
|
153
|
+
const v_y = u_z * nx - u_x * nz;
|
|
154
|
+
const v_z = u_x * ny - u_y * nx;
|
|
155
|
+
|
|
156
|
+
const b = this._basis;
|
|
157
|
+
b[0] = u_x; b[1] = u_y; b[2] = u_z;
|
|
158
|
+
b[3] = v_x; b[4] = v_y; b[5] = v_z;
|
|
159
|
+
b[6] = nx; b[7] = ny; b[8] = nz;
|
|
160
|
+
|
|
161
|
+
this._basis_orientation_x = nx;
|
|
162
|
+
this._basis_orientation_y = ny;
|
|
163
|
+
this._basis_orientation_z = nz;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Sample the surface height at heightmap UV coordinates.
|
|
168
|
+
* Uses Catmull-Rom filtering to match the terrain system's geometry construction.
|
|
169
|
+
* @param {number} u01 horizontal UV, in [0, 1]
|
|
170
|
+
* @param {number} v01 vertical UV, in [0, 1]
|
|
171
|
+
* @returns {number} height along orientation axis
|
|
172
|
+
*/
|
|
173
|
+
sample_height_at_uv(u01, v01) {
|
|
174
|
+
return this.sampler.sampleChannelCatmullRomUV(u01, v01, 0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Project a body-local position to the surface and sample the height there.
|
|
179
|
+
* The returned height is in the orientation-axis direction.
|
|
180
|
+
* Positions outside the footprint sample the clamped UV (sampler clamps).
|
|
181
|
+
* @param {number} px body-local x
|
|
182
|
+
* @param {number} py body-local y
|
|
183
|
+
* @param {number} pz body-local z
|
|
184
|
+
* @returns {number}
|
|
185
|
+
*/
|
|
186
|
+
sample_height_at_position(px, py, pz) {
|
|
187
|
+
this._ensure_basis();
|
|
188
|
+
|
|
189
|
+
const b = this._basis;
|
|
190
|
+
|
|
191
|
+
// project onto basis u and basis v
|
|
192
|
+
const u_coord = b[0] * px + b[1] * py + b[2] * pz;
|
|
193
|
+
const v_coord = b[3] * px + b[4] * py + b[5] * pz;
|
|
194
|
+
|
|
195
|
+
const u01 = u_coord / this.size[0] + 0.5;
|
|
196
|
+
const v01 = v_coord / this.size[2] + 0.5;
|
|
197
|
+
|
|
198
|
+
return this.sample_height_at_uv(u01, v01);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
compute_bounding_box(result) {
|
|
202
|
+
this._ensure_basis();
|
|
203
|
+
|
|
204
|
+
const b = this._basis;
|
|
205
|
+
|
|
206
|
+
const sx = this.size[0];
|
|
207
|
+
const sy = this.size[1];
|
|
208
|
+
const sz = this.size[2];
|
|
209
|
+
|
|
210
|
+
const half_u = sx * 0.5;
|
|
211
|
+
const half_v = sz * 0.5;
|
|
212
|
+
|
|
213
|
+
// For each body axis k (0=x, 1=y, 2=z):
|
|
214
|
+
// body[k] = b[0+k]*u + b[3+k]*v + b[6+k]*h
|
|
215
|
+
//
|
|
216
|
+
// The (u,v) footprint contribution is symmetric (u ∈ [-half_u, +half_u], v ∈ [-half_v, +half_v])
|
|
217
|
+
// The height contribution is asymmetric (h ∈ [0, sy])
|
|
218
|
+
for (let k = 0; k < 3; k++) {
|
|
219
|
+
const cu = b[k];
|
|
220
|
+
const cv = b[3 + k];
|
|
221
|
+
const ch = b[6 + k];
|
|
222
|
+
|
|
223
|
+
const uv_extent = Math.abs(cu) * half_u + Math.abs(cv) * half_v;
|
|
224
|
+
|
|
225
|
+
const h_lo = ch < 0 ? ch * sy : 0;
|
|
226
|
+
const h_hi = ch > 0 ? ch * sy : 0;
|
|
227
|
+
|
|
228
|
+
result[k] = -uv_extent + h_lo;
|
|
229
|
+
result[k + 3] = uv_extent + h_hi;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
contains_point(point) {
|
|
234
|
+
const px = point[0];
|
|
235
|
+
const py = point[1];
|
|
236
|
+
const pz = point[2];
|
|
237
|
+
|
|
238
|
+
this._ensure_basis();
|
|
239
|
+
|
|
240
|
+
const b = this._basis;
|
|
241
|
+
|
|
242
|
+
// project into heightmap-local frame (u, v, h)
|
|
243
|
+
const u_coord = b[0] * px + b[1] * py + b[2] * pz;
|
|
244
|
+
const v_coord = b[3] * px + b[4] * py + b[5] * pz;
|
|
245
|
+
const h_coord = b[6] * px + b[7] * py + b[8] * pz;
|
|
246
|
+
|
|
247
|
+
const half_u = this.size[0] * 0.5;
|
|
248
|
+
const half_v = this.size[2] * 0.5;
|
|
249
|
+
|
|
250
|
+
if (u_coord <= -half_u || u_coord >= half_u) return false;
|
|
251
|
+
if (v_coord <= -half_v || v_coord >= half_v) return false;
|
|
252
|
+
if (h_coord <= 0 || h_coord >= this.size[1]) return false;
|
|
253
|
+
|
|
254
|
+
const u01 = u_coord / this.size[0] + 0.5;
|
|
255
|
+
const v01 = v_coord / this.size[2] + 0.5;
|
|
256
|
+
|
|
257
|
+
const surface_h = this.sample_height_at_uv(u01, v01);
|
|
258
|
+
|
|
259
|
+
return h_coord < surface_h;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Approximate signed distance: difference between the point's height
|
|
264
|
+
* (along orientation) and the surface height sampled at the point's
|
|
265
|
+
* footprint UV. POSITIVE = above surface, NEGATIVE = below.
|
|
266
|
+
*
|
|
267
|
+
* Locally correct when the surface is flat; biased when the surface
|
|
268
|
+
* has significant slope. Sufficient for cling/raycast queries that
|
|
269
|
+
* walk down to the surface.
|
|
270
|
+
*/
|
|
271
|
+
signed_distance_at_point(point) {
|
|
272
|
+
const px = point[0];
|
|
273
|
+
const py = point[1];
|
|
274
|
+
const pz = point[2];
|
|
275
|
+
|
|
276
|
+
this._ensure_basis();
|
|
277
|
+
|
|
278
|
+
const b = this._basis;
|
|
279
|
+
|
|
280
|
+
const u_coord = b[0] * px + b[1] * py + b[2] * pz;
|
|
281
|
+
const v_coord = b[3] * px + b[4] * py + b[5] * pz;
|
|
282
|
+
const h_coord = b[6] * px + b[7] * py + b[8] * pz;
|
|
283
|
+
|
|
284
|
+
const u01 = u_coord / this.size[0] + 0.5;
|
|
285
|
+
const v01 = v_coord / this.size[2] + 0.5;
|
|
286
|
+
|
|
287
|
+
const surface_h = this.sample_height_at_uv(u01, v01);
|
|
288
|
+
|
|
289
|
+
return h_coord - surface_h;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Project a reference point onto the surface along the orientation axis.
|
|
294
|
+
* The footprint UV is clamped, so points outside the footprint produce
|
|
295
|
+
* the nearest edge-of-footprint surface sample (approximate).
|
|
296
|
+
*/
|
|
297
|
+
nearest_point_on_surface(result, reference) {
|
|
298
|
+
const rx = reference[0];
|
|
299
|
+
const ry = reference[1];
|
|
300
|
+
const rz = reference[2];
|
|
301
|
+
|
|
302
|
+
this._ensure_basis();
|
|
303
|
+
|
|
304
|
+
const b = this._basis;
|
|
305
|
+
|
|
306
|
+
const u_coord = b[0] * rx + b[1] * ry + b[2] * rz;
|
|
307
|
+
const v_coord = b[3] * rx + b[4] * ry + b[5] * rz;
|
|
308
|
+
|
|
309
|
+
const half_u = this.size[0] * 0.5;
|
|
310
|
+
const half_v = this.size[2] * 0.5;
|
|
311
|
+
|
|
312
|
+
const u_clamped = clamp(u_coord, -half_u, half_u);
|
|
313
|
+
const v_clamped = clamp(v_coord, -half_v, half_v);
|
|
314
|
+
|
|
315
|
+
const u01 = u_clamped / this.size[0] + 0.5;
|
|
316
|
+
const v01 = v_clamped / this.size[2] + 0.5;
|
|
317
|
+
|
|
318
|
+
const surface_h = this.sample_height_at_uv(u01, v01);
|
|
319
|
+
|
|
320
|
+
// compose body-local point: u_axis*u_clamped + v_axis*v_clamped + n_axis*surface_h
|
|
321
|
+
result[0] = b[0] * u_clamped + b[3] * v_clamped + b[6] * surface_h;
|
|
322
|
+
result[1] = b[1] * u_clamped + b[4] * v_clamped + b[7] * surface_h;
|
|
323
|
+
result[2] = b[2] * u_clamped + b[5] * v_clamped + b[8] * surface_h;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Heightmaps are non-convex; GJK/EPA cannot work against them directly.
|
|
328
|
+
* The physics narrowphase must dispatch a grid-traversal path that
|
|
329
|
+
* decomposes the heightmap into per-cell triangle pairs and tests each
|
|
330
|
+
* against the other shape (analogous to Bullet's btHeightfieldTerrainShape
|
|
331
|
+
* × btConcaveShape interface).
|
|
332
|
+
*
|
|
333
|
+
* This throws rather than returning a degenerate result so the call
|
|
334
|
+
* site is forced to handle heightmaps explicitly.
|
|
335
|
+
*/
|
|
336
|
+
support(result, result_offset, direction_x, direction_y, direction_z) {
|
|
337
|
+
throw new Error("HeightMapShape3D.support: heightmaps are non-convex; the narrowphase must dispatch grid-traversal instead.");
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
sample_random_point_in_volume(result, result_offset, random) {
|
|
341
|
+
const u01 = random();
|
|
342
|
+
const v01 = random();
|
|
343
|
+
|
|
344
|
+
const u_coord = (u01 - 0.5) * this.size[0];
|
|
345
|
+
const v_coord = (v01 - 0.5) * this.size[2];
|
|
346
|
+
|
|
347
|
+
const surface_h = this.sample_height_at_uv(u01, v01);
|
|
348
|
+
const h_coord = random() * surface_h;
|
|
349
|
+
|
|
350
|
+
this._ensure_basis();
|
|
351
|
+
|
|
352
|
+
const b = this._basis;
|
|
353
|
+
|
|
354
|
+
result[result_offset] = b[0] * u_coord + b[3] * v_coord + b[6] * h_coord;
|
|
355
|
+
result[result_offset + 1] = b[1] * u_coord + b[4] * v_coord + b[7] * h_coord;
|
|
356
|
+
result[result_offset + 2] = b[2] * u_coord + b[5] * v_coord + b[8] * h_coord;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Sum of sampler heights × per-cell footprint area. This is the
|
|
361
|
+
* piecewise-constant approximation of the integral ∫h(u,v) dA over
|
|
362
|
+
* the footprint — exact when h is constant per cell, biased when
|
|
363
|
+
* h is smooth.
|
|
364
|
+
*/
|
|
365
|
+
get volume() {
|
|
366
|
+
const sampler = this.sampler;
|
|
367
|
+
|
|
368
|
+
if (sampler === null) {
|
|
369
|
+
return 0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const w = sampler.width;
|
|
373
|
+
const h = sampler.height;
|
|
374
|
+
|
|
375
|
+
if (w === 0 || h === 0) {
|
|
376
|
+
return 0;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const cell_area = (this.size[0] / w) * (this.size[2] / h);
|
|
380
|
+
|
|
381
|
+
let total = 0;
|
|
382
|
+
|
|
383
|
+
for (let y = 0; y < h; y++) {
|
|
384
|
+
for (let x = 0; x < w; x++) {
|
|
385
|
+
total += sampler.readChannel(x, y, 0);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
return total * cell_area;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Returns just the footprint area. A true heightmap surface area
|
|
394
|
+
* requires integrating sqrt(1 + (∂h/∂u)² + (∂h/∂v)²) over the grid;
|
|
395
|
+
* the footprint area is a lower bound and is sufficient for the
|
|
396
|
+
* physics inertia-tensor seam (heightmaps are static anyway).
|
|
397
|
+
*/
|
|
398
|
+
get surface_area() {
|
|
399
|
+
return this.size[0] * this.size[2];
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @param {HeightMapShape3D} other
|
|
404
|
+
* @returns {boolean}
|
|
405
|
+
*/
|
|
406
|
+
equals(other) {
|
|
407
|
+
if (!super.equals(other)) return false;
|
|
408
|
+
|
|
409
|
+
if (!this.orientation.equals(other.orientation)) return false;
|
|
410
|
+
if (!this.size.equals(other.size)) return false;
|
|
411
|
+
|
|
412
|
+
// strict identity is enough for sampler equality in the common case;
|
|
413
|
+
// fall through to value equality so two shapes built from independent
|
|
414
|
+
// but identical sampler instances still compare equal
|
|
415
|
+
if (this.sampler === other.sampler) return true;
|
|
416
|
+
|
|
417
|
+
if (this.sampler === null || other.sampler === null) return false;
|
|
418
|
+
|
|
419
|
+
return this.sampler.equals(other.sampler);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
hash() {
|
|
423
|
+
const a = this.orientation.hash();
|
|
424
|
+
const b = this.size.hash();
|
|
425
|
+
const c = this.sampler !== null ? this.sampler.hash() : 0;
|
|
426
|
+
|
|
427
|
+
let h = (a * 31 + b) | 0;
|
|
428
|
+
h = (h * 31 + c) | 0;
|
|
429
|
+
|
|
430
|
+
return h;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Fast type-check marker, matching the pattern on every other concrete
|
|
436
|
+
* AbstractShape3D subclass. The physics narrowphase reads this to dispatch
|
|
437
|
+
* the heightmap-vs-X grid-traversal path.
|
|
438
|
+
* @readonly
|
|
439
|
+
* @type {boolean}
|
|
440
|
+
*/
|
|
441
|
+
HeightMapShape3D.prototype.isHeightMapShape3D = true;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Heightmaps are non-convex: the solid volume bounded by an arbitrary
|
|
445
|
+
* height-field has valleys and overhangs that break GJK's convex-Minkowski
|
|
446
|
+
* precondition. The narrowphase must use grid traversal + per-triangle
|
|
447
|
+
* GJK instead of feeding this shape's {@link support} into pair tests.
|
|
448
|
+
* @readonly
|
|
449
|
+
* @type {boolean}
|
|
450
|
+
*/
|
|
451
|
+
HeightMapShape3D.prototype.is_convex = false;
|