@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.
Files changed (491) hide show
  1. package/package.json +1 -1
  2. package/src/core/collection/PairUint32Map.d.ts +100 -0
  3. package/src/core/collection/PairUint32Map.d.ts.map +1 -0
  4. package/src/core/collection/PairUint32Map.js +321 -0
  5. package/src/core/collection/Uint32Map.d.ts +119 -0
  6. package/src/core/collection/Uint32Map.d.ts.map +1 -0
  7. package/src/core/collection/Uint32Map.js +345 -0
  8. package/src/core/collection/array/array_shuffle.d.ts +10 -3
  9. package/src/core/collection/array/array_shuffle.d.ts.map +1 -1
  10. package/src/core/collection/array/array_shuffle.js +27 -22
  11. package/src/core/collection/heap/FibonacciHeap.d.ts +195 -0
  12. package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -0
  13. package/src/core/collection/heap/FibonacciHeap.js +586 -0
  14. package/src/core/collection/heap/Uint32Heap.js +1 -1
  15. package/src/core/collection/heap/Uint32Heap4.d.ts +169 -0
  16. package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -0
  17. package/src/core/collection/heap/Uint32Heap4.js +490 -0
  18. package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +27 -0
  19. package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -0
  20. package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +88 -0
  21. package/src/core/geom/3d/shape/BoxShape3D.d.ts +61 -0
  22. package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -0
  23. package/src/core/geom/3d/shape/BoxShape3D.js +158 -0
  24. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +11 -0
  25. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
  26. package/src/core/geom/3d/shape/CapsuleShape3D.js +12 -0
  27. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +37 -9
  28. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
  29. package/src/core/geom/3d/shape/UnitCubeShape3D.js +45 -98
  30. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +10 -0
  31. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
  32. package/src/core/geom/3d/shape/UnitSphereShape3D.js +11 -0
  33. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +61 -0
  34. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -0
  35. package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +148 -0
  36. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts +39 -0
  37. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -0
  38. package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +147 -0
  39. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +15 -0
  40. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -0
  41. package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +22 -0
  42. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts +2 -0
  43. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.d.ts.map +1 -0
  44. package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +673 -0
  45. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts +26 -0
  46. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.d.ts.map +1 -0
  47. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +222 -0
  48. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts +34 -0
  49. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.d.ts.map +1 -0
  50. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_find_tets_around_edge.js +146 -0
  51. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts +36 -0
  52. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.d.ts.map +1 -0
  53. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_23.js +232 -0
  54. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts +33 -0
  55. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.d.ts.map +1 -0
  56. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_flip_32.js +255 -0
  57. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts +68 -0
  58. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.d.ts.map +1 -0
  59. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +365 -0
  60. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts +31 -0
  61. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.d.ts.map +1 -0
  62. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_smooth_vertex.js +112 -0
  63. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts +22 -0
  64. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.d.ts.map +1 -0
  65. package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_vertex_is_boundary.js +55 -0
  66. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts +32 -0
  67. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.d.ts.map +1 -0
  68. package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +66 -0
  69. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +22 -0
  70. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
  71. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +49 -0
  72. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts +134 -0
  73. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.d.ts.map +1 -1
  74. package/src/core/geom/3d/topology/struct/binary/BinaryTopology.js +276 -3
  75. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts +17 -0
  76. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.d.ts.map +1 -0
  77. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +135 -0
  78. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts +14 -0
  79. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.d.ts.map +1 -0
  80. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compact.js +177 -0
  81. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.d.ts.map +1 -1
  82. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple.js +20 -4
  83. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.d.ts.map +1 -1
  84. package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +5 -3
  85. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.d.ts.map +1 -1
  86. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_create.js +9 -0
  87. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.d.ts.map +1 -1
  88. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_get_or_create.js +21 -45
  89. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.d.ts.map +1 -1
  90. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill.js +7 -1
  91. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts +8 -6
  92. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.d.ts.map +1 -1
  93. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_kill_parallels.js +8 -6
  94. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts +22 -0
  95. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.d.ts.map +1 -0
  96. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_kill_short_edges.js +73 -0
  97. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.d.ts.map +1 -1
  98. package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_replace.js +51 -1
  99. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts +10 -0
  100. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.d.ts.map +1 -0
  101. package/src/core/geom/3d/topology/struct/binary/query/bt_edge_get.js +42 -0
  102. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts +28 -0
  103. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.d.ts.map +1 -0
  104. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +227 -0
  105. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts +13 -0
  106. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.d.ts.map +1 -0
  107. package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +108 -0
  108. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +11 -0
  109. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -0
  110. package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +20 -0
  111. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +20 -0
  112. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -0
  113. package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +38 -0
  114. package/src/core/graph/csr/CSRGraph.d.ts +168 -0
  115. package/src/core/graph/csr/CSRGraph.d.ts.map +1 -0
  116. package/src/core/graph/csr/CSRGraph.js +319 -0
  117. package/src/core/graph/metis/cluster_mesh_metis.d.ts +12 -0
  118. package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
  119. package/src/core/graph/metis/cluster_mesh_metis.js +12 -0
  120. package/src/core/graph/metis/metis.d.ts +19 -0
  121. package/src/core/graph/metis/metis.d.ts.map +1 -1
  122. package/src/core/graph/metis/metis.js +20 -0
  123. package/src/core/graph/metis/metis_cluster_bs.d.ts +11 -0
  124. package/src/core/graph/metis/metis_cluster_bs.d.ts.map +1 -1
  125. package/src/core/graph/metis/metis_cluster_bs.js +11 -0
  126. package/src/core/graph/metis/metis_options.d.ts +17 -2
  127. package/src/core/graph/metis/metis_options.d.ts.map +1 -1
  128. package/src/core/graph/metis/metis_options.js +17 -2
  129. package/src/core/graph/metis/native/MetisGraph.d.ts +144 -0
  130. package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -0
  131. package/src/core/graph/metis/native/MetisGraph.js +212 -0
  132. package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +72 -0
  133. package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -0
  134. package/src/core/graph/metis/native/bisection/BisectionScratch.js +101 -0
  135. package/src/core/graph/metis/native/bisection/bisect_graph.d.ts +37 -0
  136. package/src/core/graph/metis/native/bisection/bisect_graph.d.ts.map +1 -0
  137. package/src/core/graph/metis/native/bisection/bisect_graph.js +100 -0
  138. package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts +15 -0
  139. package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -0
  140. package/src/core/graph/metis/native/bisection/compute_2way_params.js +84 -0
  141. package/src/core/graph/metis/native/bisection/fm_2way.d.ts +30 -0
  142. package/src/core/graph/metis/native/bisection/fm_2way.d.ts.map +1 -0
  143. package/src/core/graph/metis/native/bisection/fm_2way.js +290 -0
  144. package/src/core/graph/metis/native/bisection/grow_bisection.d.ts +23 -0
  145. package/src/core/graph/metis/native/bisection/grow_bisection.d.ts.map +1 -0
  146. package/src/core/graph/metis/native/bisection/grow_bisection.js +137 -0
  147. package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts +28 -0
  148. package/src/core/graph/metis/native/bisection/split_graph_two_way.d.ts.map +1 -0
  149. package/src/core/graph/metis/native/bisection/split_graph_two_way.js +119 -0
  150. package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts +20 -0
  151. package/src/core/graph/metis/native/coarsen/coarsen_graph.d.ts.map +1 -0
  152. package/src/core/graph/metis/native/coarsen/coarsen_graph.js +94 -0
  153. package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts +24 -0
  154. package/src/core/graph/metis/native/coarsen/create_coarse_graph.d.ts.map +1 -0
  155. package/src/core/graph/metis/native/coarsen/create_coarse_graph.js +158 -0
  156. package/src/core/graph/metis/native/coarsen/match_shem.d.ts +41 -0
  157. package/src/core/graph/metis/native/coarsen/match_shem.d.ts.map +1 -0
  158. package/src/core/graph/metis/native/coarsen/match_shem.js +175 -0
  159. package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts +24 -0
  160. package/src/core/graph/metis/native/initial/initial_kway_bfs.d.ts.map +1 -0
  161. package/src/core/graph/metis/native/initial/initial_kway_bfs.js +122 -0
  162. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts +29 -0
  163. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.d.ts.map +1 -0
  164. package/src/core/graph/metis/native/initial/initial_kway_recursive_bisection.js +170 -0
  165. package/src/core/graph/metis/native/metis_partition_kway.d.ts +41 -0
  166. package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -0
  167. package/src/core/graph/metis/native/metis_partition_kway.js +126 -0
  168. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts +62 -0
  169. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.d.ts.map +1 -0
  170. package/src/core/graph/metis/native/refine/IndexedFloatMaxHeap.js +261 -0
  171. package/src/core/graph/metis/native/refine/RefinementScratch.d.ts +45 -0
  172. package/src/core/graph/metis/native/refine/RefinementScratch.d.ts.map +1 -0
  173. package/src/core/graph/metis/native/refine/RefinementScratch.js +53 -0
  174. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts +18 -0
  175. package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -0
  176. package/src/core/graph/metis/native/refine/compute_kway_params.js +138 -0
  177. package/src/core/graph/metis/native/refine/fm_kway.d.ts +63 -0
  178. package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -0
  179. package/src/core/graph/metis/native/refine/fm_kway.js +462 -0
  180. package/src/core/graph/metis/native/refine/project_kway.d.ts +22 -0
  181. package/src/core/graph/metis/native/refine/project_kway.d.ts.map +1 -0
  182. package/src/core/graph/metis/native/refine/project_kway.js +43 -0
  183. package/src/core/graph/metis/native/refine/refine_kway.d.ts +34 -0
  184. package/src/core/graph/metis/native/refine/refine_kway.d.ts.map +1 -0
  185. package/src/core/graph/metis/native/refine/refine_kway.js +43 -0
  186. package/src/core/math/linalg/eigen/matrix_householder_in_place.d.ts +2 -2
  187. package/src/core/math/linalg/eigen/matrix_householder_in_place.js +2 -2
  188. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts +6 -4
  189. package/src/core/math/linalg/eigen/matrix_qr_in_place.d.ts.map +1 -1
  190. package/src/core/math/linalg/eigen/matrix_qr_in_place.js +69 -23
  191. package/src/engine/EngineHarness.d.ts +3 -1
  192. package/src/engine/EngineHarness.d.ts.map +1 -1
  193. package/src/engine/EngineHarness.js +3 -0
  194. package/src/engine/control/first-person/DESIGN.md +30 -6
  195. package/src/engine/control/first-person/DESIGN_EXTENSIONS.md +563 -0
  196. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +102 -9
  197. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  198. package/src/engine/control/first-person/FirstPersonPlayerController.js +38 -3
  199. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +533 -4
  200. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -1
  201. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +315 -6
  202. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +220 -22
  203. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  204. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +858 -241
  205. package/src/engine/control/first-person/TODO.md +127 -0
  206. package/src/engine/control/first-person/abilities/Ability.d.ts +101 -0
  207. package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -0
  208. package/src/engine/control/first-person/abilities/Ability.js +119 -0
  209. package/src/engine/control/first-person/abilities/AbilitySet.d.ts +86 -0
  210. package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -0
  211. package/src/engine/control/first-person/abilities/AbilitySet.js +185 -0
  212. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts +62 -0
  213. package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -0
  214. package/src/engine/control/first-person/abilities/LedgeGrab.js +199 -0
  215. package/src/engine/control/first-person/abilities/Mantle.d.ts +45 -0
  216. package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -0
  217. package/src/engine/control/first-person/abilities/Mantle.js +188 -0
  218. package/src/engine/control/first-person/abilities/Slide.d.ts +33 -0
  219. package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -0
  220. package/src/engine/control/first-person/abilities/Slide.js +158 -0
  221. package/src/engine/control/first-person/abilities/WallJump.d.ts +45 -0
  222. package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -0
  223. package/src/engine/control/first-person/abilities/WallJump.js +131 -0
  224. package/src/engine/control/first-person/abilities/WallRun.d.ts +44 -0
  225. package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -0
  226. package/src/engine/control/first-person/abilities/WallRun.js +180 -0
  227. package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts +49 -0
  228. package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -0
  229. package/src/engine/control/first-person/composer/EyeOffsetStack.js +60 -0
  230. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +100 -0
  231. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -0
  232. package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -0
  233. package/src/engine/control/first-person/mastery/DecisionPoint.d.ts +10 -0
  234. package/src/engine/control/first-person/mastery/DecisionPoint.d.ts.map +1 -0
  235. package/src/engine/control/first-person/mastery/DecisionPoint.js +30 -0
  236. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts +61 -0
  237. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -0
  238. package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +109 -0
  239. package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts +40 -0
  240. package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -0
  241. package/src/engine/control/first-person/mastery/MasteryEvaluator.js +45 -0
  242. package/src/engine/control/first-person/mastery/MasteryScore.d.ts +68 -0
  243. package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -0
  244. package/src/engine/control/first-person/mastery/MasteryScore.js +100 -0
  245. package/src/engine/control/first-person/mastery/MasterySet.d.ts +60 -0
  246. package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -0
  247. package/src/engine/control/first-person/mastery/MasterySet.js +86 -0
  248. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts +58 -0
  249. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -0
  250. package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +83 -0
  251. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts +69 -0
  252. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -0
  253. package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +109 -0
  254. package/src/engine/control/first-person/math/Spring.d.ts +56 -0
  255. package/src/engine/control/first-person/math/Spring.d.ts.map +1 -0
  256. package/src/engine/control/first-person/math/Spring.js +71 -0
  257. package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts +26 -0
  258. package/src/engine/control/first-person/math/computeLRCBreathRate.d.ts.map +1 -0
  259. package/src/engine/control/first-person/math/computeLRCBreathRate.js +41 -0
  260. package/src/engine/control/first-person/math/computeMassRatios.d.ts +35 -0
  261. package/src/engine/control/first-person/math/computeMassRatios.d.ts.map +1 -0
  262. package/src/engine/control/first-person/math/computeMassRatios.js +44 -0
  263. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +31 -1
  264. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -1
  265. package/src/engine/control/first-person/pose/FirstPersonPose.js +49 -3
  266. package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts +7 -0
  267. package/src/engine/control/first-person/pose/FirstPersonPosture.d.ts.map +1 -0
  268. package/src/engine/control/first-person/pose/FirstPersonPosture.js +27 -0
  269. package/src/engine/control/first-person/prototype_first_person_controller.js +550 -119
  270. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts +58 -0
  271. package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -0
  272. package/src/engine/control/first-person/sensors/FirstPersonSensors.js +77 -0
  273. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +80 -0
  274. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -0
  275. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +196 -0
  276. package/src/engine/control/first-person/test/buildTestPlayer.d.ts +20 -0
  277. package/src/engine/control/first-person/test/buildTestPlayer.d.ts.map +1 -0
  278. package/src/engine/control/first-person/test/buildTestPlayer.js +28 -0
  279. package/src/engine/graphics/camera/testClippingPlaneComputation.js +0 -2
  280. package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
  281. package/src/engine/graphics/ecs/light/Light.js +27 -0
  282. package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
  283. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  284. package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +0 -2
  285. package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +0 -2
  286. package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +0 -2
  287. package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +0 -2
  288. package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +0 -2
  289. package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
  290. package/src/engine/navigation/grid/find_path_on_grid_astar.js +11 -2
  291. package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +1 -1
  292. package/src/engine/navigation/mesh/bt_mesh_face_find_path.js +11 -1
  293. package/src/engine/physics/PLAN.md +236 -0
  294. package/src/engine/physics/body/BodyStorage.d.ts +187 -0
  295. package/src/engine/physics/body/BodyStorage.d.ts.map +1 -0
  296. package/src/engine/physics/body/BodyStorage.js +427 -0
  297. package/src/engine/physics/broadphase/PairList.d.ts +62 -0
  298. package/src/engine/physics/broadphase/PairList.d.ts.map +1 -0
  299. package/src/engine/physics/broadphase/PairList.js +97 -0
  300. package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts +30 -0
  301. package/src/engine/physics/broadphase/aabb_transform_oriented.d.ts.map +1 -0
  302. package/src/engine/physics/broadphase/aabb_transform_oriented.js +93 -0
  303. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts +16 -0
  304. package/src/engine/physics/broadphase/compute_fat_world_aabb.d.ts.map +1 -0
  305. package/src/engine/physics/broadphase/compute_fat_world_aabb.js +61 -0
  306. package/src/engine/physics/broadphase/generate_pairs.d.ts +38 -0
  307. package/src/engine/physics/broadphase/generate_pairs.d.ts.map +1 -0
  308. package/src/engine/physics/broadphase/generate_pairs.js +101 -0
  309. package/src/engine/physics/contact/ManifoldStore.d.ts +226 -0
  310. package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -0
  311. package/src/engine/physics/contact/ManifoldStore.js +499 -0
  312. package/src/engine/physics/ecs/BodyKind.d.ts +23 -0
  313. package/src/engine/physics/ecs/BodyKind.d.ts.map +1 -0
  314. package/src/engine/physics/ecs/BodyKind.js +24 -0
  315. package/src/engine/physics/ecs/Collider.d.ts +98 -0
  316. package/src/engine/physics/ecs/Collider.d.ts.map +1 -0
  317. package/src/engine/physics/ecs/Collider.js +136 -0
  318. package/src/engine/physics/ecs/ColliderFlags.d.ts +14 -0
  319. package/src/engine/physics/ecs/ColliderFlags.d.ts.map +1 -0
  320. package/src/engine/physics/ecs/ColliderFlags.js +15 -0
  321. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +58 -0
  322. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -0
  323. package/src/engine/physics/ecs/ColliderObserverSystem.js +103 -0
  324. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +25 -0
  325. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -0
  326. package/src/engine/physics/ecs/ColliderSerializationAdapter.js +37 -0
  327. package/src/engine/physics/ecs/PhysicsEvents.d.ts +15 -0
  328. package/src/engine/physics/ecs/PhysicsEvents.d.ts.map +1 -0
  329. package/src/engine/physics/ecs/PhysicsEvents.js +16 -0
  330. package/src/engine/physics/ecs/PhysicsSystem.d.ts +520 -0
  331. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -0
  332. package/src/engine/physics/ecs/PhysicsSystem.js +1159 -0
  333. package/src/engine/physics/ecs/RigidBody.d.ts +197 -0
  334. package/src/engine/physics/ecs/RigidBody.d.ts.map +1 -0
  335. package/src/engine/physics/ecs/RigidBody.js +240 -0
  336. package/src/engine/physics/ecs/RigidBodyFlags.d.ts +21 -0
  337. package/src/engine/physics/ecs/RigidBodyFlags.d.ts.map +1 -0
  338. package/src/engine/physics/ecs/RigidBodyFlags.js +22 -0
  339. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +28 -0
  340. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -0
  341. package/src/engine/physics/ecs/RigidBodySerializationAdapter.js +81 -0
  342. package/src/engine/physics/ecs/SleepState.d.ts +11 -0
  343. package/src/engine/physics/ecs/SleepState.d.ts.map +1 -0
  344. package/src/engine/physics/ecs/SleepState.js +12 -0
  345. package/src/engine/physics/events/ContactEventBuffer.d.ts +46 -0
  346. package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -0
  347. package/src/engine/physics/events/ContactEventBuffer.js +83 -0
  348. package/src/engine/physics/events/diff_manifolds.d.ts +25 -0
  349. package/src/engine/physics/events/diff_manifolds.d.ts.map +1 -0
  350. package/src/engine/physics/events/diff_manifolds.js +50 -0
  351. package/src/engine/physics/fluid/FluidField.d.ts +294 -16
  352. package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
  353. package/src/engine/physics/fluid/FluidField.js +510 -66
  354. package/src/engine/physics/fluid/FluidSimulator.d.ts +188 -5
  355. package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
  356. package/src/engine/physics/fluid/FluidSimulator.js +455 -95
  357. package/src/engine/physics/fluid/SliceVisualiser.d.ts +29 -6
  358. package/src/engine/physics/fluid/SliceVisualiser.d.ts.map +1 -1
  359. package/src/engine/physics/fluid/SliceVisualiser.js +190 -165
  360. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts +154 -0
  361. package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -0
  362. package/src/engine/physics/fluid/ecs/FluidComponent.js +238 -0
  363. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts +45 -0
  364. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.d.ts.map +1 -0
  365. package/src/engine/physics/fluid/ecs/FluidEffectorsComponent.js +89 -0
  366. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +107 -0
  367. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -0
  368. package/src/engine/physics/fluid/ecs/FluidSystem.js +278 -0
  369. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +62 -1
  370. package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts.map +1 -1
  371. package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +81 -6
  372. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +17 -4
  373. package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
  374. package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +105 -12
  375. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts +43 -0
  376. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -0
  377. package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +210 -0
  378. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts +62 -1
  379. package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
  380. package/src/engine/physics/fluid/effector/WakeFluidEffector.js +302 -8
  381. package/src/engine/physics/fluid/prototype.js +102 -91
  382. package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts +33 -0
  383. package/src/engine/physics/fluid/solver/optimal_sor_omega.d.ts.map +1 -0
  384. package/src/engine/physics/fluid/solver/optimal_sor_omega.js +41 -0
  385. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts +20 -5
  386. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.d.ts.map +1 -1
  387. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_forward.js +60 -38
  388. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts +25 -4
  389. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.d.ts.map +1 -1
  390. package/src/engine/physics/fluid/solver/v3_grid_apply_diffusion.js +93 -73
  391. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts +23 -0
  392. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.d.ts.map +1 -0
  393. package/src/engine/physics/fluid/solver/v3_grid_apply_scalar_advection.js +60 -0
  394. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts +23 -0
  395. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.d.ts.map +1 -0
  396. package/src/engine/physics/fluid/solver/v3_grid_compute_divergence.js +68 -0
  397. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts +30 -0
  398. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.d.ts.map +1 -0
  399. package/src/engine/physics/fluid/solver/v3_grid_compute_solid_neighbour_mask.js +66 -0
  400. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts +26 -0
  401. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.d.ts.map +1 -0
  402. package/src/engine/physics/fluid/solver/v3_grid_patch_edges_uniform.js +113 -0
  403. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts +30 -0
  404. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.d.ts.map +1 -0
  405. package/src/engine/physics/fluid/solver/v3_grid_shift_in_place.js +107 -0
  406. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts +49 -0
  407. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.d.ts.map +1 -0
  408. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure.js +126 -0
  409. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts +93 -0
  410. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.d.ts.map +1 -0
  411. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_pcg.js +424 -0
  412. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts +20 -0
  413. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.d.ts.map +1 -0
  414. package/src/engine/physics/fluid/solver/v3_grid_solve_pressure_unmasked_legacy.js +83 -0
  415. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts +26 -0
  416. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.d.ts.map +1 -0
  417. package/src/engine/physics/fluid/solver/v3_grid_subtract_pressure_gradient.js +70 -0
  418. package/src/engine/physics/gjk/expanding_polytope_algorithm.d.ts.map +1 -1
  419. package/src/engine/physics/gjk/expanding_polytope_algorithm.js +8 -10
  420. package/src/engine/physics/inertia/world_inverse_inertia.d.ts +29 -0
  421. package/src/engine/physics/inertia/world_inverse_inertia.d.ts.map +1 -0
  422. package/src/engine/physics/inertia/world_inverse_inertia.js +79 -0
  423. package/src/engine/physics/integration/integrate_position.d.ts +16 -0
  424. package/src/engine/physics/integration/integrate_position.d.ts.map +1 -0
  425. package/src/engine/physics/integration/integrate_position.js +48 -0
  426. package/src/engine/physics/integration/integrate_velocity.d.ts +25 -0
  427. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -0
  428. package/src/engine/physics/integration/integrate_velocity.js +79 -0
  429. package/src/engine/physics/integration/quat_integrate.d.ts +27 -0
  430. package/src/engine/physics/integration/quat_integrate.d.ts.map +1 -0
  431. package/src/engine/physics/integration/quat_integrate.js +62 -0
  432. package/src/engine/physics/island/IslandBuilder.d.ts +167 -0
  433. package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -0
  434. package/src/engine/physics/island/IslandBuilder.js +411 -0
  435. package/src/engine/physics/island/union_find.d.ts +51 -0
  436. package/src/engine/physics/island/union_find.d.ts.map +1 -0
  437. package/src/engine/physics/island/union_find.js +76 -0
  438. package/src/engine/physics/narrowphase/PosedShape.d.ts +59 -0
  439. package/src/engine/physics/narrowphase/PosedShape.d.ts.map +1 -0
  440. package/src/engine/physics/narrowphase/PosedShape.js +110 -0
  441. package/src/engine/physics/narrowphase/box_box_manifold.d.ts +32 -0
  442. package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -0
  443. package/src/engine/physics/narrowphase/box_box_manifold.js +543 -0
  444. package/src/engine/physics/narrowphase/capsule_contacts.d.ts +122 -0
  445. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -0
  446. package/src/engine/physics/narrowphase/capsule_contacts.js +508 -0
  447. package/src/engine/physics/narrowphase/narrowphase_step.d.ts +11 -0
  448. package/src/engine/physics/narrowphase/narrowphase_step.d.ts.map +1 -0
  449. package/src/engine/physics/narrowphase/narrowphase_step.js +382 -0
  450. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts +38 -0
  451. package/src/engine/physics/narrowphase/sphere_box_contact.d.ts.map +1 -0
  452. package/src/engine/physics/narrowphase/sphere_box_contact.js +130 -0
  453. package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts +26 -0
  454. package/src/engine/physics/narrowphase/sphere_sphere_contact.d.ts.map +1 -0
  455. package/src/engine/physics/narrowphase/sphere_sphere_contact.js +51 -0
  456. package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts +83 -0
  457. package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -0
  458. package/src/engine/physics/queries/PhysicsSurfacePoint.js +100 -0
  459. package/src/engine/physics/queries/raycast.d.ts +20 -0
  460. package/src/engine/physics/queries/raycast.d.ts.map +1 -0
  461. package/src/engine/physics/queries/raycast.js +249 -0
  462. package/src/engine/physics/solver/friction_cone.d.ts +16 -0
  463. package/src/engine/physics/solver/friction_cone.d.ts.map +1 -0
  464. package/src/engine/physics/solver/friction_cone.js +37 -0
  465. package/src/engine/physics/solver/solve_contacts.d.ts +36 -0
  466. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -0
  467. package/src/engine/physics/solver/solve_contacts.js +598 -0
  468. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts +0 -34
  469. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.d.ts.map +0 -1
  470. package/src/core/geom/3d/topology/struct/binary/io/edge/OrderedEdge.js +0 -66
  471. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts +0 -2
  472. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.d.ts.map +0 -1
  473. package/src/core/geom/3d/topology/struct/binary/io/edge/bt_mesh_calc_edges.js +0 -54
  474. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts +0 -2
  475. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.d.ts.map +0 -1
  476. package/src/core/geom/3d/topology/struct/binary/io/edge/get_or_create_edge_map.js +0 -26
  477. package/src/engine/ecs/components/Motion.d.ts +0 -21
  478. package/src/engine/ecs/components/Motion.d.ts.map +0 -1
  479. package/src/engine/ecs/components/Motion.js +0 -27
  480. package/src/engine/ecs/components/MotionSerializationAdapter.d.ts +0 -20
  481. package/src/engine/ecs/components/MotionSerializationAdapter.d.ts.map +0 -1
  482. package/src/engine/ecs/components/MotionSerializationAdapter.js +0 -26
  483. package/src/engine/ecs/systems/MotionSystem.d.ts +0 -9
  484. package/src/engine/ecs/systems/MotionSystem.d.ts.map +0 -1
  485. package/src/engine/ecs/systems/MotionSystem.js +0 -29
  486. package/src/engine/physics/fluid/Fluid.d.ts +0 -26
  487. package/src/engine/physics/fluid/Fluid.d.ts.map +0 -1
  488. package/src/engine/physics/fluid/Fluid.js +0 -221
  489. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts +0 -7
  490. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.d.ts.map +0 -1
  491. package/src/engine/physics/fluid/solver/v3_grid_apply_advection_reverse.js +0 -8
