@woosh/meep-engine 2.165.6 → 2.165.7

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 (901) hide show
  1. package/editor/tools/v2/GizmoNode.d.ts +21 -0
  2. package/editor/tools/v2/GizmoNode.d.ts.map +1 -0
  3. package/editor/tools/v2/TransformControls.d.ts +87 -20
  4. package/editor/tools/v2/TransformControls.d.ts.map +1 -0
  5. package/editor/tools/v2/TransformControlsGizmo.d.ts +22 -0
  6. package/editor/tools/v2/TransformControlsGizmo.d.ts.map +1 -0
  7. package/editor/tools/v2/TransformControlsPlane.d.ts +6 -0
  8. package/editor/tools/v2/TransformControlsPlane.d.ts.map +1 -0
  9. package/editor/tools/v2/TranslateHelperGeometry.d.ts +6 -0
  10. package/editor/tools/v2/TranslateHelperGeometry.d.ts.map +1 -0
  11. package/package.json +1 -1
  12. package/src/core/binary/data_view/DataType2DataViewReaders.d.ts +8 -12
  13. package/src/core/binary/data_view/DataType2DataViewReaders.d.ts.map +1 -1
  14. package/src/core/binary/data_view/DataType2DataViewWriters.d.ts +8 -12
  15. package/src/core/binary/data_view/DataType2DataViewWriters.d.ts.map +1 -1
  16. package/src/core/binary/data_view/DataViewStructAccessor.d.ts +39 -18
  17. package/src/core/binary/type/BinaryDataType.d.ts +15 -15
  18. package/src/core/binary/type/DataType2TypedArrayConstructorMapping.d.ts +7 -11
  19. package/src/core/binary/type/DataType2TypedArrayConstructorMapping.d.ts.map +1 -1
  20. package/src/core/binary/type/DataTypeByteSizes.d.ts +7 -13
  21. package/src/core/binary/type/DataTypeByteSizes.d.ts.map +1 -1
  22. package/src/core/binary/type/DataTypeIndices.d.ts +8 -11
  23. package/src/core/binary/type/DataTypeIndices.d.ts.map +1 -1
  24. package/src/core/cache/Cache.d.ts +226 -56
  25. package/src/core/cache/Cache.d.ts.map +1 -1
  26. package/src/core/cache/LoadingCache.d.ts +72 -23
  27. package/src/core/collection/Stack.d.ts +2 -2
  28. package/src/core/collection/array/array_copy.d.ts +12 -7
  29. package/src/core/collection/array/computeHashArray.d.ts +9 -1
  30. package/src/core/collection/array/isArrayEqualStrict.d.ts +8 -1
  31. package/src/core/collection/array/isArraysEqualWithComparator.d.ts +10 -1
  32. package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts +3 -1
  33. package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts.map +1 -1
  34. package/src/core/collection/list/List.d.ts +334 -45
  35. package/src/core/collection/list/List.d.ts.map +1 -1
  36. package/src/core/collection/list/ListForwarder.d.ts +37 -18
  37. package/src/core/collection/map/HashMap.d.ts +199 -40
  38. package/src/core/collection/queue/Deque.d.ts +113 -37
  39. package/src/core/collection/set/ArraySet.d.ts +87 -26
  40. package/src/core/collection/set/HashSet.d.ts +66 -33
  41. package/src/core/collection/set/HashSet.d.ts.map +1 -1
  42. package/src/core/collection/table/bind/TableRecord.d.ts +21 -20
  43. package/src/core/color/Color.d.ts +1 -2
  44. package/src/core/color/Color.d.ts.map +1 -1
  45. package/src/core/events/signal/Signal.d.ts +210 -57
  46. package/src/core/events/signal/signal_filter.d.ts +1 -1
  47. package/src/core/fsm/simple/SimpleStateMachine.d.ts +83 -27
  48. package/src/core/fsm/simple/SimpleStateMachineDescription.d.ts +90 -21
  49. package/src/core/geom/2d/aabb/AABB2.d.ts +335 -51
  50. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts +1 -6
  51. package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
  52. package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts +1 -2
  53. package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts.map +1 -1
  54. package/src/core/geom/3d/SurfacePoint3.d.ts +62 -17
  55. package/src/core/geom/3d/aabb/aabb3_build_corners.d.ts +13 -1
  56. package/src/core/geom/3d/frustum/read_three_planes_to_array.d.ts +7 -3
  57. package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.d.ts +7 -6
  58. package/src/core/geom/3d/sphere/harmonics/sh3_sample_by_direction.d.ts +16 -6
  59. package/src/core/geom/Quaternion.d.ts +1 -2
  60. package/src/core/geom/Quaternion.d.ts.map +1 -1
  61. package/src/core/geom/Vector1.d.ts +1 -2
  62. package/src/core/geom/Vector1.d.ts.map +1 -1
  63. package/src/core/geom/Vector2.d.ts +1 -2
  64. package/src/core/geom/Vector2.d.ts.map +1 -1
  65. package/src/core/geom/Vector3.d.ts +1 -2
  66. package/src/core/geom/Vector3.d.ts.map +1 -1
  67. package/src/core/geom/Vector4.d.ts +1 -1
  68. package/src/core/geom/Vector4.d.ts.map +1 -1
  69. package/src/core/graph/v2/Graph.d.ts +4 -4
  70. package/src/core/graph/v2/Graph.d.ts.map +1 -1
  71. package/src/core/json/resolvePathByArray.d.ts +10 -1
  72. package/src/core/math/clamp.d.ts +9 -1
  73. package/src/core/math/epsilonEquals.d.ts +9 -1
  74. package/src/core/math/interval/NumericInterval.d.ts +1 -2
  75. package/src/core/math/interval/NumericInterval.d.ts.map +1 -1
  76. package/src/core/math/noise/create_simplex_noise_2d.d.ts +7 -1
  77. package/src/core/math/random/seededRandom.d.ts +3 -1
  78. package/src/core/math/remap.d.ts +12 -5
  79. package/src/core/math/sign.d.ts +10 -1
  80. package/src/core/model/BooleanVector3.d.ts +77 -28
  81. package/src/core/model/BooleanVector3.d.ts.map +1 -1
  82. package/src/core/model/BoundedValue.d.ts +5 -5
  83. package/src/core/model/BoundedValue.d.ts.map +1 -1
  84. package/src/core/model/ModuleRegistry.d.ts +45 -3
  85. package/src/core/model/ObservedBoolean.d.ts +1 -2
  86. package/src/core/model/ObservedBoolean.d.ts.map +1 -1
  87. package/src/core/model/ObservedEnum.d.ts +91 -7
  88. package/src/core/model/ObservedEnum.d.ts.map +1 -1
  89. package/src/core/model/ObservedString.d.ts +1 -2
  90. package/src/core/model/ObservedString.d.ts.map +1 -1
  91. package/src/core/model/ObservedValue.d.ts +1 -1
  92. package/src/core/model/ObservedValue.d.ts.map +1 -1
  93. package/src/core/model/node-graph/Connection.d.ts +57 -12
  94. package/src/core/model/node-graph/NodeGraph.d.ts +2 -2
  95. package/src/core/model/node-graph/node/NodeDescription.d.ts +166 -15
  96. package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
  97. package/src/core/model/node-graph/node/NodeInstance.d.ts +181 -22
  98. package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
  99. package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts +82 -3
  100. package/src/core/model/node-graph/node/Port.d.ts +72 -3
  101. package/src/core/model/node-graph/node/Port.d.ts.map +1 -1
  102. package/src/core/model/node-graph/node/PortDirection.d.ts +7 -5
  103. package/src/core/model/node-graph/type/DataType.d.ts +61 -4
  104. package/src/core/model/node-graph/type/ParametricDataType.d.ts +0 -1
  105. package/src/core/model/node-graph/type/ParametricDataType.d.ts.map +1 -1
  106. package/src/core/model/object/ImmutableObjectPool.d.ts +1 -2
  107. package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
  108. package/src/core/model/object/invokeObjectEquals.d.ts +9 -5
  109. package/src/core/model/object/invokeObjectHash.d.ts +7 -5
  110. package/src/core/model/object/objectDeepEquals.d.ts +10 -1
  111. package/src/core/model/object/objectKeyByValue.d.ts +10 -1
  112. package/src/core/model/object/read_property.d.ts +11 -1
  113. package/src/core/model/object/write_property.d.ts +10 -1
  114. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts +6 -0
  115. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
  116. package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +12 -12
  117. package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
  118. package/src/core/model/reactive/js/compileReactiveToJS.js +35 -1
  119. package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts +1 -3
  120. package/src/core/model/reactive/model/ReactiveBinaryExpression.d.ts.map +1 -1
  121. package/src/core/model/reactive/model/ReactiveExpression.d.ts +63 -10
  122. package/src/core/model/reactive/model/ReactiveExpression.d.ts.map +1 -1
  123. package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts +0 -12
  124. package/src/core/model/reactive/model/ReactiveUnaryExpression.d.ts.map +1 -1
  125. package/src/core/model/reactive/model/arithmetic/ReactiveAdd.d.ts +1 -1
  126. package/src/core/model/reactive/model/arithmetic/ReactiveAdd.d.ts.map +1 -1
  127. package/src/core/model/reactive/model/arithmetic/ReactiveDivide.d.ts +1 -1
  128. package/src/core/model/reactive/model/arithmetic/ReactiveDivide.d.ts.map +1 -1
  129. package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.d.ts +1 -1
  130. package/src/core/model/reactive/model/arithmetic/ReactiveMultiply.d.ts.map +1 -1
  131. package/src/core/model/reactive/model/arithmetic/ReactiveNegate.d.ts +1 -1
  132. package/src/core/model/reactive/model/arithmetic/ReactiveNegate.d.ts.map +1 -1
  133. package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.d.ts +1 -1
  134. package/src/core/model/reactive/model/arithmetic/ReactiveSubtract.d.ts.map +1 -1
  135. package/src/core/model/reactive/model/comparative/ReactiveEquals.d.ts +1 -1
  136. package/src/core/model/reactive/model/comparative/ReactiveEquals.d.ts.map +1 -1
  137. package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.d.ts +1 -1
  138. package/src/core/model/reactive/model/comparative/ReactiveGreaterThan.d.ts.map +1 -1
  139. package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.d.ts +1 -1
  140. package/src/core/model/reactive/model/comparative/ReactiveGreaterThanOrEqual.d.ts.map +1 -1
  141. package/src/core/model/reactive/model/comparative/ReactiveLessThan.d.ts +1 -1
  142. package/src/core/model/reactive/model/comparative/ReactiveLessThan.d.ts.map +1 -1
  143. package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.d.ts +1 -1
  144. package/src/core/model/reactive/model/comparative/ReactiveLessThanOrEqual.d.ts.map +1 -1
  145. package/src/core/model/reactive/model/comparative/ReactiveNotEquals.d.ts +1 -1
  146. package/src/core/model/reactive/model/comparative/ReactiveNotEquals.d.ts.map +1 -1
  147. package/src/core/model/reactive/model/logic/ReactiveAnd.d.ts +41 -5
  148. package/src/core/model/reactive/model/logic/ReactiveAnd.d.ts.map +1 -1
  149. package/src/core/model/reactive/model/logic/ReactiveNot.d.ts +1 -1
  150. package/src/core/model/reactive/model/logic/ReactiveNot.d.ts.map +1 -1
  151. package/src/core/model/reactive/model/logic/ReactiveOr.d.ts +2 -1
  152. package/src/core/model/reactive/model/logic/ReactiveOr.d.ts.map +1 -1
  153. package/src/core/model/reactive/model/terminal/ReactiveLiteralBoolean.d.ts +2 -1
  154. package/src/core/model/reactive/model/terminal/ReactiveLiteralBoolean.d.ts.map +1 -1
  155. package/src/core/model/reactive/model/terminal/ReactiveLiteralNumber.d.ts +2 -3
  156. package/src/core/model/reactive/model/terminal/ReactiveLiteralNumber.d.ts.map +1 -1
  157. package/src/core/model/reactive/model/terminal/ReactiveLiteralString.d.ts +2 -4
  158. package/src/core/model/reactive/model/terminal/ReactiveLiteralString.d.ts.map +1 -1
  159. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts +68 -11
  160. package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
  161. package/src/core/model/stat/LinearModifier.d.ts +79 -24
  162. package/src/core/parser/simple/DataType.d.ts +13 -5
  163. package/src/core/parser/simple/Token.d.ts +52 -13
  164. package/src/core/parser/simple/readArrayLiteral.d.ts +1 -0
  165. package/src/core/parser/simple/readArrayLiteral.d.ts.map +1 -1
  166. package/src/core/parser/simple/readBooleanToken.d.ts +1 -0
  167. package/src/core/parser/simple/readBooleanToken.d.ts.map +1 -1
  168. package/src/core/parser/simple/readHexToken.d.ts +1 -0
  169. package/src/core/parser/simple/readHexToken.d.ts.map +1 -1
  170. package/src/core/parser/simple/readIdentifierToken.d.ts +1 -0
  171. package/src/core/parser/simple/readIdentifierToken.d.ts.map +1 -1
  172. package/src/core/parser/simple/readNumberToken.d.ts +1 -0
  173. package/src/core/parser/simple/readNumberToken.d.ts.map +1 -1
  174. package/src/core/parser/simple/readReferenceToken.d.ts +1 -0
  175. package/src/core/parser/simple/readReferenceToken.d.ts.map +1 -1
  176. package/src/core/parser/simple/readStringToken.d.ts +1 -0
  177. package/src/core/parser/simple/readStringToken.d.ts.map +1 -1
  178. package/src/core/parser/simple/readUnsignedIntegerToken.d.ts +1 -0
  179. package/src/core/parser/simple/readUnsignedIntegerToken.d.ts.map +1 -1
  180. package/src/core/process/BaseProcess.d.ts +17 -5
  181. package/src/core/process/BaseProcess.d.ts.map +1 -1
  182. package/src/core/process/CompositeProcess.d.ts +0 -1
  183. package/src/core/process/CompositeProcess.d.ts.map +1 -1
  184. package/src/core/process/action/AsynchronousAction.d.ts +3 -3
  185. package/src/core/process/executor/ConcurrentExecutor.d.ts +3 -3
  186. package/src/core/process/filter/MutableFilter.d.ts +1 -1
  187. package/src/core/process/filter/MutableFilter.d.ts.map +1 -1
  188. package/src/core/process/task/Task.d.ts +1 -1
  189. package/src/core/process/task/Task.d.ts.map +1 -1
  190. package/src/core/process/task/TaskGroup.d.ts +3 -3
  191. package/src/core/process/task/TaskSignal.d.ts +8 -6
  192. package/src/core/process/undo/Action.d.ts +31 -9
  193. package/src/core/process/undo/ActionGroup.d.ts +20 -5
  194. package/src/core/process/undo/ActionProcessor.d.ts +163 -27
  195. package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
  196. package/src/engine/Engine.d.ts +178 -42
  197. package/src/engine/Engine.d.ts.map +1 -1
  198. package/src/engine/EngineConfiguration.d.ts +74 -20
  199. package/src/engine/achievements/AchievementGateway.d.ts +17 -5
  200. package/src/engine/achievements/AchievementManager.d.ts +0 -1
  201. package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
  202. package/src/engine/animation/Tween.d.ts +1 -1
  203. package/src/engine/animation/clip/AnimationClip.d.ts +24 -4
  204. package/src/engine/animation/clip/AnimationClipBinding.d.ts +35 -14
  205. package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts +2 -2
  206. package/src/engine/animation/curve/actionProcessorOperations/curveActions.d.ts.map +1 -1
  207. package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts +1 -1
  208. package/src/engine/animation/curve/editor/createKeyframeMarker.d.ts.map +1 -1
  209. package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts +1 -1
  210. package/src/engine/animation/keyed2/behavior/AnimationBehavior.d.ts +0 -1
  211. package/src/engine/animation/keyed2/behavior/AnimationBehavior.d.ts.map +1 -1
  212. package/src/engine/asset/Asset.d.ts +47 -7
  213. package/src/engine/asset/AssetManager.d.ts +258 -60
  214. package/src/engine/asset/AssetRequestScope.d.ts +27 -3
  215. package/src/engine/asset/AssetTransformer.d.ts +16 -5
  216. package/src/engine/asset/CORS/CrossOriginConfig.d.ts +8 -5
  217. package/src/engine/asset/CORS/CrossOriginConfig.d.ts.map +1 -1
  218. package/src/engine/asset/CORS/CrossOriginKind.d.ts +5 -4
  219. package/src/engine/asset/loaders/AssetLoader.d.ts +50 -12
  220. package/src/engine/asset/loaders/GLTFAssetLoader.d.ts +71 -6
  221. package/src/engine/asset/loaders/image/ImageRGBADataAsset.d.ts +0 -1
  222. package/src/engine/asset/loaders/image/ImageRGBADataAsset.d.ts.map +1 -1
  223. package/src/engine/asset/loaders/material/StaticMaterialCache.d.ts +30 -7
  224. package/src/engine/asset/loaders/material/computeMaterialEquality.d.ts +8 -3
  225. package/src/engine/asset/loaders/material/computeMaterialHash.d.ts +7 -3
  226. package/src/engine/asset/loaders/material/traverseMaterialTextures.d.ts +8 -3
  227. package/src/engine/asset/loaders/texture/TextureAssetLoader.d.ts +6 -6
  228. package/src/engine/asset/preloader/AssetPreloader.d.ts +6 -15
  229. package/src/engine/asset/preloader/AssetPreloader.d.ts.map +1 -1
  230. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts +13 -13
  231. package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
  232. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts +14 -4
  233. package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
  234. package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts +1 -1
  235. package/src/engine/ecs/Entity.d.ts +228 -41
  236. package/src/engine/ecs/EntityBlueprint.d.ts +43 -17
  237. package/src/engine/ecs/EntityComponentDataset.d.ts +580 -60
  238. package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
  239. package/src/engine/ecs/EntityManager.d.ts +10 -9
  240. package/src/engine/ecs/EntityManager.d.ts.map +1 -1
  241. package/src/engine/ecs/EntityObserver.d.ts +80 -13
  242. package/src/engine/ecs/System.d.ts +162 -33
  243. package/src/engine/ecs/animation/AnimationSerializationAdapter.d.ts +0 -1
  244. package/src/engine/ecs/animation/AnimationSerializationAdapter.d.ts.map +1 -1
  245. package/src/engine/ecs/attachment/AttachmentSystem.d.ts +1 -1
  246. package/src/engine/ecs/attachment/AttachmentSystem.d.ts.map +1 -1
  247. package/src/engine/ecs/components/PropertySetSerializationAdapter.d.ts +0 -1
  248. package/src/engine/ecs/components/PropertySetSerializationAdapter.d.ts.map +1 -1
  249. package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.d.ts +0 -1
  250. package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.d.ts.map +1 -1
  251. package/src/engine/ecs/components/TagSerializationAdapter.d.ts +0 -1
  252. package/src/engine/ecs/components/TagSerializationAdapter.d.ts.map +1 -1
  253. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts +1 -1
  254. package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.d.ts.map +1 -1
  255. package/src/engine/ecs/fow/FogOfWar.d.ts +1 -1
  256. package/src/engine/ecs/fow/FogOfWarRevealerSystem.d.ts +1 -1
  257. package/src/engine/ecs/fow/FogOfWarSystem.d.ts +1 -6
  258. package/src/engine/ecs/fow/FogOfWarSystem.d.ts.map +1 -1
  259. package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.d.ts +0 -1
  260. package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.d.ts.map +1 -1
  261. package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.d.ts +0 -1
  262. package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.d.ts.map +1 -1
  263. package/src/engine/ecs/gui/GUIElement.d.ts +115 -5
  264. package/src/engine/ecs/gui/GUIElementSerializationAdapter.d.ts +0 -1
  265. package/src/engine/ecs/gui/GUIElementSerializationAdapter.d.ts.map +1 -1
  266. package/src/engine/ecs/gui/GUIElementSystem.d.ts +59 -8
  267. package/src/engine/ecs/gui/GUIElementSystem.d.ts.map +1 -1
  268. package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.d.ts +0 -1
  269. package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.d.ts.map +1 -1
  270. package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.d.ts +42 -6
  271. package/src/engine/ecs/gui/menu/radial/RadialContextMenu.d.ts +23 -22
  272. package/src/engine/ecs/gui/parallax/GuiElementParallaxSystem.d.ts +1 -1
  273. package/src/engine/ecs/gui/position/ViewportPositionSerializationAdapter.d.ts +0 -1
  274. package/src/engine/ecs/gui/position/ViewportPositionSerializationAdapter.d.ts.map +1 -1
  275. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts +1 -1
  276. package/src/engine/ecs/gui/view/ViewEntity.d.ts +1 -2
  277. package/src/engine/ecs/gui/view/ViewEntity.d.ts.map +1 -1
  278. package/src/engine/ecs/guid/UUIDSerializationAdapter.d.ts +0 -1
  279. package/src/engine/ecs/guid/UUIDSerializationAdapter.d.ts.map +1 -1
  280. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts +0 -1
  281. package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.d.ts.map +1 -1
  282. package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts +1 -1
  283. package/src/engine/ecs/ik/InverseKinematicsSystem.d.ts.map +1 -1
  284. package/src/engine/ecs/name/NameSerializationAdapter.d.ts +0 -1
  285. package/src/engine/ecs/name/NameSerializationAdapter.d.ts.map +1 -1
  286. package/src/engine/ecs/parent/ChildEntities.d.ts +23 -3
  287. package/src/engine/ecs/parent/EntityNode.d.ts +157 -25
  288. package/src/engine/ecs/parent/ParentEntity.d.ts +31 -11
  289. package/src/engine/ecs/parent/ParentEntitySystem.d.ts +44 -11
  290. package/src/engine/ecs/renderable/RenderSystem.d.ts +65 -7
  291. package/src/engine/ecs/renderable/Renderable.d.ts +95 -25
  292. package/src/engine/ecs/speaker/VoiceSystem.d.ts +3 -3
  293. package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
  294. package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.d.ts +86 -21
  295. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts +1 -1
  296. package/src/engine/ecs/storage/binary/object-v2/serializerTestHarness.d.ts.map +1 -1
  297. package/src/engine/ecs/system/AbstractContextSystem.d.ts +1 -1
  298. package/src/engine/ecs/system_validate_class.d.ts +1 -1
  299. package/src/engine/ecs/system_validate_class.d.ts.map +1 -1
  300. package/src/engine/ecs/systems/AnimationSystem.d.ts +41 -6
  301. package/src/engine/ecs/systems/AnimationSystem.d.ts.map +1 -1
  302. package/src/engine/ecs/systems/ScriptSystem.d.ts +9 -5
  303. package/src/engine/ecs/systems/ScriptSystem.d.ts.map +1 -1
  304. package/src/engine/ecs/systems/TimerSystem.d.ts +1 -1
  305. package/src/engine/ecs/systems/TimerSystem.d.ts.map +1 -1
  306. package/src/engine/ecs/team/TeamSerializationAdapter.d.ts +0 -1
  307. package/src/engine/ecs/team/TeamSerializationAdapter.d.ts.map +1 -1
  308. package/src/engine/ecs/terrain/ecs/OffsetScaleTransform2D.d.ts +7 -6
  309. package/src/engine/ecs/terrain/ecs/Terrain.d.ts +389 -17
  310. package/src/engine/ecs/terrain/ecs/TerrainSystem.d.ts +65 -8
  311. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.d.ts +0 -1
  312. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.d.ts.map +1 -1
  313. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +1 -1
  314. package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
  315. package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.d.ts +0 -1
  316. package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.d.ts.map +1 -1
  317. package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts +2 -2
  318. package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
  319. package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts +2 -2
  320. package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.d.ts +0 -1
  321. package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.d.ts.map +1 -1
  322. package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts +1 -1
  323. package/src/engine/ecs/transform/TransformSerializationAdapter.d.ts +0 -1
  324. package/src/engine/ecs/transform/TransformSerializationAdapter.d.ts.map +1 -1
  325. package/src/engine/ecs/transform-attachment/TransformAttachment.d.ts +116 -19
  326. package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.d.ts +58 -6
  327. package/src/engine/graphics/GraphicsEngine.d.ts +220 -41
  328. package/src/engine/graphics/camera/CameraShake.d.ts +6 -6
  329. package/src/engine/graphics/camera/CameraShake.d.ts.map +1 -1
  330. package/src/engine/graphics/camera/CameraShakeBehavior.d.ts +1 -2
  331. package/src/engine/graphics/camera/CameraShakeBehavior.d.ts.map +1 -1
  332. package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts +1 -2
  333. package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts.map +1 -1
  334. package/src/engine/graphics/camera/camera_compute_distance_to_fit_length.d.ts +8 -1
  335. package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts +8 -4
  336. package/src/engine/graphics/composit/CompositLayer.d.ts +1 -1
  337. package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.d.ts +0 -1
  338. package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.d.ts.map +1 -1
  339. package/src/engine/graphics/ecs/animation/AnimationControllerSystem.d.ts +1 -2
  340. package/src/engine/graphics/ecs/animation/AnimationControllerSystem.d.ts.map +1 -1
  341. package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.d.ts +1 -1
  342. package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.d.ts +0 -1
  343. package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.d.ts.map +1 -1
  344. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.d.ts +0 -1
  345. package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.d.ts.map +1 -1
  346. package/src/engine/graphics/ecs/camera/Camera.d.ts +113 -18
  347. package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
  348. package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +74 -10
  349. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts +0 -1
  350. package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.d.ts.map +1 -1
  351. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts +90 -33
  352. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.d.ts +0 -1
  353. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.d.ts.map +1 -1
  354. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts +34 -5
  355. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.d.ts +0 -1
  356. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.d.ts.map +1 -1
  357. package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.d.ts +1 -1
  358. package/src/engine/graphics/ecs/decal/v2/Decal.d.ts +52 -15
  359. package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts +0 -1
  360. package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts.map +1 -1
  361. package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.d.ts +70 -24
  362. package/src/engine/graphics/ecs/highlight/Highlight.d.ts +61 -16
  363. package/src/engine/graphics/ecs/highlight/HighlightDefinition.d.ts +57 -19
  364. package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.d.ts +0 -1
  365. package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.d.ts.map +1 -1
  366. package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.d.ts +0 -1
  367. package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.d.ts.map +1 -1
  368. package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.d.ts +57 -8
  369. package/src/engine/graphics/ecs/highlight/system/MeshHighlightSystem.d.ts.map +1 -1
  370. package/src/engine/graphics/ecs/highlight/system/RenderableHighlightSystem.d.ts +62 -8
  371. package/src/engine/graphics/ecs/highlight/system/RenderableHighlightSystem.d.ts.map +1 -1
  372. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts +68 -8
  373. package/src/engine/graphics/ecs/highlight/system/ShadedGeometryHighlightSystem.d.ts.map +1 -1
  374. package/src/engine/graphics/ecs/light/Light.d.ts +79 -19
  375. package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
  376. package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts +0 -1
  377. package/src/engine/graphics/ecs/light/LightSerializationAdapter.d.ts.map +1 -1
  378. package/src/engine/graphics/ecs/light/LightSystem.d.ts +123 -11
  379. package/src/engine/graphics/ecs/light/LightType.d.ts +8 -6
  380. package/src/engine/graphics/ecs/mesh/Mesh.d.ts +176 -30
  381. package/src/engine/graphics/ecs/mesh/MeshEvents.d.ts +6 -12
  382. package/src/engine/graphics/ecs/mesh/MeshSystem.d.ts +99 -7
  383. package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.d.ts +0 -1
  384. package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.d.ts.map +1 -1
  385. package/src/engine/graphics/ecs/mesh-v2/DrawMode.d.ts +8 -6
  386. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +147 -32
  387. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  388. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +37 -0
  389. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGAnimationPlayback.d.ts +6 -5
  390. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +162 -25
  391. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationController.d.ts +40 -12
  392. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +31 -11
  393. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshEvents.d.ts +5 -12
  394. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshHighlightSystem.d.ts +36 -7
  395. package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts +63 -8
  396. package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts +9 -4
  397. package/src/engine/graphics/ecs/path/PathDisplay.d.ts +21 -9
  398. package/src/engine/graphics/ecs/path/PathDisplayEvents.d.ts +6 -3
  399. package/src/engine/graphics/ecs/path/PathDisplaySpec.d.ts +28 -11
  400. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts +55 -10
  401. package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
  402. package/src/engine/graphics/ecs/path/PathDisplayType.d.ts +8 -6
  403. package/src/engine/graphics/ecs/path/entity/EntityPathMarkerDefinition.d.ts +39 -8
  404. package/src/engine/graphics/ecs/path/entity/EntityPathStyle.d.ts +38 -12
  405. package/src/engine/graphics/ecs/path/highlight/PathDisplayHighlightSystem.d.ts +31 -7
  406. package/src/engine/graphics/ecs/path/ribbon/RibbonPathStyle.d.ts +24 -7
  407. package/src/engine/graphics/ecs/path/tube/BasicMaterialDefinition.d.ts +4 -3
  408. package/src/engine/graphics/ecs/path/tube/CapType.d.ts +7 -5
  409. package/src/engine/graphics/ecs/path/tube/MatcapMaterialDefinition.d.ts +11 -3
  410. package/src/engine/graphics/ecs/path/tube/PathNormalType.d.ts +6 -4
  411. package/src/engine/graphics/ecs/path/tube/StandardMaterialDefinition.d.ts +9 -4
  412. package/src/engine/graphics/ecs/path/tube/TubeMaterialType.d.ts +7 -6
  413. package/src/engine/graphics/ecs/path/tube/TubePathStyle.d.ts +114 -35
  414. package/src/engine/graphics/ecs/path/tube/TubePathStyle.d.ts.map +1 -1
  415. package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +85 -6
  416. package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +1 -1
  417. package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts +0 -1
  418. package/src/engine/graphics/ecs/water/WaterSerializationAdapter.d.ts.map +1 -1
  419. package/src/engine/graphics/ecs/water/WaterSystem.d.ts +1 -1
  420. package/src/engine/graphics/geometry/AttributeGroupSpec.d.ts +75 -25
  421. package/src/engine/graphics/geometry/AttributeSpec.d.ts +85 -12
  422. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts +1 -2
  423. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts.map +1 -1
  424. package/src/engine/graphics/impostors/octahedral/grid/OctahedralUvEncoder.d.ts +6 -4
  425. package/src/engine/graphics/material/manager/MaterialManager.d.ts +12 -0
  426. package/src/engine/graphics/material/manager/MaterialManager.d.ts.map +1 -1
  427. package/src/engine/graphics/material/manager/MaterialManager.js +78 -41
  428. package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.d.ts +55 -7
  429. package/src/engine/graphics/particles/ecs/ParticleEmitterSystem.d.ts.map +1 -1
  430. package/src/engine/graphics/particles/node-based/codegen/glsl/getTypeByteSize.d.ts +9 -9
  431. package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.d.ts +1 -2
  432. package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.d.ts.map +1 -1
  433. package/src/engine/graphics/particles/node-based/nodes/FloatConstant.d.ts +0 -1
  434. package/src/engine/graphics/particles/node-based/nodes/FloatConstant.d.ts.map +1 -1
  435. package/src/engine/graphics/particles/node-based/nodes/ParticleDataTypes.d.ts +10 -9
  436. package/src/engine/graphics/particles/node-based/nodes/ParticleDataTypes.d.ts.map +1 -1
  437. package/src/engine/graphics/particles/node-based/nodes/ReadFloatUniform.d.ts +0 -1
  438. package/src/engine/graphics/particles/node-based/nodes/ReadFloatUniform.d.ts.map +1 -1
  439. package/src/engine/graphics/particles/node-based/nodes/ReadVelocity.d.ts +0 -1
  440. package/src/engine/graphics/particles/node-based/nodes/ReadVelocity.d.ts.map +1 -1
  441. package/src/engine/graphics/particles/node-based/nodes/Vector3Constant.d.ts +0 -1
  442. package/src/engine/graphics/particles/node-based/nodes/Vector3Constant.d.ts.map +1 -1
  443. package/src/engine/graphics/particles/node-based/nodes/Vector3Merge.d.ts +0 -1
  444. package/src/engine/graphics/particles/node-based/nodes/Vector3Merge.d.ts.map +1 -1
  445. package/src/engine/graphics/particles/node-based/nodes/Vector3Split.d.ts +0 -1
  446. package/src/engine/graphics/particles/node-based/nodes/Vector3Split.d.ts.map +1 -1
  447. package/src/engine/graphics/particles/node-based/nodes/WriteVelocity.d.ts +0 -1
  448. package/src/engine/graphics/particles/node-based/nodes/WriteVelocity.d.ts.map +1 -1
  449. package/src/engine/graphics/particles/node-based/nodes/attribute/ReadVector3Attribute.d.ts +0 -1
  450. package/src/engine/graphics/particles/node-based/nodes/attribute/ReadVector3Attribute.d.ts.map +1 -1
  451. package/src/engine/graphics/particles/node-based/nodes/attribute/WriteVector3Attribute.d.ts +0 -1
  452. package/src/engine/graphics/particles/node-based/nodes/attribute/WriteVector3Attribute.d.ts.map +1 -1
  453. package/src/engine/graphics/particles/node-based/nodes/math/AddFloatNode.d.ts +0 -1
  454. package/src/engine/graphics/particles/node-based/nodes/math/AddFloatNode.d.ts.map +1 -1
  455. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Add.d.ts +0 -1
  456. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Add.d.ts.map +1 -1
  457. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Divide.d.ts +0 -1
  458. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Divide.d.ts.map +1 -1
  459. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Multiply.d.ts +0 -1
  460. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Multiply.d.ts.map +1 -1
  461. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Subtract.d.ts +0 -1
  462. package/src/engine/graphics/particles/node-based/nodes/math/Vector3Subtract.d.ts.map +1 -1
  463. package/src/engine/graphics/particles/node-based/nodes/noise/CurlNoiseNode.d.ts +0 -1
  464. package/src/engine/graphics/particles/node-based/nodes/noise/CurlNoiseNode.d.ts.map +1 -1
  465. package/src/engine/graphics/particles/node-based/particle/ParticleAttributeSpecification.d.ts +18 -18
  466. package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts +252 -2
  467. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts +0 -1
  468. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.d.ts.map +1 -1
  469. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts +0 -1
  470. package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.d.ts.map +1 -1
  471. package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.d.ts +2 -15
  472. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts +5 -1
  473. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrack.d.ts.map +1 -1
  474. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts +1 -1
  475. package/src/engine/graphics/particles/particular/engine/parameter/ParameterTrackSet.d.ts.map +1 -1
  476. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts +5 -1
  477. package/src/engine/graphics/particles/particular/engine/parameter/ParticleParameter.d.ts.map +1 -1
  478. package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.d.ts +76 -16
  479. package/src/engine/graphics/particles/particular/engine/utils/volume/SamplingFunctionKind.d.ts +6 -4
  480. package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts +92 -8
  481. package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts.map +1 -1
  482. package/src/engine/graphics/render/buffer/simple-fx/ao/SAOUpscaleShader.js +78 -37
  483. package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.d.ts +0 -3
  484. package/src/engine/graphics/render/buffer/simple-fx/taa/TemporalSupersamplingRenderPlugin.d.ts.map +1 -1
  485. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +1 -1
  486. package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
  487. package/src/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.d.ts +27 -5
  488. package/src/engine/graphics/render/forward_plus/plugin/MaterialTransformer.d.ts.map +1 -1
  489. package/src/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +4 -9
  490. package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.d.ts +16 -0
  491. package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.d.ts.map +1 -0
  492. package/src/engine/graphics/render/forward_plus/plugin/forwardPlusMaterialMarker.js +18 -0
  493. package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.d.ts +16 -0
  494. package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.d.ts.map +1 -0
  495. package/src/engine/graphics/render/forward_plus/plugin/isForwardPlusLightingSkipped.js +31 -0
  496. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +1 -1
  497. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  498. package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts +1 -1
  499. package/src/engine/graphics/render/gizmo/Gizmo.d.ts +7 -3
  500. package/src/engine/graphics/render/gizmo/GizmoRenderingPlugin.d.ts +5 -5
  501. package/src/engine/graphics/render/gizmo/GizmoRenderingPlugin.d.ts.map +1 -1
  502. package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.d.ts +72 -13
  503. package/src/engine/graphics/render/layers/RenderLayer.d.ts +78 -22
  504. package/src/engine/graphics/render/layers/RenderLayerManager.d.ts +72 -17
  505. package/src/engine/graphics/render/layers/RenderLayerState.d.ts +18 -3
  506. package/src/engine/graphics/render/view/CameraView.d.ts +3 -3
  507. package/src/engine/graphics/render/view/CameraViewManager.d.ts +2 -2
  508. package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts +143 -24
  509. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts +0 -1
  510. package/src/engine/graphics/sh3/lpg/serialization/LightProbeGridSerializationAdapter.d.ts.map +1 -1
  511. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts +3 -1
  512. package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.d.ts.map +1 -1
  513. package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts +0 -1
  514. package/src/engine/graphics/sh3/lpv/serialization/LightProbeVolumeSerializationAdapter.d.ts.map +1 -1
  515. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +1 -2
  516. package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
  517. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts +3 -3
  518. package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
  519. package/src/engine/graphics/texture/cubemap/load_environment_map.d.ts +13 -8
  520. package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +1 -1
  521. package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.d.ts +0 -1
  522. package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.d.ts.map +1 -1
  523. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +1 -3
  524. package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +1 -1
  525. package/src/engine/graphics/three/cloneObject3D.d.ts +7 -3
  526. package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts +0 -1
  527. package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts.map +1 -1
  528. package/src/engine/graphics/trail/x/RibbonXMaterialSpec.d.ts +13 -3
  529. package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts +0 -3
  530. package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
  531. package/src/engine/graphics/util/promiseMaterialLoaded.d.ts +7 -3
  532. package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.d.ts +0 -1
  533. package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.d.ts.map +1 -1
  534. package/src/engine/grid/grid2transform/GridPosition2TransformSystem.d.ts +1 -1
  535. package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.d.ts +0 -1
  536. package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.d.ts.map +1 -1
  537. package/src/engine/grid/position/GridPositionSerializationAdapter.d.ts +0 -1
  538. package/src/engine/grid/position/GridPositionSerializationAdapter.d.ts.map +1 -1
  539. package/src/engine/grid/position/GridPositionSystem.d.ts +1 -1
  540. package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts +1 -1
  541. package/src/engine/input/GAMEPAD_API_PROPOSAL.md +717 -0
  542. package/src/engine/input/analog/apply_radial_dead_zone.d.ts +23 -0
  543. package/src/engine/input/analog/apply_radial_dead_zone.d.ts.map +1 -0
  544. package/src/engine/input/analog/apply_radial_dead_zone.js +38 -0
  545. package/src/engine/input/devices/GamepadDevice.d.ts +140 -23
  546. package/src/engine/input/devices/GamepadDevice.d.ts.map +1 -1
  547. package/src/engine/input/devices/GamepadDevice.js +202 -16
  548. package/src/engine/input/devices/InputDeviceSwitch.d.ts +44 -11
  549. package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
  550. package/src/engine/input/devices/KeyCodes.d.ts +112 -1
  551. package/src/engine/input/devices/KeyboardDevice.d.ts +2 -3
  552. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  553. package/src/engine/input/devices/PointerDevice.d.ts +96 -31
  554. package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
  555. package/src/engine/input/devices/events/KeyboardEvents.d.ts +5 -4
  556. package/src/engine/input/devices/events/MouseEvents.d.ts +18 -12
  557. package/src/engine/input/devices/events/TouchEvents.d.ts +12 -6
  558. package/src/engine/input/devices/gamepad/GamepadAxes.d.ts +5 -1
  559. package/src/engine/input/devices/gamepad/GamepadAxes.d.ts.map +1 -1
  560. package/src/engine/input/devices/gamepad/GamepadAxes.js +5 -1
  561. package/src/engine/input/devices/gamepad/GamepadHandle.d.ts +130 -26
  562. package/src/engine/input/devices/gamepad/GamepadHandle.d.ts.map +1 -1
  563. package/src/engine/input/devices/gamepad/GamepadHandle.js +60 -34
  564. package/src/engine/input/devices/gamepad/GamepadStandardMapping.d.ts +20 -0
  565. package/src/engine/input/devices/gamepad/GamepadStandardMapping.d.ts.map +1 -0
  566. package/src/engine/input/devices/gamepad/GamepadStandardMapping.js +20 -0
  567. package/src/engine/input/devices/gamepad/GamepadStick.d.ts +93 -0
  568. package/src/engine/input/devices/gamepad/GamepadStick.d.ts.map +1 -0
  569. package/src/engine/input/devices/gamepad/GamepadStick.js +165 -0
  570. package/src/engine/input/devices/gamepad/GamepadStickCalibration.d.ts +84 -0
  571. package/src/engine/input/devices/gamepad/GamepadStickCalibration.d.ts.map +1 -0
  572. package/src/engine/input/devices/gamepad/GamepadStickCalibration.js +119 -0
  573. package/src/engine/input/devices/gamepad/GamepadStickCalibrator.d.ts +92 -0
  574. package/src/engine/input/devices/gamepad/GamepadStickCalibrator.d.ts.map +1 -0
  575. package/src/engine/input/devices/gamepad/GamepadStickCalibrator.js +250 -0
  576. package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.d.ts +17 -0
  577. package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.d.ts.map +1 -0
  578. package/src/engine/input/devices/gamepad/gamepad_write_dpad_vector.js +30 -0
  579. package/src/engine/input/devices/touch/TouchDevice.d.ts +3 -3
  580. package/src/engine/input/ecs/components/Input.d.ts +49 -6
  581. package/src/engine/input/ecs/components/InputController.d.ts +33 -3
  582. package/src/engine/input/ecs/ism/InputBinding.d.ts +40 -4
  583. package/src/engine/input/ecs/systems/InputControllerSystem.d.ts +28 -6
  584. package/src/engine/input/ecs/systems/InputSystem.d.ts +59 -6
  585. package/src/engine/intelligence/behavior/Behavior.d.ts +58 -16
  586. package/src/engine/intelligence/behavior/Behavior.d.ts.map +1 -1
  587. package/src/engine/intelligence/behavior/BehaviorStatus.d.ts +10 -8
  588. package/src/engine/intelligence/behavior/SelectorBehavior.d.ts +0 -1
  589. package/src/engine/intelligence/behavior/SelectorBehavior.d.ts.map +1 -1
  590. package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +0 -8
  591. package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts.map +1 -1
  592. package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.d.ts +0 -1
  593. package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.d.ts.map +1 -1
  594. package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts +0 -1
  595. package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts.map +1 -1
  596. package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.d.ts +0 -1
  597. package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.d.ts.map +1 -1
  598. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts +0 -1
  599. package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts.map +1 -1
  600. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts +1 -2
  601. package/src/engine/intelligence/behavior/decorator/IgnoreFailureBehavior.d.ts.map +1 -1
  602. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts +1 -2
  603. package/src/engine/intelligence/behavior/decorator/InvertStatusBehavior.d.ts.map +1 -1
  604. package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.d.ts +0 -1
  605. package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.d.ts.map +1 -1
  606. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts +1 -1
  607. package/src/engine/intelligence/behavior/decorator/OverrideContextBehavior.d.ts.map +1 -1
  608. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +1 -2
  609. package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts.map +1 -1
  610. package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.d.ts +0 -1
  611. package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.d.ts.map +1 -1
  612. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +1 -2
  613. package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts.map +1 -1
  614. package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts +0 -1
  615. package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts.map +1 -1
  616. package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +1 -1
  617. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts +1 -2
  618. package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts.map +1 -1
  619. package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts +0 -1
  620. package/src/engine/intelligence/behavior/ecs/EntityBehavior.d.ts.map +1 -1
  621. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts +1 -2
  622. package/src/engine/intelligence/behavior/ecs/KillBehavior.d.ts.map +1 -1
  623. package/src/engine/intelligence/behavior/ecs/OrbitingBehavior.d.ts +1 -2
  624. package/src/engine/intelligence/behavior/ecs/OrbitingBehavior.d.ts.map +1 -1
  625. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +1 -2
  626. package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts.map +1 -1
  627. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts +1 -2
  628. package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts.map +1 -1
  629. package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.d.ts +0 -1
  630. package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.d.ts.map +1 -1
  631. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +1 -2
  632. package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts.map +1 -1
  633. package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts +1 -3
  634. package/src/engine/intelligence/behavior/primitive/FailingBehavior.d.ts.map +1 -1
  635. package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.d.ts +0 -1
  636. package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.d.ts.map +1 -1
  637. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +2 -4
  638. package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts.map +1 -1
  639. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +1 -3
  640. package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts.map +1 -1
  641. package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.d.ts +0 -1
  642. package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.d.ts.map +1 -1
  643. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -2
  644. package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
  645. package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts +1 -3
  646. package/src/engine/intelligence/behavior/util/BranchBehavior.d.ts.map +1 -1
  647. package/src/engine/intelligence/behavior/util/ConditionBehavior.d.ts +1 -2
  648. package/src/engine/intelligence/behavior/util/ConditionBehavior.d.ts.map +1 -1
  649. package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts +1 -3
  650. package/src/engine/intelligence/behavior/util/DelayBehavior.d.ts.map +1 -1
  651. package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts +1 -2
  652. package/src/engine/intelligence/behavior/util/LogMessageBehavior.d.ts.map +1 -1
  653. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts +4 -4
  654. package/src/engine/intelligence/behavior/util/RandomDelayBehavior.d.ts.map +1 -1
  655. package/src/engine/intelligence/behavior/util/RotationBehavior.d.ts +1 -2
  656. package/src/engine/intelligence/behavior/util/RotationBehavior.d.ts.map +1 -1
  657. package/src/engine/intelligence/blackboard/AbstractBlackboard.d.ts +58 -15
  658. package/src/engine/intelligence/blackboard/AbstractBlackboard.d.ts.map +1 -1
  659. package/src/engine/intelligence/blackboard/Blackboard.d.ts +79 -11
  660. package/src/engine/intelligence/blackboard/Blackboard.d.ts.map +1 -1
  661. package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.d.ts +0 -1
  662. package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.d.ts.map +1 -1
  663. package/src/engine/intelligence/blackboard/BlackboardValue.d.ts +1 -0
  664. package/src/engine/intelligence/blackboard/BlackboardValue.d.ts.map +1 -1
  665. package/src/engine/intelligence/controller/graph/StateGraphSystem.d.ts +1 -3
  666. package/src/engine/intelligence/controller/graph/StateGraphSystem.d.ts.map +1 -1
  667. package/src/engine/interpolation/InterpolationSystem.d.ts +1 -5
  668. package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -1
  669. package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts +0 -1
  670. package/src/engine/interpolation/TransformPoseSerializationAdapter.d.ts.map +1 -1
  671. package/src/engine/knowledge/database/StaticKnowledgeDataTable.d.ts +140 -9
  672. package/src/engine/knowledge/database/StaticKnowledgeDataTableDescriptor.d.ts +26 -7
  673. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts +2 -3
  674. package/src/engine/knowledge/database/StaticKnowledgeDatabase.d.ts.map +1 -1
  675. package/src/engine/navigation/ecs/components/InterpolationType.d.ts +8 -4
  676. package/src/engine/navigation/ecs/components/Path.d.ts +167 -47
  677. package/src/engine/navigation/ecs/components/PathEvents.d.ts +8 -6
  678. package/src/engine/navigation/ecs/components/PathSerializationAdapter.d.ts +0 -1
  679. package/src/engine/navigation/ecs/components/PathSerializationAdapter.d.ts.map +1 -1
  680. package/src/engine/navigation/ecs/path_following/PathFollower.d.ts +85 -45
  681. package/src/engine/navigation/ecs/path_following/PathFollowerEventType.d.ts +5 -3
  682. package/src/engine/navigation/ecs/path_following/PathFollowerFlags.d.ts +14 -20
  683. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.d.ts +0 -1
  684. package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.d.ts.map +1 -1
  685. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts +31 -6
  686. package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
  687. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts +0 -1
  688. package/src/engine/network/adapters/TransformReplicationAdapter.d.ts.map +1 -1
  689. package/src/engine/network/ecs/NetworkSystem.d.ts +1 -1
  690. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts +0 -1
  691. package/src/engine/network/ecs/serialization/NetworkIdentitySerializationAdapter.d.ts.map +1 -1
  692. package/src/engine/options/Option.d.ts +3 -3
  693. package/src/engine/options/OptionsView.d.ts +1 -2
  694. package/src/engine/options/OptionsView.d.ts.map +1 -1
  695. package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -1
  696. package/src/engine/physics/body/SolverBodyState.js +10 -1
  697. package/src/engine/physics/constraint/solve_constraints.d.ts.map +1 -1
  698. package/src/engine/physics/constraint/solve_constraints.js +840 -830
  699. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +3 -3
  700. package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -1
  701. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts +0 -1
  702. package/src/engine/physics/ecs/ColliderSerializationAdapter.d.ts.map +1 -1
  703. package/src/engine/physics/ecs/JointSerializationAdapter.d.ts +0 -1
  704. package/src/engine/physics/ecs/JointSerializationAdapter.d.ts.map +1 -1
  705. package/src/engine/physics/ecs/PhysicsSystem.d.ts +14 -2
  706. package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
  707. package/src/engine/physics/ecs/PhysicsSystem.js +2246 -2172
  708. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts +0 -1
  709. package/src/engine/physics/ecs/RigidBodySerializationAdapter.d.ts.map +1 -1
  710. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +12 -8
  711. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -1
  712. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +8 -4
  713. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -1
  714. package/src/engine/physics/integration/integrate_velocity.d.ts.map +1 -1
  715. package/src/engine/physics/integration/integrate_velocity.js +25 -2
  716. package/src/engine/physics/narrowphase/capsule_contacts.d.ts.map +1 -1
  717. package/src/engine/physics/narrowphase/capsule_contacts.js +622 -617
  718. package/src/engine/physics/narrowphase/convex_convex_manifold.d.ts.map +1 -1
  719. package/src/engine/physics/narrowphase/convex_convex_manifold.js +632 -568
  720. package/src/engine/physics/solver/solve_contacts.d.ts +6 -5
  721. package/src/engine/physics/solver/solve_contacts.d.ts.map +1 -1
  722. package/src/engine/physics/solver/solve_contacts.js +1506 -1482
  723. package/src/engine/platform/EnginePlatform.d.ts +24 -14
  724. package/src/engine/platform/WebEnginePlatform.d.ts +20 -5
  725. package/src/engine/platform/WebEnginePlatform.d.ts.map +1 -1
  726. package/src/engine/plugin/EnginePlugin.d.ts +36 -3
  727. package/src/engine/plugin/EnginePlugin.d.ts.map +1 -1
  728. package/src/engine/plugin/EnginePluginManager.d.ts +85 -16
  729. package/src/engine/plugin/EnginePluginManager.d.ts.map +1 -1
  730. package/src/engine/plugin/PluginReferenceContext.d.ts +1 -1
  731. package/src/engine/reference/v2/Reference.d.ts +55 -17
  732. package/src/engine/reference/v2/Reference.d.ts.map +1 -1
  733. package/src/engine/save/GameStateLoader.d.ts +0 -1
  734. package/src/engine/save/GameStateLoader.d.ts.map +1 -1
  735. package/src/engine/save/Storage.d.ts +75 -15
  736. package/src/engine/save/storage/InMemoryStorage.d.ts +0 -1
  737. package/src/engine/save/storage/InMemoryStorage.d.ts.map +1 -1
  738. package/src/engine/save/storage/IndexedDBStorage.d.ts +0 -2
  739. package/src/engine/save/storage/IndexedDBStorage.d.ts.map +1 -1
  740. package/src/engine/scene/Scene.d.ts +65 -7
  741. package/src/engine/scene/SceneManager.d.ts +125 -25
  742. package/src/engine/simulation/Ticker.d.ts +1 -2
  743. package/src/engine/simulation/Ticker.d.ts.map +1 -1
  744. package/src/engine/sound/SoundEngine.d.ts +46 -3
  745. package/src/engine/sound/ecs/SoundController.d.ts +0 -1
  746. package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
  747. package/src/engine/sound/ecs/SoundControllerSystem.d.ts +1 -2
  748. package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
  749. package/src/engine/sound/ecs/SoundListener.d.ts +0 -1
  750. package/src/engine/sound/ecs/SoundListener.d.ts.map +1 -1
  751. package/src/engine/sound/ecs/SoundListenerSystem.d.ts +1 -1
  752. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +1 -1
  753. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts +1 -1
  754. package/src/engine/sound/ecs/emitter/SoundEmitter.d.ts.map +1 -1
  755. package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.d.ts +0 -1
  756. package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.d.ts.map +1 -1
  757. package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +1 -1
  758. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts +1 -2
  759. package/src/engine/sound/ecs/emitter/SoundTrack.d.ts.map +1 -1
  760. package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts +0 -1
  761. package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts.map +1 -1
  762. package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts +0 -1
  763. package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts.map +1 -1
  764. package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts +0 -1
  765. package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts.map +1 -1
  766. package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts +0 -1
  767. package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts.map +1 -1
  768. package/src/engine/sound/simulation/ecs/AcousticProbeFieldSystem.d.ts +1 -1
  769. package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts +1 -1
  770. package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts +0 -1
  771. package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts.map +1 -1
  772. package/src/engine/sound/simulation/ecs/AcousticVolumeSystem.d.ts +1 -1
  773. package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts +0 -1
  774. package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts.map +1 -1
  775. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts +0 -1
  776. package/src/engine/sound/sopra/definition/BusDefinitionSerializationAdapter.d.ts.map +1 -1
  777. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts +0 -1
  778. package/src/engine/sound/sopra/definition/DuckingRuleSerializationAdapter.d.ts.map +1 -1
  779. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +0 -1
  780. package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
  781. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts +0 -1
  782. package/src/engine/sound/sopra/definition/MixerSnapshotSerializationAdapter.d.ts.map +1 -1
  783. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts +0 -1
  784. package/src/engine/sound/sopra/definition/ParameterDefinitionSerializationAdapter.d.ts.map +1 -1
  785. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts +0 -1
  786. package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClipSerializationAdapter.d.ts.map +1 -1
  787. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts +0 -1
  788. package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClipSerializationAdapter.d.ts.map +1 -1
  789. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts +0 -1
  790. package/src/engine/sound/sopra/definition/clip/SampleAudioClipSerializationAdapter.d.ts.map +1 -1
  791. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts +0 -1
  792. package/src/engine/sound/sopra/definition/clip/SequenceContainerAudioClipSerializationAdapter.d.ts.map +1 -1
  793. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts +0 -1
  794. package/src/engine/sound/sopra/definition/clip/SilenceAudioClipSerializationAdapter.d.ts.map +1 -1
  795. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts +0 -1
  796. package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClipSerializationAdapter.d.ts.map +1 -1
  797. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts +0 -1
  798. package/src/engine/sound/sopra/definition/effect/CompressorEffectSerializationAdapter.d.ts.map +1 -1
  799. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts +0 -1
  800. package/src/engine/sound/sopra/definition/effect/EqEffectSerializationAdapter.d.ts.map +1 -1
  801. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts +0 -1
  802. package/src/engine/sound/sopra/definition/effect/ReverbEffectSerializationAdapter.d.ts.map +1 -1
  803. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +1 -2
  804. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  805. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts +1 -2
  806. package/src/engine/sound/sopra/runtime/ParameterStore.d.ts.map +1 -1
  807. package/src/engine/ui/bindings/DomElementProcessorManager.d.ts +0 -3
  808. package/src/engine/ui/bindings/DomElementProcessorManager.d.ts.map +1 -1
  809. package/src/engine/ui/modal/ModalStack.d.ts +3 -3
  810. package/src/engine/ui/notification/AnimatedObjectEmitter.d.ts +2 -2
  811. package/src/engine/ui/notification/ViewEmitter.d.ts +2 -2
  812. package/src/generation/filtering/CellFilter.d.ts +1 -1
  813. package/src/generation/filtering/CellFilter.d.ts.map +1 -1
  814. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts +3 -1
  815. package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.d.ts.map +1 -1
  816. package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts +3 -1
  817. package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.d.ts.map +1 -1
  818. package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.d.ts +3 -1
  819. package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.d.ts.map +1 -1
  820. package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.d.ts +3 -1
  821. package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.d.ts.map +1 -1
  822. package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.d.ts +3 -1
  823. package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.d.ts.map +1 -1
  824. package/src/generation/placement/action/util/CellMatcherWithinAABB.d.ts +1 -1
  825. package/src/generation/placement/action/util/CellMatcherWithinAABB.d.ts.map +1 -1
  826. package/src/misc/makeMatcapSelectionOption.d.ts +11 -13
  827. package/src/view/View.d.ts +313 -30
  828. package/src/view/asset/AssetLoaderStatusView.d.ts +1 -1
  829. package/src/view/asset/PreloaderView.d.ts +1 -1
  830. package/src/view/common/LabelView.d.ts +2 -1
  831. package/src/view/common/LabelView.d.ts.map +1 -1
  832. package/src/view/common/ListView.d.ts +2 -2
  833. package/src/view/common/ListView.d.ts.map +1 -1
  834. package/src/view/common/TabbedView.d.ts +1 -1
  835. package/src/view/common/VirtualListView.d.ts +3 -3
  836. package/src/view/common/VirtualListView.d.ts.map +1 -1
  837. package/src/view/common/dnd/Draggable.d.ts +2 -2
  838. package/src/view/common/dnd/DropTarget.d.ts +6 -6
  839. package/src/view/controller/GuiController.d.ts +1 -2
  840. package/src/view/controller/GuiController.d.ts.map +1 -1
  841. package/src/view/controller/controls/BooleanVector3Control.d.ts +1 -2
  842. package/src/view/controller/controls/BooleanVector3Control.d.ts.map +1 -1
  843. package/src/view/controller/controls/NativeListController.d.ts +1 -1
  844. package/src/view/controller/controls/Vector1Control.d.ts +1 -1
  845. package/src/view/currency/CompositeCurrencyLabelView.d.ts +1 -1
  846. package/src/view/currency/CurrencyDenominationLabelView.d.ts +1 -1
  847. package/src/view/elements/BottomLeftResizeHandleView.d.ts +1 -1
  848. package/src/view/elements/CanvasView.d.ts +1 -2
  849. package/src/view/elements/CanvasView.d.ts.map +1 -1
  850. package/src/view/elements/CheckboxView.d.ts +1 -1
  851. package/src/view/elements/CompassArrowView.d.ts +1 -2
  852. package/src/view/elements/CompassArrowView.d.ts.map +1 -1
  853. package/src/view/elements/ConfirmationDialogView.d.ts +1 -1
  854. package/src/view/elements/DropDownSelectionView.d.ts +1 -1
  855. package/src/view/elements/EmptyView.d.ts +1 -2
  856. package/src/view/elements/EmptyView.d.ts.map +1 -1
  857. package/src/view/elements/Group.d.ts +1 -2
  858. package/src/view/elements/Group.d.ts.map +1 -1
  859. package/src/view/elements/MeshPreview.d.ts +1 -1
  860. package/src/view/elements/SimpleWindow.d.ts +1 -1
  861. package/src/view/elements/button/ButtonView.d.ts +1 -1
  862. package/src/view/elements/image/ImageView.d.ts +1 -2
  863. package/src/view/elements/image/ImageView.d.ts.map +1 -1
  864. package/src/view/elements/image/SvgImageView.d.ts +1 -1
  865. package/src/view/elements/label/LabeledValueView.d.ts +1 -1
  866. package/src/view/elements/navigation/ViewStack.d.ts +1 -8
  867. package/src/view/elements/navigation/ViewStack.d.ts.map +1 -1
  868. package/src/view/elements/notify/ToastLogView.d.ts +1 -1
  869. package/src/view/elements/progress/RectangularPieProgressView.d.ts +1 -1
  870. package/src/view/elements/progress/SmoothProgressBar.d.ts +1 -1
  871. package/src/view/elements/progress/segmented/SegmentedResourceBarView.d.ts +1 -1
  872. package/src/view/elements/radial/RadialMenu.d.ts +1 -1
  873. package/src/view/elements/radial/RadialMenuElement.d.ts +1 -1
  874. package/src/view/elements/radial/RadialMenuElementDefinition.d.ts +125 -39
  875. package/src/view/elements/radial/RadialProgressView.d.ts +1 -1
  876. package/src/view/elements/radial/RadialText.d.ts +1 -1
  877. package/src/view/elements/tiles2d/Tile.d.ts +1 -1
  878. package/src/view/elements/tiles2d/TileGrid.d.ts +4 -5
  879. package/src/view/elements/tiles2d/TileGrid.d.ts.map +1 -1
  880. package/src/view/elements/video/VideoView.d.ts +2 -2
  881. package/src/view/elements/video/VideoView.d.ts.map +1 -1
  882. package/src/view/elements/windrose/WindRoseDiagram.d.ts +1 -1
  883. package/src/view/game/achievements/AchievementNotificationView.d.ts +1 -1
  884. package/src/view/math/FunctionGraphView.d.ts +1 -1
  885. package/src/view/minimap/Minimap.d.ts +1 -1
  886. package/src/view/minimap/dom/MinimapCameraView.d.ts +1 -1
  887. package/src/view/minimap/dom/MinimapMarkerView.d.ts +1 -1
  888. package/src/view/minimap/dom/MinimapTerrainView.d.ts +1 -1
  889. package/src/view/task/TaskProgressView.d.ts +1 -1
  890. package/src/view/tooltip/DomTooltipObserver.d.ts +2 -2
  891. package/src/view/tooltip/TooltipView.d.ts +1 -1
  892. package/src/view/tooltip/gml/parser/parseTooltipString.d.ts +1 -0
  893. package/src/view/tooltip/gml/parser/parseTooltipString.d.ts.map +1 -1
  894. package/src/view/tooltip/gml/parser/readReferenceToken.d.ts +1 -0
  895. package/src/view/tooltip/gml/parser/readReferenceToken.d.ts.map +1 -1
  896. package/src/view/tooltip/gml/parser/readReferenceValueToken.d.ts +2 -1
  897. package/src/view/tooltip/gml/parser/readReferenceValueToken.d.ts.map +1 -1
  898. package/src/view/tooltip/gml/parser/readStyleToken.d.ts +1 -0
  899. package/src/view/tooltip/gml/parser/readStyleToken.d.ts.map +1 -1
  900. package/editor/ecs/component/TypeSchema.d.ts +0 -38
  901. package/editor/tools/v2/BlenderCameraOrientationGizmo.d.ts +0 -50
