@codexo/exojs 0.7.13 → 0.8.2

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 (544) hide show
  1. package/CHANGELOG.md +637 -124
  2. package/README.md +19 -19
  3. package/dist/esm/animation/Easing.js +13 -21
  4. package/dist/esm/animation/Easing.js.map +1 -1
  5. package/dist/esm/animation/Tween.d.ts +3 -3
  6. package/dist/esm/animation/Tween.js +7 -5
  7. package/dist/esm/animation/Tween.js.map +1 -1
  8. package/dist/esm/animation/TweenManager.js +1 -1
  9. package/dist/esm/animation/TweenManager.js.map +1 -1
  10. package/dist/esm/animation/types.js.map +1 -1
  11. package/dist/esm/audio/AbstractMedia.d.ts +1 -1
  12. package/dist/esm/audio/AbstractMedia.js +1 -1
  13. package/dist/esm/audio/AbstractMedia.js.map +1 -1
  14. package/dist/esm/audio/AudioAnalyser.d.ts +1 -1
  15. package/dist/esm/audio/AudioAnalyser.js +2 -2
  16. package/dist/esm/audio/AudioAnalyser.js.map +1 -1
  17. package/dist/esm/audio/AudioBus.d.ts +1 -1
  18. package/dist/esm/audio/AudioBus.js.map +1 -1
  19. package/dist/esm/audio/AudioFilter.js +3 -1
  20. package/dist/esm/audio/AudioFilter.js.map +1 -1
  21. package/dist/esm/audio/AudioListener.d.ts +1 -1
  22. package/dist/esm/audio/AudioListener.js +5 -3
  23. package/dist/esm/audio/AudioListener.js.map +1 -1
  24. package/dist/esm/audio/AudioManager.js.map +1 -1
  25. package/dist/esm/audio/BeatDetector.d.ts +4 -4
  26. package/dist/esm/audio/BeatDetector.js +68 -44
  27. package/dist/esm/audio/BeatDetector.js.map +1 -1
  28. package/dist/esm/audio/Envelope.d.ts +1 -1
  29. package/dist/esm/audio/Envelope.js +2 -2
  30. package/dist/esm/audio/Envelope.js.map +1 -1
  31. package/dist/esm/audio/Music.d.ts +1 -1
  32. package/dist/esm/audio/Music.js +1 -1
  33. package/dist/esm/audio/Music.js.map +1 -1
  34. package/dist/esm/audio/OscillatorSound.d.ts +2 -2
  35. package/dist/esm/audio/OscillatorSound.js.map +1 -1
  36. package/dist/esm/audio/Sound.d.ts +40 -2
  37. package/dist/esm/audio/Sound.js +69 -9
  38. package/dist/esm/audio/Sound.js.map +1 -1
  39. package/dist/esm/audio/audio-context.js +1 -1
  40. package/dist/esm/audio/audio-context.js.map +1 -1
  41. package/dist/esm/audio/crossFade.js +1 -1
  42. package/dist/esm/audio/crossFade.js.map +1 -1
  43. package/dist/esm/audio/dsp/mel.d.ts +2 -2
  44. package/dist/esm/audio/dsp/tempogram.d.ts +2 -2
  45. package/dist/esm/audio/filters/ChorusFilter.js +12 -4
  46. package/dist/esm/audio/filters/ChorusFilter.js.map +1 -1
  47. package/dist/esm/audio/filters/CompressorFilter.d.ts +9 -0
  48. package/dist/esm/audio/filters/CompressorFilter.js +11 -0
  49. package/dist/esm/audio/filters/CompressorFilter.js.map +1 -1
  50. package/dist/esm/audio/filters/DelayFilter.js.map +1 -1
  51. package/dist/esm/audio/filters/DuckingFilter.d.ts +1 -1
  52. package/dist/esm/audio/filters/DuckingFilter.js +13 -5
  53. package/dist/esm/audio/filters/DuckingFilter.js.map +1 -1
  54. package/dist/esm/audio/filters/EqualizerFilter.js.map +1 -1
  55. package/dist/esm/audio/filters/GranularFilter.js +30 -14
  56. package/dist/esm/audio/filters/GranularFilter.js.map +1 -1
  57. package/dist/esm/audio/filters/HighpassFilter.js.map +1 -1
  58. package/dist/esm/audio/filters/LowpassFilter.js.map +1 -1
  59. package/dist/esm/audio/filters/PitchShiftFilter.js +14 -10
  60. package/dist/esm/audio/filters/PitchShiftFilter.js.map +1 -1
  61. package/dist/esm/audio/filters/ReverbFilter.js.map +1 -1
  62. package/dist/esm/audio/filters/VocoderFilter.d.ts +2 -2
  63. package/dist/esm/audio/filters/VocoderFilter.js +20 -12
  64. package/dist/esm/audio/filters/VocoderFilter.js.map +1 -1
  65. package/dist/esm/audio/filters/WorkletFilter.js +5 -6
  66. package/dist/esm/audio/filters/WorkletFilter.js.map +1 -1
  67. package/dist/esm/audio/filters/index.d.ts +7 -7
  68. package/dist/esm/audio/index.d.ts +9 -9
  69. package/dist/esm/audio/worklet/registerWorklet.js +7 -3
  70. package/dist/esm/audio/worklet/registerWorklet.js.map +1 -1
  71. package/dist/esm/core/Application.d.ts +13 -13
  72. package/dist/esm/core/Application.js +24 -16
  73. package/dist/esm/core/Application.js.map +1 -1
  74. package/dist/esm/core/Bounds.d.ts +1 -1
  75. package/dist/esm/core/Bounds.js +1 -3
  76. package/dist/esm/core/Bounds.js.map +1 -1
  77. package/dist/esm/core/Clock.js +1 -1
  78. package/dist/esm/core/Clock.js.map +1 -1
  79. package/dist/esm/core/Color.js +2 -5
  80. package/dist/esm/core/Color.js.map +1 -1
  81. package/dist/esm/core/Scene.d.ts +10 -10
  82. package/dist/esm/core/Scene.js +1 -1
  83. package/dist/esm/core/Scene.js.map +1 -1
  84. package/dist/esm/core/SceneManager.d.ts +4 -4
  85. package/dist/esm/core/SceneManager.js +39 -33
  86. package/dist/esm/core/SceneManager.js.map +1 -1
  87. package/dist/esm/core/SceneNode.d.ts +8 -8
  88. package/dist/esm/core/SceneNode.js +39 -29
  89. package/dist/esm/core/SceneNode.js.map +1 -1
  90. package/dist/esm/core/Signal.d.ts +3 -3
  91. package/dist/esm/core/Signal.js +3 -3
  92. package/dist/esm/core/Signal.js.map +1 -1
  93. package/dist/esm/core/Time.js +6 -6
  94. package/dist/esm/core/Time.js.map +1 -1
  95. package/dist/esm/core/Timer.d.ts +1 -1
  96. package/dist/esm/core/Timer.js +1 -1
  97. package/dist/esm/core/Timer.js.map +1 -1
  98. package/dist/esm/core/capabilities.js +2 -4
  99. package/dist/esm/core/capabilities.js.map +1 -1
  100. package/dist/esm/core/index.d.ts +2 -2
  101. package/dist/esm/core/utils.d.ts +4 -4
  102. package/dist/esm/core/utils.js +10 -10
  103. package/dist/esm/core/utils.js.map +1 -1
  104. package/dist/esm/debug/BoundingBoxesLayer.d.ts +3 -3
  105. package/dist/esm/debug/BoundingBoxesLayer.js +6 -13
  106. package/dist/esm/debug/BoundingBoxesLayer.js.map +1 -1
  107. package/dist/esm/debug/DebugLayer.d.ts +1 -1
  108. package/dist/esm/debug/DebugLayer.js.map +1 -1
  109. package/dist/esm/debug/DebugOverlay.d.ts +2 -2
  110. package/dist/esm/debug/DebugOverlay.js +2 -2
  111. package/dist/esm/debug/DebugOverlay.js.map +1 -1
  112. package/dist/esm/debug/HitTestLayer.d.ts +3 -3
  113. package/dist/esm/debug/HitTestLayer.js +3 -10
  114. package/dist/esm/debug/HitTestLayer.js.map +1 -1
  115. package/dist/esm/debug/PerformanceLayer.d.ts +2 -2
  116. package/dist/esm/debug/PerformanceLayer.js +6 -6
  117. package/dist/esm/debug/PerformanceLayer.js.map +1 -1
  118. package/dist/esm/debug/PointerStackLayer.d.ts +3 -3
  119. package/dist/esm/debug/PointerStackLayer.js +3 -3
  120. package/dist/esm/debug/PointerStackLayer.js.map +1 -1
  121. package/dist/esm/debug/index.d.ts +3 -3
  122. package/dist/esm/debug/index.js +3 -3
  123. package/dist/esm/index.d.ts +1 -1
  124. package/dist/esm/index.js +106 -84
  125. package/dist/esm/index.js.map +1 -1
  126. package/dist/esm/input/ArcadeStickGamepadMapping.js.map +1 -1
  127. package/dist/esm/input/GameCubeGamepadMapping.d.ts +1 -1
  128. package/dist/esm/input/GameCubeGamepadMapping.js +1 -1
  129. package/dist/esm/input/GameCubeGamepadMapping.js.map +1 -1
  130. package/dist/esm/input/Gamepad.d.ts +7 -7
  131. package/dist/esm/input/Gamepad.js +10 -6
  132. package/dist/esm/input/Gamepad.js.map +1 -1
  133. package/dist/esm/input/GamepadAxis.js +1 -1
  134. package/dist/esm/input/GamepadAxis.js.map +1 -1
  135. package/dist/esm/input/GamepadButton.js +1 -1
  136. package/dist/esm/input/GamepadButton.js.map +1 -1
  137. package/dist/esm/input/GamepadDefinitions.d.ts +4 -4
  138. package/dist/esm/input/GamepadDefinitions.js +12 -14
  139. package/dist/esm/input/GamepadDefinitions.js.map +1 -1
  140. package/dist/esm/input/GamepadMapping.d.ts +5 -5
  141. package/dist/esm/input/GamepadMapping.js.map +1 -1
  142. package/dist/esm/input/GamepadPromptLayouts.d.ts +2 -2
  143. package/dist/esm/input/GamepadPromptLayouts.js +8 -8
  144. package/dist/esm/input/GamepadPromptLayouts.js.map +1 -1
  145. package/dist/esm/input/GenericDualAnalogGamepadMapping.js.map +1 -1
  146. package/dist/esm/input/GestureRecognizer.d.ts +1 -1
  147. package/dist/esm/input/GestureRecognizer.js.map +1 -1
  148. package/dist/esm/input/InputBinding.d.ts +3 -3
  149. package/dist/esm/input/InputBinding.js.map +1 -1
  150. package/dist/esm/input/InputManager.d.ts +9 -9
  151. package/dist/esm/input/InputManager.js +25 -16
  152. package/dist/esm/input/InputManager.js.map +1 -1
  153. package/dist/esm/input/InteractionEvent.d.ts +1 -1
  154. package/dist/esm/input/InteractionEvent.js.map +1 -1
  155. package/dist/esm/input/InteractionManager.d.ts +2 -2
  156. package/dist/esm/input/InteractionManager.js +25 -16
  157. package/dist/esm/input/InteractionManager.js.map +1 -1
  158. package/dist/esm/input/JoyConLeftGamepadMapping.js.map +1 -1
  159. package/dist/esm/input/JoyConRightGamepadMapping.js.map +1 -1
  160. package/dist/esm/input/PlayStationGamepadMapping.d.ts +1 -1
  161. package/dist/esm/input/PlayStationGamepadMapping.js +1 -1
  162. package/dist/esm/input/PlayStationGamepadMapping.js.map +1 -1
  163. package/dist/esm/input/Pointer.d.ts +2 -2
  164. package/dist/esm/input/Pointer.js +6 -6
  165. package/dist/esm/input/Pointer.js.map +1 -1
  166. package/dist/esm/input/SteamControllerGamepadMapping.d.ts +1 -1
  167. package/dist/esm/input/SteamControllerGamepadMapping.js +1 -1
  168. package/dist/esm/input/SteamControllerGamepadMapping.js.map +1 -1
  169. package/dist/esm/input/SteamDeckGamepadMapping.js.map +1 -1
  170. package/dist/esm/input/SwitchProGamepadMapping.d.ts +1 -1
  171. package/dist/esm/input/SwitchProGamepadMapping.js +1 -1
  172. package/dist/esm/input/SwitchProGamepadMapping.js.map +1 -1
  173. package/dist/esm/input/XboxGamepadMapping.d.ts +1 -1
  174. package/dist/esm/input/XboxGamepadMapping.js +1 -1
  175. package/dist/esm/input/XboxGamepadMapping.js.map +1 -1
  176. package/dist/esm/input/index.d.ts +16 -16
  177. package/dist/esm/input/interaction-hooks.js.map +1 -1
  178. package/dist/esm/input/types.js.map +1 -1
  179. package/dist/esm/math/AbstractVector.js +8 -9
  180. package/dist/esm/math/AbstractVector.js.map +1 -1
  181. package/dist/esm/math/Circle.d.ts +5 -5
  182. package/dist/esm/math/Circle.js +33 -21
  183. package/dist/esm/math/Circle.js.map +1 -1
  184. package/dist/esm/math/Collision.d.ts +2 -2
  185. package/dist/esm/math/Collision.js.map +1 -1
  186. package/dist/esm/math/Ellipse.d.ts +5 -5
  187. package/dist/esm/math/Ellipse.js +28 -19
  188. package/dist/esm/math/Ellipse.js.map +1 -1
  189. package/dist/esm/math/Flags.d.ts +4 -4
  190. package/dist/esm/math/Flags.js.map +1 -1
  191. package/dist/esm/math/Interval.js.map +1 -1
  192. package/dist/esm/math/Line.d.ts +5 -5
  193. package/dist/esm/math/Line.js +23 -15
  194. package/dist/esm/math/Line.js.map +1 -1
  195. package/dist/esm/math/Matrix.js +14 -16
  196. package/dist/esm/math/Matrix.js.map +1 -1
  197. package/dist/esm/math/ObservableSize.js.map +1 -1
  198. package/dist/esm/math/ObservableVector.d.ts +1 -1
  199. package/dist/esm/math/ObservableVector.js.map +1 -1
  200. package/dist/esm/math/PolarVector.js.map +1 -1
  201. package/dist/esm/math/Polygon.d.ts +11 -11
  202. package/dist/esm/math/Polygon.js +37 -26
  203. package/dist/esm/math/Polygon.js.map +1 -1
  204. package/dist/esm/math/PolygonLike.d.ts +1 -1
  205. package/dist/esm/math/Quadtree.js +2 -8
  206. package/dist/esm/math/Quadtree.js.map +1 -1
  207. package/dist/esm/math/Random.js +5 -5
  208. package/dist/esm/math/Random.js.map +1 -1
  209. package/dist/esm/math/Rectangle.d.ts +4 -4
  210. package/dist/esm/math/Rectangle.js +59 -41
  211. package/dist/esm/math/Rectangle.js.map +1 -1
  212. package/dist/esm/math/Segment.d.ts +1 -1
  213. package/dist/esm/math/Segment.js +4 -4
  214. package/dist/esm/math/Segment.js.map +1 -1
  215. package/dist/esm/math/ShapeLike.d.ts +1 -1
  216. package/dist/esm/math/Size.js +1 -2
  217. package/dist/esm/math/Size.js.map +1 -1
  218. package/dist/esm/math/Vector.d.ts +4 -4
  219. package/dist/esm/math/Vector.js +19 -13
  220. package/dist/esm/math/Vector.js.map +1 -1
  221. package/dist/esm/math/collision-detection.d.ts +3 -3
  222. package/dist/esm/math/collision-detection.js +49 -49
  223. package/dist/esm/math/collision-detection.js.map +1 -1
  224. package/dist/esm/math/collision-primitives.d.ts +8 -8
  225. package/dist/esm/math/collision-primitives.js +27 -33
  226. package/dist/esm/math/collision-primitives.js.map +1 -1
  227. package/dist/esm/math/geometry.d.ts +3 -3
  228. package/dist/esm/math/geometry.js +55 -48
  229. package/dist/esm/math/geometry.js.map +1 -1
  230. package/dist/esm/math/index.d.ts +16 -16
  231. package/dist/esm/math/swept-collision.d.ts +3 -3
  232. package/dist/esm/math/swept-collision.js +5 -8
  233. package/dist/esm/math/swept-collision.js.map +1 -1
  234. package/dist/esm/math/triangulate.js +34 -24
  235. package/dist/esm/math/triangulate.js.map +1 -1
  236. package/dist/esm/math/utils.d.ts +2 -2
  237. package/dist/esm/math/utils.js +7 -7
  238. package/dist/esm/math/utils.js.map +1 -1
  239. package/dist/esm/particles/ParticleSystem.d.ts +181 -84
  240. package/dist/esm/particles/ParticleSystem.js +460 -147
  241. package/dist/esm/particles/ParticleSystem.js.map +1 -1
  242. package/dist/esm/particles/distributions/BoxArea.d.ts +17 -0
  243. package/dist/esm/particles/distributions/BoxArea.js +48 -0
  244. package/dist/esm/particles/distributions/BoxArea.js.map +1 -0
  245. package/dist/esm/particles/distributions/CircleArea.d.ts +19 -0
  246. package/dist/esm/particles/distributions/CircleArea.js +33 -0
  247. package/dist/esm/particles/distributions/CircleArea.js.map +1 -0
  248. package/dist/esm/particles/distributions/ConeDirection.d.ts +28 -0
  249. package/dist/esm/particles/distributions/ConeDirection.js +44 -0
  250. package/dist/esm/particles/distributions/ConeDirection.js.map +1 -0
  251. package/dist/esm/particles/distributions/Constant.d.ts +17 -0
  252. package/dist/esm/particles/distributions/Constant.js +35 -0
  253. package/dist/esm/particles/distributions/Constant.js.map +1 -0
  254. package/dist/esm/particles/distributions/Curve.d.ts +30 -0
  255. package/dist/esm/particles/distributions/Curve.js +53 -0
  256. package/dist/esm/particles/distributions/Curve.js.map +1 -0
  257. package/dist/esm/particles/distributions/Distribution.d.ts +45 -0
  258. package/dist/esm/particles/distributions/Gradient.d.ts +40 -0
  259. package/dist/esm/particles/distributions/Gradient.js +72 -0
  260. package/dist/esm/particles/distributions/Gradient.js.map +1 -0
  261. package/dist/esm/particles/distributions/LineSegment.d.ts +15 -0
  262. package/dist/esm/particles/distributions/LineSegment.js +27 -0
  263. package/dist/esm/particles/distributions/LineSegment.js.map +1 -0
  264. package/dist/esm/particles/distributions/Range.d.ts +12 -0
  265. package/dist/esm/particles/distributions/Range.js +19 -0
  266. package/dist/esm/particles/distributions/Range.js.map +1 -0
  267. package/dist/esm/particles/distributions/VectorRange.d.ts +20 -0
  268. package/dist/esm/particles/distributions/VectorRange.js +31 -0
  269. package/dist/esm/particles/distributions/VectorRange.js.map +1 -0
  270. package/dist/esm/particles/distributions/index.d.ts +12 -0
  271. package/dist/esm/particles/gpu/ParticleGpuState.d.ts +57 -0
  272. package/dist/esm/particles/gpu/ParticleGpuState.js +535 -0
  273. package/dist/esm/particles/gpu/ParticleGpuState.js.map +1 -0
  274. package/dist/esm/particles/index.d.ts +2 -10
  275. package/dist/esm/particles/modules/AlphaFadeOverLifetime.d.ts +24 -0
  276. package/dist/esm/particles/modules/AlphaFadeOverLifetime.js +60 -0
  277. package/dist/esm/particles/modules/AlphaFadeOverLifetime.js.map +1 -0
  278. package/dist/esm/particles/modules/ApplyForce.d.ts +20 -0
  279. package/dist/esm/particles/modules/ApplyForce.js +48 -0
  280. package/dist/esm/particles/modules/ApplyForce.js.map +1 -0
  281. package/dist/esm/particles/modules/AttractToPoint.d.ts +27 -0
  282. package/dist/esm/particles/modules/AttractToPoint.js +73 -0
  283. package/dist/esm/particles/modules/AttractToPoint.js.map +1 -0
  284. package/dist/esm/particles/modules/BurstSpawn.d.ts +53 -0
  285. package/dist/esm/particles/modules/BurstSpawn.js +94 -0
  286. package/dist/esm/particles/modules/BurstSpawn.js.map +1 -0
  287. package/dist/esm/particles/modules/ColorOverLifetime.d.ts +22 -0
  288. package/dist/esm/particles/modules/ColorOverLifetime.js +65 -0
  289. package/dist/esm/particles/modules/ColorOverLifetime.js.map +1 -0
  290. package/dist/esm/particles/modules/ColorOverSpeed.d.ts +27 -0
  291. package/dist/esm/particles/modules/ColorOverSpeed.js +86 -0
  292. package/dist/esm/particles/modules/ColorOverSpeed.js.map +1 -0
  293. package/dist/esm/particles/modules/DeathModule.d.ts +24 -0
  294. package/dist/esm/particles/modules/DeathModule.js +25 -0
  295. package/dist/esm/particles/modules/DeathModule.js.map +1 -0
  296. package/dist/esm/particles/modules/Drag.d.ts +20 -0
  297. package/dist/esm/particles/modules/Drag.js +43 -0
  298. package/dist/esm/particles/modules/Drag.js.map +1 -0
  299. package/dist/esm/particles/modules/OrbitalForce.d.ts +28 -0
  300. package/dist/esm/particles/modules/OrbitalForce.js +65 -0
  301. package/dist/esm/particles/modules/OrbitalForce.js.map +1 -0
  302. package/dist/esm/particles/modules/RateSpawn.d.ts +41 -0
  303. package/dist/esm/particles/modules/RateSpawn.js +76 -0
  304. package/dist/esm/particles/modules/RateSpawn.js.map +1 -0
  305. package/dist/esm/particles/modules/RepelFromPoint.d.ts +24 -0
  306. package/dist/esm/particles/modules/RepelFromPoint.js +76 -0
  307. package/dist/esm/particles/modules/RepelFromPoint.js.map +1 -0
  308. package/dist/esm/particles/modules/RotateOverLifetime.d.ts +20 -0
  309. package/dist/esm/particles/modules/RotateOverLifetime.js +41 -0
  310. package/dist/esm/particles/modules/RotateOverLifetime.js.map +1 -0
  311. package/dist/esm/particles/modules/ScaleOverLifetime.d.ts +26 -0
  312. package/dist/esm/particles/modules/ScaleOverLifetime.js +59 -0
  313. package/dist/esm/particles/modules/ScaleOverLifetime.js.map +1 -0
  314. package/dist/esm/particles/modules/SpawnModule.d.ts +30 -0
  315. package/dist/esm/particles/modules/SpawnModule.js +31 -0
  316. package/dist/esm/particles/modules/SpawnModule.js.map +1 -0
  317. package/dist/esm/particles/modules/SpawnOnDeath.d.ts +24 -0
  318. package/dist/esm/particles/modules/SpawnOnDeath.js +47 -0
  319. package/dist/esm/particles/modules/SpawnOnDeath.js.map +1 -0
  320. package/dist/esm/particles/modules/Turbulence.d.ts +30 -0
  321. package/dist/esm/particles/modules/Turbulence.js +122 -0
  322. package/dist/esm/particles/modules/Turbulence.js.map +1 -0
  323. package/dist/esm/particles/modules/UpdateModule.d.ts +95 -0
  324. package/dist/esm/particles/modules/UpdateModule.js +66 -0
  325. package/dist/esm/particles/modules/UpdateModule.js.map +1 -0
  326. package/dist/esm/particles/modules/VelocityOverLifetime.d.ts +30 -0
  327. package/dist/esm/particles/modules/VelocityOverLifetime.js +84 -0
  328. package/dist/esm/particles/modules/VelocityOverLifetime.js.map +1 -0
  329. package/dist/esm/particles/modules/WgslContribution.d.ts +81 -0
  330. package/dist/esm/particles/modules/WgslContribution.js +34 -0
  331. package/dist/esm/particles/modules/WgslContribution.js.map +1 -0
  332. package/dist/esm/particles/modules/index.d.ts +22 -0
  333. package/dist/esm/rendering/CallbackRenderPass.js.map +1 -1
  334. package/dist/esm/rendering/Container.d.ts +2 -2
  335. package/dist/esm/rendering/Container.js +10 -11
  336. package/dist/esm/rendering/Container.js.map +1 -1
  337. package/dist/esm/rendering/Drawable.js.map +1 -1
  338. package/dist/esm/rendering/RenderBackend.d.ts +6 -6
  339. package/dist/esm/rendering/RenderBackendType.js.map +1 -1
  340. package/dist/esm/rendering/RenderNode.d.ts +10 -10
  341. package/dist/esm/rendering/RenderNode.js +31 -31
  342. package/dist/esm/rendering/RenderNode.js.map +1 -1
  343. package/dist/esm/rendering/RenderStats.js.map +1 -1
  344. package/dist/esm/rendering/RenderTarget.d.ts +2 -2
  345. package/dist/esm/rendering/RenderTarget.js +5 -5
  346. package/dist/esm/rendering/RenderTarget.js.map +1 -1
  347. package/dist/esm/rendering/RenderTargetPass.d.ts +3 -3
  348. package/dist/esm/rendering/RenderTargetPass.js.map +1 -1
  349. package/dist/esm/rendering/Renderer.d.ts +2 -2
  350. package/dist/esm/rendering/RendererRegistry.d.ts +3 -3
  351. package/dist/esm/rendering/RendererRegistry.js +2 -3
  352. package/dist/esm/rendering/RendererRegistry.js.map +1 -1
  353. package/dist/esm/rendering/View.d.ts +3 -3
  354. package/dist/esm/rendering/View.js +17 -20
  355. package/dist/esm/rendering/View.js.map +1 -1
  356. package/dist/esm/rendering/filters/BlurFilter.d.ts +1 -1
  357. package/dist/esm/rendering/filters/BlurFilter.js +4 -9
  358. package/dist/esm/rendering/filters/BlurFilter.js.map +1 -1
  359. package/dist/esm/rendering/filters/ColorFilter.d.ts +1 -1
  360. package/dist/esm/rendering/filters/ColorFilter.js +3 -9
  361. package/dist/esm/rendering/filters/ColorFilter.js.map +1 -1
  362. package/dist/esm/rendering/filters/Filter.d.ts +1 -1
  363. package/dist/esm/rendering/filters/Filter.js.map +1 -1
  364. package/dist/esm/rendering/filters/LutFilter.d.ts +87 -0
  365. package/dist/esm/rendering/filters/LutFilter.js +261 -0
  366. package/dist/esm/rendering/filters/LutFilter.js.map +1 -0
  367. package/dist/esm/rendering/filters/WebGl2ShaderFilter.d.ts +2 -2
  368. package/dist/esm/rendering/filters/WebGl2ShaderFilter.js +7 -14
  369. package/dist/esm/rendering/filters/WebGl2ShaderFilter.js.map +1 -1
  370. package/dist/esm/rendering/filters/WebGpuShaderFilter.d.ts +1 -1
  371. package/dist/esm/rendering/filters/WebGpuShaderFilter.js +11 -10
  372. package/dist/esm/rendering/filters/WebGpuShaderFilter.js.map +1 -1
  373. package/dist/esm/rendering/index.d.ts +28 -27
  374. package/dist/esm/rendering/mesh/Mesh.d.ts +49 -1
  375. package/dist/esm/rendering/mesh/Mesh.js +3 -1
  376. package/dist/esm/rendering/mesh/Mesh.js.map +1 -1
  377. package/dist/esm/rendering/primitives/Graphics.d.ts +3 -3
  378. package/dist/esm/rendering/primitives/Graphics.js +12 -12
  379. package/dist/esm/rendering/primitives/Graphics.js.map +1 -1
  380. package/dist/esm/rendering/shader/Shader.js.map +1 -1
  381. package/dist/esm/rendering/shader/ShaderAttribute.js.map +1 -1
  382. package/dist/esm/rendering/shader/ShaderUniform.js.map +1 -1
  383. package/dist/esm/rendering/shader/upgradeFragmentShaderToGl300.js +6 -8
  384. package/dist/esm/rendering/shader/upgradeFragmentShaderToGl300.js.map +1 -1
  385. package/dist/esm/rendering/sprite/AnimatedSprite.d.ts +3 -3
  386. package/dist/esm/rendering/sprite/AnimatedSprite.js.map +1 -1
  387. package/dist/esm/rendering/sprite/Sprite.d.ts +4 -4
  388. package/dist/esm/rendering/sprite/Sprite.js +51 -35
  389. package/dist/esm/rendering/sprite/Sprite.js.map +1 -1
  390. package/dist/esm/rendering/sprite/Spritesheet.d.ts +5 -9
  391. package/dist/esm/rendering/sprite/Spritesheet.js +1 -1
  392. package/dist/esm/rendering/sprite/Spritesheet.js.map +1 -1
  393. package/dist/esm/rendering/text/DynamicGlyphAtlas.js +3 -9
  394. package/dist/esm/rendering/text/DynamicGlyphAtlas.js.map +1 -1
  395. package/dist/esm/rendering/text/Text.js +9 -9
  396. package/dist/esm/rendering/text/Text.js.map +1 -1
  397. package/dist/esm/rendering/text/TextLayout.d.ts +2 -2
  398. package/dist/esm/rendering/text/TextLayout.js.map +1 -1
  399. package/dist/esm/rendering/text/TextStyle.js.map +1 -1
  400. package/dist/esm/rendering/text/atlas-singleton.js.map +1 -1
  401. package/dist/esm/rendering/texture/RenderTexture.d.ts +1 -1
  402. package/dist/esm/rendering/texture/RenderTexture.js +4 -1
  403. package/dist/esm/rendering/texture/RenderTexture.js.map +1 -1
  404. package/dist/esm/rendering/texture/Sampler.js.map +1 -1
  405. package/dist/esm/rendering/texture/Texture.d.ts +2 -2
  406. package/dist/esm/rendering/texture/Texture.js +8 -5
  407. package/dist/esm/rendering/texture/Texture.js.map +1 -1
  408. package/dist/esm/rendering/types.js.map +1 -1
  409. package/dist/esm/rendering/utils.js.map +1 -1
  410. package/dist/esm/rendering/video/Video.d.ts +3 -3
  411. package/dist/esm/rendering/video/Video.js +7 -6
  412. package/dist/esm/rendering/video/Video.js.map +1 -1
  413. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.d.ts +6 -6
  414. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.js +7 -10
  415. package/dist/esm/rendering/webgl2/AbstractWebGl2BatchedRenderer.js.map +1 -1
  416. package/dist/esm/rendering/webgl2/AbstractWebGl2Renderer.d.ts +1 -1
  417. package/dist/esm/rendering/webgl2/AbstractWebGl2Renderer.js +1 -2
  418. package/dist/esm/rendering/webgl2/AbstractWebGl2Renderer.js.map +1 -1
  419. package/dist/esm/rendering/webgl2/WebGl2Backend.d.ts +11 -11
  420. package/dist/esm/rendering/webgl2/WebGl2Backend.js +19 -21
  421. package/dist/esm/rendering/webgl2/WebGl2Backend.js.map +1 -1
  422. package/dist/esm/rendering/webgl2/WebGl2MaskCompositor.d.ts +2 -2
  423. package/dist/esm/rendering/webgl2/WebGl2MaskCompositor.js +6 -8
  424. package/dist/esm/rendering/webgl2/WebGl2MaskCompositor.js.map +1 -1
  425. package/dist/esm/rendering/webgl2/WebGl2MeshRenderer.d.ts +7 -4
  426. package/dist/esm/rendering/webgl2/WebGl2MeshRenderer.js +110 -43
  427. package/dist/esm/rendering/webgl2/WebGl2MeshRenderer.js.map +1 -1
  428. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.d.ts +10 -15
  429. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.js +100 -79
  430. package/dist/esm/rendering/webgl2/WebGl2ParticleRenderer.js.map +1 -1
  431. package/dist/esm/rendering/webgl2/WebGl2RenderBuffer.d.ts +1 -1
  432. package/dist/esm/rendering/webgl2/WebGl2RenderBuffer.js.map +1 -1
  433. package/dist/esm/rendering/webgl2/WebGl2ShaderBlock.js.map +1 -1
  434. package/dist/esm/rendering/webgl2/WebGl2ShaderMappings.js.map +1 -1
  435. package/dist/esm/rendering/webgl2/WebGl2ShaderProgram.js +54 -22
  436. package/dist/esm/rendering/webgl2/WebGl2ShaderProgram.js.map +1 -1
  437. package/dist/esm/rendering/webgl2/WebGl2SpriteRenderer.d.ts +1 -1
  438. package/dist/esm/rendering/webgl2/WebGl2SpriteRenderer.js +11 -14
  439. package/dist/esm/rendering/webgl2/WebGl2SpriteRenderer.js.map +1 -1
  440. package/dist/esm/rendering/webgl2/WebGl2VertexArrayObject.d.ts +1 -1
  441. package/dist/esm/rendering/webgl2/WebGl2VertexArrayObject.js.map +1 -1
  442. package/dist/esm/rendering/webgl2/glsl/particle.vert.js +1 -1
  443. package/dist/esm/rendering/webgpu/AbstractWebGpuRenderer.d.ts +1 -1
  444. package/dist/esm/rendering/webgpu/AbstractWebGpuRenderer.js +1 -2
  445. package/dist/esm/rendering/webgpu/AbstractWebGpuRenderer.js.map +1 -1
  446. package/dist/esm/rendering/webgpu/WebGpuBackend.d.ts +7 -7
  447. package/dist/esm/rendering/webgpu/WebGpuBackend.js +44 -30
  448. package/dist/esm/rendering/webgpu/WebGpuBackend.js.map +1 -1
  449. package/dist/esm/rendering/webgpu/WebGpuBlendState.js.map +1 -1
  450. package/dist/esm/rendering/webgpu/WebGpuMaskCompositor.d.ts +2 -2
  451. package/dist/esm/rendering/webgpu/WebGpuMaskCompositor.js +1 -3
  452. package/dist/esm/rendering/webgpu/WebGpuMaskCompositor.js.map +1 -1
  453. package/dist/esm/rendering/webgpu/WebGpuMeshRenderer.d.ts +2 -2
  454. package/dist/esm/rendering/webgpu/WebGpuMeshRenderer.js +25 -23
  455. package/dist/esm/rendering/webgpu/WebGpuMeshRenderer.js.map +1 -1
  456. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.d.ts +10 -1
  457. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js +204 -76
  458. package/dist/esm/rendering/webgpu/WebGpuParticleRenderer.js.map +1 -1
  459. package/dist/esm/rendering/webgpu/WebGpuSpriteRenderer.d.ts +2 -2
  460. package/dist/esm/rendering/webgpu/WebGpuSpriteRenderer.js +45 -45
  461. package/dist/esm/rendering/webgpu/WebGpuSpriteRenderer.js.map +1 -1
  462. package/dist/esm/rendering/webgpu/compute/WebGpuComputePipeline.d.ts +52 -0
  463. package/dist/esm/rendering/webgpu/compute/WebGpuStorageBuffer.d.ts +29 -0
  464. package/dist/esm/rendering/webgpu/compute/index.d.ts +3 -0
  465. package/dist/esm/resources/AbstractAssetFactory.d.ts +1 -1
  466. package/dist/esm/resources/AbstractAssetFactory.js.map +1 -1
  467. package/dist/esm/resources/AssetManifest.d.ts +1 -1
  468. package/dist/esm/resources/AssetManifest.js +2 -2
  469. package/dist/esm/resources/AssetManifest.js.map +1 -1
  470. package/dist/esm/resources/CacheFirstStrategy.d.ts +2 -2
  471. package/dist/esm/resources/CacheFirstStrategy.js.map +1 -1
  472. package/dist/esm/resources/CacheStrategy.d.ts +1 -1
  473. package/dist/esm/resources/FactoryRegistry.d.ts +1 -1
  474. package/dist/esm/resources/FactoryRegistry.js +2 -3
  475. package/dist/esm/resources/FactoryRegistry.js.map +1 -1
  476. package/dist/esm/resources/IndexedDbDatabase.d.ts +1 -1
  477. package/dist/esm/resources/IndexedDbDatabase.js +11 -14
  478. package/dist/esm/resources/IndexedDbDatabase.js.map +1 -1
  479. package/dist/esm/resources/IndexedDbStore.d.ts +1 -1
  480. package/dist/esm/resources/IndexedDbStore.js +2 -7
  481. package/dist/esm/resources/IndexedDbStore.js.map +1 -1
  482. package/dist/esm/resources/Loader.d.ts +9 -9
  483. package/dist/esm/resources/Loader.js +48 -35
  484. package/dist/esm/resources/Loader.js.map +1 -1
  485. package/dist/esm/resources/NetworkOnlyStrategy.d.ts +2 -2
  486. package/dist/esm/resources/NetworkOnlyStrategy.js.map +1 -1
  487. package/dist/esm/resources/factories/BinaryFactory.js.map +1 -1
  488. package/dist/esm/resources/factories/FontFactory.js +1 -1
  489. package/dist/esm/resources/factories/FontFactory.js.map +1 -1
  490. package/dist/esm/resources/factories/ImageFactory.js +4 -4
  491. package/dist/esm/resources/factories/ImageFactory.js.map +1 -1
  492. package/dist/esm/resources/factories/JsonFactory.d.ts +1 -1
  493. package/dist/esm/resources/factories/JsonFactory.js +1 -1
  494. package/dist/esm/resources/factories/JsonFactory.js.map +1 -1
  495. package/dist/esm/resources/factories/MusicFactory.d.ts +1 -1
  496. package/dist/esm/resources/factories/MusicFactory.js +4 -4
  497. package/dist/esm/resources/factories/MusicFactory.js.map +1 -1
  498. package/dist/esm/resources/factories/SoundFactory.d.ts +1 -1
  499. package/dist/esm/resources/factories/SoundFactory.js +3 -3
  500. package/dist/esm/resources/factories/SoundFactory.js.map +1 -1
  501. package/dist/esm/resources/factories/SvgFactory.js +3 -3
  502. package/dist/esm/resources/factories/SvgFactory.js.map +1 -1
  503. package/dist/esm/resources/factories/TextFactory.js +1 -1
  504. package/dist/esm/resources/factories/TextFactory.js.map +1 -1
  505. package/dist/esm/resources/factories/TextureFactory.d.ts +1 -1
  506. package/dist/esm/resources/factories/TextureFactory.js +3 -3
  507. package/dist/esm/resources/factories/TextureFactory.js.map +1 -1
  508. package/dist/esm/resources/factories/VideoFactory.d.ts +2 -2
  509. package/dist/esm/resources/factories/VideoFactory.js +5 -5
  510. package/dist/esm/resources/factories/VideoFactory.js.map +1 -1
  511. package/dist/esm/resources/factories/VttFactory.d.ts +2 -2
  512. package/dist/esm/resources/factories/VttFactory.js +6 -6
  513. package/dist/esm/resources/factories/VttFactory.js.map +1 -1
  514. package/dist/esm/resources/factories/WasmFactory.js.map +1 -1
  515. package/dist/esm/resources/index.d.ts +11 -11
  516. package/dist/esm/resources/utils.js +30 -25
  517. package/dist/esm/resources/utils.js.map +1 -1
  518. package/dist/exo.esm.js +26438 -23869
  519. package/dist/exo.esm.js.map +1 -1
  520. package/package.json +15 -4
  521. package/dist/esm/particles/Particle.d.ts +0 -77
  522. package/dist/esm/particles/Particle.js +0 -143
  523. package/dist/esm/particles/Particle.js.map +0 -1
  524. package/dist/esm/particles/ParticleProperties.d.ts +0 -29
  525. package/dist/esm/particles/affectors/ColorAffector.d.ts +0 -30
  526. package/dist/esm/particles/affectors/ColorAffector.js +0 -55
  527. package/dist/esm/particles/affectors/ColorAffector.js.map +0 -1
  528. package/dist/esm/particles/affectors/ForceAffector.d.ts +0 -24
  529. package/dist/esm/particles/affectors/ForceAffector.js +0 -39
  530. package/dist/esm/particles/affectors/ForceAffector.js.map +0 -1
  531. package/dist/esm/particles/affectors/ParticleAffector.d.ts +0 -19
  532. package/dist/esm/particles/affectors/ScaleAffector.d.ts +0 -23
  533. package/dist/esm/particles/affectors/ScaleAffector.js +0 -38
  534. package/dist/esm/particles/affectors/ScaleAffector.js.map +0 -1
  535. package/dist/esm/particles/affectors/TorqueAffector.d.ts +0 -23
  536. package/dist/esm/particles/affectors/TorqueAffector.js +0 -37
  537. package/dist/esm/particles/affectors/TorqueAffector.js.map +0 -1
  538. package/dist/esm/particles/emitters/ParticleEmitter.d.ts +0 -19
  539. package/dist/esm/particles/emitters/ParticleOptions.d.ts +0 -62
  540. package/dist/esm/particles/emitters/ParticleOptions.js +0 -120
  541. package/dist/esm/particles/emitters/ParticleOptions.js.map +0 -1
  542. package/dist/esm/particles/emitters/UniversalEmitter.d.ts +0 -40
  543. package/dist/esm/particles/emitters/UniversalEmitter.js +0 -68
  544. package/dist/esm/particles/emitters/UniversalEmitter.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codexo/exojs",
