@woosh/meep-engine 2.138.17 → 2.138.19

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 (449) hide show
  1. package/README.md +2 -2
  2. package/build/bundle-worker-image-decoder.js +1 -1
  3. package/editor/actions/concrete/ActionUpdateTexture.d.ts +12 -0
  4. package/editor/actions/concrete/ActionUpdateTexture.d.ts.map +1 -0
  5. package/editor/actions/concrete/ArrayCopyAction.d.ts +20 -0
  6. package/editor/actions/concrete/ArrayCopyAction.d.ts.map +1 -0
  7. package/editor/actions/concrete/ComponentRemoveAction.d.ts +11 -0
  8. package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -0
  9. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +47 -0
  10. package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts.map +1 -0
  11. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +38 -0
  12. package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +1 -0
  13. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +23 -0
  14. package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +1 -0
  15. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +19 -0
  16. package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -0
  17. package/editor/actions/concrete/SelectionRemoveAction.d.ts +10 -0
  18. package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -0
  19. package/editor/actions/concrete/WriteGridValueAction.d.ts +15 -0
  20. package/editor/actions/concrete/WriteGridValueAction.d.ts.map +1 -0
  21. package/editor/ecs/component/FieldDescriptor.d.ts +27 -0
  22. package/editor/ecs/component/FieldDescriptor.d.ts.map +1 -0
  23. package/editor/ecs/component/FieldValueAdapter.d.ts +7 -0
  24. package/editor/ecs/component/FieldValueAdapter.d.ts.map +1 -0
  25. package/editor/ecs/component/createFieldEditor.d.ts +9 -0
  26. package/editor/ecs/component/createFieldEditor.d.ts.map +1 -0
  27. package/editor/ecs/component/createObjectEditor.d.ts +14 -0
  28. package/editor/ecs/component/createObjectEditor.d.ts.map +1 -0
  29. package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts.map +1 -1
  30. package/editor/ecs/component/findNearestRegisteredType.d.ts +8 -0
  31. package/editor/ecs/component/findNearestRegisteredType.d.ts.map +1 -0
  32. package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -1
  33. package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts.map +1 -1
  34. package/editor/tools/GridPaintTool.d.ts +17 -0
  35. package/editor/tools/GridPaintTool.d.ts.map +1 -0
  36. package/editor/tools/SelectionTool.d.ts +27 -0
  37. package/editor/tools/SelectionTool.d.ts.map +1 -0
  38. package/editor/tools/TopDownCameraControlTool.d.ts +13 -0
  39. package/editor/tools/TopDownCameraControlTool.d.ts.map +1 -0
  40. package/editor/view/ecs/ComponentControlFactory.d.ts.map +1 -0
  41. package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
  42. package/editor/view/ecs/EntityEditor.d.ts.map +1 -0
  43. package/editor/view/ecs/EntityList.d.ts.map +1 -0
  44. package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +1 -0
  45. package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
  46. package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
  47. package/editor/view/node-graph/NodeView.d.ts.map +1 -1
  48. package/editor/view/node-graph/PortView.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/src/core/binary/BinaryBuffer.d.ts +1 -1
  51. package/src/core/binary/BinaryBuffer.js +1 -1
  52. package/src/core/binary/BitSet.d.ts +1 -1
  53. package/src/core/binary/BitSet.js +1 -1
  54. package/src/core/cache/Cache.js +1 -1
  55. package/src/core/cache/LoadingCache.js +1 -1
  56. package/src/core/collection/list/List.js +1 -1
  57. package/src/core/collection/map/HashMap.js +1 -1
  58. package/src/core/collection/table/RowFirstTable.d.ts +1 -1
  59. package/src/core/collection/table/RowFirstTable.js +1 -1
  60. package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -1
  61. package/src/core/collection/table/RowFirstTableSpec.js +1 -1
  62. package/src/core/color/oklab/compute_max_saturation.d.ts +1 -1
  63. package/src/core/color/oklab/compute_max_saturation.js +1 -1
  64. package/src/core/color/oklab/find_cusp.d.ts +1 -1
  65. package/src/core/color/oklab/find_cusp.js +1 -1
  66. package/src/core/color/oklab/find_gamut_intersection.d.ts +1 -1
  67. package/src/core/color/oklab/find_gamut_intersection.js +1 -1
  68. package/src/core/color/oklab/okhsv_to_linear_srgb.d.ts +1 -1
  69. package/src/core/color/oklab/okhsv_to_linear_srgb.js +1 -1
  70. package/src/core/color/oklab/oklab_to_linear_srgb.d.ts +1 -1
  71. package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -1
  72. package/src/core/color/oklab/oklab_to_xyz.d.ts +1 -1
  73. package/src/core/color/oklab/oklab_to_xyz.js +1 -1
  74. package/src/core/color/oklab/xyz_to_oklab.d.ts +1 -1
  75. package/src/core/color/oklab/xyz_to_oklab.js +1 -1
  76. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts +1 -1
  77. package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +1 -1
  78. package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts.map +1 -1
  79. package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.js +57 -65
  80. package/src/core/geom/3d/octahedra/octahedral_uv_wrap.d.ts +1 -1
  81. package/src/core/geom/3d/octahedra/octahedral_uv_wrap.js +1 -1
  82. package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts +1 -1
  83. package/src/core/geom/3d/quaternion/quat_decode_from_uint32.js +1 -1
  84. package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts +1 -1
  85. package/src/core/geom/3d/quaternion/quat_encode_to_uint32.js +1 -1
  86. package/src/core/geom/3d/shape/AbstractShape3D.d.ts +74 -3
  87. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +37 -0
  88. package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -0
  89. package/src/core/geom/3d/shape/CapsuleShape3D.js +210 -0
  90. package/src/core/geom/3d/shape/PointShape3D.d.ts +5 -0
  91. package/src/core/geom/3d/shape/PointShape3D.d.ts.map +1 -1
  92. package/src/core/geom/3d/shape/PointShape3D.js +52 -14
  93. package/src/core/geom/3d/shape/TransformedShape3D.d.ts +75 -12
  94. package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
  95. package/src/core/geom/3d/shape/TransformedShape3D.js +12 -3
  96. package/src/core/geom/3d/shape/UnionShape3D.d.ts +47 -5
  97. package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
  98. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts +12 -5
  99. package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
  100. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts +17 -5
  101. package/src/core/geom/3d/shape/UnitSphereShape3D.d.ts.map +1 -1
  102. package/src/core/geom/3d/shape/json/shape_to_type.d.ts.map +1 -1
  103. package/src/core/geom/3d/shape/json/shape_to_type.js +4 -1
  104. package/src/core/geom/3d/shape/json/type_adapters.d.ts +17 -2
  105. package/src/core/geom/3d/shape/json/type_adapters.d.ts.map +1 -1
  106. package/src/core/geom/3d/shape/json/type_adapters.js +18 -2
  107. package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.d.ts.map +1 -1
  108. package/src/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.js +51 -48
  109. package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.d.ts +1 -1
  110. package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +1 -1
  111. package/src/core/geom/ConicRay.d.ts +1 -1
  112. package/src/core/geom/ConicRay.js +1 -1
  113. package/src/core/geom/Quaternion.d.ts +2 -2
  114. package/src/core/geom/Quaternion.js +2 -2
  115. package/src/core/geom/Vector1.d.ts +1 -1
  116. package/src/core/geom/Vector1.js +1 -1
  117. package/src/core/geom/Vector2.d.ts +1 -1
  118. package/src/core/geom/Vector2.js +1 -1
  119. package/src/core/geom/Vector3.d.ts +1 -1
  120. package/src/core/geom/Vector3.js +1 -1
  121. package/src/core/geom/packing/miniball/Miniball.d.ts +1 -1
  122. package/src/core/geom/packing/miniball/Miniball.js +1 -1
  123. package/src/core/geom/vec3/serialization/v3_binary_equality_decode.d.ts +1 -1
  124. package/src/core/geom/vec3/serialization/v3_binary_equality_decode.js +1 -1
  125. package/src/core/geom/vec3/serialization/v3_binary_equality_encode.d.ts +1 -1
  126. package/src/core/geom/vec3/serialization/v3_binary_equality_encode.js +1 -1
  127. package/src/core/math/spline/spline3_hermite.d.ts +1 -1
  128. package/src/core/math/spline/spline3_hermite.js +1 -1
  129. package/src/core/math/spline/spline3_hermite_bounds.d.ts +1 -1
  130. package/src/core/math/spline/spline3_hermite_bounds.js +1 -1
  131. package/src/core/math/spline/spline3_hermite_bounds_t.d.ts +1 -1
  132. package/src/core/math/spline/spline3_hermite_bounds_t.js +1 -1
  133. package/src/core/math/spline/spline3_hermite_to_monomial.d.ts +1 -1
  134. package/src/core/math/spline/spline3_hermite_to_monomial.js +1 -1
  135. package/src/core/model/ObservedBoolean.d.ts +1 -1
  136. package/src/core/model/ObservedBoolean.js +1 -1
  137. package/src/core/model/ObservedString.d.ts +1 -1
  138. package/src/core/model/ObservedString.js +1 -1
  139. package/src/core/process/undo/Action.js +1 -1
  140. package/src/core/process/undo/ActionProcessor.js +1 -1
  141. package/src/engine/animation/curve/AnimationCurve.d.ts +1 -1
  142. package/src/engine/animation/curve/AnimationCurve.js +1 -1
  143. package/src/engine/animation/curve/Keyframe.d.ts +1 -1
  144. package/src/engine/animation/curve/Keyframe.js +1 -1
  145. package/src/engine/animation/curve/animation_curve_compute_aabb.d.ts +1 -1
  146. package/src/engine/animation/curve/animation_curve_compute_aabb.js +1 -1
  147. package/src/engine/animation/curve/animation_curve_optimize.d.ts +1 -1
  148. package/src/engine/animation/curve/animation_curve_optimize.js +2 -2
  149. package/src/engine/asset/loaders/image/jpeg/JpegImage.js +1 -1
  150. package/src/engine/asset/loaders/image/png/PNGReader.d.ts.map +1 -1
  151. package/src/engine/asset/loaders/image/png/PNGReader.js +27 -7
  152. package/src/engine/asset/loaders/image/png/crc32.d.ts +1 -1
  153. package/src/engine/asset/loaders/image/png/crc32.js +1 -1
  154. package/src/engine/control/first-person/DESIGN.md +616 -0
  155. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +229 -0
  156. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -0
  157. package/src/engine/control/first-person/FirstPersonPlayerController.js +176 -0
  158. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts +251 -0
  159. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.d.ts.map +1 -0
  160. package/src/engine/control/first-person/FirstPersonPlayerControllerConfig.js +205 -0
  161. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +151 -0
  162. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -0
  163. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +799 -0
  164. package/src/engine/control/first-person/math/computeJumpFromApex.d.ts +23 -0
  165. package/src/engine/control/first-person/math/computeJumpFromApex.d.ts.map +1 -0
  166. package/src/engine/control/first-person/math/computeJumpFromApex.js +23 -0
  167. package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts +23 -0
  168. package/src/engine/control/first-person/math/criticallyDampedSpring.d.ts.map +1 -0
  169. package/src/engine/control/first-person/math/criticallyDampedSpring.js +34 -0
  170. package/src/engine/control/first-person/math/dampedSpringStep.d.ts +23 -0
  171. package/src/engine/control/first-person/math/dampedSpringStep.d.ts.map +1 -0
  172. package/src/engine/control/first-person/math/dampedSpringStep.js +72 -0
  173. package/src/engine/control/first-person/math/stepTowards.d.ts +12 -0
  174. package/src/engine/control/first-person/math/stepTowards.d.ts.map +1 -0
  175. package/src/engine/control/first-person/math/stepTowards.js +20 -0
  176. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts +69 -0
  177. package/src/engine/control/first-person/pose/FirstPersonPose.d.ts.map +1 -0
  178. package/src/engine/control/first-person/pose/FirstPersonPose.js +91 -0
  179. package/src/engine/control/first-person/prototype_first_person_controller.d.ts +2 -0
  180. package/src/engine/control/first-person/prototype_first_person_controller.d.ts.map +1 -0
  181. package/src/engine/control/first-person/prototype_first_person_controller.js +314 -0
  182. package/src/engine/ecs/Entity.js +1 -1
  183. package/src/engine/ecs/EntityComponentDataset.js +1 -1
  184. package/src/engine/ecs/EntityManager.d.ts +1 -1
  185. package/src/engine/ecs/EntityManager.js +1 -1
  186. package/src/engine/ecs/EntityObserver.js +1 -1
  187. package/src/engine/ecs/EntityReference.d.ts +1 -1
  188. package/src/engine/ecs/EntityReference.js +1 -1
  189. package/src/engine/ecs/System.js +1 -1
  190. package/src/engine/ecs/attachment/AttachmentSystem.d.ts +2 -2
  191. package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
  192. package/src/engine/ecs/grid/HeightMap2AOMap.d.ts.map +1 -1
  193. package/src/engine/ecs/grid/HeightMap2AOMap.js +3 -2
  194. package/src/engine/ecs/guid/UUID.d.ts +1 -1
  195. package/src/engine/ecs/guid/UUID.js +1 -1
  196. package/src/engine/ecs/name/Name.d.ts +1 -1
  197. package/src/engine/ecs/name/Name.js +1 -1
  198. package/src/engine/ecs/parent/ParentEntity.js +1 -1
  199. package/src/engine/ecs/storage/BinaryBufferDeSerializer.d.ts +1 -1
  200. package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
  201. package/src/engine/ecs/storage/BinaryBufferSerializer.d.ts +1 -1
  202. package/src/engine/ecs/storage/BinaryBufferSerializer.js +1 -1
  203. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +1 -1
  204. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.d.ts +1 -1
  205. package/src/engine/ecs/storage/binary/BinarySerializationRegistry.js +1 -1
  206. package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.d.ts +1 -1
  207. package/src/engine/ecs/storage/binary/collection/BinaryCollectionDeSerializer.js +1 -1
  208. package/src/engine/ecs/transform/Transform.d.ts +1 -1
  209. package/src/engine/ecs/transform/Transform.js +1 -1
  210. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  211. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
  212. package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +10 -1
  213. package/src/engine/graphics/impostors/voxel/README.md +149 -0
  214. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts +91 -0
  215. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.d.ts.map +1 -0
  216. package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +376 -0
  217. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts +128 -0
  218. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.d.ts.map +1 -0
  219. package/src/engine/graphics/impostors/voxel/VoxelImpostorDescription.js +141 -0
  220. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts +38 -0
  221. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.d.ts.map +1 -0
  222. package/src/engine/graphics/impostors/voxel/bake/read_atlas_to_samples.js +338 -0
  223. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts +43 -0
  224. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.d.ts.map +1 -0
  225. package/src/engine/graphics/impostors/voxel/bake/voxelize_samples.js +192 -0
  226. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts +2 -0
  227. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.d.ts.map +1 -0
  228. package/src/engine/graphics/impostors/voxel/prototype_voxel_impostors.js +343 -0
  229. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts +13 -0
  230. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.d.ts.map +1 -0
  231. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderDepthV0.js +99 -0
  232. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts +19 -0
  233. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.d.ts.map +1 -0
  234. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderLitV0.js +231 -0
  235. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts +5 -0
  236. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.d.ts.map +1 -0
  237. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderNormalsV0.js +70 -0
  238. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts +13 -0
  239. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.d.ts.map +1 -0
  240. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderV0.js +127 -0
  241. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts +5 -0
  242. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.d.ts.map +1 -0
  243. package/src/engine/graphics/impostors/voxel/shader/VoxelImpostorShaderViewportDepthV0.js +68 -0
  244. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts +27 -0
  245. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.d.ts.map +1 -0
  246. package/src/engine/graphics/impostors/voxel/util/make_voxel_impostor_geometry.js +96 -0
  247. package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +113 -29
  248. package/src/engine/graphics/render/forward_plus/SPECIFICATION.md +1 -1
  249. package/src/engine/graphics/shaders/AmbientOcclusionShader.d.ts.map +1 -1
  250. package/src/engine/graphics/shaders/AmbientOcclusionShader.js +20 -5
  251. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
  252. package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
  253. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.d.ts +1 -1
  254. package/src/engine/graphics/texture/sampler/distance/computeSignedDistanceField_NaiveFlood.js +1 -1
  255. package/src/engine/graphics/util/build_max_height_pyramid.d.ts +21 -14
  256. package/src/engine/graphics/util/build_max_height_pyramid.d.ts.map +1 -1
  257. package/src/engine/graphics/util/build_max_height_pyramid.js +107 -70
  258. package/src/engine/input/devices/InputDeviceSwitch.js +1 -1
  259. package/src/engine/input/devices/KeyboardDevice.js +1 -1
  260. package/src/engine/input/devices/PointerDevice.js +1 -1
  261. package/src/engine/intelligence/behavior/Behavior.js +1 -1
  262. package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +1 -1
  263. package/src/engine/intelligence/behavior/SelectorBehavior.js +1 -1
  264. package/src/engine/intelligence/behavior/behavior_to_dot.d.ts +1 -1
  265. package/src/engine/intelligence/behavior/behavior_to_dot.js +1 -1
  266. package/src/engine/intelligence/behavior/composite/CompositeBehavior.d.ts +1 -1
  267. package/src/engine/intelligence/behavior/composite/CompositeBehavior.js +1 -1
  268. package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +1 -1
  269. package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +1 -1
  270. package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +1 -1
  271. package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +1 -1
  272. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +1 -1
  273. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +1 -1
  274. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -1
  275. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.js +1 -1
  276. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -1
  277. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.js +1 -1
  278. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -1
  279. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +1 -1
  280. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -1
  281. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +1 -1
  282. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +1 -1
  283. package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +1 -1
  284. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
  285. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +1 -1
  286. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -1
  287. package/src/engine/intelligence/behavior/ecs/DieBehavior.js +1 -1
  288. package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +1 -1
  289. package/src/engine/intelligence/behavior/ecs/EntityBehavior.js +1 -1
  290. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -1
  291. package/src/engine/intelligence/behavior/ecs/KillBehavior.js +1 -1
  292. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -1
  293. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +1 -1
  294. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -1
  295. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +1 -1
  296. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -1
  297. package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +1 -1
  298. package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -1
  299. package/src/engine/intelligence/behavior/primitive/FailingBehavior.js +1 -1
  300. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +1 -1
  301. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.js +1 -1
  302. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -1
  303. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +1 -1
  304. package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +1 -1
  305. package/src/engine/intelligence/behavior/selector/WeightedElement.js +1 -1
  306. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
  307. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +1 -1
  308. package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -1
  309. package/src/engine/intelligence/behavior/util/BranchBehavior.js +1 -1
  310. package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -1
  311. package/src/engine/intelligence/behavior/util/DelayBehavior.js +1 -1
  312. package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -1
  313. package/src/engine/intelligence/behavior/util/LogMessageBehavior.js +1 -1
  314. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +1 -1
  315. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.js +1 -1
  316. package/src/engine/intelligence/blackboard/Blackboard.js +1 -1
  317. package/src/engine/intelligence/mcts/MonteCarlo.d.ts +1 -1
  318. package/src/engine/intelligence/mcts/MonteCarlo.js +1 -1
  319. package/src/engine/intelligence/mcts/MoveEdge.d.ts +1 -1
  320. package/src/engine/intelligence/mcts/MoveEdge.js +1 -1
  321. package/src/engine/intelligence/mcts/StateNode.d.ts +1 -1
  322. package/src/engine/intelligence/mcts/StateNode.js +1 -1
  323. package/src/engine/intelligence/resource/ActionSequence.d.ts +1 -1
  324. package/src/engine/intelligence/resource/ActionSequence.js +1 -1
  325. package/src/engine/intelligence/resource/Resource.d.ts +1 -1
  326. package/src/engine/intelligence/resource/Resource.js +1 -1
  327. package/src/engine/intelligence/resource/ResourceAllocation.d.ts +1 -1
  328. package/src/engine/intelligence/resource/ResourceAllocation.js +1 -1
  329. package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts +1 -1
  330. package/src/engine/intelligence/resource/ResourceAllocationBid.js +1 -1
  331. package/src/engine/intelligence/resource/ResourceAllocationSolver.d.ts +1 -1
  332. package/src/engine/intelligence/resource/ResourceAllocationSolver.js +1 -1
  333. package/src/engine/intelligence/resource/StrategicResourceAllocator.d.ts +1 -1
  334. package/src/engine/intelligence/resource/StrategicResourceAllocator.js +1 -1
  335. package/src/engine/intelligence/resource/TacticalModule.d.ts +1 -1
  336. package/src/engine/intelligence/resource/TacticalModule.js +1 -1
  337. package/src/engine/network/NetworkSession.d.ts +1 -1
  338. package/src/engine/network/NetworkSession.js +1 -1
  339. package/src/engine/network/adapters/QuaternionInterpolationAdapter.d.ts +1 -1
  340. package/src/engine/network/adapters/QuaternionInterpolationAdapter.js +1 -1
  341. package/src/engine/network/adapters/TransformInterpolationAdapter.d.ts +1 -1
  342. package/src/engine/network/adapters/TransformInterpolationAdapter.js +1 -1
  343. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +1 -1
  344. package/src/engine/network/adapters/TransformReplicationAdapter.js +1 -1
  345. package/src/engine/network/adapters/Vector3InterpolationAdapter.d.ts +1 -1
  346. package/src/engine/network/adapters/Vector3InterpolationAdapter.js +1 -1
  347. package/src/engine/network/core/quantize/quantize_float.d.ts +1 -1
  348. package/src/engine/network/core/quantize/quantize_float.js +1 -1
  349. package/src/engine/network/core/quantize/quantize_position.d.ts +1 -1
  350. package/src/engine/network/core/quantize/quantize_position.js +1 -1
  351. package/src/engine/network/core/sequence/ack_bitfield.d.ts +1 -1
  352. package/src/engine/network/core/sequence/ack_bitfield.js +1 -1
  353. package/src/engine/network/core/sequence/seq16.d.ts +1 -1
  354. package/src/engine/network/core/sequence/seq16.js +1 -1
  355. package/src/engine/network/core/sequence/seq32.d.ts +1 -1
  356. package/src/engine/network/core/sequence/seq32.js +1 -1
  357. package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
  358. package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
  359. package/src/engine/network/diagnostics/ReplayLog.d.ts +1 -1
  360. package/src/engine/network/diagnostics/ReplayLog.js +1 -1
  361. package/src/engine/network/diagnostics/SyncTest.d.ts +1 -1
  362. package/src/engine/network/diagnostics/SyncTest.js +1 -1
  363. package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
  364. package/src/engine/network/ecs/NetworkSystem.js +1 -1
  365. package/src/engine/network/ecs/components/NetworkIdentity.d.ts +1 -1
  366. package/src/engine/network/ecs/components/NetworkIdentity.js +1 -1
  367. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +1 -1
  368. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.js +1 -1
  369. package/src/engine/network/orchestrator/NetworkPeer.d.ts +1 -1
  370. package/src/engine/network/orchestrator/NetworkPeer.js +1 -1
  371. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +1 -1
  372. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +1 -1
  373. package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +1 -1
  374. package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +1 -1
  375. package/src/engine/network/replication/Replicator.d.ts +1 -1
  376. package/src/engine/network/replication/Replicator.js +1 -1
  377. package/src/engine/network/replication/ScopeFilter.d.ts +2 -2
  378. package/src/engine/network/replication/ScopeFilter.js +2 -2
  379. package/src/engine/network/sim/ActionLog.d.ts +1 -1
  380. package/src/engine/network/sim/ActionLog.js +1 -1
  381. package/src/engine/network/sim/BinaryInterpolationAdapter.d.ts +1 -1
  382. package/src/engine/network/sim/BinaryInterpolationAdapter.js +1 -1
  383. package/src/engine/network/sim/InterpolationLog.d.ts +1 -1
  384. package/src/engine/network/sim/InterpolationLog.js +1 -1
  385. package/src/engine/network/sim/ReplicatedComponentRegistry.d.ts +1 -1
  386. package/src/engine/network/sim/ReplicatedComponentRegistry.js +1 -1
  387. package/src/engine/network/sim/RewindEngine.d.ts +1 -1
  388. package/src/engine/network/sim/RewindEngine.js +1 -1
  389. package/src/engine/network/sim/SimAction.d.ts +1 -1
  390. package/src/engine/network/sim/SimAction.js +1 -1
  391. package/src/engine/network/sim/SimActionExecutor.d.ts +1 -1
  392. package/src/engine/network/sim/SimActionExecutor.js +1 -1
  393. package/src/engine/network/sim/SimActionRegistry.d.ts +1 -1
  394. package/src/engine/network/sim/SimActionRegistry.js +1 -1
  395. package/src/engine/network/sim/SmoothingState.js +1 -1
  396. package/src/engine/network/sim/Snapshotter.d.ts +1 -1
  397. package/src/engine/network/sim/Snapshotter.js +1 -1
  398. package/src/engine/network/sim/SpeculationLog.d.ts +1 -1
  399. package/src/engine/network/sim/SpeculationLog.js +1 -1
  400. package/src/engine/network/state/Baseline.d.ts +1 -1
  401. package/src/engine/network/state/Baseline.js +1 -1
  402. package/src/engine/network/state/ChangedEntitySet.d.ts +1 -1
  403. package/src/engine/network/state/ChangedEntitySet.js +1 -1
  404. package/src/engine/network/state/InputRing.d.ts +1 -1
  405. package/src/engine/network/state/InputRing.js +1 -1
  406. package/src/engine/network/state/MutationLedger.d.ts +1 -1
  407. package/src/engine/network/state/MutationLedger.js +1 -1
  408. package/src/engine/network/state/PriorityAccumulator.d.ts +1 -1
  409. package/src/engine/network/state/PriorityAccumulator.js +1 -1
  410. package/src/engine/network/state/ReplicationSlotTable.d.ts +1 -1
  411. package/src/engine/network/state/ReplicationSlotTable.js +1 -1
  412. package/src/engine/network/time/AdaptiveRenderDelay.d.ts +1 -1
  413. package/src/engine/network/time/AdaptiveRenderDelay.js +1 -1
  414. package/src/engine/network/time/JitterBuffer.d.ts +1 -1
  415. package/src/engine/network/time/JitterBuffer.js +1 -1
  416. package/src/engine/network/time/TimeDilation.d.ts +1 -1
  417. package/src/engine/network/time/TimeDilation.js +1 -1
  418. package/src/engine/network/time/TimeSync.d.ts +1 -1
  419. package/src/engine/network/time/TimeSync.js +1 -1
  420. package/src/engine/network/transport/Channel.d.ts.map +1 -1
  421. package/src/engine/network/transport/Channel.js +3 -6
  422. package/src/engine/network/transport/LoopbackTransport.d.ts +1 -1
  423. package/src/engine/network/transport/LoopbackTransport.js +1 -1
  424. package/src/engine/network/transport/ReliableCommandPipeline.d.ts +1 -1
  425. package/src/engine/network/transport/ReliableCommandPipeline.js +1 -1
  426. package/src/engine/network/transport/Transport.d.ts +1 -1
  427. package/src/engine/network/transport/Transport.js +1 -1
  428. package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts +1 -1
  429. package/src/engine/network/transport/adapters/NodeUDPTransport.js +2 -2
  430. package/src/engine/network/transport/adapters/SimulatedTransport.d.ts +1 -1
  431. package/src/engine/network/transport/adapters/SimulatedTransport.js +1 -1
  432. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts +1 -1
  433. package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +1 -1
  434. package/src/engine/network/transport/adapters/WebSocketTransport.d.ts +1 -1
  435. package/src/engine/network/transport/adapters/WebSocketTransport.js +1 -1
  436. package/src/engine/network/transport/adapters/WebTransportTransport.d.ts +1 -1
  437. package/src/engine/network/transport/adapters/WebTransportTransport.js +1 -1
  438. package/src/engine/network/transport/fragments/FragmentAssembler.d.ts +1 -1
  439. package/src/engine/network/transport/fragments/FragmentAssembler.js +1 -1
  440. package/src/engine/network/transport/fragments/FragmentRetention.d.ts +1 -1
  441. package/src/engine/network/transport/fragments/FragmentRetention.js +1 -1
  442. package/src/engine/network/transport/fragments/packet_size.d.ts +1 -1
  443. package/src/engine/network/transport/fragments/packet_size.js +1 -1
  444. package/src/engine/simulation/Ticker.d.ts +1 -1
  445. package/src/engine/simulation/Ticker.js +1 -1
  446. package/src/engine/sound/SoundEngine.js +1 -1
  447. package/src/engine/ui/DraggableAspect.d.ts +1 -1
  448. package/src/engine/ui/DraggableAspect.js +1 -1
  449. package/src/view/View.js +1 -1
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Convert designer-friendly jump parameters (apex height in meters, time to
3
+ * reach apex in seconds) into the gravity and initial vertical velocity that
4
+ * produce that jump exactly.
5
+ *
6
+ * The standard ballistic equations:
7
+ * y(t) = v0 * t - 0.5 * g * t^2
8
+ * y'(t) = v0 - g * t
9
+ *
10
+ * At apex y'(t) = 0, so t_apex = v0 / g.
11
+ * Solving with the desired apex height h:
12
+ * g = 2h / t_apex^2
13
+ * v0 = 2h / t_apex
14
+ *
15
+ * @param {number} peakHeight desired apex height in meters (must be > 0)
16
+ * @param {number} timeToApex seconds to reach apex (must be > 0)
17
+ * @param {{gravity:number, initialVelocity:number}} out
18
+ */
19
+ export function computeJumpFromApex(peakHeight: number, timeToApex: number, out: {
20
+ gravity: number;
21
+ initialVelocity: number;
22
+ }): void;
23
+ //# sourceMappingURL=computeJumpFromApex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeJumpFromApex.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/computeJumpFromApex.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,gDAJW,MAAM,cACN,MAAM,OACN;IAAC,OAAO,EAAC,MAAM,CAAC;IAAC,eAAe,EAAC,MAAM,CAAA;CAAC,QAMlD"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Convert designer-friendly jump parameters (apex height in meters, time to
3
+ * reach apex in seconds) into the gravity and initial vertical velocity that
4
+ * produce that jump exactly.
5
+ *
6
+ * The standard ballistic equations:
7
+ * y(t) = v0 * t - 0.5 * g * t^2
8
+ * y'(t) = v0 - g * t
9
+ *
10
+ * At apex y'(t) = 0, so t_apex = v0 / g.
11
+ * Solving with the desired apex height h:
12
+ * g = 2h / t_apex^2
13
+ * v0 = 2h / t_apex
14
+ *
15
+ * @param {number} peakHeight desired apex height in meters (must be > 0)
16
+ * @param {number} timeToApex seconds to reach apex (must be > 0)
17
+ * @param {{gravity:number, initialVelocity:number}} out
18
+ */
19
+ export function computeJumpFromApex(peakHeight, timeToApex, out) {
20
+ const t = timeToApex;
21
+ out.gravity = (2 * peakHeight) / (t * t);
22
+ out.initialVelocity = (2 * peakHeight) / t;
23
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Critically damped spring step, parameterized by half-life rather than
3
+ * angular frequency. A critically damped spring reaches its goal as fast as
4
+ * possible without oscillation — ideal for FOV, crouch height, and lean.
5
+ *
6
+ * Form follows Daniel Holden, "Spring-It-On" — `theorangeduck.com/page/spring-roll-call`.
7
+ *
8
+ * y = ln(2) / halfLife
9
+ * eyt = exp(-y * dt)
10
+ * j1 = v + (x - target) * y
11
+ * x' = target + (x - target + j1 * dt) * eyt
12
+ * v' = (v - j1 * y * dt) * eyt
13
+ *
14
+ * @param {{value:number, velocity:number}} state mutated in place
15
+ * @param {number} target goal value
16
+ * @param {number} halfLife seconds for the gap to halve (smaller = snappier)
17
+ * @param {number} dt
18
+ */
19
+ export function criticallyDampedSpringStep(state: {
20
+ value: number;
21
+ velocity: number;
22
+ }, target: number, halfLife: number, dt: number): void;
23
+ //# sourceMappingURL=criticallyDampedSpring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criticallyDampedSpring.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/criticallyDampedSpring.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,kDALW;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,QAAQ,EAAC,MAAM,CAAA;CAAC,UAC/B,MAAM,YACN,MAAM,MACN,MAAM,QAiBhB"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Critically damped spring step, parameterized by half-life rather than
3
+ * angular frequency. A critically damped spring reaches its goal as fast as
4
+ * possible without oscillation — ideal for FOV, crouch height, and lean.
5
+ *
6
+ * Form follows Daniel Holden, "Spring-It-On" — `theorangeduck.com/page/spring-roll-call`.
7
+ *
8
+ * y = ln(2) / halfLife
9
+ * eyt = exp(-y * dt)
10
+ * j1 = v + (x - target) * y
11
+ * x' = target + (x - target + j1 * dt) * eyt
12
+ * v' = (v - j1 * y * dt) * eyt
13
+ *
14
+ * @param {{value:number, velocity:number}} state mutated in place
15
+ * @param {number} target goal value
16
+ * @param {number} halfLife seconds for the gap to halve (smaller = snappier)
17
+ * @param {number} dt
18
+ */
19
+ export function criticallyDampedSpringStep(state, target, halfLife, dt) {
20
+ if (halfLife <= 0) {
21
+ state.value = target;
22
+ state.velocity = 0;
23
+ return;
24
+ }
25
+
26
+ const y = 0.6931471805599453 / halfLife; // ln(2) / halfLife
27
+ const eyt = Math.exp(-y * dt);
28
+
29
+ const delta = state.value - target;
30
+ const j1 = state.velocity + delta * y;
31
+
32
+ state.value = target + (delta + j1 * dt) * eyt;
33
+ state.velocity = (state.velocity - j1 * y * dt) * eyt;
34
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * General damped spring step (under/critically/over-damped), used for
3
+ * landing recovery where a small ring/overshoot is desirable.
4
+ *
5
+ * Uses the half-life form of natural frequency and an explicit damping
6
+ * ratio zeta. zeta=1 → critically damped (no ring), zeta<1 → under-damped
7
+ * (rings), zeta>1 → over-damped (sluggish).
8
+ *
9
+ * Numerically stable for any zeta via the closed-form solutions of the
10
+ * 2nd-order ODE. Reference: Allen Chou,
11
+ * `allenchou.net/2015/04/game-math-precise-control-over-numeric-springing/`.
12
+ *
13
+ * @param {{value:number, velocity:number}} state mutated in place
14
+ * @param {number} target
15
+ * @param {number} halfLife seconds for the *envelope* to halve
16
+ * @param {number} zeta damping ratio (e.g. 0.55 for a slight ring)
17
+ * @param {number} dt
18
+ */
19
+ export function dampedSpringStep(state: {
20
+ value: number;
21
+ velocity: number;
22
+ }, target: number, halfLife: number, zeta: number, dt: number): void;
23
+ //# sourceMappingURL=dampedSpringStep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dampedSpringStep.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/dampedSpringStep.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCANW;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,QAAQ,EAAC,MAAM,CAAA;CAAC,UAC/B,MAAM,YACN,MAAM,QACN,MAAM,MACN,MAAM,QAuDhB"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * General damped spring step (under/critically/over-damped), used for
3
+ * landing recovery where a small ring/overshoot is desirable.
4
+ *
5
+ * Uses the half-life form of natural frequency and an explicit damping
6
+ * ratio zeta. zeta=1 → critically damped (no ring), zeta<1 → under-damped
7
+ * (rings), zeta>1 → over-damped (sluggish).
8
+ *
9
+ * Numerically stable for any zeta via the closed-form solutions of the
10
+ * 2nd-order ODE. Reference: Allen Chou,
11
+ * `allenchou.net/2015/04/game-math-precise-control-over-numeric-springing/`.
12
+ *
13
+ * @param {{value:number, velocity:number}} state mutated in place
14
+ * @param {number} target
15
+ * @param {number} halfLife seconds for the *envelope* to halve
16
+ * @param {number} zeta damping ratio (e.g. 0.55 for a slight ring)
17
+ * @param {number} dt
18
+ */
19
+ export function dampedSpringStep(state, target, halfLife, zeta, dt) {
20
+ if (halfLife <= 0) {
21
+ state.value = target;
22
+ state.velocity = 0;
23
+ return;
24
+ }
25
+
26
+ // omega such that the envelope decays by 1/2 in halfLife
27
+ // for the under-damped case the envelope is exp(-zeta * omega * t)
28
+ // → omega = ln(2) / (zeta * halfLife). For zeta=1 this matches the
29
+ // critically damped form.
30
+ const omega = 0.6931471805599453 / (Math.max(zeta, 1e-4) * halfLife);
31
+
32
+ const x = state.value - target;
33
+ const v = state.velocity;
34
+
35
+ if (zeta < 1.0) {
36
+ // Under-damped: rings
37
+ const omega_d = omega * Math.sqrt(1 - zeta * zeta);
38
+ const za = zeta * omega;
39
+ const exp_term = Math.exp(-za * dt);
40
+ const cos_term = Math.cos(omega_d * dt);
41
+ const sin_term = Math.sin(omega_d * dt);
42
+ const A = x;
43
+ const B = (v + za * x) / omega_d;
44
+
45
+ state.value = target + exp_term * (A * cos_term + B * sin_term);
46
+ state.velocity = exp_term * (
47
+ (-za) * (A * cos_term + B * sin_term)
48
+ + omega_d * (-A * sin_term + B * cos_term)
49
+ );
50
+ } else if (zeta > 1.0) {
51
+ // Over-damped: two real roots
52
+ const za = zeta * omega;
53
+ const zb = omega * Math.sqrt(zeta * zeta - 1);
54
+ const r1 = -za + zb;
55
+ const r2 = -za - zb;
56
+ const c2 = (v - x * r1) / (r2 - r1);
57
+ const c1 = x - c2;
58
+ const e1 = Math.exp(r1 * dt);
59
+ const e2 = Math.exp(r2 * dt);
60
+
61
+ state.value = target + c1 * e1 + c2 * e2;
62
+ state.velocity = c1 * r1 * e1 + c2 * r2 * e2;
63
+ } else {
64
+ // Critically damped: shared root
65
+ const exp_term = Math.exp(-omega * dt);
66
+ const A = x;
67
+ const B = v + omega * x;
68
+
69
+ state.value = target + exp_term * (A + B * dt);
70
+ state.velocity = exp_term * (B - omega * (A + B * dt));
71
+ }
72
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Linearly step a scalar toward a target by at most `maxStep`. If the gap
3
+ * is smaller than the step, snaps to target. Used for accel/decel on
4
+ * horizontal velocity.
5
+ *
6
+ * @param {number} current
7
+ * @param {number} target
8
+ * @param {number} maxStep must be >= 0
9
+ * @returns {number}
10
+ */
11
+ export function stepTowards(current: number, target: number, maxStep: number): number;
12
+ //# sourceMappingURL=stepTowards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepTowards.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/math/stepTowards.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qCALW,MAAM,UACN,MAAM,WACN,MAAM,GACJ,MAAM,CAWlB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Linearly step a scalar toward a target by at most `maxStep`. If the gap
3
+ * is smaller than the step, snaps to target. Used for accel/decel on
4
+ * horizontal velocity.
5
+ *
6
+ * @param {number} current
7
+ * @param {number} target
8
+ * @param {number} maxStep must be >= 0
9
+ * @returns {number}
10
+ */
11
+ export function stepTowards(current, target, maxStep) {
12
+ const delta = target - current;
13
+ if (delta > maxStep) {
14
+ return current + maxStep;
15
+ }
16
+ if (delta < -maxStep) {
17
+ return current - maxStep;
18
+ }
19
+ return target;
20
+ }
@@ -0,0 +1,69 @@
1
+ export namespace FirstPersonActionState {
2
+ let Grounded: number;
3
+ let Anticipating: number;
4
+ let Airborne: number;
5
+ let Landing: number;
6
+ }
7
+ export class FirstPersonPose {
8
+ /**
9
+ * World-space body root.
10
+ * @type {Vector3}
11
+ */
12
+ rootPosition: Vector3;
13
+ /**
14
+ * Body facing yaw (radians, around world up).
15
+ * @type {number}
16
+ */
17
+ rootYawRad: number;
18
+ /**
19
+ * Head decoupled from body. For most first-person controllers
20
+ * headYawRad === rootYawRad; surfaced separately so future torso-twist
21
+ * rigs can lag the head.
22
+ * @type {number}
23
+ */
24
+ headYawRad: number;
25
+ /**
26
+ * @type {number}
27
+ */
28
+ headPitchRad: number;
29
+ /**
30
+ * Includes lean roll.
31
+ * @type {number}
32
+ */
33
+ headRollRad: number;
34
+ /**
35
+ * Stride phase, [0..1). Same value the camera bob uses, so a feet rig
36
+ * driven by this will land its footfalls on the same frames the camera
37
+ * dips.
38
+ * @type {number}
39
+ */
40
+ locomotionPhase: number;
41
+ /**
42
+ * m/s, horizontal speed. Drives a blend tree.
43
+ * @type {number}
44
+ */
45
+ locomotionSpeed: number;
46
+ /**
47
+ * [-1..1] lateral component, for strafe-blend space.
48
+ * @type {number}
49
+ */
50
+ locomotionStrafe: number;
51
+ /**
52
+ * See {@link FirstPersonActionState}.
53
+ * @type {number}
54
+ */
55
+ actionState: number;
56
+ /**
57
+ * [0..1] interpolation between standing and fully-crouched pose.
58
+ * @type {number}
59
+ */
60
+ crouchAmount: number;
61
+ /**
62
+ * Same as headPitchRad, surfaced separately for IK consumers that only
63
+ * need the aim axis.
64
+ * @type {number}
65
+ */
66
+ aimPitch: number;
67
+ }
68
+ import Vector3 from "../../../../core/geom/Vector3.js";
69
+ //# sourceMappingURL=FirstPersonPose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FirstPersonPose.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/control/first-person/pose/FirstPersonPose.js"],"names":[],"mappings":";;;;;;AAoBA;IACI;;;OAGG;IACH,cAFU,OAAO,CAEY;IAE7B;;;OAGG;IACH,YAFU,MAAM,CAED;IAEf;;;;;OAKG;IACH,YAFU,MAAM,CAED;IAEf;;OAEG;IACH,cAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,aAFU,MAAM,CAEA;IAEhB;;;;;OAKG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,iBAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,kBAFU,MAAM,CAEK;IAErB;;;OAGG;IACH,aAFU,MAAM,CAE8B;IAE9C;;;OAGG;IACH,cAFU,MAAM,CAEC;IAEjB;;;;OAIG;IACH,UAFU,MAAM,CAEH;CAChB;oBA1FmB,kCAAkC"}
@@ -0,0 +1,91 @@
1
+ import Vector3 from "../../../../core/geom/Vector3.js";
2
+
3
+ /**
4
+ * Read-only outputs intended for a downstream skeleton system to consume.
5
+ *
6
+ * Surfaced as a separate struct (rather than reading {@link FirstPersonState}
7
+ * directly) so that the skeleton-driving contract is stable even if
8
+ * internal state representations change later. A future first-person arms
9
+ * rig, third-person body rig, and network-replicated remote rig should all
10
+ * be able to drive themselves from these channels alone.
11
+ *
12
+ * @readonly enum
13
+ */
14
+ export const FirstPersonActionState = {
15
+ Grounded: 0,
16
+ Anticipating: 1, // squashing down before jump impulse
17
+ Airborne: 2,
18
+ Landing: 3
19
+ };
20
+
21
+ export class FirstPersonPose {
22
+ /**
23
+ * World-space body root.
24
+ * @type {Vector3}
25
+ */
26
+ rootPosition = new Vector3();
27
+
28
+ /**
29
+ * Body facing yaw (radians, around world up).
30
+ * @type {number}
31
+ */
32
+ rootYawRad = 0;
33
+
34
+ /**
35
+ * Head decoupled from body. For most first-person controllers
36
+ * headYawRad === rootYawRad; surfaced separately so future torso-twist
37
+ * rigs can lag the head.
38
+ * @type {number}
39
+ */
40
+ headYawRad = 0;
41
+
42
+ /**
43
+ * @type {number}
44
+ */
45
+ headPitchRad = 0;
46
+
47
+ /**
48
+ * Includes lean roll.
49
+ * @type {number}
50
+ */
51
+ headRollRad = 0;
52
+
53
+ /**
54
+ * Stride phase, [0..1). Same value the camera bob uses, so a feet rig
55
+ * driven by this will land its footfalls on the same frames the camera
56
+ * dips.
57
+ * @type {number}
58
+ */
59
+ locomotionPhase = 0;
60
+
61
+ /**
62
+ * m/s, horizontal speed. Drives a blend tree.
63
+ * @type {number}
64
+ */
65
+ locomotionSpeed = 0;
66
+
67
+ /**
68
+ * [-1..1] lateral component, for strafe-blend space.
69
+ * @type {number}
70
+ */
71
+ locomotionStrafe = 0;
72
+
73
+ /**
74
+ * See {@link FirstPersonActionState}.
75
+ * @type {number}
76
+ */
77
+ actionState = FirstPersonActionState.Grounded;
78
+
79
+ /**
80
+ * [0..1] interpolation between standing and fully-crouched pose.
81
+ * @type {number}
82
+ */
83
+ crouchAmount = 0;
84
+
85
+ /**
86
+ * Same as headPitchRad, surfaced separately for IK consumers that only
87
+ * need the aim axis.
88
+ * @type {number}
89
+ */
90
+ aimPitch = 0;
91
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prototype_first_person_controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototype_first_person_controller.d.ts","sourceRoot":"","sources":["../../../../../src/engine/control/first-person/prototype_first_person_controller.js"],"names":[],"mappings":""}