@@ -0,0 +1,717 @@
1
+ # Gamepad API — proposal
2
+
3
+ Response to the external review *"how convenient is the meep gamepad API? (UX)"*.
4
+
5
+ > **Revision 2.** P1, P4, P5, P6 accepted as written. **P2 replaced** with a persistent `main` handle (better than
6
+ > slot pre-population — see §4.2). **P3 replaced** with learned per-stick calibration and a `GamepadStick`
7
+ > abstraction, grounded in the survey in Appendix A. Revision 1's fixed `axisNoiseFloor` is withdrawn.
8
+ >
9
+ > **Revision 3 — implemented.** All of P1–P6 have landed. §4 describes the design **as shipped**: names,
10
+ > constants and signatures there match the code. §6 records what changed between the proposal and the
11
+ > implementation, and why. §1, §2 and §5 are unchanged — they are the argument, not the design.
12
+
13
+ ## 0. Summary
14
+
15
+ The review grades a hardware abstraction layer by how little game code the consumer had to write. That is the
16
+ wrong axis, and it leads to the wrong headline recommendation.
17
+
18
+ Checked against the source:
19
+
20
+ * one papercut (**sparse `buttons`**) does not reproduce through any supported access path — the guard the
21
+ reviewer wrote is dead code;
22
+ * one technical claim (**"full-diagonal magnitude ~0.99"**) is not producible by this code at all — there is no
23
+ rescaling path in `GamepadHandle#update`;
24
+ * one papercut (**"the `.d.ts` doesn't carry the frame"**) is about a file that does not exist — `engine/input`
25
+ contains zero `.d.ts` files, and the frame *is* documented, on the enum that defines it;
26
+ * the headline recommendation (**`pad.getMovement({radialDeadzone})`**) moves gameplay policy, a coordinate
27
+ convention, an options bag, and a per-frame allocation into the driver.
28
+
29
+ The review did, however, bump into a **real structural gap and misdiagnose it**: the gamepad is effectively
30
+ invisible to the engine's input binding layer (`InputSystem` / `InputControllerSystem`). That is *why* the
31
+ reviewer ended up hand-fusing raw device state — not because the device lacks convenience methods. Closing that
32
+ gap removes the "boilerplate every consumer will duplicate" without adding a single convenience method to
33
+ `GamepadHandle`.
34
+
35
+ Two of the underlying observations are worth acting on, in a different shape than proposed.
36
+
37
+ ### Dispositions
38
+
39
+ | # | Review item | Disposition |
40
+ |---|---|---|
41
+ | 1 | `buttons` sparse → add `pad.isDown(i)` | **Reject the mechanism, accept the goal.** Claim doesn't reproduce; fix uniformity at the source (P1), don't add a third accessor. |
42
+ | 2 | `pad.getMovement({radialDeadzone})` | **Reject.** Policy in the driver. Decomposed into two device-agnostic primitives instead (P4, P5). |
43
+ | 3 | Per-axis dead-zone leaks diagonals; shortens full diagonal to ~0.99 | **Half accept.** The `~0.99` claim is fabricated. The genuine defect is different and worse: the gate is destructive, misnamed, and *guesses* a number that varies 6× across hardware. Replaced by learned calibration (P3). |
44
+ | 4 | Frame undocumented "at the type level" | **Reject as stated, accept a sliver.** No `.d.ts` exists; frame is documented in `GamepadAxes.js`. Add a cross-reference on `axes`/`stickLeft`/`stickRight` (P6). |
45
+ | 5 | No digital view of stick / analog view of D-pad; fusion is on the caller | **Accept the observation, keep fusion on the caller.** Ship the two primitives, not the fused result (P5). |
46
+ | 6 | Analog-vs-digital speed is game policy | **Agree, no action.** |
47
+ | — | *(missed)* Gamepad is unbindable through the ISM path layer | **New work.** The actual defect (P1 + P2). |
48
+
49
+ ---
50
+
51
+ ## 1. The layering premise the review is missing
52
+
53
+ meep input devices are **state mirrors of hardware**. They report what the hardware reports, plus the minimum
54
+ hygiene needed to make polled hardware observable (edge detection, stuck-input release on disconnect/stop). They
55
+ contain no game policy. This is not an accident of the gamepad implementation — it is the shape of the whole
56
+ package:
57
+
58
+ * `KeyboardDevice` exposes `keys.w.is_down`. It does not expose `keyboard.getMovement()` from WASD.
59
+ * Nobody asks it to, because the layer that owns that question already exists:
60
+ [`KeyboardCameraController.js`](ecs/controllers/KeyboardCameraController.js) — a *controller* that reads device
61
+ switches and produces a camera-frame pan vector.
62
+
63
+ `pad.getMovement()` is a request to put `KeyboardCameraController`'s job inside `KeyboardDevice`. Five concrete
64
+ reasons it does not belong there:
65
+
66
+ 1. **The game frame is not a property of the stick.** The reviewer wants `+y = up`. Up in *what*? meep's world is
67
+ 3D; "stick up" maps to a world direction that depends on the camera yaw, the projection, and whether the game
68
+ is top-down or third-person. `KeyboardCameraController` resolves exactly this and it needs a
69
+ `TopDownCameraController` to do it. A `Vector2` on a driver cannot know the answer, so any answer it bakes in
70
+ is wrong for some consumer — who then must un-negate it. That is strictly worse than never negating.
71
+
72
+ 2. **Dead-zoning is not one policy.** Radial-with-rescale is right for locomotion; per-axis is right for menu
73
+ navigation; inner+outer with a response curve is right for aiming; square-gate normalization is right for
74
+ pads that report a square gate. `{radialDeadzone}` picks one and demotes the rest to "off the golden path".
75
+
76
+ 3. **`{radialDeadzone}` is an options bag.** The codebase's position is typed and verbose over magic-looking
77
+ configuration. An options object on a per-frame hot call is the opposite of that, and it grows monotonically
78
+ — the next request is `{radialDeadzone, outerDeadzone, curve, squareGate}`.
79
+
80
+ 4. **It allocates.** `getMovement()` returning a fresh `Vector2` allocates once per consumer per frame. The
81
+ engine's convention for vector-producing calls is `f(result, ...)` writing into a caller-owned target.
82
+
83
+ 5. **It creates a dual-mode API.** With `getMovement()` present, `stickLeft` becomes "the raw one" and
84
+ `getMovement()` "the good one" — two ways to ask the same question with a silent policy difference between
85
+ them. Uniform control flow means picking the common case as the *only* case at each layer, and letting
86
+ callers who want something else drop to the lower-level primitive.
87
+
88
+ What the reviewer actually wants is real. It just belongs one layer up, and it should be *composable functions*,
89
+ not a method on the driver.
90
+
91
+ ---
92
+
93
+ ## 2. Item-by-item
94
+
95
+ *Line references in this section point at the code **as reviewed**, before any of P1–P6 landed. They are part of
96
+ the argument about what the reviewer was looking at, not navigation aids for the current tree.*
97
+
98
+ ### 2.1 "`buttons` is lazily populated and sparse, so I wrote a guard"
99
+
100
+ **This does not reproduce.** Trace the code:
101
+
102
+ * [`GamepadHandle.js:140`](devices/gamepad/GamepadHandle.js:140) — `update()` iterates **every** button in the
103
+ native snapshot and calls `getButton(i)` on each. After one update, `buttons[0 … n-1]` are all populated.
104
+ * [`GamepadDevice.js:130`](devices/GamepadDevice.js:130) — `#connect()` calls `pad.update(...)` **before**
105
+ setting `pad.connected = true`.
106
+ * [`GamepadDevice.js:86`](devices/GamepadDevice.js:86) — `main` only returns pads with `connected === true`.
107
+
108
+ So every handle reachable through `gamepad.main` has already had its full button set materialised.
109
+ `pad.buttons[GamepadButtons.a].is_down` is safe, and the `button !== undefined &&` half of the reviewer's guard
110
+ never evaluates false in a connected-pad path. The `?.` in the existing `@example` is belt-and-braces, and reads
111
+ as a warning it isn't.
112
+
113
+ The one residual hole is real but different: a **non-standard mapping** pad reporting fewer than 17 buttons.
114
+ `buttons[GamepadButtons.dpad_up]` is genuinely `undefined` there, because the button does not exist.
115
+ `pad.isDown(15)` would return `false` for it — converting "this hardware has no D-pad" into "the D-pad is not
116
+ pressed", silently, forever. That is a worse API than the honest `undefined`, and it is the reason to reject the
117
+ proposed mechanism specifically.
118
+
119
+ **The goal is still right.** Keyboard/gamepad symmetry should not have an asterisk, and `pads`/`buttons`
120
+ sparseness has a second, much more serious consequence (§3). Fix it at the source: pre-populate (P1/P2), so
121
+ there is nothing to guard and no third accessor.
122
+
123
+ ### 2.2 `getMovement()` — rejected
124
+
125
+ See §1. Replaced by P4 + P5.
126
+
127
+ ### 2.3 "Per-axis dead-zoning leaks diagonal drift and shortens the full diagonal to ~0.99"
128
+
129
+ **First half: correct.** A per-axis gate at 0.1 admits up to `sqrt(0.1² + 0.1²) ≈ 0.141` of resting magnitude,
130
+ and its boundary is anisotropic — a stick pushed to `(0.09, 0.09)` reads dead, `(0.11, 0.0)` reads live.
131
+
132
+ **Second half: not producible by this code.** The gate is
133
+ [`GamepadHandle.js:169`](devices/gamepad/GamepadHandle.js:169):
134
+
135
+ ```js
136
+ if (Math.abs(value) < deadZone) {
137
+ value = 0;
138
+ }
139
+ ```
140
+
141
+ There is no rescale, no normalization, no magnitude clamp anywhere in `update()`. A full-deflection axis passes
142
+ through byte-identical to what the hardware reported. If the reviewer measured 0.99 at full diagonal, that was
143
+ their pad's gate, not ours. This matters because it is the tell that the section was reasoned about rather than
144
+ read — and the actual defect sitting three lines away was missed.
145
+
146
+ **The actual defect** is threefold and worse than "leaks diagonals":
147
+
148
+ 1. **It is destructive.** The gated value is what gets *stored* in `axes`, so a consumer who wants radial
149
+ dead-zoning cannot recover the raw signal — the information is gone before they see it. Policy applied in a
150
+ mirror layer is not just misplaced, it is lossy.
151
+ 2. **It is discontinuous.** `0.0999 → 0`, `0.1001 → 0.1001`. Input magnitude jumps by the full dead-zone width
152
+ the instant the threshold is crossed. Any consumer mapping magnitude to speed gets a visible speed pop.
153
+ 3. **It is named for a policy it should not be implementing.** `deadZone` at `0.1` reads as "the engine has
154
+ decided your gameplay dead-zone", which is precisely how the reviewer read it.
155
+
156
+ There is a fourth problem the review could not have seen without measuring hardware, and it is the one that
157
+ kills the whole "pick a good constant" approach: **the right number varies by more than 6× across pads.** XInput
158
+ ships 0.24 (left stick) and 0.265 (right); SDL treats ±0.098 as at-rest; hall-effect and TMR pads need 0.02–0.03
159
+ and stay there for life; a worn potentiometer pad needs 0.2+ and gets worse over time. Any single constant is
160
+ sized for the worst pad in the population, and every good pad pays for it with lost range.
161
+
162
+ Fixed in P3 + P4: the device *measures* its own stick instead of guessing (learned center + noise radius), and
163
+ gameplay dead-zoning becomes a continuous, rescaling, radial primitive applied by the consumer.
164
+
165
+ ### 2.4 "Frame is undocumented at the type level — the `.d.ts` doesn't carry it"
166
+
167
+ Two problems.
168
+
169
+ * **The frame is documented**, in the file that owns the concept —
170
+ [`GamepadAxes.js:5`](devices/gamepad/GamepadAxes.js:5): *"Negative values are left/up, positive values are
171
+ right/down"*. The review cites having read it, then calls it undocumented.
172
+ * **There is no `.d.ts`.** `find src/engine/input -name "*.d.ts"` returns nothing. Hand-written `.d.ts` are not
173
+ maintained in this project; whatever the reviewer was reading was IDE inference or a stale tree. If a `.d.ts`
174
+ for this package appears, deleting it is the fix.
175
+
176
+ **Accepted sliver:** the frame note lives on the *enum*, and a consumer touching `stickLeft` may never open
177
+ `GamepadAxes.js`. One-line cross-references on `axes`, `stickLeft`, `stickRight` (P6).
178
+
179
+ ### 2.5 "No digital view of the stick, no analog view of the D-pad; fusion is on the caller"
180
+
181
+ Correct, and **fusion stays on the caller** — which of stick and D-pad wins, whether they sum or the last-touched
182
+ device latches, and whether a held D-pad suppresses stick drift are all game decisions with no defensible
183
+ default. What *is* mechanical and duplicated is the conversion on each side, so ship both directions as
184
+ primitives (P5) and leave the `max`/`or`/`latch` to the consumer.
185
+
186
+ ### 2.6 "Analog-vs-digital speed is a caller concern"
187
+
188
+ Agreed, explicitly. No action.
189
+
190
+ ---
191
+
192
+ ## 3. What the review missed: the gamepad is unbindable through the ISM
193
+
194
+ The engine's action-mapping layer resolves bindings by *path* against the device tree —
195
+ [`InputSystem.js:18`](ecs/systems/InputSystem.js:18) and
196
+ [`InputControllerSystem.js:159`](ecs/systems/InputControllerSystem.js:159), both via
197
+ [`resolvePath`](../../core/json/resolvePath.js), which **throws when a path cannot be resolved**.
198
+
199
+ Keyboard works because `KeyboardDevice` pre-populates every key from `KeyCodes` in its constructor, so
200
+ `keyboard/keys/w/down` resolves at load time, before anyone touches the hardware.
201
+
202
+ The gamepad cannot do this:
203
+
204
+ * `pads` is sparse and keyed on the hardware slot, so `gamepad/pads/0/...` throws until a pad connects;
205
+ * `buttons` is sparse until first poll, so `gamepad/pads/0/buttons/0/down` throws until the pad has been read.
206
+
207
+ Consequences: an `InputController` carrying a gamepad binding **cannot be linked until the player has already
208
+ plugged in and pressed something**; whether a given binding works depends on which physical slot the pad landed
209
+ in; and a serialized `InputBinding` referencing a gamepad path is a load-order landmine. (Unlink is safe once
210
+ link succeeded — handles are retained across disconnect — but that is the only part of the lifecycle that is.)
211
+
212
+ This — not the absence of `getMovement()` — is why the integration was "entirely on the caller". The blessed
213
+ mapping mechanism was unavailable, so the reviewer polled raw state and fused by hand, then reported the
214
+ symptoms of doing so as API friction. P1 and P2 close it as a side effect of fixing uniformity.
215
+
216
+ *(Separately: axis bindings have no per-axis granularity — only the aggregate `on.axis`, forcing listeners to
217
+ filter by index. Noted, not proposed. The string-path ISM is already the odd one out against the codebase's
218
+ typed-over-magic position; make it work, don't grow it. Direct typed state access — `pad.buttons[GamepadButtons.a].is_down`
219
+ — remains the blessed path.)*
220
+
221
+ ---
222
+
223
+ ## 4. Proposed work
224
+
225
+ ### P1 — `GamepadHandle` pre-populates the standard mapping
226
+
227
+ ```js
228
+ // gamepad/GamepadStandardMapping.js
229
+ export const GAMEPAD_STANDARD_BUTTON_COUNT = 17;
230
+ export const GAMEPAD_STANDARD_AXIS_COUNT = 4;
231
+ ```
232
+
233
+ `GamepadHandle` materialises those in its constructor: 17 `InputDeviceSwitch`, 17 zeroed `buttonValues`, 4 zeroed
234
+ `axes`. `getButton` stays as-is and keeps growing the array for hardware exposing more than 17 buttons.
235
+
236
+ Effect: `pad.buttons[GamepadButtons.dpad_up].is_down` is total. No guard, no `?.`, no `isDown()`. Exactly the
237
+ keyboard's contract.
238
+
239
+ **Tradeoff, stated explicitly:** on a non-standard pad with 6 buttons, `buttons[12]` now reads "up" rather than
240
+ "absent". Absence is signalled by `pad.mapping !== "standard"`, which is where the Gamepad API puts it, not by
241
+ holes in an array. Uniform beats expressive here — a hole is not a usable absence signal anyway, since the
242
+ consumer sees a hole for "no such button" and (previously) also for "not polled yet".
243
+
244
+ Cost: 17 small objects per handle, allocated once.
245
+
246
+ ### P2 — `main` becomes a persistent handle bound to the active pad
247
+
248
+ *(Replaces revision 1's slot pre-population. This is the better design: it gives the binding layer a stable path
249
+ without pretending four pads exist, and it matches what a single-player consumer actually means by "the
250
+ gamepad".)*
251
+
252
+ `GamepadDevice.main` becomes a `GamepadHandle` constructed with the device, living **outside** `pads[]`, starting
253
+ disconnected:
254
+
255
+ * it binds to the first pad that connects;
256
+ * when its bound pad disconnects, it rebinds to the **oldest still-connected** pad (connection order);
257
+ * when nothing is connected, it stays present and `connected === false`, with all switches released.
258
+
259
+ Mechanically `main` is a real handle fed the *same* native snapshot as its bound pad during `poll()` — not a
260
+ proxy or a getter chain. That matters: `gamepad/main/buttons/0/down` is a stable `Signal` **object** that
261
+ resolves at engine construction and never changes identity, which is exactly what `resolvePath` needs (§3).
262
+
263
+ ```js
264
+ // GamepadDevice
265
+ #connection_sequence = 0;
266
+
267
+ /**
268
+ * The active gamepad. Always present; check {@link GamepadHandle#connected}.
269
+ * Mirrors the first connected pad, falling back to the oldest remaining one when that pad is lost.
270
+ * Not a member of {@link pads}.
271
+ */
272
+ main = new GamepadHandle();
273
+ ```
274
+
275
+ Notes on the implementation:
276
+
277
+ * **Do not** forward `main.on.*` into the device-level `on.*` signals. The pad it mirrors already forwards, so
278
+ wiring both would double-fire every press for every listener.
279
+ * On unbind, `main.reset()` — releases everything, so a yank-the-cable never leaves input stuck. The next
280
+ `update()` from the new source re-presses whatever is genuinely held. Free correctness from the existing edge
281
+ detection.
282
+ * `main.index` / `.id` / `.mapping` follow the mirrored pad, because `update()` already copies them. Useful:
283
+ a settings screen can name the active pad without touching `pads`.
284
+ * Connection order needs one counter — stamp `pad.connectionIndex = this.#connectionSequence++` inside
285
+ `#connect`, pick the smallest among connected on rebind.
286
+ * Binding, rebinding and refreshing all happen in one place at the end of `poll()`. Splitting them across
287
+ `#connect`/`#disconnect` leaves `main` a frame stale on a swap — see §6.3.
288
+
289
+ Cost: one extra handle update per poll (17 buttons + 4 axes) — noise.
290
+
291
+ **Breaking, and an improvement:** `main` was `GamepadHandle | undefined`. It is now always a handle. Existing
292
+ `if (pad !== undefined)` guards still compile and simply never trigger; the check becomes `main.connected`. This
293
+ removes the only sentinel in the gamepad API, which is the direction the codebase wants anyway.
294
+
295
+ **Deliberately unresolved:** per-slot paths (`gamepad/pads/1/...`) still don't resolve, because `pads` keeps its
296
+ honest sparse hardware-slot semantics. Local multiplayer binds through the device-level `on.down`, which already
297
+ dispatches `(buttonIndex, pad)`, or holds handles from the `connected` signal. If per-player path binding is ever
298
+ wanted, the shape is an ordered player-assignment list of which `main` is element 0 — this design doesn't
299
+ preclude it, and I'd rather add it when there's a consumer than guess the assignment policy now.
300
+
301
+ ### P3 — Learned per-stick calibration, and a `GamepadStick` abstraction
302
+
303
+ *(Replaces revision 1's fixed `axisNoiseFloor`. Appendix A is the supporting survey.)*
304
+
305
+ Three findings drive this:
306
+
307
+ 1. **In a browser there is no factory calibration, so learning is the only calibration available.** Native stacks
308
+ can read hardware calibration — a Switch pad stores per-axis min/center/max in SPI flash, XInput and SDL apply
309
+ vendor-tuned constants. The Gamepad API exposes none of it: normalized floats and nothing else. Every native
310
+ stack calibrates; we're the only ones who'd be guessing.
311
+ 2. **The dominant error is a center offset, not symmetric noise.** This is what "stick drift" *is*, and it is why
312
+ every consumer calibration tool works by sampling the resting position and subtracting it. A fixed dead zone
313
+ responds to an offset center by widening the dead area — asymmetrically, so you lose range on one side and
314
+ still drift on the other. Learning the center fixes the actual defect; a dead zone only hides it.
315
+ 3. **The right radius varies 6×+ across the installed base** (§2.3). Measuring is the only way to give a TMR pad
316
+ its 0.02 and a worn pad its 0.15 from one code path.
317
+
318
+ **Layering — why this doesn't contradict §1.** Calibration is *hardware characterization*: learning that this
319
+ stick rests at `(0.03, -0.01)` with `0.018` of dispersion makes the mirror **more accurate**, which is squarely
320
+ the device layer's job. Gameplay dead zone, response curve, and frame conversion remain policy and stay with the
321
+ consumer via `apply_radial_dead_zone`. The line is: *the device removes what the hardware got wrong; the game
322
+ decides what to do with what's left.* Getting this backwards is a known failure mode — SDL applying its own dead
323
+ zone under a game that applies another is a long-standing complaint, and the result is exactly the doubled dead
324
+ zone with all precision gone.
325
+
326
+ #### The abstraction
327
+
328
+ ```js
329
+ export class GamepadStick {
330
+ /** Indices into {@link GamepadHandle#axes} that this stick reads. */
331
+ axisX = 0;
332
+ axisY = 1;
333
+
334
+ /** Hardware value, exactly as reported. */
335
+ raw = new Vector2();
336
+
337
+ /** Calibrated value: center-corrected and noise-gated. This is what gameplay should read. */
338
+ value = new Vector2();
339
+
340
+ /** @type {GamepadStickCalibration} */
341
+ calibration = new GamepadStickCalibration();
342
+
343
+ on = {
344
+ /** Fires when {@link value} changes. A calibrated stick at rest is silent. */
345
+ changed: new Signal()
346
+ };
347
+
348
+ /** Refresh from raw axis values, feeding the calibrator on the way through. */
349
+ update(axes) {}
350
+
351
+ /** Return to neutral, keeping the calibration — the hardware has not changed. */
352
+ reset() {}
353
+
354
+ /** Discard what was learned. For when the handle starts representing *different* hardware. */
355
+ forgetCalibration() {}
356
+ }
357
+
358
+ export class GamepadStickCalibration {
359
+ /** Learned rest position. */
360
+ center = new Vector2();
361
+
362
+ /** Learned dispersion around {@link center}; magnitudes inside this read as 0. */
363
+ noiseRadius = 0;
364
+
365
+ /** When true, learning is suspended and the current values are used as-is. */
366
+ locked = false;
367
+ }
368
+ ```
369
+
370
+ `stickLeft` / `stickRight` become `GamepadStick` rather than `Vector2`. **Breaking:** `pad.stickLeft.x` →
371
+ `pad.stickLeft.value.x`. Changelog line; this is public surface.
372
+
373
+ **Opt-out without a mode flag.** You asked for an opt-out, and the obvious form of it — a boolean that switches
374
+ between two code paths — is the dual-mode shape we rejected for `getMovement()`. It isn't needed here: the
375
+ transform is *always* applied, and an identity calibration (`center = (0,0)`, `noiseRadius = 0`, `locked =
376
+ true`) is a bit-exact passthrough. One code path, and "no filtering" is just a particular calibration. The same
377
+ mechanism covers a settings-screen manual dead zone and a saved per-controller profile — `GamepadStickCalibration`
378
+ gets `to/fromBinaryBuffer`, keyed on `pad.id`.
379
+
380
+ **Calibration belongs to hardware, not to a handle.** A handle outlives the pad it represents: slots get
381
+ re-occupied, and `main` moves between pads. Carrying an estimate across that would apply one pad's correction to
382
+ another — and because the calibrator only ever moves its estimate *closer* to the origin (below), a new pad
383
+ resting further out could never adopt its own rest position at all. So `forgetCalibration()` is called on a fresh
384
+ connection and when `main` binds a new source. It is a no-op on a locked calibration: a supplied profile is not
385
+ ours to discard.
386
+
387
+ #### The learning algorithm
388
+
389
+ **Phase A — rest estimation.** Runs continuously and unattended; there is no separate "on connect" mode.
390
+
391
+ * Collect `REST_SAMPLE_COUNT = 60` raw samples (≈1 s at rAF) as a fixed, non-overlapping window.
392
+ * **Reject the whole window** if any sample magnitude exceeds `REST_CANDIDATE_MAX = 0.08`, or if per-axis spread
393
+ (max − min) exceeds `REST_SPREAD_MAX = 0.015`. Resting and holding cannot be told apart inside one window —
394
+ both are steady — so the bounds are biased hard toward rejection, on the asymmetry that failing to calibrate
395
+ leaves an exact passthrough while calibrating wrongly injects phantom deflection. The spread bound is the
396
+ primary defence, and it exploits a physical difference: a held stick carries hand tremor, a settled one
397
+ carries only sensor noise, and the two differ by roughly an order of magnitude. (§6.1 and §6.4 record how
398
+ these numbers were arrived at — the first version of this section got the reasoning wrong.)
399
+ * **Center = per-axis median** of the window. Median, not mean: one spike shifts a 60-sample mean by 1.7% of its
400
+ amplitude, and shifts the median by nothing.
401
+ * **`noiseRadius` = median(d) + `NOISE_RADIUS_DEVIATIONS`·MAD(d)** where `d` are the sample distances from the
402
+ learned center and MAD is the median absolute deviation. MAD is the standard robust dispersion estimator — a
403
+ high quantile computed from 60 samples is dominated by its own tail, which is precisely the outliers we're
404
+ trying not to fit. No clamp: the spread bound already constrains the result structurally, to
405
+ `NOISE_RADIUS_MAX = REST_SPREAD_MAX · √2 · (1 + NOISE_RADIUS_DEVIATIONS)` ≈ 0.106.
406
+ * **Adopt only if closer in.** A window is written to the calibration only when its center is nearer the origin
407
+ than the accepted one. This is what makes a wrong estimate self-correcting: a stick that was being held when
408
+ sampling started is superseded the moment it is released, with no separate recovery path. The trade is that
409
+ drift *growing* within a session is not followed — a wear process measured in weeks, and calibration restarts
410
+ whenever the pad reconnects.
411
+ * **Recovery takes up to two windows.** Windows are fixed and non-overlapping, so the one straddling a release
412
+ or a rebind still holds pre-transition samples and is rejected on spread; only the window after it is clean.
413
+ This affects how quickly a correct estimate is found, never whether it is correct.
414
+
415
+ **Phase B — range estimation.** Proposed as **optional and off by default.** Pads differ in gate shape (square
416
+ gates reach ~1.41 at full diagonal, circular ones ~1.0), so a learned per-direction max would let us normalize to
417
+ a unit circle. But a running max is a self-poisoning estimator — one spike raises the ceiling permanently and
418
+ silently compresses everything afterwards. If we do it: require K consecutive samples above the current maximum
419
+ before raising it, clamp to `[0.8, 1.5]`, and decay slowly. I'd rather ship Phase A, which is high-value and
420
+ low-risk, and leave this behind a flag until a real pad demands it.
421
+
422
+ **Not proposed, but worth knowing about:** dead-zoning only addresses error *near center*. Jitter while the stick
423
+ is **deflected** is a separate problem, and the state of the art for it is the 1€ filter (Casiez et al., CHI
424
+ 2012) — a speed-adaptive low-pass with two parameters: low cutoff at low speed kills jitter, rising cutoff at
425
+ speed kills lag. It's ~30 lines and would slot in as an optional stage on `GamepadStick` between `raw` and
426
+ `value`. I'd hold it until someone reports jitter that calibration doesn't fix, but the abstraction should leave
427
+ room for it — which it does, since the stage lives inside the stick and consumers only see `value`.
428
+
429
+ #### Consequences for `axes` and `deadZone`
430
+
431
+ * **`pad.axes` becomes raw** — a true mirror, no destructive gating (fixes §2.3's real defect). Non-stick axes on
432
+ exotic mappings are unaffected by stick calibration, as they should be.
433
+ * **`GamepadDevice.deadZone` is removed**, replaced by a `@deprecated` accessor whose setter writes
434
+ `noiseRadius` into every stick — existing and subsequently connected — and locks them. That is a faithful
435
+ migration: the old behaviour *was* a manually-specified fixed gate, and a locked calibration is exactly that.
436
+ Locking also means such a value survives reconnection, unlike a learned one.
437
+ * **`on.axis` now fires at hardware sample rate on a drifting pad**, where the gate used to silence it. Decided
438
+ in favour of leaving it: the raw layer is honest, and the recommended path (`stick.on.changed`) is silent at
439
+ rest because the calibrated value genuinely doesn't change. The rejected alternative was gating `on.axis` at
440
+ an epsilon, which is the destructive gate creeping back in under a smaller number. This is a behaviour change
441
+ for anything bound to `on.axis`.
442
+
443
+ ### P4 — `apply_radial_dead_zone(result, x, y, inner, outer)`
444
+
445
+ `engine/input/analog/apply_radial_dead_zone.js` — device-agnostic, no allocation, no options bag, continuous:
446
+
447
+ ```js
448
+ export function apply_radial_dead_zone(result, x, y, inner, outer) {
449
+ const m = Math.sqrt(x * x + y * y);
450
+
451
+ if (m <= inner) {
452
+ result.set(0, 0);
453
+ return;
454
+ }
455
+
456
+ const scale = Math.min((m - inner) / (outer - inner), 1) / m;
457
+
458
+ result.set(x * scale, y * scale);
459
+ }
460
+ ```
461
+
462
+ Isotropic boundary (no diagonal leak), continuous at `inner` (no speed pop), saturates to unit magnitude at
463
+ `outer` (no `>1` from square-gate pads). Applies equally to a stick, a touch nub, or a mouse delta.
464
+
465
+ ### P5 — `gamepad_write_dpad_vector(result, pad)`
466
+
467
+ `engine/input/devices/gamepad/gamepad_write_dpad_vector.js` — the D-pad as an analog vector, **in hardware
468
+ frame** (`+y` down), so it composes with `stickLeft` without the consumer tracking which of the two is flipped:
469
+
470
+ ```js
471
+ export function gamepad_write_dpad_vector(result, pad) {
472
+ const buttons = pad.buttons;
473
+
474
+ const up = buttons[GamepadButtons.dpad_up].is_down;
475
+ const down = buttons[GamepadButtons.dpad_down].is_down;
476
+ const left = buttons[GamepadButtons.dpad_left].is_down;
477
+ const right = buttons[GamepadButtons.dpad_right].is_down;
478
+
479
+ result.set(
480
+ (right ? 1 : 0) - (left ? 1 : 0),
481
+ (down ? 1 : 0) - (up ? 1 : 0)
482
+ );
483
+ }
484
+ ```
485
+
486
+ (Total only because of P1.) The digital view of the stick is the caller's threshold on
487
+ `apply_radial_dead_zone`'s output, which is a comparison, not an API.
488
+
489
+ ### P6 — Documentation
490
+
491
+ * Cross-reference the frame on `axes`, `stickLeft`, `stickRight`: *"Hardware frame: `+x` right, `+y` down. See
492
+ {@link GamepadAxes}. Game-frame conversion belongs in the controller — see `KeyboardCameraController`."*
493
+ * Drop the misleading `?.` from the `buttons` `@example` once P1 lands.
494
+ * Worked gamepad-locomotion example in the `GamepadDevice` class doc (below), so the next consumer copies the
495
+ intended composition instead of inventing one.
496
+
497
+ ### Tests
498
+
499
+ `GamepadDevice.spec.js` currently has 7 tests and does not cover any of this. Add:
500
+
501
+ * P1: all standard buttons defined on a fresh handle, before any poll; `getButton(20)` still grows.
502
+ * P2: `main` exists and is disconnected on a fresh device; binds to the first pad that connects; mirrors its
503
+ buttons and axes; on disconnect of the bound pad falls back to the oldest remaining connected pad; goes
504
+ disconnected with everything released when the last pad is lost; a button held at disconnect is released
505
+ exactly once; a press on the bound pad fires device-level `on.down` exactly once (double-forwarding guard).
506
+ * §3 regression: `resolvePath(devices, "gamepad/main/buttons/0/down")` resolves to a Signal on a fresh engine
507
+ with no hardware, is the *same object* after connect→disconnect→reconnect, and dispatches across a pad swap.
508
+ * P3 calibration: a window centered at `(0.03, -0.01)` with small noise yields a center within tolerance and a
509
+ non-zero, structurally bounded `noiseRadius`; a window containing a held stick is **rejected**; a window with
510
+ one 0.9 spike is rejected; a swept window is rejected; a window with one mild outlier still yields a
511
+ median-based center unmoved beyond tolerance; identity + `locked` is a bit-exact passthrough of `raw` to
512
+ `value`; calibrated `value` is exactly `(0,0)` for samples inside the learned radius; `axes` are byte-identical
513
+ to source at all deflections (mirror contract); the deprecated `deadZone` setter reaches pads connected later.
514
+ * P3 adversarial (§6.4): connecting while the stick is fully deflected, diagonally deflected, or resting at an
515
+ axis extreme never calibrates; connecting while it is *slightly* deflected stays bounded below a usable
516
+ gameplay dead zone and recovers; `main` and a reused slot handle each forget a previous pad's calibration, and
517
+ can then learn a rest position further out than it; a locked calibration survives reconnection.
518
+ * P4: rest → `(0,0)`; just inside `inner` → `(0,0)`; just outside `inner` → magnitude ≈ 0 (continuity, no jump);
519
+ at `outer` → magnitude 1; beyond `outer` → magnitude 1; full diagonal on a square-gate pad → magnitude 1, not
520
+ 1.41; isotropy — `(0.14, 0.14)` and `(0.198, 0)` land within epsilon of the same magnitude.
521
+ * P5: each direction; opposing pair cancels to 0; diagonal → `(1, 1)` pre-normalization.
522
+
523
+ All black-box, against real `GamepadHandle` / `InputDeviceSwitch` / a plain object standing in for the native
524
+ `Gamepad` snapshot (a platform type we cannot construct in node — the only fake here).
525
+
526
+ ### After this proposal, the reviewer's integration reads:
527
+
528
+ ```js
529
+ const pad = engine.devices.gamepad.main; // always present
530
+
531
+ if (pad.connected) {
532
+ const left = pad.stickLeft.value; // already center-corrected for this specific stick
533
+
534
+ gamepad_write_dpad_vector(dpad, pad);
535
+ apply_radial_dead_zone(stick, left.x, left.y, 0.15, 0.95);
536
+
537
+ // fusion + frame: game policy, and this is the whole of it
538
+ const x = stick.x !== 0 || stick.y !== 0 ? stick.x : dpad.x;
539
+ const y = stick.x !== 0 || stick.y !== 0 ? stick.y : dpad.y;
540
+
541
+ move.set(x, -y); // this game is y-up; the negation is stated once, here, on purpose
542
+ }
543
+ ```
544
+
545
+ Shorter than what the review reported writing, with zero allocation per frame, no `undefined` guard, every policy
546
+ decision visible at the call site instead of hidden behind an options bag — and a gameplay dead zone the game
547
+ picks for feel rather than to paper over hardware, because the hardware error is already gone by this line.
548
+
549
+ Hot-swapping pads mid-session requires no code here at all: `main` rebinds and the loop doesn't notice.
550
+
551
+ ---
552
+
553
+ ## 5. Explicitly not doing
554
+
555
+ * **`pad.isDown(i)`** — a third way to ask a question `buttons[i].is_down` and `getButton(i).is_down` already
556
+ answer, which silently converts absent hardware into an unpressed button. P1 removes the need.
557
+ * **`pad.getMovement()`** — §1.
558
+ * **Frame negation anywhere in the device layer** — the device reports hardware frame, full stop. One negation,
559
+ in the controller, where the camera is known.
560
+ * **Growing the ISM string-path layer with gamepad-specific concepts** — make the existing paths resolve (P1/P2);
561
+ do not build more magic strings.
562
+ * **Per-axis signals on `GamepadHandle`** — noted as a real granularity gap in §3. Partly answered by
563
+ `GamepadStick.on.changed`; the remaining gap is non-stick axes on exotic mappings. Revisit if a consumer needs
564
+ it.
565
+ * **A calibration wizard** ("rotate the stick in circles") — the standard consumer-tool flow, and the only way to
566
+ learn true per-direction range. Out of scope: Phase A needs no UI, and Phase B is deferred. If a settings
567
+ screen wants one later, `GamepadStickCalibration` is already the serializable thing it would write to.
568
+ * **1€ filter** — right tool for deflected-stick jitter, wrong time. Left room for it inside `GamepadStick`; see
569
+ P3.
570
+
571
+ ---
572
+
573
+ ## 6. What changed during implementation
574
+
575
+ Two corrections, both found by tests that failed against the design as written above.
576
+
577
+ ### 6.1 The rest-window guard did not do what §4 claimed
578
+
579
+ *(§4 now describes the shipped bounds; what it said before this correction is quoted here.)*
580
+
581
+ Revision 2's P3 asserted that `REST_CANDIDATE_MAX = 0.30` plus a spread check together catch "the player was holding the
582
+ stick", *"because a stick held steady at 0.25 passes the first test alone"*. That reasoning is wrong: a stick
583
+ held **steady** at 0.25 also has near-zero spread, so it passes the second test too. The first implementation
584
+ duly learned a held position as the rest position, producing a phantom −0.23 deflection once the player let go.
585
+ The test asserting it wouldn't is what caught it.
586
+
587
+ There is no way to tell resting from holding inside a single window — both are steady. So the bounds are now
588
+ biased hard toward rejection, on the reasoning that **failing to calibrate is harmless** (identity is an exact
589
+ passthrough) **while calibrating wrongly is actively harmful**:
590
+
591
+ * `REST_CANDIDATE_MAX` 0.30 → **0.15**. Drift worse than this is a pad heading for replacement, and past some
592
+ deflection a steady reading is likelier to be a hand than a stick. *(Tightened again to 0.08 in §6.4, on a
593
+ better argument than this one.)*
594
+ * `REST_SPREAD_MAX` 0.05 → **0.015**. This is now the primary defence, and it exploits a physical difference the
595
+ original design ignored: a held stick carries the hand's tremor, a settled one carries only sensor noise, and
596
+ the two differ by roughly an order of magnitude. The cost is that an unusually noisy stick never calibrates,
597
+ which is the safe failure.
598
+
599
+ The residual hole is documented rather than papered over: a player parked at a small steady deflection for a
600
+ full second can still poison the estimate until they release, bounded by `REST_CANDIDATE_MAX`, and the
601
+ minimum-magnitude rule then supersedes it. Both the poisoning and the recovery are tested.
602
+
603
+ ### 6.2 `NOISE_RADIUS_MAX` became unreachable, so the clamp went
604
+
605
+ With the spread bound at 0.015, a window that passes it cannot produce a radius anywhere near 0.20 — the result
606
+ is structurally bounded at `REST_SPREAD_MAX · √2 · (1 + NOISE_RADIUS_DEVIATIONS)` ≈ 0.106. The clamp was a guard
607
+ for a condition that can no longer occur, so it was removed and the constant kept as a derived, documented
608
+ bound. The test asserts the structural property instead of the removed clamp.
609
+
610
+ ### 6.3 Two smaller notes
611
+
612
+ * **`main` rebinding was one frame stale.** Binding logic initially lived in `#connect`/`#disconnect`, so a
613
+ successor picked up mid-poll wasn't fed hardware until the *next* poll — `main.connected` read true while
614
+ `main.id` still named the unplugged pad. Binding, rebinding and refreshing now all happen in one place at the
615
+ end of `poll()`, which resolves a swap within a single poll and, incidentally, removed a pre-existing
616
+ duplicate `pad.update()` per poll.
617
+ * **The deprecated `deadZone` setter is plumbed properly**, not just applied to pads that happen to exist when
618
+ it is written — new handles pick the override up in `#obtainHandle`. A half-working compatibility shim would
619
+ have been worse than none.
620
+
621
+ ### 6.4 Adversarial pass: connecting with a deflected stick
622
+
623
+ Two scenarios were put to the implementation afterwards. One was safe, one was not, and chasing them turned up a
624
+ third defect neither scenario named.
625
+
626
+ **Connecting with a *fully* deflected stick — safe by construction.** Every sample is far outside
627
+ `REST_CANDIDATE_MAX`, so every window is rejected for as long as the stick is held, and release leaves an exact
628
+ passthrough rather than a phantom pull the other way. Same for a diagonal hold, and for the non-standard
629
+ mappings that report a released trigger as an axis resting at −1: those never calibrate, which is the correct
630
+ outcome, not a silent wrong one.
631
+
632
+ **Connecting with a *partially* deflected stick — this was the real gap.** A steady hold inside the plausibility
633
+ bound is genuinely indistinguishable from drift in a single window, so it was adopted as the rest position and
634
+ produced a phantom deflection of the same size on release. It self-corrected, but "bounded at 0.15 and recovers
635
+ in about two seconds" is a weaker answer than it needs to be, because the bound was set too generously:
636
+
637
+ * `REST_CANDIDATE_MAX` 0.15 → **0.08**. The reasoning that fixes it is an asymmetry the earlier revisions
638
+ missed. Auto-calibration earns its keep on *small* drift — the kind that sits under a gameplay dead zone and
639
+ still causes slow creep. Drift larger than that is already absorbed by any sane gameplay dead zone (XInput
640
+ ships 0.24), so declining to calibrate it costs almost nothing. Poisoning, on the other hand, costs a phantom
641
+ deflection. Tightening trades away the case that needs us least, and in exchange the worst wrong estimate now
642
+ lands **below any usable gameplay dead zone** — it never reaches the game at all before being superseded.
643
+ That is asserted directly rather than implied.
644
+
645
+ **The defect neither scenario named: a handle outliving the hardware it learned.** `main` rebinding to a
646
+ different pad, and a slot handle being reused when a different pad is plugged into that slot, both carried the
647
+ previous pad's calibration onto new hardware. Worse than a stale offset: because the calibrator only ever moves
648
+ its estimate *closer* to the origin, a new pad whose rest position sat further out than the old one's could
649
+ **never** have its own rest position adopted — the wrong calibration would have been permanent. Both paths now
650
+ call `forgetCalibration()`, which is a no-op on a locked calibration, since a supplied profile is not ours to
651
+ discard. Regression tests cover both, including a new pad resting further out and the other way.
652
+
653
+ **Recovery takes up to two windows, not one.** Windows are fixed and non-overlapping, so the one straddling a
654
+ release or a rebind still contains pre-transition samples and is rejected on spread; only the window after it is
655
+ clean. This affects how fast a correct estimate is found, never whether it is correct. Stated here because the
656
+ first tests written assumed one window and were wrong about the contract, not about the code.
657
+
658
+ **Tests: 101 passing across 13 suites in `engine/input`.** New: `GamepadHandle.spec.js`,
659
+ `GamepadStick.spec.js`, `GamepadStickCalibration.spec.js`, `gamepad_write_dpad_vector.spec.js`,
660
+ `apply_radial_dead_zone.spec.js`, plus P2/P3 coverage and the `resolvePath` regression in
661
+ `GamepadDevice.spec.js`.
662
+
663
+ ---
664
+
665
+ ## Appendix A — What the state of the art actually does
666
+
667
+ Surveyed while designing P3. Three things are worth having on the record.
668
+
669
+ **Nobody good uses a single hard-coded constant, and everybody who ships one ships a different number.**
670
+
671
+ | Stack | At-rest threshold | Notes |
672
+ |---|---|---|
673
+ | XInput (Microsoft) | 7849/32767 ≈ **0.240** left, 8689/32767 ≈ **0.265** right | Vendor-recommended constants, per-stick — even Microsoft doesn't use one number for both sticks on the same pad |
674
+ | SDL | ±3200/32767 ≈ **0.098** | Documented as "consider at rest"; SDL notes advanced UI should let users set or **autodetect** it |
675
+ | Hall-effect / TMR pads (current gen) | **0.02–0.03** | Manufacturer guidance; stable for the life of the pad rather than degrading |
676
+ | Worn potentiometer pads | **0.2+**, rising | The population XInput's 0.24 is sized for |
677
+ | meep today | 0.1, per-axis | Between the two, correct for neither |
678
+
679
+ That spread is the argument: a constant is a bet on the worst pad you expect to see, and the modern population is
680
+ bimodal — drift-free magnetic sticks alongside worn potentiometer ones. Measuring costs 60 samples once.
681
+
682
+ **Native stacks calibrate against hardware data we cannot get.** A Switch pad carries factory calibration in SPI
683
+ flash (per-axis min/center/max, at `0x8010`); desktop stacks apply vendor tables. The Gamepad API gives us
684
+ normalized floats and `id`, and nothing else. So the choice isn't "learn vs. read the real values" — it's "learn
685
+ vs. guess".
686
+
687
+ **Consumer calibration tools all do the same two things**, which is a decent signal about what actually works:
688
+ sample the resting position over a short window (≈60 frames is the common figure) and subtract it; then optionally
689
+ sweep for range. Firmware-level fixes write the corrected center point to controller NVS. This is Phase A and
690
+ Phase B, and it's why P3 puts center estimation first — offset is the defect people call "drift", and a dead zone
691
+ never fixes an offset, it only hides half of one.
692
+
693
+ **Dead-zone geometry.** Josh Sutphin's taxonomy (axial / radial / scaled radial / sloped-scaled-axial / hybrid)
694
+ is still the reference, with a good annotated implementation set at
695
+ [Minimuino/thumbstick-deadzones](https://github.com/Minimuino/thumbstick-deadzones). Scaled radial with inner and
696
+ outer bounds is P4, and it's the right default: isotropic boundary, full `[0,1]` output range preserved,
697
+ continuous at the inner edge. Axial has legitimate uses (menus, anything wanting pure horizontal/vertical), which
698
+ is another reason it belongs in a consumer-side function rather than baked into the device.
699
+
700
+ **Jitter vs. drift are different problems.** Dead zones address error near center. Error while deflected is
701
+ jitter, and the state of the art is the 1€ filter (Casiez, Roussel & Vogel, CHI 2012) — a first-order low-pass
702
+ whose cutoff rises with signal speed, so it stabilizes at rest and doesn't lag under motion. Two parameters,
703
+ trivial to implement, measurably less lag than fixed low-pass at equal jitter reduction. Deferred, not dismissed.
704
+
705
+ Sources:
706
+ [XInput deadzone constants](https://learn.microsoft.com/en-us/previous-versions/windows/xna/bb197229(v=xnagamestudio.42)) ·
707
+ [SDL3 gamepad axis](https://wiki.libsdl.org/SDL3/SDL_GamepadAxis) ·
708
+ [SDL: stacked deadzones issue](https://github.com/libsdl-org/SDL/issues/3781) ·
709
+ [Doing Thumbstick Dead Zones Right — Josh Sutphin](https://joshsutphin.com/blog/doing-thumbstick-dead-zones-right.html) ·
710
+ [Understanding thumbstick deadzones](https://minimuino.github.io/thumbstick-deadzones/) ·
711
+ [Switch SPI calibration layout](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/spi_flash_notes.md) ·
712
+ [Analog stick calibration data — Hand Held Legend](https://wiki.handheldlegend.com/analog-stick-calibration-data) ·
713
+ [Hall-effect vs traditional thumbsticks](https://www.turtlebeach.com/blog/hall-effect-thumbsticks-vs-traditional-joysticks) ·
714
+ [TMR vs hall-effect](https://www.easysmx.com/blogs/easysmx-controllers/tmr-vs-hall-effect-joysticks) ·
715
+ [Controller calibration & drift — SCUF](https://www.scufgaming.com/us/en/gaming/products/scuf-products/controller-calibration-dead-zones-and-stick-drift-explained/) ·
716
+ [1€ filter (CHI 2012, PDF)](https://direction.bordeaux.inria.fr/~roussel/publications/2012-CHI-one-euro-filter.pdf) ·
717
+ [1€ filter reference implementations](https://github.com/casiez/OneEuroFilter)