@@ -12,10 +12,27 @@ export class FirstPersonPlayerControllerConfig {
12
12
  height: number;
13
13
  /** Crouched eye height. */
14
14
  crouchHeight: number;
15
+ /** Prone eye height (used by slide). Body is horizontal — eye
16
+ * just above ground level, head turned toward the direction
17
+ * of travel. */
18
+ proneHeight: number;
15
19
  /** Capsule radius, for downstream physics. */
16
20
  radius: number;
17
- /** Kilograms — drives bob amplitude and land-impact magnitude. */
21
+ /** Kilograms — affects bob, jump, landing, accel, and exertion via massRatio. */
18
22
  mass: number;
23
+ /** Reference mass against which `mass` is normalized (massRatio = mass/refMass). */
24
+ referenceMass: number;
25
+ /**
26
+ * How strongly `mass` couples into derived effects. 0 = mass is
27
+ * cosmetic; 1.0 = full coupling (heavier ⇒ lower jump, lower accel,
28
+ * harder landing, faster exhaustion). At 1.0 a 25% mass increase
29
+ * yields:
30
+ * jump peak ≈ 0.83× (∝ 1/√massRatio — kinematically motivated)
31
+ * ground accel ≈ 0.80× (∝ 1/massRatio — F = ma at fixed force)
32
+ * landing dip ≈ 1.25× (∝ massRatio — higher momentum to absorb)
33
+ * exertion rise ≈ 1.25× (∝ massRatio — more body to move)
34
+ */
35
+ massCouplingStrength: number;
19
36
  };