3
3
  "description": "A TypeScript-first browser 2D runtime for games and interactive apps.",
4
- "version": "0.7.13",
4
+ "version": "0.8.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist/esm/",
@@ -46,12 +46,17 @@
46
46
  "build:watch": "tsx node_modules/rollup/dist/bin/rollup -cw",
47
47
  "verify:exports": "tsx ./scripts/verify-exports.ts",
48
48
  "verify:package": "npm run build && npm run verify:exports && npm pack --dry-run --ignore-scripts",
49
- "verify:release": "npm run typecheck && npm run lint && npm test && npm run verify:package",
49
+ "sync:example-capabilities": "tsx ./scripts/sync-example-capabilities.ts",
50
+ "verify:release": "npm run typecheck && npm run lint:strict && npm run format:check && npm test && npm run verify:package",
50
51
  "release": "node ./scripts/release.mjs",
51
52
  "prepack": "npm run build",
52
53
  "typecheck": "tsc --noEmit",
53
- "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
54
- "lint:fix": "eslint --fix \"src/**/*.ts\" \"test/**/*.ts\"",
54
+ "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"examples/**/*.js\"",
55
+ "lint:fix": "eslint --fix \"src/**/*.ts\" \"test/**/*.ts\" \"examples/**/*.js\"",
56
+ "lint:strict": "eslint --max-warnings=0 \"src/**/*.ts\"",
57
+ "lint:strict:fix": "eslint --fix --max-warnings=0 \"src/**/*.ts\"",
58
+ "format": "prettier --write .",
59
+ "format:check": "prettier --check .",
55
60
  "test": "jest --runInBand",
