@woosh/meep-engine 2.138.20 → 2.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/collection/PairUint32Map.d.ts +100 -0
- package/src/core/collection/PairUint32Map.d.ts.map +1 -0
- package/src/core/collection/PairUint32Map.js +321 -0
- package/src/core/collection/Uint32Map.d.ts +119 -0
- package/src/core/collection/Uint32Map.d.ts.map +1 -0
- package/src/core/collection/Uint32Map.js +345 -0
- package/src/core/collection/array/array_shuffle.d.ts +10 -3
- package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
- package/src/core/collection/array/array_shuffle.js +27 -22
- package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
- package/src/core/collection/heap/FibonacciHeap.js +586 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -1
- package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
- package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
- package/src/core/collection/heap/Uint32Heap4.js +490 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
- package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
- package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +673 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +365 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +31 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +112 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +22 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +55 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +49 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
- package/src/core/graph/csr/CSRGraph.d.ts +168 -0
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
- package/src/core/graph/csr/CSRGraph.js +319 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
- package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
- package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
- package/src/core/graph/metis/metis.d.ts +19 -0
- package/src/core/graph/metis/metis.d.ts.map +1 -1
- package/src/core/graph/metis/metis.js +20 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
- package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
- package/src/core/graph/metis/metis_cluster_bs.js +11 -0
- package/src/core/graph/metis/metis_options.d.ts +17 -2
- package/src/core/graph/metis/metis_options.d.ts.map +1 -1
- package/src/core/graph/metis/metis_options.js +17 -2
- package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
- package/src/core/graph/metis/native/MetisGraph.js +212 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
- package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
- package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
- package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
- package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
- package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
- package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
- package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
- package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/project_kway.js +43 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
- package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
- package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
- package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
- package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
- package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
- package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
- package/src/engine/EngineHarness.d.ts +3 -1
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +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 +102 -9
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +38 -3
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +533 -4
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +315 -6
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +220 -22
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +858 -241
- package/src/engine/control/first-person/TODO.md +127 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
- package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Ability.js +119 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Mantle.js +188 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/Slide.js +158 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallJump.js +131 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
- package/src/engine/control/first-person/abilities/WallRun.js +180 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
- package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
- package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
- package/src/engine/control/first-person/math/Spring.d.ts +56 -0
- package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
- package/src/engine/control/first-person/math/Spring.js +71 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
- package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
- package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
- package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
- package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
- package/src/engine/control/first-person/prototype_first_person_controller.js +550 -119
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
- package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
- package/src/engine/control/first-person/test/buildTestPlayer.js +28 -0
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.js +27 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
- package/src/engine/physics/PLAN.md +236 -0
- package/src/engine/physics/body/BodyStorage.d.ts +187 -0
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
- package/src/engine/physics/body/BodyStorage.js +427 -0
- package/src/engine/physics/broadphase/PairList.d.ts +62 -0
- package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
- package/src/engine/physics/broadphase/PairList.js +97 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts +30 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +1 -0
- package/src/engine/physics/broadphase/aabb_transform_oriented.js +93 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
- package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
- package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
- package/src/engine/physics/broadphase/generate_pairs.js +101 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts +226 -0
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
- package/src/engine/physics/contact/ManifoldStore.js +499 -0
- package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
- package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
- package/src/engine/physics/ecs/BodyKind.js +24 -0
- package/src/engine/physics/ecs/Collider.d.ts +98 -0
- package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
- package/src/engine/physics/ecs/Collider.js +136 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
- package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderFlags.js +15 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
- package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +520 -0
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
- package/src/engine/physics/ecs/PhysicsSystem.js +1159 -0
- package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
- package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBody.js +240 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
- package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
- package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
- package/src/engine/physics/ecs/SleepState.d.ts +11 -0
- package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
- package/src/engine/physics/ecs/SleepState.js +12 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
- package/src/engine/physics/events/ContactEventBuffer.js +83 -0
- package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
- package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
- package/src/engine/physics/events/diff_manifolds.js +50 -0
- package/src/engine/physics/fluid/FluidField.d.ts +294 -16
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +510 -66
- package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +455 -95
- package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
- package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
- package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
- package/src/engine/physics/fluid/prototype.js +102 -91
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts +20 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +83 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +26 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
- package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +70 -0
- package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
- package/src/engine/physics/gjk/expanding_polytope_algorithm.js +8 -10
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts +29 -0
- package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
- package/src/engine/physics/inertia/world_inverse_inertia.js +79 -0
- package/src/engine/physics/integration/integrate_position.d.ts +16 -0
- package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_position.js +48 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts +25 -0
- package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
- package/src/engine/physics/integration/integrate_velocity.js +79 -0
- package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
- package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
- package/src/engine/physics/integration/quat_integrate.js +62 -0
- package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
- package/src/engine/physics/island/IslandBuilder.js +411 -0
- package/src/engine/physics/island/union_find.d.ts +51 -0
- package/src/engine/physics/island/union_find.d.ts.map +1 -0
- package/src/engine/physics/island/union_find.js +76 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts +59 -0
- package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/PosedShape.js +110 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/box_box_manifold.js +543 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
- package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/capsule_contacts.js +508 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts +11 -0
- package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/narrowphase_step.js +382 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_box_contact.js +130 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
- package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
- package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
- package/src/engine/physics/queries/raycast.d.ts +20 -0
- package/src/engine/physics/queries/raycast.d.ts.map +1 -0
- package/src/engine/physics/queries/raycast.js +249 -0
- package/src/engine/physics/solver/friction_cone.d.ts +16 -0
- package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
- package/src/engine/physics/solver/friction_cone.js +37 -0
- package/src/engine/physics/solver/solve_contacts.d.ts +36 -0
- package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
- package/src/engine/physics/solver/solve_contacts.js +598 -0
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
- package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
- package/src/engine/ecs/components/Motion.d.ts +0 -21
- package/src/engine/ecs/components/Motion.d.ts.map +0 -1
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
- package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
- package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
- package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
- package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
- package/src/engine/ecs/systems/MotionSystem.js +0 -29
- package/src/engine/physics/fluid/Fluid.d.ts +0 -26
- package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
- package/src/engine/physics/fluid/Fluid.js +0 -221
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
- package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MasterySet.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/mastery/MasterySet.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAEQ;;;OAGG;IACH,YAFU,kBAAkB,CAER;IAEpB;;;;OAIG;IACH,OAFU,YAAY,CAES;IAGnC;;;;OAIG;IACH,uCAEC;IAED;;;OAGG;IACH,0CAGC;IAED;;;;;;;;;OASG;IACH,wBALW,MAAM,kCAGJ,MAAM,CAclB;IAED;;;OAGG;IACH,SAFW,MAAM,QAIhB;CACJ;6BArF4B,mBAAmB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MasteryScore } from "./MasteryScore.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Aggregates {@link MasteryEvaluator} instances and exposes a single
|
|
5
|
+
* `evaluate(decisionPoint, ...)` entry point that composes all evaluators
|
|
6
|
+
* for that point multiplicatively.
|
|
7
|
+
*
|
|
8
|
+
* Identity behaviour: with zero evaluators registered, every query returns
|
|
9
|
+
* `1.0`, leaving the base controller behaviour untouched. This is the
|
|
10
|
+
* default state — mastery is opt-in.
|
|
11
|
+
*
|
|
12
|
+
* Composition: contributions multiply, NOT sum. So a +10% and a +5% give
|
|
13
|
+
* +15.5% (1.10 × 1.05 = 1.155). And a +10% with a −5% gives +4.5% (1.10
|
|
14
|
+
* × 0.95 = 1.045). Mistiming partially offsets bonuses from other
|
|
15
|
+
* evaluators — exactly what we want for honest "your timing matters
|
|
16
|
+
* everywhere" feel.
|
|
17
|
+
*
|
|
18
|
+
* @author Alex Goldring
|
|
19
|
+
* @copyright Company Named Limited (c) 2026
|
|
20
|
+
*/
|
|
21
|
+
export class MasterySet {
|
|
22
|
+
constructor() {
|
|
23
|
+
/**
|
|
24
|
+
* Registered evaluators, in insertion order.
|
|
25
|
+
* @type {MasteryEvaluator[]}
|
|
26
|
+
*/
|
|
27
|
+
this.evaluators = [];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Telemetry EMA. The controller doesn't consume it; downstream
|
|
31
|
+
* systems read it for player-facing mastery feedback.
|
|
32
|
+
* @type {MasteryScore}
|
|
33
|
+
*/
|
|
34
|
+
this.score = new MasteryScore();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Add an evaluator. Order does not affect the final result
|
|
39
|
+
* (multiplication is commutative).
|
|
40
|
+
* @param {MasteryEvaluator} evaluator
|
|
41
|
+
*/
|
|
42
|
+
add(evaluator) {
|
|
43
|
+
this.evaluators.push(evaluator);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Remove an evaluator if present.
|
|
48
|
+
* @param {MasteryEvaluator} evaluator
|
|
49
|
+
*/
|
|
50
|
+
remove(evaluator) {
|
|
51
|
+
const i = this.evaluators.indexOf(evaluator);
|
|
52
|
+
if (i !== -1) this.evaluators.splice(i, 1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Compose all registered evaluators against `decisionPoint`. Each
|
|
57
|
+
* evaluator's contribution is recorded into the score for telemetry,
|
|
58
|
+
* then multiplied into the running product.
|
|
59
|
+
*
|
|
60
|
+
* @param {number} decisionPoint
|
|
61
|
+
* @param {*} controller
|
|
62
|
+
* @param {*} runtime
|
|
63
|
+
* @returns {number} composed multiplier; 1.0 if no evaluators care
|
|
64
|
+
*/
|
|
65
|
+
evaluate(decisionPoint, controller, runtime) {
|
|
66
|
+
let product = 1.0;
|
|
67
|
+
const n = this.evaluators.length;
|
|
68
|
+
for (let i = 0; i < n; i++) {
|
|
69
|
+
const v = this.evaluators[i].evaluate(decisionPoint, controller, runtime);
|
|
70
|
+
// Defensive: ignore evaluators returning non-finite or non-positive
|
|
71
|
+
// values (would corrupt downstream math). Treat as identity.
|
|
72
|
+
if (!Number.isFinite(v) || v <= 0) continue;
|
|
73
|
+
product *= v;
|
|
74
|
+
this.score.record(decisionPoint, v);
|
|
75
|
+
}
|
|
76
|
+
return product;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Advance the score's time-based decay. Call once per fixed step.
|
|
81
|
+
* @param {number} dt
|
|
82
|
+
*/
|
|
83
|
+
tick(dt) {
|
|
84
|
+
this.score.decay(dt);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default symmetric stride-timing curve for slide entry. Peaks at the
|
|
3
|
+
* midstance phases (≈0.25 R-mid, ≈0.75 L-mid) — committing to the slide
|
|
4
|
+
* at midstance lets you convert your push-off momentum into the slide's
|
|
5
|
+
* forward velocity cleanly. Troughs near footfall transitions (≈0, ≈0.5)
|
|
6
|
+
* where the leg's loading-response decelerates the body and a slide
|
|
7
|
+
* commitment loses energy to the foot-ground transition.
|
|
8
|
+
*
|
|
9
|
+
* Designed shape: smaller range than the jump curve. Slide is a forgiving
|
|
10
|
+
* mechanic — the bonus is at most ~+6%, the penalty at most ~−3%. Both
|
|
11
|
+
* are well below the JumpImpulse curve's swing (peak +12%, trough −4%)
|
|
12
|
+
* because slide timing is harder to feel deliberately than jump timing.
|
|
13
|
+
*
|
|
14
|
+
* @returns {AnimationCurve}
|
|
15
|
+
*/
|
|
16
|
+
export function makeDefaultSlideInitiationTimingCurve(): AnimationCurve;
|
|
17
|
+
/**
|
|
18
|
+
* Mastery evaluator: slide-entry velocity preservation scales with
|
|
19
|
+
* stride-phase timing at the moment of crouch-press. Committing at
|
|
20
|
+
* midstance lets the body convert push-off momentum directly into the
|
|
21
|
+
* slide's launch velocity. Committing at footfall means the leg is
|
|
22
|
+
* absorbing the body's downward momentum just as the slide starts, and
|
|
23
|
+
* the transition loses energy.
|
|
24
|
+
*
|
|
25
|
+
* Physically motivated: real-world athletes diving into a slide at the
|
|
26
|
+
* right gait moment land flatter and keep more momentum than at the
|
|
27
|
+
* wrong one. The range is tight (≈±5%) because slide is a forgiving
|
|
28
|
+
* action — the design rule "slide is forgiving — small skill ceiling"
|
|
29
|
+
* (DESIGN_EXTENSIONS Phase 7).
|
|
30
|
+
*
|
|
31
|
+
* Symmetry: behaves on both sides (bonus and penalty), asymmetric in
|
|
32
|
+
* magnitude (bonus larger). Bonus side is the design's "reward the
|
|
33
|
+
* timing" half; penalty side discourages mashing crouch arbitrarily.
|
|
34
|
+
*
|
|
35
|
+
* @author Alex Goldring
|
|
36
|
+
* @copyright Company Named Limited (c) 2026
|
|
37
|
+
*/
|
|
38
|
+
export class SlideInitiationTimingEvaluator extends MasteryEvaluator {
|
|
39
|
+
/**
|
|
40
|
+
* Curve mapping stridePhase ∈ [0..1) → multiplier on the slide-
|
|
41
|
+
* entry velocity preservation. Symmetric in behaviour, asymmetric
|
|
42
|
+
* in magnitude (peak farther from 1.0 than trough).
|
|
43
|
+
* @type {AnimationCurve}
|
|
44
|
+
*/
|
|
45
|
+
curve: AnimationCurve;
|
|
46
|
+
/**
|
|
47
|
+
* Exponent applied to (curve − 1.0) to scale overall response.
|
|
48
|
+
* Convention shared with {@link StrideTimingJumpEvaluator}:
|
|
49
|
+
* tune deviation, not curve directly, so symmetry around 1.0 is
|
|
50
|
+
* preserved.
|
|
51
|
+
* @type {number}
|
|
52
|
+
*/
|
|
53
|
+
flatBoost: number;
|
|
54
|
+
evaluate(decisionPoint: any, controller: any, _runtime: any): number;
|
|
55
|
+
}
|
|
56
|
+
import { AnimationCurve } from "../../../animation/curve/AnimationCurve.js";
|
|
57
|
+
import { MasteryEvaluator } from "./MasteryEvaluator.js";
|
|
58
|
+
//# sourceMappingURL=SlideInitiationTimingEvaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlideInitiationTimingEvaluator.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,yDAFa,cAAc,CAS1B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAKQ;;;;;OAKG;IACH,OAFU,cAAc,CAE4B;IAEpD;;;;;;OAMG;IACH,WAFU,MAAM,CAEI;IAGxB,qEAQC;CACJ;+BAlF8B,4CAA4C;iCAG1C,uBAAuB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AnimationCurve } from "../../../animation/curve/AnimationCurve.js";
|
|
2
|
+
import { Keyframe } from "../../../animation/curve/Keyframe.js";
|
|
3
|
+
import { DecisionPoint } from "./DecisionPoint.js";
|
|
4
|
+
import { MasteryEvaluator } from "./MasteryEvaluator.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default symmetric stride-timing curve for slide entry. Peaks at the
|
|
8
|
+
* midstance phases (≈0.25 R-mid, ≈0.75 L-mid) — committing to the slide
|
|
9
|
+
* at midstance lets you convert your push-off momentum into the slide's
|
|
10
|
+
* forward velocity cleanly. Troughs near footfall transitions (≈0, ≈0.5)
|
|
11
|
+
* where the leg's loading-response decelerates the body and a slide
|
|
12
|
+
* commitment loses energy to the foot-ground transition.
|
|
13
|
+
*
|
|
14
|
+
* Designed shape: smaller range than the jump curve. Slide is a forgiving
|
|
15
|
+
* mechanic — the bonus is at most ~+6%, the penalty at most ~−3%. Both
|
|
16
|
+
* are well below the JumpImpulse curve's swing (peak +12%, trough −4%)
|
|
17
|
+
* because slide timing is harder to feel deliberately than jump timing.
|
|
18
|
+
*
|
|
19
|
+
* @returns {AnimationCurve}
|
|
20
|
+
*/
|
|
21
|
+
export function makeDefaultSlideInitiationTimingCurve() {
|
|
22
|
+
return AnimationCurve.from([
|
|
23
|
+
Keyframe.from(0.00, 0.97), // R-foot footfall — slight penalty
|
|
24
|
+
Keyframe.from(0.25, 1.06), // R-foot midstance — peak commitment
|
|
25
|
+
Keyframe.from(0.50, 0.97), // L-foot footfall — slight penalty
|
|
26
|
+
Keyframe.from(0.75, 1.06), // L-foot midstance — peak commitment
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Mastery evaluator: slide-entry velocity preservation scales with
|
|
32
|
+
* stride-phase timing at the moment of crouch-press. Committing at
|
|
33
|
+
* midstance lets the body convert push-off momentum directly into the
|
|
34
|
+
* slide's launch velocity. Committing at footfall means the leg is
|
|
35
|
+
* absorbing the body's downward momentum just as the slide starts, and
|
|
36
|
+
* the transition loses energy.
|
|
37
|
+
*
|
|
38
|
+
* Physically motivated: real-world athletes diving into a slide at the
|
|
39
|
+
* right gait moment land flatter and keep more momentum than at the
|
|
40
|
+
* wrong one. The range is tight (≈±5%) because slide is a forgiving
|
|
41
|
+
* action — the design rule "slide is forgiving — small skill ceiling"
|
|
42
|
+
* (DESIGN_EXTENSIONS Phase 7).
|
|
43
|
+
*
|
|
44
|
+
* Symmetry: behaves on both sides (bonus and penalty), asymmetric in
|
|
45
|
+
* magnitude (bonus larger). Bonus side is the design's "reward the
|
|
46
|
+
* timing" half; penalty side discourages mashing crouch arbitrarily.
|
|
47
|
+
*
|
|
48
|
+
* @author Alex Goldring
|
|
49
|
+
* @copyright Company Named Limited (c) 2026
|
|
50
|
+
*/
|
|
51
|
+
export class SlideInitiationTimingEvaluator extends MasteryEvaluator {
|
|
52
|
+
constructor() {
|
|
53
|
+
super();
|
|
54
|
+
this.name = "SlideInitiationTiming";
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Curve mapping stridePhase ∈ [0..1) → multiplier on the slide-
|
|
58
|
+
* entry velocity preservation. Symmetric in behaviour, asymmetric
|
|
59
|
+
* in magnitude (peak farther from 1.0 than trough).
|
|
60
|
+
* @type {AnimationCurve}
|
|
61
|
+
*/
|
|
62
|
+
this.curve = makeDefaultSlideInitiationTimingCurve();
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Exponent applied to (curve − 1.0) to scale overall response.
|
|
66
|
+
* Convention shared with {@link StrideTimingJumpEvaluator}:
|
|
67
|
+
* tune deviation, not curve directly, so symmetry around 1.0 is
|
|
68
|
+
* preserved.
|
|
69
|
+
* @type {number}
|
|
70
|
+
*/
|
|
71
|
+
this.flatBoost = 1.0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
evaluate(decisionPoint, controller, _runtime) {
|
|
75
|
+
if (decisionPoint !== DecisionPoint.SlideEntryVelocity) return 1.0;
|
|
76
|
+
|
|
77
|
+
const phase = controller.state.stridePhase;
|
|
78
|
+
const raw = this.curve.evaluate(phase);
|
|
79
|
+
|
|
80
|
+
// Scale the deviation around 1.0 by flatBoost so symmetry holds.
|
|
81
|
+
return 1.0 + (raw - 1.0) * this.flatBoost;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default symmetric stride-timing curve for the jump-impulse decision
|
|
3
|
+
* point. Peaks at the midstance phases (≈0.25 R-mid, ≈0.75 L-mid) and
|
|
4
|
+
* troughs near the footfall transitions (≈0, ≈0.5).
|
|
5
|
+
*
|
|
6
|
+
* Curve is asymmetric in magnitude per the project rule: bonus side is
|
|
7
|
+
* larger than penalty side. Default peak = +12%, default trough = −4%.
|
|
8
|
+
* The curve is keyed at the four phase critical points; the engine's
|
|
9
|
+
* tangent-interpolation gives smooth motion between them.
|
|
10
|
+
*
|
|
11
|
+
* @returns {AnimationCurve}
|
|
12
|
+
*/
|
|
13
|
+
export function makeDefaultStrideTimingJumpCurve(): AnimationCurve;
|
|
14
|
+
/**
|
|
15
|
+
* Mastery evaluator: jump impulse magnitude scales with stride-phase
|
|
16
|
+
* timing. Pressing jump at midstance (legs straight, body high in the
|
|
17
|
+
* gait cycle, push-off power available) gives a small bonus. Pressing
|
|
18
|
+
* during loading response (just after foot strike, body's downward
|
|
19
|
+
* momentum still being absorbed) gives a small penalty.
|
|
20
|
+
*
|
|
21
|
+
* Physically motivated: real athletes get more vertical from a jump
|
|
22
|
+
* timed to ankle/knee extension than from one timed to the loading phase
|
|
23
|
+
* of the gait cycle. The bonus is small (~12% peak) because real
|
|
24
|
+
* difference is also small — this is mastery, not exploit-power.
|
|
25
|
+
*
|
|
26
|
+
* Optional foot-asymmetry: if the player has a configured
|
|
27
|
+
* `dominantFoot`, that foot's midstance peak is slightly higher
|
|
28
|
+
* (representing the natural handedness asymmetry — right-dominant
|
|
29
|
+
* humans push slightly harder off the right leg). Off by default.
|
|
30
|
+
*
|
|
31
|
+
* @author Alex Goldring
|
|
32
|
+
* @copyright Company Named Limited (c) 2026
|
|
33
|
+
*/
|
|
34
|
+
export class StrideTimingJumpEvaluator extends MasteryEvaluator {
|
|
35
|
+
/**
|
|
36
|
+
* Curve mapping stridePhase ∈ [0..1) → multiplier. Authored to be
|
|
37
|
+
* symmetric in *behaviour* (bonus and penalty regions both
|
|
38
|
+
* present) and asymmetric in *magnitude* (peak > 1 + ε; trough <
|
|
39
|
+
* 1 − ε, with bonus larger than penalty).
|
|
40
|
+
* @type {AnimationCurve}
|
|
41
|
+
*/
|
|
42
|
+
curve: AnimationCurve;
|
|
43
|
+
/**
|
|
44
|
+
* Exponent applied to (curve − 1.0). Scales the OVERALL response
|
|
45
|
+
* magnitude without re-authoring the curve. Default 1.0 = use
|
|
46
|
+
* curve as authored. 0.5 = halve all effects. 1.5 = 50% larger.
|
|
47
|
+
* Convention: scale the deviation, not the curve directly, so
|
|
48
|
+
* the symmetry around 1.0 is preserved.
|
|
49
|
+
* @type {number}
|
|
50
|
+
*/
|
|
51
|
+
flatBoost: number;
|
|
52
|
+
/**
|
|
53
|
+
* Optional foot-asymmetry: extra bonus when the dominant foot is
|
|
54
|
+
* the standing one at jump time. Set to "R" or "L" to enable.
|
|
55
|
+
* `null` (default) = no asymmetry.
|
|
56
|
+
* @type {"R"|"L"|null}
|
|
57
|
+
*/
|
|
58
|
+
dominantFoot: "R" | "L" | null;
|
|
59
|
+
/**
|
|
60
|
+
* Magnitude of the foot-asymmetry contribution (additive to the
|
|
61
|
+
* multiplier). Default 0.03 = up to +3% on dominant-foot jumps.
|
|
62
|
+
* @type {number}
|
|
63
|
+
*/
|
|
64
|
+
dominantFootBonus: number;
|
|
65
|
+
evaluate(decisionPoint: any, controller: any, runtime: any): number;
|
|
66
|
+
}
|
|
67
|
+
import { AnimationCurve } from "../../../animation/curve/AnimationCurve.js";
|
|
68
|
+
import { MasteryEvaluator } from "./MasteryEvaluator.js";
|
|
69
|
+
//# sourceMappingURL=StrideTimingJumpEvaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StrideTimingJumpEvaluator.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,oDAFa,cAAc,CAS1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAKQ;;;;;;OAMG;IACH,OAFU,cAAc,CAEuB;IAE/C;;;;;;;OAOG;IACH,WAFU,MAAM,CAEI;IAEpB;;;;;OAKG;IACH,cAFU,GAAG,GAAC,GAAG,GAAC,IAAI,CAEE;IAExB;;;;OAIG;IACH,mBAFU,MAAM,CAEa;IAGjC,oEAqBC;CACJ;+BA5G8B,4CAA4C;iCAG1C,uBAAuB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AnimationCurve } from "../../../animation/curve/AnimationCurve.js";
|
|
2
|
+
import { Keyframe } from "../../../animation/curve/Keyframe.js";
|
|
3
|
+
import { DecisionPoint } from "./DecisionPoint.js";
|
|
4
|
+
import { MasteryEvaluator } from "./MasteryEvaluator.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default symmetric stride-timing curve for the jump-impulse decision
|
|
8
|
+
* point. Peaks at the midstance phases (≈0.25 R-mid, ≈0.75 L-mid) and
|
|
9
|
+
* troughs near the footfall transitions (≈0, ≈0.5).
|
|
10
|
+
*
|
|
11
|
+
* Curve is asymmetric in magnitude per the project rule: bonus side is
|
|
12
|
+
* larger than penalty side. Default peak = +12%, default trough = −4%.
|
|
13
|
+
* The curve is keyed at the four phase critical points; the engine's
|
|
14
|
+
* tangent-interpolation gives smooth motion between them.
|
|
15
|
+
*
|
|
16
|
+
* @returns {AnimationCurve}
|
|
17
|
+
*/
|
|
18
|
+
export function makeDefaultStrideTimingJumpCurve() {
|
|
19
|
+
return AnimationCurve.from([
|
|
20
|
+
Keyframe.from(0.00, 0.96), // R-foot footfall — slight penalty (just touched down)
|
|
21
|
+
Keyframe.from(0.25, 1.12), // R-foot midstance — peak push-off power
|
|
22
|
+
Keyframe.from(0.50, 0.96), // L-foot footfall — slight penalty
|
|
23
|
+
Keyframe.from(0.75, 1.12), // L-foot midstance — peak push-off power
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Mastery evaluator: jump impulse magnitude scales with stride-phase
|
|
29
|
+
* timing. Pressing jump at midstance (legs straight, body high in the
|
|
30
|
+
* gait cycle, push-off power available) gives a small bonus. Pressing
|
|
31
|
+
* during loading response (just after foot strike, body's downward
|
|
32
|
+
* momentum still being absorbed) gives a small penalty.
|
|
33
|
+
*
|
|
34
|
+
* Physically motivated: real athletes get more vertical from a jump
|
|
35
|
+
* timed to ankle/knee extension than from one timed to the loading phase
|
|
36
|
+
* of the gait cycle. The bonus is small (~12% peak) because real
|
|
37
|
+
* difference is also small — this is mastery, not exploit-power.
|
|
38
|
+
*
|
|
39
|
+
* Optional foot-asymmetry: if the player has a configured
|
|
40
|
+
* `dominantFoot`, that foot's midstance peak is slightly higher
|
|
41
|
+
* (representing the natural handedness asymmetry — right-dominant
|
|
42
|
+
* humans push slightly harder off the right leg). Off by default.
|
|
43
|
+
*
|
|
44
|
+
* @author Alex Goldring
|
|
45
|
+
* @copyright Company Named Limited (c) 2026
|
|
46
|
+
*/
|
|
47
|
+
export class StrideTimingJumpEvaluator extends MasteryEvaluator {
|
|
48
|
+
constructor() {
|
|
49
|
+
super();
|
|
50
|
+
this.name = "StrideTimingJump";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Curve mapping stridePhase ∈ [0..1) → multiplier. Authored to be
|
|
54
|
+
* symmetric in *behaviour* (bonus and penalty regions both
|
|
55
|
+
* present) and asymmetric in *magnitude* (peak > 1 + ε; trough <
|
|
56
|
+
* 1 − ε, with bonus larger than penalty).
|
|
57
|
+
* @type {AnimationCurve}
|
|
58
|
+
*/
|
|
59
|
+
this.curve = makeDefaultStrideTimingJumpCurve();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Exponent applied to (curve − 1.0). Scales the OVERALL response
|
|
63
|
+
* magnitude without re-authoring the curve. Default 1.0 = use
|
|
64
|
+
* curve as authored. 0.5 = halve all effects. 1.5 = 50% larger.
|
|
65
|
+
* Convention: scale the deviation, not the curve directly, so
|
|
66
|
+
* the symmetry around 1.0 is preserved.
|
|
67
|
+
* @type {number}
|
|
68
|
+
*/
|
|
69
|
+
this.flatBoost = 1.0;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Optional foot-asymmetry: extra bonus when the dominant foot is
|
|
73
|
+
* the standing one at jump time. Set to "R" or "L" to enable.
|
|
74
|
+
* `null` (default) = no asymmetry.
|
|
75
|
+
* @type {"R"|"L"|null}
|
|
76
|
+
*/
|
|
77
|
+
this.dominantFoot = null;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Magnitude of the foot-asymmetry contribution (additive to the
|
|
81
|
+
* multiplier). Default 0.03 = up to +3% on dominant-foot jumps.
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
this.dominantFootBonus = 0.03;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
evaluate(decisionPoint, controller, runtime) {
|
|
88
|
+
if (decisionPoint !== DecisionPoint.JumpImpulse) return 1.0;
|
|
89
|
+
|
|
90
|
+
const phase = controller.state.stridePhase;
|
|
91
|
+
const raw = this.curve.evaluate(phase);
|
|
92
|
+
|
|
93
|
+
// Scale the deviation around 1.0 by flatBoost so symmetry holds:
|
|
94
|
+
// raw < 1 stays < 1, raw > 1 stays > 1, magnitude scales linearly.
|
|
95
|
+
let multiplier = 1.0 + (raw - 1.0) * this.flatBoost;
|
|
96
|
+
|
|
97
|
+
// Foot-asymmetry bonus only adds in the BONUS region (raw > 1),
|
|
98
|
+
// never amplifies the penalty. Keeps "favouring your dominant
|
|
99
|
+
// foot" as a strictly-additive nicety rather than a tax on the
|
|
100
|
+
// off-foot.
|
|
101
|
+
if (this.dominantFoot !== null
|
|
102
|
+
&& runtime.standingFoot === this.dominantFoot
|
|
103
|
+
&& raw > 1.0) {
|
|
104
|
+
multiplier *= 1.0 + this.dominantFootBonus;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return multiplier;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Damped spring with a value and velocity. Half-life parameterized.
|
|
3
|
+
*
|
|
4
|
+
* Convention: zeta = 1.0 is critically damped (no overshoot, fastest settle).
|
|
5
|
+
* zeta < 1.0 under-damps (oscillation/ringing, useful for impact bounces).
|
|
6
|
+
* zeta > 1.0 over-damps (slow approach, rarely useful in this engine).
|
|
7
|
+
*
|
|
8
|
+
* Use kick() to inject a velocity impulse (e.g. footfall impact, gunfire
|
|
9
|
+
* recoil, knockback). Use stepTo() each fixed update to advance the
|
|
10
|
+
* simulation toward a target value.
|
|
11
|
+
*
|
|
12
|
+
* @author Alex Goldring
|
|
13
|
+
* @copyright Company Named Limited (c) 2026
|
|
14
|
+
*/
|
|
15
|
+
export class Spring {
|
|
16
|
+
/**
|
|
17
|
+
* @param {number} [value] initial value
|
|
18
|
+
* @param {number} [velocity] initial velocity
|
|
19
|
+
*/
|
|
20
|
+
constructor(value?: number, velocity?: number);
|
|
21
|
+
value: number;
|
|
22
|
+
velocity: number;
|
|
23
|
+
/**
|
|
24
|
+
* Advance the spring toward `target`. Same half-life form used by the
|
|
25
|
+
* pre-existing dampedSpringStep / criticallyDampedSpringStep helpers.
|
|
26
|
+
*
|
|
27
|
+
* @param {number} target target value
|
|
28
|
+
* @param {number} halfLife seconds for the envelope to halve (smaller → snappier)
|
|
29
|
+
* @param {number} zeta damping ratio (1=critical, <1=ring, >1=sluggish)
|
|
30
|
+
* @param {number} dt
|
|
31
|
+
*/
|
|
32
|
+
stepTo(target: number, halfLife: number, zeta: number, dt: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Inject a velocity impulse. Use for one-shot events that should result
|
|
35
|
+
* in an immediate "snap" (footfall down-kick, recoil push, blow-back).
|
|
36
|
+
*
|
|
37
|
+
* @param {number} impulse velocity to add
|
|
38
|
+
*/
|
|
39
|
+
kick(impulse: number): void;
|
|
40
|
+
/**
|
|
41
|
+
* Instantaneously place the spring at a value with zero velocity. Use
|
|
42
|
+
* when initializing or hard-resetting (e.g. teleport).
|
|
43
|
+
*
|
|
44
|
+
* @param {number} [value]
|
|
45
|
+
*/
|
|
46
|
+
settle(value?: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* Displace value while preserving velocity. Used for "land here, then
|
|
49
|
+
* decay" — see landing recovery where we want the impact dip displaced
|
|
50
|
+
* but the velocity to ride out from there.
|
|
51
|
+
*
|
|
52
|
+
* @param {number} value
|
|
53
|
+
*/
|
|
54
|
+
setValue(value: number): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=Spring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spring.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/Spring.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH;IACI;;;OAGG;IACH,oBAHW,MAAM,aACN,MAAM,EAKhB;IAFG,cAAkB;IAClB,iBAAwB;IAG5B;;;;;;;;OAQG;IACH,eALW,MAAM,YACN,MAAM,QACN,MAAM,MACN,MAAM,QAIhB;IAED;;;;;OAKG;IACH,cAFW,MAAM,QAIhB;IAED;;;;;OAKG;IACH,eAFW,MAAM,QAKhB;IAED;;;;;;OAMG;IACH,gBAFW,MAAM,QAIhB;CACJ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { dampedSpringStep } from "./dampedSpringStep.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Damped spring with a value and velocity. Half-life parameterized.
|
|
5
|
+
*
|
|
6
|
+
* Convention: zeta = 1.0 is critically damped (no overshoot, fastest settle).
|
|
7
|
+
* zeta < 1.0 under-damps (oscillation/ringing, useful for impact bounces).
|
|
8
|
+
* zeta > 1.0 over-damps (slow approach, rarely useful in this engine).
|
|
9
|
+
*
|
|
10
|
+
* Use kick() to inject a velocity impulse (e.g. footfall impact, gunfire
|
|
11
|
+
* recoil, knockback). Use stepTo() each fixed update to advance the
|
|
12
|
+
* simulation toward a target value.
|
|
13
|
+
*
|
|
14
|
+
* @author Alex Goldring
|
|
15
|
+
* @copyright Company Named Limited (c) 2026
|
|
16
|
+
*/
|
|
17
|
+
export class Spring {
|
|
18
|
+
/**
|
|
19
|
+
* @param {number} [value] initial value
|
|
20
|
+
* @param {number} [velocity] initial velocity
|
|
21
|
+
*/
|
|
22
|
+
constructor(value = 0, velocity = 0) {
|
|
23
|
+
this.value = value;
|
|
24
|
+
this.velocity = velocity;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Advance the spring toward `target`. Same half-life form used by the
|
|
29
|
+
* pre-existing dampedSpringStep / criticallyDampedSpringStep helpers.
|
|
30
|
+
*
|
|
31
|
+
* @param {number} target target value
|
|
32
|
+
* @param {number} halfLife seconds for the envelope to halve (smaller → snappier)
|
|
33
|
+
* @param {number} zeta damping ratio (1=critical, <1=ring, >1=sluggish)
|
|
34
|
+
* @param {number} dt
|
|
35
|
+
*/
|
|
36
|
+
stepTo(target, halfLife, zeta, dt) {
|
|
37
|
+
dampedSpringStep(this, target, halfLife, zeta, dt);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Inject a velocity impulse. Use for one-shot events that should result
|
|
42
|
+
* in an immediate "snap" (footfall down-kick, recoil push, blow-back).
|
|
43
|
+
*
|
|
44
|
+
* @param {number} impulse velocity to add
|
|
45
|
+
*/
|
|
46
|
+
kick(impulse) {
|
|
47
|
+
this.velocity += impulse;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Instantaneously place the spring at a value with zero velocity. Use
|
|
52
|
+
* when initializing or hard-resetting (e.g. teleport).
|
|
53
|
+
*
|
|
54
|
+
* @param {number} [value]
|
|
55
|
+
*/
|
|
56
|
+
settle(value = 0) {
|
|
57
|
+
this.value = value;
|
|
58
|
+
this.velocity = 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Displace value while preserving velocity. Used for "land here, then
|
|
63
|
+
* decay" — see landing recovery where we want the impact dip displaced
|
|
64
|
+
* but the velocity to ride out from there.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} value
|
|
67
|
+
*/
|
|
68
|
+
setValue(value) {
|
|
69
|
+
this.value = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locomotor-respiratory coupling — compute the breath-rate target by
|
|
3
|
+
* blending the metabolic-demand rate with a stride-aligned sub-multiple.
|
|
4
|
+
*
|
|
5
|
+
* Empirical basis: in steady-state running, breath naturally locks to a
|
|
6
|
+
* sub-multiple of stride (2:1, 3:1, 4:1 depending on speed — see Bramble &
|
|
7
|
+
* Carrier 1983, Bernasconi & Kohl 1993). In *dynamic* activity (varied
|
|
8
|
+
* terrain, sports, untrained) the coupling is much weaker and the breath
|
|
9
|
+
* rate is dictated mostly by metabolic demand.
|
|
10
|
+
*
|
|
11
|
+
* We blend the two: at low exertion (or below the strideFreq threshold)
|
|
12
|
+
* the output is purely metabolic. At high exertion AND active gait, the
|
|
13
|
+
* output is pulled toward the integer-ratio aligned rate. This is
|
|
14
|
+
* FREQUENCY-only coupling — no phase lock — so the breath "rides" the
|
|
15
|
+
* gait without being constrained to it, matching loose dynamic-activity
|
|
16
|
+
* coupling rather than tight steady-state coupling.
|
|
17
|
+
*
|
|
18
|
+
* @param {number} metabolicRate the rate driven by exertion alone (Hz)
|
|
19
|
+
* @param {number} strideFreqHz current stride frequency (Hz, 0 if not striding)
|
|
20
|
+
* @param {number} exertion in [0..1]
|
|
21
|
+
* @param {number} couplingMax coupling strength at exertion=1
|
|
22
|
+
* @param {number} minStrideFreqHz coupling does not engage below this
|
|
23
|
+
* @returns {number} target breath rate (Hz)
|
|
24
|
+
*/
|
|
25
|
+
export function computeLRCBreathRate(metabolicRate: number, strideFreqHz: number, exertion: number, couplingMax: number, minStrideFreqHz: number): number;
|
|
26
|
+
//# sourceMappingURL=computeLRCBreathRate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeLRCBreathRate.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/computeLRCBreathRate.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oDAPW,MAAM,gBACN,MAAM,YACN,MAAM,eACN,MAAM,mBACN,MAAM,GACJ,MAAM,CAgBlB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { lerp } from "../../../../core/math/lerp.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Locomotor-respiratory coupling — compute the breath-rate target by
|
|
5
|
+
* blending the metabolic-demand rate with a stride-aligned sub-multiple.
|
|
6
|
+
*
|
|
7
|
+
* Empirical basis: in steady-state running, breath naturally locks to a
|
|
8
|
+
* sub-multiple of stride (2:1, 3:1, 4:1 depending on speed — see Bramble &
|
|
9
|
+
* Carrier 1983, Bernasconi & Kohl 1993). In *dynamic* activity (varied
|
|
10
|
+
* terrain, sports, untrained) the coupling is much weaker and the breath
|
|
11
|
+
* rate is dictated mostly by metabolic demand.
|
|
12
|
+
*
|
|
13
|
+
* We blend the two: at low exertion (or below the strideFreq threshold)
|
|
14
|
+
* the output is purely metabolic. At high exertion AND active gait, the
|
|
15
|
+
* output is pulled toward the integer-ratio aligned rate. This is
|
|
16
|
+
* FREQUENCY-only coupling — no phase lock — so the breath "rides" the
|
|
17
|
+
* gait without being constrained to it, matching loose dynamic-activity
|
|
18
|
+
* coupling rather than tight steady-state coupling.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} metabolicRate the rate driven by exertion alone (Hz)
|
|
21
|
+
* @param {number} strideFreqHz current stride frequency (Hz, 0 if not striding)
|
|
22
|
+
* @param {number} exertion in [0..1]
|
|
23
|
+
* @param {number} couplingMax coupling strength at exertion=1
|
|
24
|
+
* @param {number} minStrideFreqHz coupling does not engage below this
|
|
25
|
+
* @returns {number} target breath rate (Hz)
|
|
26
|
+
*/
|
|
27
|
+
export function computeLRCBreathRate(
|
|
28
|
+
metabolicRate,
|
|
29
|
+
strideFreqHz,
|
|
30
|
+
exertion,
|
|
31
|
+
couplingMax,
|
|
32
|
+
minStrideFreqHz,
|
|
33
|
+
) {
|
|
34
|
+
if (strideFreqHz < minStrideFreqHz || metabolicRate <= 1e-3) {
|
|
35
|
+
return metabolicRate;
|
|
36
|
+
}
|
|
37
|
+
const stridesPerBreath = Math.max(1, Math.round(strideFreqHz / metabolicRate));
|
|
38
|
+
const strideAlignedRate = strideFreqHz / stridesPerBreath;
|
|
39
|
+
const coupling = couplingMax * exertion;
|
|
40
|
+
return lerp(metabolicRate, strideAlignedRate, coupling);
|
|
41
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive the per-effect mass scaling factors from the body config. Computed
|
|
3
|
+
* once at link time (mass is not expected to change at runtime); the system
|
|
4
|
+
* caches the result on the runtime.
|
|
5
|
+
*
|
|
6
|
+
* Each scaling is mixed with coupling-strength ∈ [0, 1]: at 0 the ratio is
|
|
7
|
+
* identity (mass becomes purely cosmetic, useful for prototypes); at 1 the
|
|
8
|
+
* full kinematic relationship applies.
|
|
9
|
+
*
|
|
10
|
+
* massRatio = mass / referenceMass
|
|
11
|
+
* coupled(r, k) = 1 + (r - 1) · k // identity at k=0, full r at k=1
|
|
12
|
+
* jumpV0Scale = 1 / √coupled(massRatio, k) ∝ 1/√mass
|
|
13
|
+
* groundAccelScale = 1 / coupled(massRatio, k) ∝ 1/mass
|
|
14
|
+
* landingDipScale = coupled(massRatio, k) ∝ mass
|
|
15
|
+
* exertionRiseScale = coupled(massRatio, k) ∝ mass
|
|
16
|
+
*
|
|
17
|
+
* @param {number} mass
|
|
18
|
+
* @param {number} referenceMass
|
|
19
|
+
* @param {number} couplingStrength [0..1]
|
|
20
|
+
* @returns {{
|
|
21
|
+
* massRatio: number,
|
|
22
|
+
* jumpV0Scale: number,
|
|
23
|
+
* groundAccelScale: number,
|
|
24
|
+
* landingDipScale: number,
|
|
25
|
+
* exertionRiseScale: number,
|
|
26
|
+
* }}
|
|
27
|
+
*/
|
|
28
|
+
export function computeMassRatios(mass: number, referenceMass: number, couplingStrength: number): {
|
|
29
|
+
massRatio: number;
|
|
30
|
+
jumpV0Scale: number;
|
|
31
|
+
groundAccelScale: number;
|
|
32
|
+
landingDipScale: number;
|
|
33
|
+
exertionRiseScale: number;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=computeMassRatios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeMassRatios.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/computeMassRatios.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wCAXW,MAAM,iBACN,MAAM,oBACN,MAAM,GACJ;IACZ,SAAa,EAAE,MAAM,CAAC;IACtB,WAAe,EAAE,MAAM,CAAC;IACxB,gBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAqB,EAAE,MAAM,CAAC;CAC3B,CAkBH"}
|