20
37
  motion: {
21
38
  walkSpeed: number;
@@ -29,6 +46,19 @@ export class FirstPersonPlayerControllerConfig {
29
46
  groundDecel: number;
30
47
  /** m/s^2 horizontal acceleration while airborne. */
31
48
  airAccel: number;
49
+ /**
50
+ * Top-speed multiplier applied while the move intent has a backward
51
+ * component (intent.move.y < 0). Backpedaling is mechanically slower
52
+ * than running forward — this also enforces a hard cap rather than
53
+ * letting "backward sprint" reach the same speed as forward sprint.
54
+ */
55
+ backwardSpeedFactor: number;
56
+ /**
57
+ * Acceleration multiplier while moving backward. Body has worse
58
+ * mechanical advantage when reversing — slower to start, slower to
59
+ * stop, sells the "fighting the gait" feel.
60
+ */
61
+ backwardAccelFactor: number;
32
62
  };
33
63
  jump: {
34
64
  /** Apex height of a clean jump, meters. */
@@ -69,6 +99,118 @@ export class FirstPersonPlayerControllerConfig {
69
99
  /** "hold" or "toggle" */
70
100
  mode: string;
71
101
  };
102
+ /**
103
+ * Wall-run ability — airborne + lateral wall + speed → run along the
104
+ * wall with reduced gravity. Camera tilts into the wall via the
105
+ * shared lean spring (consistent with the rest of the camera).
106
+ * Fields here are consumed by the {@link WallRun} ability when
107
+ * registered.
108
+ */
109
+ wallRun: {
110
+ /** Minimum horizontal speed (m/s) to engage wall-run. */
111
+ minSpeed: number;
112
+ /** Player must be airborne at least this long before wall-run can
113
+ * engage — prevents wall-run triggering off a jump's first frames. */
114
+ minAirborneTime: number;
115
+ /** Maximum wall-run duration (s). Auto-exits at the end. */
116
+ maxDuration: number;
117
+ /** Multiplier on base gravity while wall-running. Lower = longer hang. */
118
+ gravityFactor: number;
119
+ /** Camera tilt magnitude (deg) into the wall. Disabled by the
120
+ * motion-sickness toggle alongside the standard lean. */
121
+ cameraRollDeg: number;
122
+ };
123
+ /**
124
+ * Wall-jump ability — instantaneous off-wall impulse. Fires from
125
+ * either an active wall-run state or from near-wall airborne (a
126
+ * short window where the player is close enough to push off).
127
+ */
128
+ wallJump: {
129
+ /** Impulse magnitude away from the wall (m/s, applied along wall normal). */
130
+ outwardImpulse: number;
131
+ /** Upward component multiplier on jumpInitialVy. */
132
+ upFactor: number;
133
+ /** Max distance to wall (m) at which a near-wall-airborne wall-jump
134
+ * is allowed (when not already wall-running). */
135
+ nearWallMaxDistance: number;
136
+ };
137
+ /**
138
+ * Ledge-grab ability — snap to a forward ledge while descending and
139
+ * hang from it until the player releases. Climbing fatigue is
140
+ * modelled via the shared exertion channel: hang too long and you
141
+ * slip. Fields here are consumed by the {@link LedgeGrab} ability
142
+ * if registered; ignored otherwise.
143
+ */
144
+ ledgeGrab: {
145
+ /** Body Y offset from ledge top while hanging (negative — feet
146
+ * below the ledge so the body looks like it's gripping the
147
+ * edge). */
148
+ hangOffsetY: number;
149
+ /** Forward offset from the ledge edge (negative = pulled BACK
150
+ * from the edge so the body is against the wall under the
151
+ * ledge). */
152
+ hangOffsetForward: number;
153
+ /** Exertion rise per second while hanging — drives slip-by-
154
+ * fatigue. The base exertion rise scale (massRatios) applies. */
155
+ exertionRiseRate: number;
156
+ /** Player must be airborne at least this long before a ledge-
157
+ * grab can engage — prevents auto-catching mid-jump. */
158
+ minAirborneTime: number;
159
+ /** Vertical kick (multiplier on jumpInitialVy) given on a
160
+ * mantle-up release. Just enough to put the body above the
161
+ * ledge so mantle's ledgeAhead probe still resolves correctly
162
+ * on the next tick. */
163
+ mantleUpUpFactor: number;
164
+ };
165
+ /**
166
+ * Mantle ability — auto-triggers when the player approaches a
167
+ * reachable obstacle with forward intent. The body follows a scripted
168
+ * path (horizontal + vertical eases) onto the surface; player input
169
+ * is suspended for the path's duration. Fields here are consumed by
170
+ * the {@link Mantle} ability if registered; ignored otherwise.
171
+ */
172
+ mantle: {
173
+ /** Below this height (m above feet), the obstacle is just a step
174
+ * the player can walk over — no mantle. */
175
+ minHeight: number;
176
+ /** Above this, the surface is out of reach — no mantle. ~1.4m
177
+ * is chest height for a 1.8m body, which is the canonical
178
+ * "obstacle you can climb on but not over without help". */
179
+ maxHeight: number;
180
+ /** Total scripted-path duration (seconds). Short enough that the
181
+ * brief loss of player control isn't frustrating. */
182
+ duration: number;
183
+ /** How far past the obstacle edge the player lands (m). Slight
184
+ * forward bias so the player ends on top of the surface, not
185
+ * on the edge. */
186
+ forwardOffsetOnLand: number;
187
+ };
188
+ /**
189
+ * Slide ability — activates from sprint+crouch when grounded. The
190
+ * fields here are read by the {@link Slide} ability if it's registered
191
+ * on the controller; unused if Slide is not in use.
192
+ */
193
+ slide: {
194
+ /** Required horizontal speed to start a slide. Below this, crouch+
195
+ * sprint just transitions to a normal crouched walk. */
196
+ minEntrySpeed: number;
197
+ /** Auto-exit threshold — slide ends when speed drops below this. */
198
+ endSpeed: number;
199
+ /** Horizontal deceleration (m/s²) while sliding. Lower than the
200
+ * normal groundDecel so slides preserve momentum longer. */
201
+ friction: number;
202
+ /** Non-interruptible window (seconds) after slide start — higher-
203
+ * priority abilities can't preempt during this window so the
204
+ * player isn't yanked out the instant they commit to a slide. */
205
+ startupWindow: number;
206
+ /** Multiplier on the jump initial Vy for slide-jump. 1.0 = same
207
+ * height as a standing jump; >1 gives slide-jump some extra
208
+ * reward for chaining the input. */
209
+ slideJumpUpFactor: number;
210
+ /** Vertical-impact-spring kick (m/s) at slide entry — the
211
+ * satisfying "thud" of dropping into the slide. */
212
+ entryImpactVelocity: number;
213
+ };
72
214
  bob: {
73
215
  stepFreqAtWalk: number;
74
216
  stepFreqExp: number;
@@ -79,6 +221,60 @@ export class FirstPersonPlayerControllerConfig {
79
221
  rollAtWalkDeg: number;
80
222
  /** Speeds below this don't tick the stride at all. */
81
223
  minStepSpeed: number;
224
+ /**
225
+ * Half-life of the bob-amplitude envelope (seconds). When the player
226
+ * starts/stops moving, the bob amplitude springs toward its natural
227
+ * value rather than cutting on/off — so releasing a movement key
228
+ * doesn't whiplash the head from full sway back to neutral. The
229
+ * stride phase itself still freezes when stationary; only the
230
+ * AMPLITUDE is temporally smoothed.
231
+ */
232
+ intensityHalfLife: number;
233
+ /**
234
+ * Vertical impact spring — kicked downward at each footfall. The
235
+ * spring's response shapes the actual vertical motion of the head:
236
+ * a sharp dip (foot arresting the head's fall), recovery through
237
+ * neutral, and a slight overshoot above neutral as the standing
238
+ * leg injects energy into the body (the "push" phase). Models the
239
+ * gait COM trajectory more accurately than a smooth sinusoid.
240
+ */
241
+ impactSpringHalfLife: number;
242
+ /** zeta < 1 → spring overshoots after impact, sells the leg-push. */
243
+ impactSpringZeta: number;
244
+ /**
245
+ * Multiplier converting "desired peak dip" (verticalAmpAtWalk + mass
246
+ * boost, scaled by intensity and back-pedal factor) into the actual
247
+ * velocity impulse delivered at footfall. Empirical — tuned so the
248
+ * default verticalAmpAtWalk produces the expected peak dip with the
249
+ * spring params above.
250
+ */
251
+ impactKickMultiplier: number;
252
+ /**
253
+ * Multipliers applied to bob amplitude when the player is moving
254
+ * backward (interpolated by "backwardness" — the negative dot of
255
+ * velocity onto screen-forward, normalized to sprint speed). At
256
+ * full back-pedal these are fully applied; at rest they have no
257
+ * effect.
258
+ *
259
+ * Lateral is intentionally larger than vertical: real back-gait
260
+ * has worse side-to-side balance than vertical compression, so
261
+ * the visual wobble should track that. Roll boosts each footfall's
262
+ * head-tilt for the same reason — sells "unstable footing".
263
+ */
264
+ backwardVerticalAmpFactor: number;
265
+ backwardLateralAmpFactor: number;
266
+ backwardRollFactor: number;
267
+ /**
268
+ * Bob roll × lean coupling: when the body is leaning into a turn
269
+ * (lean spring displaced), the per-stride head roll is biased
270
+ * toward the lean direction. At 0 the bob roll is symmetric
271
+ * regardless of lean. At 1.0 the bob roll excursions in the lean
272
+ * direction are doubled and the opposite-direction excursions go to
273
+ * zero. Typical 0.3–0.6 reads as a cohesive "leaning while running"
274
+ * gait. Normalized against cfg.lean.maxRollDeg so the coupling
275
+ * stays proportional regardless of how aggressive lean is tuned.
276
+ */
277
+ leanCouplingFactor: number;
82
278
  };
83
279
  breath: {
84
280
  rateRestHz: number;
@@ -89,13 +285,62 @@ export class FirstPersonPlayerControllerConfig {
89
285
  pitchAmpMaxDeg: number;
90
286
  /** ±20% amplitude noise rides on the sine. */
91
287
  noiseAmount: number;
288
+ /**
289
+ * Locomotor-respiratory coupling strength at full exertion. The
290
+ * breath-rate target is blended between purely metabolic (driven by
291
+ * exertion) and stride-aligned (an integer N strides per breath
292
+ * cycle). At 0 no coupling; at 1 breath rate is fully pulled toward
293
+ * the stride-aligned target.
294
+ *
295
+ * Coupling is SCALED by exertion — low exertion means the breath is
296
+ * dictated by metabolic demand alone, high sustained effort lets
297
+ * the diaphragm couple to gait impacts (mechanistically: heavier
298
+ * breathing means deeper chest excursions, which the gait's
299
+ * vertical accelerations bias toward integer ratios). Matches
300
+ * empirical findings in dynamic activity (Bernasconi & Kohl 1993,
301
+ * Bramble & Carrier 1983) — much weaker than steady-state running.
302
+ *
303
+ * Frequency-coupled only, NOT phase-locked: breath rate matches a
304
+ * sub-multiple of stride rate, but phase drifts. Holds the "loose"
305
+ * character the user asked for.
306
+ */
307
+ locomotorCouplingMax: number;
308
+ /** Coupling does not engage below this stride frequency (Hz). At
309
+ * walking pace your gait is too slow to mechanically influence
310
+ * breath; coupling really shows up at jog+ pace. */
311
+ couplingMinStrideFreqHz: number;
92
312
  };
93
313
  exertion: {
314
+ /** Per-second accumulation while sprinting (mass-scaled internally). */
94
315
  sprintRiseRate: number;
95
- jumpRise: number;
316
+ /** Per-second decay toward 0 when not under sustained load. */
96
317
  idleDecayRate: number;
318
+ /** Bump on jump fire — the muscular impulse of pushing off. */
319
+ jumpRise: number;
320
+ /** Bump on crouch-enter — the knee-grip on absorbing into a crouch.
321
+ * Small; we don't want crouch-spamming to instantly exhaust. */
322
+ crouchEnterRise: number;
323
+ /**
324
+ * Per-(m/s) impulse on landing — proportional to vertical impact
325
+ * speed. A clean low-jump landing barely registers; a hard fall
326
+ * delivers a noticeable bump. Clamped internally so an impossible
327
+ * fall doesn't max out exertion in one tick.
328
+ */
329
+ landImpulsePerVy: number;
330
+ /** Max impulse magnitude added by any single landing. */
331
+ landImpulseMax: number;
332
+ /** How long after exertion subsides before breath rate normalizes. */
97
333
  rateDecayHalfLife: number;
334
+ /** How long after exertion subsides before breath amplitude normalizes. */
98
335
  ampDecayHalfLife: number;
336
+ /** At full exertion, bob lateral amp is multiplied by 1 + this.
337
+ * Sells "tired wobble" — modest effect (10–20% recommended). */
338
+ bobLateralBoostAtMax: number;
339
+ /** At full exertion, the head droops forward by this many degrees.
340
+ * Sells visual fatigue without compromising aim. Subtle. */
341
+ headDroopAtMaxDeg: number;
342
+ /** Spring half-life for the head-droop transition. */
343
+ headDroopHalfLife: number;
99
344
  };
100
345
  lean: {
101
346
  enabled: boolean;
@@ -105,6 +350,29 @@ export class FirstPersonPlayerControllerConfig {
105
350
  halfLife: number;
106
351
  zeta: number;
107
352
  };
353
+ /**
354
+ * Yaw-rate "look-lean": camera banks into mouse-driven turns even
355
+ * without strafe input. Disable for motion-sickness sensitivity.
356
+ */
357
+ lookLeanEnabled: boolean;
358
+ /**
359
+ * Degrees of roll per rad/s of yaw rate. ~3 means a 180°/s turn
360
+ * (slow camera pan) gives ~16.5° of bank; a fast mouse flick at
361
+ * 5 rad/s (≈286°/s) would saturate against the clamp below.
362
+ */
363
+ lookLeanDegPerRadPerSec: number;
364
+ /** Yaw rate is clamped to ±this (rad/s) before scaling — prevents
365
+ * single-frame flicks from spiking the lean target. */
366
+ lookLeanYawRateClamp: number;
367
+ /**
368
+ * Multiplier applied to look-lean (yaw-rate banking) when crouched.
369
+ * Crouched stance is low and stable; banking from a mouse turn
370
+ * reads as unmotivated. Default 0 fully disables; dial up to add
371
+ * a subtle tilt without it feeling like you're running. The lateral-
372
+ * acceleration lean is NOT affected by this — it scales naturally
373
+ * with crouch speeds since accel magnitudes drop.
374
+ */
375
+ crouchLookLeanFactor: number;
108
376
  };
109
377
  fov: {
110
378
  base: number;
@@ -117,6 +385,22 @@ export class FirstPersonPlayerControllerConfig {
117
385
  pitchMaxDeg: number;
118
386
  invertY: boolean;
119
387
  };
388
+ /**
389
+ * Postural shifts driven by intent — distinct from look (which is
390
+ * player-driven) and from bob (which is procedural). Models
391
+ * Mirror's Edge-style "commitment to motion": sprinting tilts the head
392
+ * forward as the body leans into the run. Slow spring so it builds up
393
+ * over a second or so rather than snapping — it's a *posture* change,
394
+ * not a flick.
395
+ */
396
+ posture: {
397
+ /** Forward pitch (deg) applied to the eye at full sprint. Positive = look-down. */
398
+ sprintForwardPitchDeg: number;
399
+ /** Spring half-life for the sprint pitch transition. */
400
+ sprintForwardPitchHalfLife: number;
401
+ /** Small forward eye-position shift (m) at full sprint — head leads the hips. */
402
+ sprintForwardShiftM: number;
403
+ };
120
404
  gravity: {
121
405
  /** Default gravity magnitude (m/s^2). Overridden by computeJumpFromApex once
122
406
  * the jump tunables are resolved; kept here so non-jumping entities (NPCs,
@@ -129,10 +413,27 @@ export class FirstPersonPlayerControllerConfig {
129
413
  height: number;
130
414
  /** Crouched eye height. */
131
415
  crouchHeight: number;
416
+ /** Prone eye height (used by slide). Body is horizontal — eye
417
+ * just above ground level, head turned toward the direction
418
+ * of travel. */
419
+ proneHeight: number;
132
420
  /** Capsule radius, for downstream physics. */
133
421
  radius: number;
134
- /** Kilograms — drives bob amplitude and land-impact magnitude. */
422
+ /** Kilograms — affects bob, jump, landing, accel, and exertion via massRatio. */
135
423
  mass: number;
424
+ /** Reference mass against which `mass` is normalized (massRatio = mass/refMass). */
425
+ referenceMass: number;
426
+ /**
427
+ * How strongly `mass` couples into derived effects. 0 = mass is
428
+ * cosmetic; 1.0 = full coupling (heavier ⇒ lower jump, lower accel,
429
+ * harder landing, faster exhaustion). At 1.0 a 25% mass increase
430
+ * yields:
431
+ * jump peak ≈ 0.83× (∝ 1/√massRatio — kinematically motivated)
432
+ * ground accel ≈ 0.80× (∝ 1/massRatio — F = ma at fixed force)
433
+ * landing dip ≈ 1.25× (∝ massRatio — higher momentum to absorb)
434
+ * exertion rise ≈ 1.25× (∝ massRatio — more body to move)
435
+ */
436
+ massCouplingStrength: number;
136
437
  };
137
438
  motion: {
138
439
  walkSpeed: number;
@@ -146,6 +447,19 @@ export class FirstPersonPlayerControllerConfig {
146
447
  groundDecel: number;
147
448
  /** m/s^2 horizontal acceleration while airborne. */
148
449
  airAccel: number;
450
+ /**
451
+ * Top-speed multiplier applied while the move intent has a backward
452
+ * component (intent.move.y < 0). Backpedaling is mechanically slower
453
+ * than running forward — this also enforces a hard cap rather than
454
+ * letting "backward sprint" reach the same speed as forward sprint.
455
+ */
456
+ backwardSpeedFactor: number;
457
+ /**
458
+ * Acceleration multiplier while moving backward. Body has worse
459
+ * mechanical advantage when reversing — slower to start, slower to
460
+ * stop, sells the "fighting the gait" feel.
461
+ */
462
+ backwardAccelFactor: number;
149
463
  };
150
464
  jump: {
151
465
  anticipation: {
@@ -186,6 +500,87 @@ export class FirstPersonPlayerControllerConfig {
186
500
  /** "hold" or "toggle" */
187
501
  mode: string;
188
502
  };
503
+ ledgeGrab: {
504
+ /** Body Y offset from ledge top while hanging (negative — feet
505
+ * below the ledge so the body looks like it's gripping the
506
+ * edge). */
507
+ hangOffsetY: number;
508
+ /** Forward offset from the ledge edge (negative = pulled BACK
509
+ * from the edge so the body is against the wall under the
510
+ * ledge). */
511
+ hangOffsetForward: number;
512
+ /** Exertion rise per second while hanging — drives slip-by-
513
+ * fatigue. The base exertion rise scale (massRatios) applies. */
514
+ exertionRiseRate: number;
515
+ /** Player must be airborne at least this long before a ledge-
516
+ * grab can engage — prevents auto-catching mid-jump. */
517
+ minAirborneTime: number;
518
+ /** Vertical kick (multiplier on jumpInitialVy) given on a
519
+ * mantle-up release. Just enough to put the body above the
520
+ * ledge so mantle's ledgeAhead probe still resolves correctly
521
+ * on the next tick. */
522
+ mantleUpUpFactor: number;
523
+ };
524
+ mantle: {
525
+ /** Below this height (m above feet), the obstacle is just a step
526
+ * the player can walk over — no mantle. */
527
+ minHeight: number;
528
+ /** Above this, the surface is out of reach — no mantle. ~1.4m
529
+ * is chest height for a 1.8m body, which is the canonical
530
+ * "obstacle you can climb on but not over without help". */
531
+ maxHeight: number;
532
+ /** Total scripted-path duration (seconds). Short enough that the
533
+ * brief loss of player control isn't frustrating. */
534
+ duration: number;
535
+ /** How far past the obstacle edge the player lands (m). Slight
536
+ * forward bias so the player ends on top of the surface, not
537
+ * on the edge. */
538
+ forwardOffsetOnLand: number;
539
+ };
540
+ wallRun: {
541
+ /** Minimum horizontal speed (m/s) to engage wall-run. */
542
+ minSpeed: number;
543
+ /** Player must be airborne at least this long before wall-run can
544
+ * engage — prevents wall-run triggering off a jump's first frames. */
545
+ minAirborneTime: number;
546
+ /** Maximum wall-run duration (s). Auto-exits at the end. */
547
+ maxDuration: number;
548
+ /** Multiplier on base gravity while wall-running. Lower = longer hang. */
549
+ gravityFactor: number;
550
+ /** Camera tilt magnitude (deg) into the wall. Disabled by the
551
+ * motion-sickness toggle alongside the standard lean. */
552
+ cameraRollDeg: number;
553
+ };
554
+ wallJump: {
555
+ /** Impulse magnitude away from the wall (m/s, applied along wall normal). */
556
+ outwardImpulse: number;
557
+ /** Upward component multiplier on jumpInitialVy. */
558
+ upFactor: number;
559
+ /** Max distance to wall (m) at which a near-wall-airborne wall-jump
560
+ * is allowed (when not already wall-running). */
561
+ nearWallMaxDistance: number;
562
+ };
563
+ slide: {
564
+ /** Required horizontal speed to start a slide. Below this, crouch+
565
+ * sprint just transitions to a normal crouched walk. */
566
+ minEntrySpeed: number;
567
+ /** Auto-exit threshold — slide ends when speed drops below this. */
568
+ endSpeed: number;
569
+ /** Horizontal deceleration (m/s²) while sliding. Lower than the
570
+ * normal groundDecel so slides preserve momentum longer. */
571
+ friction: number;
572
+ /** Non-interruptible window (seconds) after slide start — higher-
573
+ * priority abilities can't preempt during this window so the
574
+ * player isn't yanked out the instant they commit to a slide. */
575
+ startupWindow: number;
576
+ /** Multiplier on the jump initial Vy for slide-jump. 1.0 = same
577
+ * height as a standing jump; >1 gives slide-jump some extra
578
+ * reward for chaining the input. */
579
+ slideJumpUpFactor: number;
580
+ /** Vertical-impact-spring kick (m/s) at slide entry — the
581
+ * satisfying "thud" of dropping into the slide. */
582
+ entryImpactVelocity: number;
583
+ };
189
584
  bob: {
190
585
  stepFreqAtWalk: number;
191
586
  stepFreqExp: number;
@@ -196,6 +591,60 @@ export class FirstPersonPlayerControllerConfig {
196
591
  rollAtWalkDeg: number;
197
592
  /** Speeds below this don't tick the stride at all. */
198
593
  minStepSpeed: number;
594
+ /**
595
+ * Half-life of the bob-amplitude envelope (seconds). When the player
596
+ * starts/stops moving, the bob amplitude springs toward its natural
597
+ * value rather than cutting on/off — so releasing a movement key
598
+ * doesn't whiplash the head from full sway back to neutral. The
599
+ * stride phase itself still freezes when stationary; only the
600
+ * AMPLITUDE is temporally smoothed.
601
+ */
602
+ intensityHalfLife: number;
603
+ /**
604
+ * Vertical impact spring — kicked downward at each footfall. The
605
+ * spring's response shapes the actual vertical motion of the head:
606
+ * a sharp dip (foot arresting the head's fall), recovery through
607
+ * neutral, and a slight overshoot above neutral as the standing
608
+ * leg injects energy into the body (the "push" phase). Models the
609
+ * gait COM trajectory more accurately than a smooth sinusoid.
610
+ */
611
+ impactSpringHalfLife: number;
612
+ /** zeta < 1 → spring overshoots after impact, sells the leg-push. */
613
+ impactSpringZeta: number;
614
+ /**
615
+ * Multiplier converting "desired peak dip" (verticalAmpAtWalk + mass
616
+ * boost, scaled by intensity and back-pedal factor) into the actual
617
+ * velocity impulse delivered at footfall. Empirical — tuned so the
618
+ * default verticalAmpAtWalk produces the expected peak dip with the
619
+ * spring params above.
620
+ */
621
+ impactKickMultiplier: number;
622
+ /**
623
+ * Multipliers applied to bob amplitude when the player is moving
624
+ * backward (interpolated by "backwardness" — the negative dot of
625
+ * velocity onto screen-forward, normalized to sprint speed). At
626
+ * full back-pedal these are fully applied; at rest they have no
627
+ * effect.
628
+ *
629
+ * Lateral is intentionally larger than vertical: real back-gait
630
+ * has worse side-to-side balance than vertical compression, so
631
+ * the visual wobble should track that. Roll boosts each footfall's
632
+ * head-tilt for the same reason — sells "unstable footing".
633
+ */
634
+ backwardVerticalAmpFactor: number;
635
+ backwardLateralAmpFactor: number;
636
+ backwardRollFactor: number;
637
+ /**
638
+ * Bob roll × lean coupling: when the body is leaning into a turn
639
+ * (lean spring displaced), the per-stride head roll is biased
640
+ * toward the lean direction. At 0 the bob roll is symmetric
641
+ * regardless of lean. At 1.0 the bob roll excursions in the lean
642
+ * direction are doubled and the opposite-direction excursions go to
643
+ * zero. Typical 0.3–0.6 reads as a cohesive "leaning while running"
644
+ * gait. Normalized against cfg.lean.maxRollDeg so the coupling
645
+ * stays proportional regardless of how aggressive lean is tuned.
646
+ */
647
+ leanCouplingFactor: number;
199
648
  };
200
649
  breath: {
201
650
  rateRestHz: number;
@@ -206,13 +655,62 @@ export class FirstPersonPlayerControllerConfig {
206
655
  pitchAmpMaxDeg: number;
207
656
  /** ±20% amplitude noise rides on the sine. */
208
657
  noiseAmount: number;
658
+ /**
659
+ * Locomotor-respiratory coupling strength at full exertion. The
660
+ * breath-rate target is blended between purely metabolic (driven by
661
+ * exertion) and stride-aligned (an integer N strides per breath
662
+ * cycle). At 0 no coupling; at 1 breath rate is fully pulled toward
663
+ * the stride-aligned target.
664
+ *
665
+ * Coupling is SCALED by exertion — low exertion means the breath is
666
+ * dictated by metabolic demand alone, high sustained effort lets
667
+ * the diaphragm couple to gait impacts (mechanistically: heavier
668
+ * breathing means deeper chest excursions, which the gait's
669
+ * vertical accelerations bias toward integer ratios). Matches
670
+ * empirical findings in dynamic activity (Bernasconi & Kohl 1993,
671
+ * Bramble & Carrier 1983) — much weaker than steady-state running.
672
+ *
673
+ * Frequency-coupled only, NOT phase-locked: breath rate matches a
674
+ * sub-multiple of stride rate, but phase drifts. Holds the "loose"
675
+ * character the user asked for.
676
+ */
677
+ locomotorCouplingMax: number;
678
+ /** Coupling does not engage below this stride frequency (Hz). At
679
+ * walking pace your gait is too slow to mechanically influence
680
+ * breath; coupling really shows up at jog+ pace. */
681
+ couplingMinStrideFreqHz: number;
209
682
  };
210
683
  exertion: {
684
+ /** Per-second accumulation while sprinting (mass-scaled internally). */
211
685
  sprintRiseRate: number;
212
- jumpRise: number;
686
+ /** Per-second decay toward 0 when not under sustained load. */
213
687
  idleDecayRate: number;
688
+ /** Bump on jump fire — the muscular impulse of pushing off. */
689
+ jumpRise: number;
690
+ /** Bump on crouch-enter — the knee-grip on absorbing into a crouch.
691
+ * Small; we don't want crouch-spamming to instantly exhaust. */
692
+ crouchEnterRise: number;
693
+ /**
694
+ * Per-(m/s) impulse on landing — proportional to vertical impact
695
+ * speed. A clean low-jump landing barely registers; a hard fall
696
+ * delivers a noticeable bump. Clamped internally so an impossible
697
+ * fall doesn't max out exertion in one tick.
698
+ */
699
+ landImpulsePerVy: number;
700
+ /** Max impulse magnitude added by any single landing. */
701
+ landImpulseMax: number;
702
+ /** How long after exertion subsides before breath rate normalizes. */
214
703
  rateDecayHalfLife: number;
704
+ /** How long after exertion subsides before breath amplitude normalizes. */
215
705
  ampDecayHalfLife: number;
706
+ /** At full exertion, bob lateral amp is multiplied by 1 + this.
707
+ * Sells "tired wobble" — modest effect (10–20% recommended). */
708
+ bobLateralBoostAtMax: number;
709
+ /** At full exertion, the head droops forward by this many degrees.
710
+ * Sells visual fatigue without compromising aim. Subtle. */
711
+ headDroopAtMaxDeg: number;
712
+ /** Spring half-life for the head-droop transition. */
713
+ headDroopHalfLife: number;
216
714
  };
217
715
  lean: {
218
716
  spring: {
@@ -222,6 +720,29 @@ export class FirstPersonPlayerControllerConfig {
222
720
  enabled: boolean;
223
721
  /** Degrees of roll per (lateral m/s^2 / 9.81). */
224
722
  maxRollDeg: number;
723
+ /**
724
+ * Yaw-rate "look-lean": camera banks into mouse-driven turns even
725
+ * without strafe input. Disable for motion-sickness sensitivity.
726
+ */
727
+ lookLeanEnabled: boolean;
728
+ /**
729
+ * Degrees of roll per rad/s of yaw rate. ~3 means a 180°/s turn
730
+ * (slow camera pan) gives ~16.5° of bank; a fast mouse flick at
731
+ * 5 rad/s (≈286°/s) would saturate against the clamp below.
732
+ */
733
+ lookLeanDegPerRadPerSec: number;
734
+ /** Yaw rate is clamped to ±this (rad/s) before scaling — prevents
735
+ * single-frame flicks from spiking the lean target. */
736
+ lookLeanYawRateClamp: number;
737
+ /**
738
+ * Multiplier applied to look-lean (yaw-rate banking) when crouched.
739
+ * Crouched stance is low and stable; banking from a mouse turn
740
+ * reads as unmotivated. Default 0 fully disables; dial up to add
741
+ * a subtle tilt without it feeling like you're running. The lateral-
742
+ * acceleration lean is NOT affected by this — it scales naturally
743
+ * with crouch speeds since accel magnitudes drop.
744
+ */
745
+ crouchLookLeanFactor: number;
225
746
  };
226
747
  fov: {
227
748
  base: number;
@@ -234,6 +755,14 @@ export class FirstPersonPlayerControllerConfig {
234
755
  pitchMaxDeg: number;
235
756
  invertY: boolean;
236
757
  };
758
+ posture: {
759
+ /** Forward pitch (deg) applied to the eye at full sprint. Positive = look-down. */
760
+ sprintForwardPitchDeg: number;
761
+ /** Spring half-life for the sprint pitch transition. */
762
+ sprintForwardPitchHalfLife: number;
763
+ /** Small forward eye-position shift (m) at full sprint — head leads the hips. */
764
+ sprintForwardShiftM: number;
765
+ };
237
766
  gravity: {
238
767
  /** Default gravity magnitude (m/s^2). Overridden by computeJumpFromApex once
239
768
  * the jump tunables are resolved; kept here so non-jumping entities (NPCs,
@@ -1 +1 @@
1
- {"version":3,"file":"FirstPersonPlayerControllerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B,8CAA8C;;QAE9C,kEAAkE;;MAEpE;IAMF;;;;QAII,iEAAiE;;QAEjE,6DAA6D;;QAE7D,kEAAkE;;QAElE,oDAAoD;;MAEtD;IAEF;QACI,2CAA2C;;QAE3C,sEAAsE;;;;QAItE,kDAAkD;;QAElD,iEAAiE;;;;;;MAMnE;IAEF;QACI,yDAAyD;;QAEzD,yDAAyD;;;YAGrD,oDAAoD;;YAEpD,0BAA0B;;;;gBAItB,mEAAmE;;;;MAI7E;IAEF;QACI,gEAAgE;;QAEhE,yBAAyB;;MAE3B;IAEF;;;;;QAKI,0DAA0D;;;QAG1D,sDAAsD;;MAExD;IAEF;;;;;;;QAOI,8CAA8C;;MAEhD;IAEF;;;;;;MAME;IAEF;;QAEI,kDAAkD;;;;;;MAGpD;IAEF;;;;;MAKE;IAEF;;;;MAIE;IAEF;QACI;;mEAE2D;;MAE7D;IAEF;;YAhII,qDAAqD;;YAErD,2BAA2B;;YAE3B,8CAA8C;;YAE9C,kEAAkE;;;;;;;YAYlE,iEAAiE;;YAEjE,6DAA6D;;YAE7D,kEAAkE;;YAElE,oDAAoD;;;;;;;;YAKpD,2CAA2C;;YAE3C,sEAAsE;;;;YAItE,kDAAkD;;YAElD,iEAAiE;;;;;;;oBAoBzD,mEAAmE;;;gBANvE,oDAAoD;;gBAEpD,0BAA0B;;;YAP9B,yDAAyD;;YAEzD,yDAAyD;;;;YAgBzD,gEAAgE;;YAEhE,yBAAyB;;;;;;;;YASzB,0DAA0D;;;YAG1D,sDAAsD;;;;;;;;;;YAWtD,8CAA8C;;;;;;;;;;;;;;;;YAc9C,kDAAkD;;;;;;;;;;;;;;;YAmBlD;;uEAE2D;;;MAyB9D;IAED,0BA6BC;IAED;;OAEG;IACH,YAFW,iCAAiC,QAI3C;IAED,2CAIC;CACJ"}
1
+ {"version":3,"file":"FirstPersonPlayerControllerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/FirstPersonPlayerControllerConfig.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH;IACI;QACI,qDAAqD;;QAErD,2BAA2B;;QAE3B;;yBAEiB;;QAEjB,8CAA8C;;QAE9C,iFAAiF;;QAEjF,oFAAoF;;QAEpF;;;;;;;;;WASG;;MAEL;IAMF;;;;QAII,iEAAiE;;QAEjE,6DAA6D;;QAE7D,kEAAkE;;QAElE,oDAAoD;;QAEpD;;;;;WAKG;;QAEH;;;;WAIG;;MAEL;IAEF;QACI,2CAA2C;;QAE3C,sEAAsE;;;;QAItE,kDAAkD;;QAElD,iEAAiE;;;;;;MAMnE;IAEF;QACI,yDAAyD;;QAEzD,yDAAyD;;;YAGrD,oDAAoD;;YAEpD,0BAA0B;;;;gBAItB,mEAAmE;;;;MAI7E;IAEF;QACI,gEAAgE;;QAEhE,yBAAyB;;MAE3B;IAEF;;;;;;OAMG;IACH;QACI,yDAAyD;;QAEzD;+EACuE;;QAEvE,4DAA4D;;QAE5D,0EAA0E;;QAE1E;kEAC0D;;MAE5D;IAEF;;;;OAIG;IACH;QACI,6EAA6E;;QAE7E,oDAAoD;;QAEpD;0DACkD;;MAEpD;IAEF;;;;;;OAMG;IACH;QACI;;qBAEa;;QAEb;;sBAEc;;QAEd;0EACkE;;QAElE;iEACyD;;QAEzD;;;gCAGwB;;MAE1B;IAEF;;;;;;OAMG;IACH;QACI;oDAC4C;;QAE5C;;qEAE6D;;QAE7D;8DACsD;;QAEtD;;2BAEmB;;MAErB;IAEF;;;;OAIG;IACH;QACI;iEACyD;;QAEzD,oEAAoE;;QAEpE;qEAC6D;;QAE7D;;0EAEkE;;QAElE;;6CAEqC;;QAErC;4DACoD;;MAEtD;IAEF;;;;;QAKI,0DAA0D;;;QAG1D,sDAAsD;;QAEtD;;;;;;;WAOG;;QAEH;;;;;;;WAOG;;QAEH,qEAAqE;;QAErE;;;;;;WAMG;;QAEH;;;;;;;;;;;WAWG;;;;QAIH;;;;;;;;;WASG;;MAEL;IAEF;;;;;;;QAOI,8CAA8C;;QAE9C;;;;;;;;;;;;;;;;;;WAkBG;;QAEH;;6DAEqD;;MAEvD;IAEF;QAEI,wEAAwE;;QAExE,+DAA+D;;QAI/D,+DAA+D;;QAE/D;yEACiE;;QAEjE;;;;;WAKG;;QAEH,yDAAyD;;QAIzD,sEAAsE;;QAEtE,2EAA2E;;QAI3E;yEACiE;;QAEjE;qEAC6D;;QAE7D,sDAAsD;;MAExD;IAEF;;QAEI,kDAAkD;;;;;;QAGlD;;;WAGG;;QAEH;;;;WAIG;;QAEH;gEACwD;;QAExD;;;;;;;WAOG;;MAEL;IAEF;;;;;MAKE;IAEF;;;;MAIE;IAEF;;;;;;;OAOG;IACH;QACI,mFAAmF;;QAEnF,wDAAwD;;QAExD,iFAAiF;;MAEnF;IAEF;QACI;;mEAE2D;;MAE7D;IAEF;;YAzaI,qDAAqD;;YAErD,2BAA2B;;YAE3B;;6BAEiB;;YAEjB,8CAA8C;;YAE9C,iFAAiF;;YAEjF,oFAAoF;;YAEpF;;;;;;;;;eASG;;;;;;;YAYH,iEAAiE;;YAEjE,6DAA6D;;YAE7D,kEAAkE;;YAElE,oDAAoD;;YAEpD;;;;;eAKG;;YAEH;;;;eAIG;;;;;;;;YAKH,2CAA2C;;YAE3C,sEAAsE;;;;YAItE,kDAAkD;;YAElD,iEAAiE;;;;;;;oBAoBzD,mEAAmE;;;gBANvE,oDAAoD;;gBAEpD,0BAA0B;;;YAP9B,yDAAyD;;YAEzD,yDAAyD;;;;YAgBzD,gEAAgE;;YAEhE,yBAAyB;;;;YAiDzB;;yBAEa;;YAEb;;0BAEc;;YAEd;8EACkE;;YAElE;qEACyD;;YAEzD;;;oCAGwB;;;;YAYxB;wDAC4C;;YAE5C;;yEAE6D;;YAE7D;kEACsD;;YAEtD;;+BAEmB;;;;YA9EnB,yDAAyD;;YAEzD;mFACuE;;YAEvE,4DAA4D;;YAE5D,0EAA0E;;YAE1E;sEAC0D;;;;YAU1D,6EAA6E;;YAE7E,oDAAoD;;YAEpD;8DACkD;;;;YA+DlD;qEACyD;;YAEzD,oEAAoE;;YAEpE;yEAC6D;;YAE7D;;8EAEkE;;YAElE;;iDAEqC;;YAErC;gEACoD;;;;;;;;YASpD,0DAA0D;;;YAG1D,sDAAsD;;YAEtD;;;;;;;eAOG;;YAEH;;;;;;;eAOG;;YAEH,qEAAqE;;YAErE;;;;;;eAMG;;YAEH;;;;;;;;;;;eAWG;;;;YAIH;;;;;;;;;eASG;;;;;;;;;;YAWH,8CAA8C;;YAE9C;;;;;;;;;;;;;;;;;;eAkBG;;YAEH;;iEAEqD;;;;YAMrD,wEAAwE;;YAExE,+DAA+D;;YAI/D,+DAA+D;;YAE/D;6EACiE;;YAEjE;;;;;eAKG;;YAEH,yDAAyD;;YAIzD,sEAAsE;;YAEtE,2EAA2E;;YAI3E;6EACiE;;YAEjE;yEAC6D;;YAE7D,sDAAsD;;;;;;;;;YAMtD,kDAAkD;;YAGlD;;;eAGG;;YAEH;;;;eAIG;;YAEH;oEACwD;;YAExD;;;;;;;eAOG;;;;;;;;;;;;;;;YA0BH,mFAAmF;;YAEnF,wDAAwD;;YAExD,iFAAiF;;;;YAKjF;;uEAE2D;;;MA+B9D;IAED,0BAmCC;IAED;;OAEG;IACH,YAFW,iCAAiC,QAI3C;IAED,2CAIC;CACJ"}