56
61
  "test:watch": "jest --watch",
57
62
  "perf:bench:rendering": "tsx test/perf/rendering-benchmark.ts",
@@ -88,12 +93,18 @@
88
93
  "@types/node": "^25.6.0",
89
94
  "@webgpu/types": "^0.1.69",
90
95
  "eslint": "^10.2.1",
96
+ "eslint-config-prettier": "^10.1.8",
97
+ "eslint-plugin-security": "^4.0.0",
98
+ "eslint-plugin-simple-import-sort": "^13.0.0",
99
+ "eslint-plugin-unicorn": "^64.0.0",
100
+ "eslint-plugin-unused-imports": "^4.4.1",
91
101
  "gitmoji-cli": "^9.7.0",
92
102
  "globals": "^17.5.0",
93
103
  "husky": "^9.1.7",
94
104
  "jest": "^30.3.0",
95
105
  "jest-environment-jsdom": "^30.3.0",
96
106
  "jiti": "^2.7.0",
107
+ "prettier": "^3.8.3",
97
108
  "rimraf": "^6.1.3",
98
109
  "rollup": "^4.60.3",
99
110
  "rollup-plugin-string": "^3.0.0",
@@ -1,77 +0,0 @@
1
- import { Vector } from '@/math/Vector';
2
- import { Color } from '@/core/Color';
3
- import { Time } from '@/core/Time';
4
- import type { ParticleOptions } from './emitters/ParticleOptions';
5
- import type { ParticleProperties } from '@/particles/ParticleProperties';
6
- /**
7
- * Mutable per-instance state for a single live particle. Implements
8
- * {@link ParticleProperties} so affectors can mutate it through the shared
9
- * interface. Particles are pooled by {@link ParticleSystem}: expired instances
10
- * are moved to the graveyard and reused via {@link ParticleSystem.requestParticle}
11
- * rather than garbage-collected.
12
- *
13
- * Do not construct directly — use {@link ParticleSystem.requestParticle} to
14
- * obtain a recycled or fresh instance, then configure it through
15
- * {@link Particle.applyOptions}.
16
- */
17
- export declare class Particle implements ParticleProperties {
18
- private _totalLifetime;
19
- private _elapsedLifetime;
20
- private _position;
21
- private _velocity;
22
- private _scale;
23
- private _rotation;
24
- private _rotationSpeed;
25
- private _textureIndex;
26
- private _tint;
27
- get totalLifetime(): Time;
28
- set totalLifetime(totalLifetime: Time);
29
- get elapsedLifetime(): Time;
30
- set elapsedLifetime(elapsedLifetime: Time);
31
- get position(): Vector;
32
- set position(position: Vector);
33
- get velocity(): Vector;
34
- set velocity(velocity: Vector);
35
- get scale(): Vector;
36
- set scale(scale: Vector);
37
- get tint(): Color;
38
- set tint(tint: Color);
39
- get rotation(): number;
40
- set rotation(degrees: number);
41
- get rotationSpeed(): number;
42
- set rotationSpeed(rotationSpeed: number);
43
- get textureIndex(): number;
44
- set textureIndex(textureIndex: number);
45
- /**
46
- * Time remaining before this particle expires, returned via the shared
47
- * `Time.temp` scratch value — copy before storing if you need it beyond
48
- * the current frame.
49
- */
50
- get remainingLifetime(): Time;
51
- /**
52
- * Fraction of total lifetime already elapsed, in [0, 1]. Used by
53
- * {@link ColorAffector} as the interpolation factor for tint blending.
54
- */
55
- get elapsedRatio(): number;
56
- /** Fraction of total lifetime still remaining, in [0, 1]. */
57
- get remainingRatio(): number;
58
- /**
59
- * Returns `true` once `elapsedLifetime` exceeds `totalLifetime`. Expired
60
- * particles are moved to the graveyard by {@link ParticleSystem.update}
61
- * before affectors run.
62
- */
63
- get expired(): boolean;
64
- /**
65
- * Bulk-copies every field from `options` into this particle, replacing all
66
- * previous state. Called immediately after {@link ParticleSystem.requestParticle}
67
- * to configure a recycled particle for reuse.
68
- */
69
- applyOptions(options: ParticleOptions): this;
70
- /**
71
- * Destroys all owned value objects. Called by
72
- * {@link ParticleSystem.clearParticles} when the pool is flushed entirely.
73
- * Do not call on individual particles mid-simulation; let the system
74
- * recycle them via the graveyard instead.
75
- */
76
- destroy(): void;
77
- }
@@ -1,143 +0,0 @@
1
- import { Vector } from '../math/Vector.js';
2
- import { Color } from '../core/Color.js';
3
- import { Time } from '../core/Time.js';
4
- import { trimRotation } from '../math/utils.js';
5
-
6
- /**
7
- * Mutable per-instance state for a single live particle. Implements
8
- * {@link ParticleProperties} so affectors can mutate it through the shared
9
- * interface. Particles are pooled by {@link ParticleSystem}: expired instances
10
- * are moved to the graveyard and reused via {@link ParticleSystem.requestParticle}
11
- * rather than garbage-collected.
12
- *
13
- * Do not construct directly — use {@link ParticleSystem.requestParticle} to
14
- * obtain a recycled or fresh instance, then configure it through
15
- * {@link Particle.applyOptions}.
16
- */
17
- class Particle {
18
- _totalLifetime = Time.oneSecond.clone();
19
- _elapsedLifetime = Time.zero.clone();
20
- _position = Vector.zero.clone();
21
- _velocity = Vector.zero.clone();
22
- _scale = Vector.one.clone();
23
- _rotation = 0;
24
- _rotationSpeed = 0;
25
- _textureIndex = 0;
26
- _tint = Color.white.clone();
27
- get totalLifetime() {
28
- return this._totalLifetime;
29
- }
30
- set totalLifetime(totalLifetime) {
31
- this._totalLifetime.copy(totalLifetime);
32
- }
33
- get elapsedLifetime() {
34
- return this._elapsedLifetime;
35
- }
36
- set elapsedLifetime(elapsedLifetime) {
37
- this._elapsedLifetime.copy(elapsedLifetime);
38
- }
39
- get position() {
40
- return this._position;
41
- }
42
- set position(position) {
43
- this._position.copy(position);
44
- }
45
- get velocity() {
46
- return this._velocity;
47
- }
48
- set velocity(velocity) {
49
- this._velocity.copy(velocity);
50
- }
51
- get scale() {
52
- return this._scale;
53
- }
54
- set scale(scale) {
55
- this._scale.copy(scale);
56
- }
57
- get tint() {
58
- return this._tint;
59
- }
60
- set tint(tint) {
61
- this._tint.copy(tint);
62
- }
63
- get rotation() {
64
- return this._rotation;
65
- }
66
- set rotation(degrees) {
67
- this._rotation = trimRotation(degrees);
68
- }
69
- get rotationSpeed() {
70
- return this._rotationSpeed;
71
- }
72
- set rotationSpeed(rotationSpeed) {
73
- this._rotationSpeed = rotationSpeed;
74
- }
75
- get textureIndex() {
76
- return this._textureIndex;
77
- }
78
- set textureIndex(textureIndex) {
79
- this._textureIndex = textureIndex;
80
- }
81
- /**
82
- * Time remaining before this particle expires, returned via the shared
83
- * `Time.temp` scratch value — copy before storing if you need it beyond
84
- * the current frame.
85
- */
86
- get remainingLifetime() {
87
- return Time.temp.set(this._totalLifetime.milliseconds - this._elapsedLifetime.milliseconds);
88
- }
89
- /**
90
- * Fraction of total lifetime already elapsed, in [0, 1]. Used by
91
- * {@link ColorAffector} as the interpolation factor for tint blending.
92
- */
93
- get elapsedRatio() {
94
- return this._elapsedLifetime.milliseconds / this._totalLifetime.milliseconds;
95
- }
96
- /** Fraction of total lifetime still remaining, in [0, 1]. */
97
- get remainingRatio() {
98
- return this.remainingLifetime.milliseconds / this._totalLifetime.milliseconds;
99
- }
100
- /**
101
- * Returns `true` once `elapsedLifetime` exceeds `totalLifetime`. Expired
102
- * particles are moved to the graveyard by {@link ParticleSystem.update}
103
- * before affectors run.
104
- */
105
- get expired() {
106
- return this._elapsedLifetime.greaterThan(this._totalLifetime);
107
- }
108
- /**
109
- * Bulk-copies every field from `options` into this particle, replacing all
110
- * previous state. Called immediately after {@link ParticleSystem.requestParticle}
111
- * to configure a recycled particle for reuse.
112
- */
113
- applyOptions(options) {
114
- const { totalLifetime, elapsedLifetime, position, velocity, scale, tint, rotation, rotationSpeed, textureIndex, } = options;
115
- this._totalLifetime.copy(totalLifetime);
116
- this._elapsedLifetime.copy(elapsedLifetime);
117
- this._position.copy(position);
118
- this._velocity.copy(velocity);
119
- this._scale.copy(scale);
120
- this._tint.copy(tint);
121
- this._rotation = rotation;
122
- this._rotationSpeed = rotationSpeed;
123
- this._textureIndex = textureIndex;
124
- return this;
125
- }
126
- /**
127
- * Destroys all owned value objects. Called by
128
- * {@link ParticleSystem.clearParticles} when the pool is flushed entirely.
129
- * Do not call on individual particles mid-simulation; let the system
130
- * recycle them via the graveyard instead.
131
- */
132
- destroy() {
133
- this._totalLifetime.destroy();
134
- this._elapsedLifetime.destroy();
135
- this._position.destroy();
136
- this._velocity.destroy();
137
- this._scale.destroy();
138
- this._tint.destroy();
139
- }
140
- }
141
-
142
- export { Particle };
143
- //# sourceMappingURL=Particle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Particle.js","sources":["../../../../src/particles/Particle.ts"],"sourcesContent":[null],"names":[],"mappings":"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"}
@@ -1,29 +0,0 @@
1
- import type { Time } from '@/core/Time';
2
- import type { Vector } from '@/math/Vector';
3
- import type { Color } from '@/core/Color';
4
- /**
5
- * Shared property contract for both {@link Particle} (live instance) and
6
- * {@link ParticleOptions} (spawn configuration). Every field represents a
7
- * mutable, per-particle attribute that affectors and the system update each
8
- * tick.
9
- */
10
- export interface ParticleProperties {
11
- /** Total time the particle lives before expiring. */
12
- totalLifetime: Time;
13
- /** Time that has passed since the particle was spawned. */
14
- elapsedLifetime: Time;
15
- /** Position in the owning {@link ParticleSystem}'s local coordinate space. */
16
- position: Vector;
17
- /** Pixels-per-second movement vector applied by the system each tick. */
18
- velocity: Vector;
19
- /** Multiplicative scale applied to the particle sprite on both axes. */
20
- scale: Vector;
21
- /** Rotation in degrees, normalised to [0, 360) by {@link trimRotation}. */
22
- rotation: number;
23
- /** Degrees-per-second angular velocity accumulated by {@link TorqueAffector}. */
24
- rotationSpeed: number;
25
- /** Index into the atlas frame list used to choose the particle sprite. */
26
- textureIndex: number;
27
- /** RGBA tint blended onto the particle sprite, interpolated by {@link ColorAffector}. */
28
- tint: Color;
29
- }
@@ -1,30 +0,0 @@
1
- import type { ParticleAffector } from '@/particles/affectors/ParticleAffector';
2
- import type { Color } from '@/core/Color';
3
- import type { Particle } from '@/particles/Particle';
4
- import type { Time } from '@/core/Time';
5
- /**
6
- * Linearly interpolates a particle's {@link Particle.tint} from `fromColor`
7
- * to `toColor` over the particle's full lifetime. The blend factor is
8
- * {@link Particle.elapsedRatio} — 0 at birth, 1 at expiry — so the
9
- * transition is always proportional to how long the particle has lived
10
- * regardless of delta size.
11
- */
12
- export declare class ColorAffector implements ParticleAffector {
13
- private readonly _fromColor;
14
- private readonly _toColor;
15
- constructor(fromColor: Color, toColor: Color);
16
- get fromColor(): Color;
17
- set fromColor(color: Color);
18
- get toColor(): Color;
19
- set toColor(color: Color);
20
- setFromColor(color: Color): this;
21
- setToColor(color: Color): this;
22
- /**
23
- * Sets `particle.tint` to the RGBA value interpolated between
24
- * {@link fromColor} and {@link toColor} at the particle's current
25
- * {@link Particle.elapsedRatio}. `delta` is unused but required by the
26
- * {@link ParticleAffector} contract.
27
- */
28
- apply(particle: Particle, delta: Time): this;
29
- destroy(): void;
30
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * Linearly interpolates a particle's {@link Particle.tint} from `fromColor`
3
- * to `toColor` over the particle's full lifetime. The blend factor is
4
- * {@link Particle.elapsedRatio} — 0 at birth, 1 at expiry — so the
5
- * transition is always proportional to how long the particle has lived
6
- * regardless of delta size.
7
- */
8
- class ColorAffector {
9
- _fromColor;
10
- _toColor;
11
- constructor(fromColor, toColor) {
12
- this._fromColor = fromColor.clone();
13
- this._toColor = toColor.clone();
14
- }
15
- get fromColor() {
16
- return this._fromColor;
17
- }
18
- set fromColor(color) {
19
- this.setFromColor(color);
20
- }
21
- get toColor() {
22
- return this._toColor;
23
- }
24
- set toColor(color) {
25
- this.setToColor(color);
26
- }
27
- setFromColor(color) {
28
- this._fromColor.copy(color);
29
- return this;
30
- }
31
- setToColor(color) {
32
- this._toColor.copy(color);
33
- return this;
34
- }
35
- /**
36
- * Sets `particle.tint` to the RGBA value interpolated between
37
- * {@link fromColor} and {@link toColor} at the particle's current
38
- * {@link Particle.elapsedRatio}. `delta` is unused but required by the
39
- * {@link ParticleAffector} contract.
40
- */
41
- apply(particle, delta) {
42
- const ratio = particle.elapsedRatio;
43
- const { r: r1, g: g1, b: b1, a: a1 } = this._fromColor;
44
- const { r: r2, g: g2, b: b2, a: a2 } = this._toColor;
45
- particle.tint.set(((r2 - r1) * ratio) + r1, ((g2 - g1) * ratio) + g1, ((b2 - b1) * ratio) + b1, ((a2 - a1) * ratio) + a1);
46
- return this;
47
- }
48
- destroy() {
49
- this._fromColor.destroy();
50
- this._toColor.destroy();
51
- }
52
- }
53
-
54
- export { ColorAffector };
55
- //# sourceMappingURL=ColorAffector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorAffector.js","sources":["../../../../../src/particles/affectors/ColorAffector.ts"],"sourcesContent":[null],"names":[],"mappings":"AAKA;;;;;;AAMG;MACU,aAAa,CAAA;AAEL,IAAA,UAAU;AACV,IAAA,QAAQ;IAEzB,WAAA,CAAmB,SAAgB,EAAE,OAAc,EAAA;AAC/C,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,KAAK,EAAE;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,EAAE;IACnC;AAEA,IAAA,IAAW,SAAS,GAAA;QAChB,OAAO,IAAI,CAAC,UAAU;IAC1B;IAEA,IAAW,SAAS,CAAC,KAAK,EAAA;AACtB,QAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;IAC5B;AAEA,IAAA,IAAW,OAAO,GAAA;QACd,OAAO,IAAI,CAAC,QAAQ;IACxB;IAEA,IAAW,OAAO,CAAC,KAAK,EAAA;AACpB,QAAA,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;IAC1B;AAEO,IAAA,YAAY,CAAC,KAAY,EAAA;AAC5B,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAE3B,QAAA,OAAO,IAAI;IACf;AAEO,IAAA,UAAU,CAAC,KAAY,EAAA;AAC1B,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAEzB,QAAA,OAAO,IAAI;IACf;AAEA;;;;;AAKG;IACI,KAAK,CAAC,QAAkB,EAAE,KAAW,EAAA;AACxC,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY;QAClC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU;QACtD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ;QAErD,QAAQ,CAAC,IAAI,CAAC,GAAG,CACb,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAAE,EACxB,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAAE,EACxB,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAAE,EACxB,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,EAAE,CAC3B;AAED,QAAA,OAAO,IAAI;IACf;IAEO,OAAO,GAAA;AACV,QAAA,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;AACzB,QAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;IAC3B;AACH;;;;"}
@@ -1,24 +0,0 @@
1
- import type { ParticleAffector } from '@/particles/affectors/ParticleAffector';
2
- import { Vector } from '@/math/Vector';
3
- import type { Particle } from '@/particles/Particle';
4
- import type { Time } from '@/core/Time';
5
- /**
6
- * Applies a constant 2-D acceleration to every particle's
7
- * {@link Particle.velocity} each tick, simulating forces such as gravity
8
- * (`new ForceAffector(0, 980)`) or wind. Velocity is mutated in place;
9
- * the system then integrates position from velocity in
10
- * {@link ParticleSystem.updateParticle}.
11
- */
12
- export declare class ForceAffector implements ParticleAffector {
13
- private readonly _acceleration;
14
- constructor(accelerationX: number, accelerationY: number);
15
- get acceleration(): Vector;
16
- set acceleration(acceleration: Vector);
17
- setAcceleration(acceleration: Vector): this;
18
- /**
19
- * Adds `acceleration * delta.seconds` to `particle.velocity`, implementing
20
- * Euler integration for the configured force vector.
21
- */
22
- apply(particle: Particle, delta: Time): this;
23
- destroy(): void;
24
- }
@@ -1,39 +0,0 @@
1
- import { Vector } from '../../math/Vector.js';
2
-
3
- /**
4
- * Applies a constant 2-D acceleration to every particle's
5
- * {@link Particle.velocity} each tick, simulating forces such as gravity
6
- * (`new ForceAffector(0, 980)`) or wind. Velocity is mutated in place;
7
- * the system then integrates position from velocity in
8
- * {@link ParticleSystem.updateParticle}.
9
- */
10
- class ForceAffector {
11
- _acceleration;
12
- constructor(accelerationX, accelerationY) {
13
- this._acceleration = new Vector(accelerationX, accelerationY);
14
- }
15
- get acceleration() {
16
- return this._acceleration;
17
- }
18
- set acceleration(acceleration) {
19
- this.setAcceleration(acceleration);
20
- }
21
- setAcceleration(acceleration) {
22
- this._acceleration.copy(acceleration);
23
- return this;
24
- }
25
- /**
26
- * Adds `acceleration * delta.seconds` to `particle.velocity`, implementing
27
- * Euler integration for the configured force vector.
28
- */
29
- apply(particle, delta) {
30
- particle.velocity.add(delta.seconds * this._acceleration.x, delta.seconds * this._acceleration.y);
31
- return this;
32
- }
33
- destroy() {
34
- this._acceleration.destroy();
35
- }
36
- }
37
-
38
- export { ForceAffector };
39
- //# sourceMappingURL=ForceAffector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForceAffector.js","sources":["../../../../../src/particles/affectors/ForceAffector.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;AAMG;MACU,aAAa,CAAA;AAEL,IAAA,aAAa;IAE9B,WAAA,CAAmB,aAAqB,EAAE,aAAqB,EAAA;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC;IACjE;AAEA,IAAA,IAAW,YAAY,GAAA;QACnB,OAAO,IAAI,CAAC,aAAa;IAC7B;IAEA,IAAW,YAAY,CAAC,YAAoB,EAAA;AACxC,QAAA,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC;IACtC;AAEO,IAAA,eAAe,CAAC,YAAoB,EAAA;AACvC,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;AAErC,QAAA,OAAO,IAAI;IACf;AAEA;;;AAGG;IACI,KAAK,CAAC,QAAkB,EAAE,KAAW,EAAA;QACxC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CACjB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,EACpC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CACvC;AAED,QAAA,OAAO,IAAI;IACf;IAEO,OAAO,GAAA;AACV,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;IAChC;AACH;;;;"}
@@ -1,19 +0,0 @@
1
- import type { Particle } from '@/particles/Particle';
2
- import type { Time } from '@/core/Time';
3
- /**
4
- * Contract for all per-particle mutators that run once per tick. Each
5
- * affector is registered on a {@link ParticleSystem} and called after
6
- * position integration for every live particle. Concrete implementations
7
- * (e.g. {@link ColorAffector}, {@link ForceAffector}, {@link ScaleAffector},
8
- * {@link TorqueAffector}) mutate one or more {@link ParticleProperties} fields
9
- * in place.
10
- */
11
- export interface ParticleAffector {
12
- /**
13
- * Mutates `particle` properties for the current `delta` timestep.
14
- * Called by {@link ParticleSystem.update} for every non-expired particle.
15
- */
16
- apply(particle: Particle, delta: Time): this;
17
- /** Releases any resources owned by this affector. */
18
- destroy(): void;
19
- }
@@ -1,23 +0,0 @@
1
- import type { ParticleAffector } from '@/particles/affectors/ParticleAffector';
2
- import { Vector } from '@/math/Vector';
3
- import type { Time } from '@/core/Time';
4
- import type { Particle } from '@/particles/Particle';
5
- /**
6
- * Additively grows or shrinks a particle's {@link Particle.scale} each tick
7
- * by a constant rate vector. A positive factor enlarges the sprite; a
8
- * negative factor shrinks it. Use `new ScaleAffector(-1, -1)` to make
9
- * particles fade out in size over one second.
10
- */
11
- export declare class ScaleAffector implements ParticleAffector {
12
- private readonly _scaleFactor;
13
- constructor(factorX: number, factorY: number);
14
- get scaleFactor(): Vector;
15
- set scaleFactor(scaleFactor: Vector);
16
- setScaleFactor(scaleFactor: Vector): this;
17
- /**
18
- * Adds `scaleFactor * delta.seconds` to `particle.scale` on both axes,
19
- * implementing linear scale drift for the configured rate.
20
- */
21
- apply(particle: Particle, delta: Time): this;
22
- destroy(): void;
23
- }
@@ -1,38 +0,0 @@
1
- import { Vector } from '../../math/Vector.js';
2
-
3
- /**
4
- * Additively grows or shrinks a particle's {@link Particle.scale} each tick
5
- * by a constant rate vector. A positive factor enlarges the sprite; a
6
- * negative factor shrinks it. Use `new ScaleAffector(-1, -1)` to make
7
- * particles fade out in size over one second.
8
- */
9
- class ScaleAffector {
10
- _scaleFactor;
11
- constructor(factorX, factorY) {
12
- this._scaleFactor = new Vector(factorX, factorY);
13
- }
14
- get scaleFactor() {
15
- return this._scaleFactor;
16
- }
17
- set scaleFactor(scaleFactor) {
18
- this.setScaleFactor(scaleFactor);
19
- }
20
- setScaleFactor(scaleFactor) {
21
- this._scaleFactor.copy(scaleFactor);
22
- return this;
23
- }
24
- /**
25
- * Adds `scaleFactor * delta.seconds` to `particle.scale` on both axes,
26
- * implementing linear scale drift for the configured rate.
27
- */
28
- apply(particle, delta) {
29
- particle.scale.add(delta.seconds * this._scaleFactor.x, delta.seconds * this._scaleFactor.y);
30
- return this;
31
- }
32
- destroy() {
33
- this._scaleFactor.destroy();
34
- }
35
- }
36
-
37
- export { ScaleAffector };
38
- //# sourceMappingURL=ScaleAffector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScaleAffector.js","sources":["../../../../../src/particles/affectors/ScaleAffector.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;AAKG;MACU,aAAa,CAAA;AAEL,IAAA,YAAY;IAE7B,WAAA,CAAmB,OAAe,EAAE,OAAe,EAAA;QAC/C,IAAI,CAAC,YAAY,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACpD;AAEA,IAAA,IAAW,WAAW,GAAA;QAClB,OAAO,IAAI,CAAC,YAAY;IAC5B;IAEA,IAAW,WAAW,CAAC,WAAmB,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;IACpC;AAEO,IAAA,cAAc,CAAC,WAAmB,EAAA;AACrC,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC;AAEnC,QAAA,OAAO,IAAI;IACf;AAEA;;;AAGG;IACI,KAAK,CAAC,QAAkB,EAAE,KAAW,EAAA;QACxC,QAAQ,CAAC,KAAK,CAAC,GAAG,CACd,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,EACnC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CACtC;AAED,QAAA,OAAO,IAAI;IACf;IAEO,OAAO,GAAA;AACV,QAAA,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC/B;AACH;;;;"}
@@ -1,23 +0,0 @@
1
- import type { ParticleAffector } from '@/particles/affectors/ParticleAffector';
2
- import type { Particle } from '@/particles/Particle';
3
- import type { Time } from '@/core/Time';
4
- /**
5
- * Accelerates a particle's angular velocity ({@link Particle.rotationSpeed})
6
- * by a constant `angularAcceleration` (degrees per second²) each tick.
7
- * The updated `rotationSpeed` is then integrated into
8
- * {@link Particle.rotation} by {@link ParticleSystem.updateParticle}.
9
- * Use a negative value to decelerate spin over time.
10
- */
11
- export declare class TorqueAffector implements ParticleAffector {
12
- private _angularAcceleration;
13
- constructor(angularAcceleration: number);
14
- get angularAcceleration(): number;
15
- set angularAcceleration(angularAcceleration: number);
16
- setAngularAcceleration(angularAcceleration: number): this;
17
- /**
18
- * Adds `angularAcceleration * delta.seconds` to `particle.rotationSpeed`,
19
- * increasing or decreasing spin rate for this timestep.
20
- */
21
- apply(particle: Particle, delta: Time): this;
22
- destroy(): void;
23
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Accelerates a particle's angular velocity ({@link Particle.rotationSpeed})
3
- * by a constant `angularAcceleration` (degrees per second²) each tick.
4
- * The updated `rotationSpeed` is then integrated into
5
- * {@link Particle.rotation} by {@link ParticleSystem.updateParticle}.
6
- * Use a negative value to decelerate spin over time.
7
- */
8
- class TorqueAffector {
9
- _angularAcceleration;
10
- constructor(angularAcceleration) {
11
- this._angularAcceleration = angularAcceleration;
12
- }
13
- get angularAcceleration() {
14
- return this._angularAcceleration;
15
- }
16
- set angularAcceleration(angularAcceleration) {
17
- this.setAngularAcceleration(angularAcceleration);
18
- }
19
- setAngularAcceleration(angularAcceleration) {
20
- this._angularAcceleration = angularAcceleration;
21
- return this;
22
- }
23
- /**
24
- * Adds `angularAcceleration * delta.seconds` to `particle.rotationSpeed`,
25
- * increasing or decreasing spin rate for this timestep.
26
- */
27
- apply(particle, delta) {
28
- particle.rotationSpeed += (delta.seconds * this._angularAcceleration);
29
- return this;
30
- }
31
- destroy() {
32
- // no-op — pure value class, kept for Destroyable interface conformance
33
- }
34
- }
35
-
36
- export { TorqueAffector };
37
- //# sourceMappingURL=TorqueAffector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TorqueAffector.js","sources":["../../../../../src/particles/affectors/TorqueAffector.ts"],"sourcesContent":[null],"names":[],"mappings":"AAIA;;;;;;AAMG;MACU,cAAc,CAAA;AAEf,IAAA,oBAAoB;AAE5B,IAAA,WAAA,CAAmB,mBAA2B,EAAA;AAC1C,QAAA,IAAI,CAAC,oBAAoB,GAAG,mBAAmB;IACnD;AAEA,IAAA,IAAW,mBAAmB,GAAA;QAC1B,OAAO,IAAI,CAAC,oBAAoB;IACpC;IAEA,IAAW,mBAAmB,CAAC,mBAA2B,EAAA;AACtD,QAAA,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;IACpD;AAEO,IAAA,sBAAsB,CAAC,mBAA2B,EAAA;AACrD,QAAA,IAAI,CAAC,oBAAoB,GAAG,mBAAmB;AAE/C,QAAA,OAAO,IAAI;IACf;AAEA;;;AAGG;IACI,KAAK,CAAC,QAAkB,EAAE,KAAW,EAAA;AACxC,QAAA,QAAQ,CAAC,aAAa,KAAK,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC;AAErE,QAAA,OAAO,IAAI;IACf;IAEO,OAAO,GAAA;;IAEd;AACH;;;;"}
@@ -1,19 +0,0 @@
1
- import type { Time } from '@/core/Time';
2
- import type { ParticleSystem } from '@/particles/ParticleSystem';
3
- /**
4
- * Contract for all particle spawners attached to a {@link ParticleSystem}.
5
- * Each emitter is called once per tick via {@link ParticleSystem.update} and
6
- * is responsible for requesting recycled or new {@link Particle} instances from
7
- * the system, configuring them, and handing them back via
8
- * {@link ParticleSystem.emitParticle}. See {@link UniversalEmitter} for the
9
- * built-in rate-based implementation.
10
- */
11
- export interface ParticleEmitter {
12
- /**
13
- * Spawns zero or more particles into `system` for the current `delta`
14
- * timestep. Called once per frame by {@link ParticleSystem.update}.
15
- */
16
- apply(system: ParticleSystem, delta: Time): this;
17
- /** Releases any resources owned by this emitter. */
18
- destroy(): void;
19
- }