laymur 0.23.0 → 0.25.1

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 (316) hide show
  1. package/README.md +1 -1
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
  5. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
  6. package/dist/core/constraints/UIConstraint.d.ts +22 -2
  7. package/dist/core/constraints/UIConstraint.js +26 -3
  8. package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
  9. package/dist/core/constraints/UICustomConstraint.js +15 -15
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
  12. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
  13. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
  16. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
  17. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
  20. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
  21. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
  23. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
  24. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
  25. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
  26. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
  27. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
  28. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
  29. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
  30. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
  31. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
  32. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
  33. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
  34. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
  35. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
  36. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
  37. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
  38. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
  39. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
  40. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
  41. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
  42. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
  43. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
  44. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
  45. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
  46. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
  47. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
  48. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
  49. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
  50. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
  51. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
  52. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
  53. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
  54. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
  55. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
  56. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
  57. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
  58. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
  59. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
  60. package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
  61. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
  62. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
  63. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
  64. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
  65. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
  66. package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
  67. package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
  68. package/dist/core/elements/UIDummy/UIDummy.js +59 -42
  69. package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
  70. package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
  71. package/dist/core/elements/UIElement/UIElement.d.ts +11 -11
  72. package/dist/core/elements/UIElement/UIElement.js +57 -60
  73. package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
  74. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
  75. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
  76. package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
  77. package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
  78. package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
  79. package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
  80. package/dist/core/elements/UIImage/UIImage.js +21 -24
  81. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
  82. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
  83. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
  84. package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
  85. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
  86. package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
  87. package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
  88. package/dist/core/elements/UIProgress/UIProgress.js +59 -62
  89. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
  90. package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
  91. package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
  92. package/dist/core/elements/UIScene/UIScene.js +68 -69
  93. package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
  94. package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
  95. package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
  96. package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
  97. package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
  98. package/dist/core/elements/UIText/UIText.Internal.js +5 -7
  99. package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
  100. package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
  101. package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
  102. package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
  103. package/dist/core/elements/UIText/UIText.d.ts +28 -14
  104. package/dist/core/elements/UIText/UIText.js +181 -141
  105. package/dist/core/index.d.ts +55 -54
  106. package/dist/core/index.js +53 -0
  107. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
  108. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
  109. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
  110. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
  111. package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
  112. package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
  113. package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
  114. package/dist/core/layers/UILayer/UILayer.js +125 -62
  115. package/dist/core/miscellaneous/UIBlendMode.js +1 -3
  116. package/dist/core/miscellaneous/UIExpression.js +16 -19
  117. package/dist/core/miscellaneous/UIMode.js +3 -5
  118. package/dist/core/miscellaneous/UIOrientation.js +2 -4
  119. package/dist/core/miscellaneous/UIPriority.js +5 -8
  120. package/dist/core/miscellaneous/UIRelation.js +5 -8
  121. package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
  122. package/dist/core/miscellaneous/area/UIArea.js +1 -3
  123. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
  124. package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
  125. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
  126. package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
  127. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
  128. package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
  129. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
  130. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
  131. package/dist/core/miscellaneous/asserts.d.ts +30 -1
  132. package/dist/core/miscellaneous/asserts.js +87 -19
  133. package/dist/core/miscellaneous/canvas.js +13 -7
  134. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
  135. package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
  136. package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
  137. package/dist/core/miscellaneous/color/UIColor.js +202 -205
  138. package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
  139. package/dist/core/miscellaneous/computeTransform.js +4 -7
  140. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +10 -5
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +63 -58
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.d.ts +52 -0
  143. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.js +110 -0
  144. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +181 -261
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  146. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  147. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +209 -115
  148. package/dist/core/miscellaneous/generic-plane/shared.d.ts +12 -12
  149. package/dist/core/miscellaneous/generic-plane/shared.js +28 -23
  150. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  151. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  152. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  156. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  157. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +13 -16
  158. package/dist/core/miscellaneous/math.js +3 -5
  159. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  160. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  161. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  176. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  177. package/dist/core/miscellaneous/shared.d.ts +1 -1
  178. package/dist/core/miscellaneous/shared.js +4 -7
  179. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  180. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  181. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  182. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  183. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  184. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  185. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  188. package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
  189. package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
  190. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  191. package/dist/core/shaders/UIImage.d.ts +9 -0
  192. package/dist/core/shaders/UIImage.js +14 -0
  193. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  194. package/dist/core/shaders/UINineSlice.js +57 -0
  195. package/dist/core/shaders/UIProgress.d.ts +14 -0
  196. package/dist/core/shaders/UIProgress.js +21 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  199. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  200. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  203. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  204. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  207. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  208. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  211. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
  212. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
  213. package/dist/debug/UIAspectDebug.d.ts +3 -3
  214. package/dist/debug/UIAspectDebug.js +64 -68
  215. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  216. package/dist/debug/UIConstraintDebug.js +1 -0
  217. package/dist/debug/UIHeightDebug.d.ts +3 -3
  218. package/dist/debug/UIHeightDebug.js +63 -67
  219. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  221. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  222. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  223. package/dist/debug/UILayerDebug.d.ts +1 -1
  224. package/dist/debug/UILayerDebug.js +55 -64
  225. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  227. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  228. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  229. package/dist/debug/UIWidthDebug.d.ts +3 -3
  230. package/dist/debug/UIWidthDebug.js +63 -67
  231. package/dist/debug/index.d.ts +8 -8
  232. package/dist/debug/index.js +8 -8
  233. package/dist/debug/miscellaneous.js +8 -11
  234. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  235. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  236. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  237. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  238. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  239. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  242. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  246. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  250. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  251. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  252. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  253. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  254. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  255. package/dist/particles/elements/UIEmitter.js +100 -88
  256. package/dist/particles/index.d.ts +20 -18
  257. package/dist/particles/index.js +19 -18
  258. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  260. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +4 -1
  261. package/dist/particles/instancedParticle/UIInstancedParticle.js +40 -32
  262. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  263. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  264. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  266. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  267. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  268. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  269. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  270. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  271. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  272. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  273. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  274. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  275. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  276. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  277. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  278. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  279. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  280. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  281. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  285. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  287. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  289. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  290. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  291. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  292. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  293. package/package.json +13 -17
  294. package/dist/_virtual/2d.js +0 -3
  295. package/dist/_virtual/3d.js +0 -3
  296. package/dist/_virtual/4d.js +0 -3
  297. package/dist/_virtual/mod.js +0 -5
  298. package/dist/_virtual/mod2.js +0 -3
  299. package/dist/core/shaders/UIImage.glsl.js +0 -3
  300. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  302. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  303. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  304. package/dist/index.js +0 -52
  305. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  306. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  307. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  308. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  309. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  310. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  311. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  312. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  313. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  314. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  315. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  316. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,14 +1,13 @@
1
- import { MathUtils } from 'three';
2
- import { assertValidPositiveNumber, assertValidNonNegativeNumber } from '../../core/miscellaneous/asserts.js';
3
- import { resolveUIRangeConfig, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_C, generateNoise2D, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
4
- import { UIBehaviorModule } from './UIBehaviorModule.js';
5
-
1
+ import { MathUtils } from "three";
2
+ import { assertValidNonNegativeNumber, assertValidPositiveNumber, } from "../../core/miscellaneous/asserts.js";
3
+ import { BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, generateNoise2D, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
4
+ import { UIBehaviorModule } from "./UIBehaviorModule.js";
6
5
  /**
7
6
  * Applies noise-based acceleration to particles.
8
7
  *
9
8
  * Uses 2D noise based on particle position. Higher scale means finer noise detail.
10
9
  */
11
- class UIBehaviorVelocityNoise extends UIBehaviorModule {
10
+ export class UIBehaviorVelocityNoise extends UIBehaviorModule {
12
11
  /**
13
12
  * @param scale - Noise frequency range. Accepts number, tuple, or range object
14
13
  * @param strength - Force multiplier range. Accepts number, tuple, or range object
@@ -17,32 +16,32 @@ class UIBehaviorVelocityNoise extends UIBehaviorModule {
17
16
  super();
18
17
  /** @internal */
19
18
  this.requiredProperties = { builtin: "Matrix4" };
20
- this._private_scaleInternal = resolveUIRangeConfig(scale);
21
- assertValidPositiveNumber(this._private_scaleInternal.min, `UIBehaviorVelocityNoise.constructor.scale.min`);
22
- assertValidPositiveNumber(this._private_scaleInternal.max, `UIBehaviorVelocityNoise.constructor.scale.max`);
23
- this._private_strengthInternal = resolveUIRangeConfig(strength);
24
- assertValidNonNegativeNumber(this._private_strengthInternal.min, `UIBehaviorVelocityNoise.constructor.strength.min`);
25
- assertValidNonNegativeNumber(this._private_strengthInternal.max, `UIBehaviorVelocityNoise.constructor.strength.max`);
19
+ this.scaleInternal = resolveUIRangeConfig(scale);
20
+ assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorVelocityNoise.constructor.scale.min`);
21
+ assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorVelocityNoise.constructor.scale.max`);
22
+ this.strengthInternal = resolveUIRangeConfig(strength);
23
+ assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorVelocityNoise.constructor.strength.min`);
24
+ assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorVelocityNoise.constructor.strength.max`);
26
25
  }
27
26
  /** Noise frequency range */
28
27
  get scale() {
29
- return this._private_scaleInternal;
28
+ return this.scaleInternal;
30
29
  }
31
30
  /** Force multiplier range */
32
31
  get strength() {
33
- return this._private_strengthInternal;
32
+ return this.strengthInternal;
34
33
  }
35
34
  /** Noise frequency range */
36
35
  set scale(value) {
37
- this._private_scaleInternal = resolveUIRangeConfig(value);
38
- assertValidPositiveNumber(this._private_scaleInternal.min, `UIBehaviorVelocityNoise.scale.min`);
39
- assertValidPositiveNumber(this._private_scaleInternal.max, `UIBehaviorVelocityNoise.scale.max`);
36
+ this.scaleInternal = resolveUIRangeConfig(value);
37
+ assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorVelocityNoise.scale.min`);
38
+ assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorVelocityNoise.scale.max`);
40
39
  }
41
40
  /** Force multiplier range */
42
41
  set strength(value) {
43
- this._private_strengthInternal = resolveUIRangeConfig(value);
44
- assertValidNonNegativeNumber(this._private_strengthInternal.min, `UIBehaviorVelocityNoise.strength.min`);
45
- assertValidNonNegativeNumber(this._private_strengthInternal.max, `UIBehaviorVelocityNoise.strength.max`);
42
+ this.strengthInternal = resolveUIRangeConfig(value);
43
+ assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorVelocityNoise.strength.min`);
44
+ assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorVelocityNoise.strength.max`);
46
45
  }
47
46
  /** @internal */
48
47
  update(properties, instanceCount, deltaTime) {
@@ -53,16 +52,14 @@ class UIBehaviorVelocityNoise extends UIBehaviorModule {
53
52
  const x = array[itemOffset + BUILTIN_OFFSET_POSITION_X];
54
53
  const y = array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
55
54
  const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_C];
56
- const scale = MathUtils.lerp(this._private_scaleInternal.min, this._private_scaleInternal.max, scaleT);
55
+ const scale = MathUtils.lerp(this.scaleInternal.min, this.scaleInternal.max, scaleT);
57
56
  const noiseX = generateNoise2D(x * scale, y * scale);
58
57
  const noiseY = generateNoise2D((x + 100) * scale, (y + 100) * scale);
59
58
  const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_D];
60
- const strength = MathUtils.lerp(this._private_strengthInternal.min, this._private_strengthInternal.max, strengthT);
59
+ const strength = MathUtils.lerp(this.strengthInternal.min, this.strengthInternal.max, strengthT);
61
60
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += noiseX * strength * deltaTime;
62
61
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += noiseY * strength * deltaTime;
63
62
  }
64
63
  builtin.needsUpdate = true;
65
64
  }
66
65
  }
67
-
68
- export { UIBehaviorVelocityNoise };
@@ -1,5 +1,5 @@
1
- import { UIMode } from "../../core";
2
- import type { UIAnchorOptions } from "../../core/elements/UIAnchor/UIAnchor.Internal";
1
+ import { UIMode } from "../../core/index.js";
2
+ import type { UIAnchorOptions } from "../../core/elements/UIAnchor/UIAnchor.Internal.js";
3
3
  export interface UIEmitterOptions extends UIAnchorOptions {
4
4
  expectedCapacity: number;
5
5
  capacityStep: number;
@@ -1,11 +1,8 @@
1
- import { UIMode } from '../../core/miscellaneous/UIMode.js';
2
-
3
- function ignoreInput() {
1
+ import { UIMode } from "../../core/index.js";
2
+ export function ignoreInput() {
4
3
  return false;
5
4
  }
6
- const EMITTER_DEFAULT_MODE = UIMode.VISIBLE;
7
- const EMITTER_DEFAULT_EXPECTED_CAPACITY = 32;
8
- const EMITTER_DEFAULT_CAPACITY_STEP = 32;
9
- const EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES = true;
10
-
11
- export { EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_MODE, ignoreInput };
5
+ export const EMITTER_DEFAULT_MODE = UIMode.VISIBLE;
6
+ export const EMITTER_DEFAULT_EXPECTED_CAPACITY = 32;
7
+ export const EMITTER_DEFAULT_CAPACITY_STEP = 32;
8
+ export const EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES = true;
@@ -1,10 +1,10 @@
1
- import type { UILayer } from "../../core";
2
- import { UIAnchor } from "../../core/elements/UIAnchor/UIAnchor";
3
- import type { UIAnchorOptions } from "../../core/elements/UIAnchor/UIAnchor.Internal";
4
- import type { UIBehaviorModule } from "../behaviorModules/UIBehaviorModule";
5
- import type { UIRenderingModule } from "../renderingModules/UIRenderingModule";
6
- import type { UISpawnModule } from "../spawnModules/UISpawnModule";
7
- import type { UIEmitterMode, UIEmitterPlayOptions } from "./UIEmitter.Internal";
1
+ import type { UILayer } from "../../core/index.js";
2
+ import { UIAnchor } from "../../core/elements/UIAnchor/UIAnchor.js";
3
+ import type { UIAnchorOptions } from "../../core/elements/UIAnchor/UIAnchor.Internal.js";
4
+ import type { UIBehaviorModule } from "../behaviorModules/UIBehaviorModule.js";
5
+ import type { UIRenderingModule } from "../renderingModules/UIRenderingModule.js";
6
+ import type { UISpawnModule } from "../spawnModules/UISpawnModule.js";
7
+ import type { UIEmitterMode, UIEmitterPlayOptions } from "./UIEmitter.Internal.js";
8
8
  export interface UIEmitterOptions extends UIAnchorOptions {
9
9
  mode: UIEmitterMode;
10
10
  expectedCapacity: number;
@@ -39,14 +39,18 @@ export declare class UIEmitter extends UIAnchor {
39
39
  constructor(layer: UILayer, spawnSequence: UISpawnModule[], behaviorSequence: readonly UIBehaviorModule[], renderingSequence: readonly UIRenderingModule[], options?: Partial<UIEmitterOptions>);
40
40
  /** Visibility mode */
41
41
  get mode(): UIEmitterMode;
42
- /** Rendering order. Higher values draw on top */
42
+ /**
43
+ * Rendering order among the elements of the layer. Higher values on top; elements with equal
44
+ * values keep the order of creation, a later one on top.
45
+ */
43
46
  get zIndex(): number;
44
47
  /** Visibility mode */
45
48
  set mode(value: UIEmitterMode);
46
- /** Rendering order. Higher values draw on top */
49
+ /**
50
+ * Rendering order among the elements of the layer. Higher values on top; elements with equal
51
+ * values keep the order of creation, a later one on top.
52
+ */
47
53
  set zIndex(value: number);
48
- /** Removes emitter and optionally destroys modules */
49
- destroy(): void;
50
54
  /**
51
55
  * Spawns a specific number of particles immediately.
52
56
  *
@@ -64,5 +68,7 @@ export declare class UIEmitter extends UIAnchor {
64
68
  play(rate: number, options?: Partial<UIEmitterPlayOptions>): void;
65
69
  /** Stops continuous particle emission */
66
70
  stop(): void;
71
+ /** Frees the particles and the input catcher, optionally destroys modules */
72
+ protected destroyInternal(): void;
67
73
  private readonly onRendering;
68
74
  }
@@ -1,18 +1,18 @@
1
- import { Vector2 } from 'three';
2
- import { UIAnchor } from '../../core/elements/UIAnchor/UIAnchor.js';
3
- import { resolveGLSLTypeInfo } from '../../core/miscellaneous/generic-plane/shared.js';
4
- import { isUIModeVisible } from '../../core/miscellaneous/UIMode.js';
5
- import { UIInstancedParticle } from '../instancedParticle/UIInstancedParticle.js';
6
- import { collectProperties, collectUniforms } from '../instancedParticle/UIInstancedParticle.Internal.js';
7
- import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_VELOCITY_Y, BUILTIN_OFFSET_ROTATION, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_RANDOM_F } from '../miscellaneous/miscellaneous.js';
8
- import { ignoreInput, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES, EMITTER_DEFAULT_MODE } from './UIEmitter.Internal.js';
9
-
1
+ import { Vector2 } from "three";
2
+ import { UIAnchor } from "../../core/elements/UIAnchor/UIAnchor.js";
3
+ import { assertValidNumber } from "../../core/miscellaneous/asserts.js";
4
+ import { resolveGLSLTypeInfo } from "../../core/miscellaneous/generic-plane/shared.js";
5
+ import { isUIModeVisible } from "../../core/miscellaneous/UIMode.js";
6
+ import { UIInstancedParticle } from "../instancedParticle/UIInstancedParticle.js";
7
+ import { collectProperties, collectUniforms, } from "../instancedParticle/UIInstancedParticle.Internal.js";
8
+ import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_RANDOM_F, BUILTIN_OFFSET_ROTATION, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, } from "../miscellaneous/miscellaneous.js";
9
+ import { EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES, EMITTER_DEFAULT_CAPACITY_STEP, EMITTER_DEFAULT_EXPECTED_CAPACITY, EMITTER_DEFAULT_MODE, ignoreInput, } from "./UIEmitter.Internal.js";
10
10
  /**
11
11
  * Particle emitter element.
12
12
  *
13
13
  * Spawns, updates, and renders particles using modular spawn/behavior/rendering pipeline.
14
14
  */
15
- class UIEmitter extends UIAnchor {
15
+ export class UIEmitter extends UIAnchor {
16
16
  /**
17
17
  * @param layer - Layer containing this emitter
18
18
  * @param spawnSequence - Modules that initialize new particles
@@ -20,54 +20,54 @@ class UIEmitter extends UIAnchor {
20
20
  * @param renderingSequence - Modules that control particle appearance
21
21
  * @param options - Configuration options
22
22
  */
23
- constructor(layer, _private_spawnSequence, _private_behaviorSequence, _private_renderingSequence, options = {}) {
23
+ constructor(layer, spawnSequence, behaviorSequence, renderingSequence, options = {}) {
24
24
  super(layer, options);
25
- this._private_spawnSequence = _private_spawnSequence;
26
- this._private_behaviorSequence = _private_behaviorSequence;
27
- this._private_renderingSequence = _private_renderingSequence;
28
- this._private_emissionRate = 0;
29
- this._private_emissionAccumulator = 0;
30
- this._private_emissionDuration = Infinity;
31
- this._private_emissionElapsed = 0;
32
- this._private_onRendering = (renderer, deltaTime) => {
25
+ this.spawnSequence = spawnSequence;
26
+ this.behaviorSequence = behaviorSequence;
27
+ this.renderingSequence = renderingSequence;
28
+ this.emissionRate = 0;
29
+ this.emissionAccumulator = 0;
30
+ this.emissionDuration = Infinity;
31
+ this.emissionElapsed = 0;
32
+ this.onRendering = (renderer, deltaTime) => {
33
+ this.layer.sceneWrapper.setOrderedObjectDepth(this.mesh, this.layer.inputWrapper.getDepth(this.catcherHandler));
33
34
  {
34
- const { builtin } = this._private_mesh.propertyBuffers;
35
+ const { builtin } = this.mesh.propertyBuffers;
35
36
  const { array, itemSize } = builtin;
36
- for (let i = 0; i < this._private_mesh.instanceCount; i++) {
37
+ for (let i = 0; i < this.mesh.instanceCount; i++) {
37
38
  array[i * itemSize + BUILTIN_OFFSET_AGE] += deltaTime;
38
39
  }
39
40
  builtin.needsUpdate = true;
40
- this._private_mesh.removeDeadParticles();
41
+ this.mesh.removeDeadParticles();
41
42
  }
42
- if (this._private_emissionRate > 0) {
43
- this._private_emissionElapsed += deltaTime;
44
- if (this._private_emissionElapsed >= this._private_emissionDuration) {
43
+ if (this.emissionRate > 0) {
44
+ this.emissionElapsed += deltaTime;
45
+ if (this.emissionElapsed >= this.emissionDuration) {
45
46
  this.stop();
46
47
  }
47
48
  else {
48
- this._private_emissionAccumulator += this._private_emissionRate * deltaTime;
49
- const particlesToSpawn = Math.floor(this._private_emissionAccumulator);
49
+ this.emissionAccumulator += this.emissionRate * deltaTime;
50
+ const particlesToSpawn = Math.floor(this.emissionAccumulator);
50
51
  if (particlesToSpawn > 0) {
51
52
  this.burst(particlesToSpawn);
52
- this._private_emissionAccumulator -= particlesToSpawn;
53
+ this.emissionAccumulator -= particlesToSpawn;
53
54
  }
54
55
  }
55
56
  }
56
- if (this._private_mesh.instanceCount === 0) {
57
+ if (this.mesh.instanceCount === 0) {
57
58
  return;
58
59
  }
59
- this._private_mesh.renderOrder = this.zIndex;
60
- this._private_mesh.setOrigin(this.x, this.y);
60
+ this.mesh.setOrigin(this.x, this.y);
61
61
  {
62
- const { propertyBuffers, instanceCount } = this._private_mesh;
63
- for (const module of this._private_behaviorSequence) {
62
+ const { propertyBuffers, instanceCount } = this.mesh;
63
+ for (const module of this.behaviorSequence) {
64
64
  module.update(propertyBuffers, instanceCount, deltaTime);
65
65
  }
66
66
  }
67
- const { builtin } = this._private_mesh.propertyBuffers;
67
+ const { builtin } = this.mesh.propertyBuffers;
68
68
  const { array, itemSize } = builtin;
69
69
  {
70
- for (let i = 0; i < this._private_mesh.instanceCount; i++) {
70
+ for (let i = 0; i < this.mesh.instanceCount; i++) {
71
71
  const itemOffset = i * itemSize;
72
72
  array[itemOffset + BUILTIN_OFFSET_POSITION_X] +=
73
73
  array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] * deltaTime;
@@ -77,7 +77,7 @@ class UIEmitter extends UIAnchor {
77
77
  builtin.needsUpdate = true;
78
78
  }
79
79
  {
80
- for (let i = 0; i < this._private_mesh.instanceCount; i++) {
80
+ for (let i = 0; i < this.mesh.instanceCount; i++) {
81
81
  const itemOffset = i * itemSize;
82
82
  array[itemOffset + BUILTIN_OFFSET_ROTATION] +=
83
83
  array[itemOffset + BUILTIN_OFFSET_TORQUE] * deltaTime;
@@ -95,58 +95,49 @@ class UIEmitter extends UIAnchor {
95
95
  // 10, 11, 12 randomX, randomY, randomZ
96
96
  // 13, 14, 16 reservedX, reservedY, reservedZ
97
97
  };
98
- collectProperties(collectedProperties, _private_spawnSequence, "UIEmitter.constructor.spawnSequence:");
99
- collectProperties(collectedProperties, _private_behaviorSequence, "UIEmitter.constructor.behaviorSequence");
100
- collectProperties(collectedProperties, _private_renderingSequence, "UIEmitter.constructor.renderingSequence");
98
+ collectProperties(collectedProperties, spawnSequence, "UIEmitter.constructor.spawnSequence");
99
+ collectProperties(collectedProperties, behaviorSequence, "UIEmitter.constructor.behaviorSequence");
100
+ collectProperties(collectedProperties, renderingSequence, "UIEmitter.constructor.renderingSequence");
101
101
  const collectedUniforms = {
102
102
  origin: { value: new Vector2(), glslTypeInfo: resolveGLSLTypeInfo("Vector2") },
103
103
  };
104
- collectUniforms(collectedUniforms, _private_renderingSequence, "UIEmitter.constructor.renderingSequence");
104
+ collectUniforms(collectedUniforms, renderingSequence, "UIEmitter.constructor.renderingSequence");
105
105
  const zIndex = 0;
106
- this._private_catcherHandler = this.layer.inputWrapper.createInputCatcher(ignoreInput, ignoreInput, ignoreInput, zIndex);
107
- this._private_mesh = new UIInstancedParticle(this._private_renderingSequence.map((module) => module.source), collectedUniforms, collectedProperties, options.expectedCapacity ?? EMITTER_DEFAULT_EXPECTED_CAPACITY, options.capacityStep ?? EMITTER_DEFAULT_CAPACITY_STEP);
108
- this._private_mesh.renderOrder = zIndex;
109
- this.layer.signalRendering.on(this._private_onRendering);
110
- this.layer.sceneWrapper.insertCustomObject(this._private_mesh);
106
+ this.catcherHandler = this.layer.inputWrapper.createInputCatcher(ignoreInput, ignoreInput, ignoreInput, zIndex);
107
+ this.mesh = new UIInstancedParticle(this.renderingSequence.map((module) => module.source), collectedUniforms, collectedProperties, options.expectedCapacity ?? EMITTER_DEFAULT_EXPECTED_CAPACITY, options.capacityStep ?? EMITTER_DEFAULT_CAPACITY_STEP);
108
+ this.layer.signalRendering.on(this.onRendering);
109
+ this.layer.sceneWrapper.insertOrderedObject(this.mesh, this.layer.inputWrapper.getDepth(this.catcherHandler));
111
110
  this.automaticallyDestroyModules =
112
111
  options.automaticallyDestroyModules ?? EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES;
113
- this._private_modeInternal = options.mode ?? EMITTER_DEFAULT_MODE;
112
+ this.modeInternal = options.mode ?? EMITTER_DEFAULT_MODE;
114
113
  }
115
114
  /** Visibility mode */
116
115
  get mode() {
117
- return this._private_modeInternal;
116
+ return this.modeInternal;
118
117
  }
119
- /** Rendering order. Higher values draw on top */
118
+ /**
119
+ * Rendering order among the elements of the layer. Higher values on top; elements with equal
120
+ * values keep the order of creation, a later one on top.
121
+ */
120
122
  get zIndex() {
121
- return this.layer.inputWrapper.getZIndex(this._private_catcherHandler);
123
+ return this.layer.inputWrapper.getZIndex(this.catcherHandler);
122
124
  }
123
125
  /** Visibility mode */
124
126
  set mode(value) {
125
- if (this._private_modeInternal !== value) {
126
- this._private_modeInternal = value;
127
- this._private_mesh.visible = isUIModeVisible(value);
127
+ this.assertNotDestroyed("UIEmitter.mode");
128
+ if (this.modeInternal !== value) {
129
+ this.modeInternal = value;
130
+ this.mesh.visible = isUIModeVisible(value);
128
131
  }
129
132
  }
130
- /** Rendering order. Higher values draw on top */
133
+ /**
134
+ * Rendering order among the elements of the layer. Higher values on top; elements with equal
135
+ * values keep the order of creation, a later one on top.
136
+ */
131
137
  set zIndex(value) {
132
- this.layer.inputWrapper.setZIndex(this._private_catcherHandler, value);
133
- }
134
- /** Removes emitter and optionally destroys modules */
135
- destroy() {
136
- this.layer.signalRendering.off(this._private_onRendering);
137
- this.layer.sceneWrapper.removeCustomObject(this._private_mesh);
138
- if (this.automaticallyDestroyModules) {
139
- for (const module of this._private_spawnSequence) {
140
- module.destroy?.();
141
- }
142
- for (const module of this._private_behaviorSequence) {
143
- module.destroy?.();
144
- }
145
- for (const module of this._private_renderingSequence) {
146
- module.destroy?.();
147
- }
148
- }
149
- super.destroy();
138
+ this.assertNotDestroyed("UIEmitter.zIndex");
139
+ assertValidNumber(value, "UIEmitter.zIndex");
140
+ this.layer.inputWrapper.setZIndex(this.catcherHandler, value);
150
141
  }
151
142
  /**
152
143
  * Spawns a specific number of particles immediately.
@@ -154,11 +145,12 @@ class UIEmitter extends UIAnchor {
154
145
  * @param count - Number of particles to create
155
146
  */
156
147
  burst(count) {
157
- const instanceBegin = this._private_mesh.instanceCount;
158
- this._private_mesh.createInstances(count);
159
- const instanceEnd = this._private_mesh.instanceCount;
148
+ this.assertNotDestroyed("UIEmitter.burst");
149
+ const instanceBegin = this.mesh.instanceCount;
150
+ this.mesh.createInstances(count);
151
+ const instanceEnd = this.mesh.instanceCount;
160
152
  {
161
- const { builtin } = this._private_mesh.propertyBuffers;
153
+ const { builtin } = this.mesh.propertyBuffers;
162
154
  const { array, itemSize } = builtin;
163
155
  for (let i = instanceBegin; i < instanceEnd; i++) {
164
156
  const itemOffset = i * itemSize;
@@ -171,13 +163,14 @@ class UIEmitter extends UIAnchor {
171
163
  }
172
164
  builtin.needsUpdate = true;
173
165
  }
174
- for (const spawnModule of this._private_spawnSequence) {
175
- spawnModule.spawn(this._private_mesh.propertyBuffers, instanceBegin, instanceEnd);
166
+ for (const spawnModule of this.spawnSequence) {
167
+ spawnModule.spawn(this.mesh.propertyBuffers, instanceBegin, instanceEnd);
176
168
  }
177
169
  }
178
170
  /** Removes all active particles */
179
171
  clear() {
180
- this._private_mesh.drop();
172
+ this.assertNotDestroyed("UIEmitter.clear");
173
+ this.mesh.drop();
181
174
  }
182
175
  /**
183
176
  * Starts continuous particle emission.
@@ -186,18 +179,37 @@ class UIEmitter extends UIAnchor {
186
179
  * @param options - Emission duration and other settings
187
180
  */
188
181
  play(rate, options = {}) {
189
- this._private_emissionRate = rate;
190
- this._private_emissionAccumulator = 0;
191
- this._private_emissionDuration = options.duration ?? Infinity;
192
- this._private_emissionElapsed = 0;
182
+ this.assertNotDestroyed("UIEmitter.play");
183
+ this.emissionRate = rate;
184
+ this.emissionAccumulator = 0;
185
+ this.emissionDuration = options.duration ?? Infinity;
186
+ this.emissionElapsed = 0;
193
187
  }
194
188
  /** Stops continuous particle emission */
195
189
  stop() {
196
- this._private_emissionRate = 0;
197
- this._private_emissionAccumulator = 0;
198
- this._private_emissionDuration = Infinity;
199
- this._private_emissionElapsed = 0;
190
+ this.assertNotDestroyed("UIEmitter.stop");
191
+ this.emissionRate = 0;
192
+ this.emissionAccumulator = 0;
193
+ this.emissionDuration = Infinity;
194
+ this.emissionElapsed = 0;
195
+ }
196
+ /** Frees the particles and the input catcher, optionally destroys modules */
197
+ destroyInternal() {
198
+ this.layer.signalRendering.off(this.onRendering);
199
+ this.layer.sceneWrapper.removeOrderedObject(this.mesh);
200
+ this.mesh.destroy();
201
+ this.layer.inputWrapper.destroyInputCatcher(this.catcherHandler);
202
+ if (this.automaticallyDestroyModules) {
203
+ for (const module of this.spawnSequence) {
204
+ module.destroy?.();
205
+ }
206
+ for (const module of this.behaviorSequence) {
207
+ module.destroy?.();
208
+ }
209
+ for (const module of this.renderingSequence) {
210
+ module.destroy?.();
211
+ }
212
+ }
213
+ super.destroyInternal();
200
214
  }
201
215
  }
202
-
203
- export { UIEmitter };
@@ -1,18 +1,20 @@
1
- export { UIBehaviorDirectionalGravity } from "./behaviorModules/UIBehaviorDirectionalGravity";
2
- export { UIBehaviorPointGravity } from "./behaviorModules/UIBehaviorPointGravity";
3
- export { UIBehaviorScaleOverLife } from "./behaviorModules/UIBehaviorScaleOverLife";
4
- export { UIBehaviorTorqueDamping } from "./behaviorModules/UIBehaviorTorqueDamping";
5
- export { UIBehaviorTorqueNoise } from "./behaviorModules/UIBehaviorTorqueNoise";
6
- export { UIBehaviorVelocityDamping } from "./behaviorModules/UIBehaviorVelocityDamping";
7
- export { UIBehaviorVelocityNoise } from "./behaviorModules/UIBehaviorVelocityNoise";
8
- export { UIEmitter } from "./elements/UIEmitter";
9
- export { UIRenderingColorOverLife } from "./renderingModules/UIRenderingColorOverLife";
10
- export { UIRenderingColorOverVelocity } from "./renderingModules/UIRenderingColorOverVelocity";
11
- export { UIRenderingTexture } from "./renderingModules/UIRenderingTexture";
12
- export { UISpawnOffset } from "./spawnModules/UISpawnOffset";
13
- export { UISpawnRandomLifetime } from "./spawnModules/UISpawnRandomLifetime";
14
- export { UISpawnRandomRotation } from "./spawnModules/UISpawnRandomRotation";
15
- export { UISpawnRandomScale } from "./spawnModules/UISpawnRandomScale";
16
- export { UISpawnRandomTorque } from "./spawnModules/UISpawnRandomTorque";
17
- export { UISpawnRandomVelocity } from "./spawnModules/UISpawnRandomVelocity";
18
- export { UISpawnRectangle } from "./spawnModules/UISpawnRectangle";
1
+ export { UIBehaviorDirectionalGravity } from "./behaviorModules/UIBehaviorDirectionalGravity.js";
2
+ export { UIBehaviorPointGravity } from "./behaviorModules/UIBehaviorPointGravity.js";
3
+ export { UIBehaviorScaleOscillation } from "./behaviorModules/UIBehaviorScaleOscillation.js";
4
+ export type { UIScaleOscillationAxis } from "./behaviorModules/UIBehaviorScaleOscillation.js";
5
+ export { UIBehaviorScaleOverLife } from "./behaviorModules/UIBehaviorScaleOverLife.js";
6
+ export { UIBehaviorTorqueDamping } from "./behaviorModules/UIBehaviorTorqueDamping.js";
7
+ export { UIBehaviorTorqueNoise } from "./behaviorModules/UIBehaviorTorqueNoise.js";
8
+ export { UIBehaviorVelocityDamping } from "./behaviorModules/UIBehaviorVelocityDamping.js";
9
+ export { UIBehaviorVelocityNoise } from "./behaviorModules/UIBehaviorVelocityNoise.js";
10
+ export { UIEmitter } from "./elements/UIEmitter.js";
11
+ export { UIRenderingColorOverLife } from "./renderingModules/UIRenderingColorOverLife.js";
12
+ export { UIRenderingColorOverVelocity } from "./renderingModules/UIRenderingColorOverVelocity.js";
13
+ export { UIRenderingTexture } from "./renderingModules/UIRenderingTexture.js";
14
+ export { UISpawnOffset } from "./spawnModules/UISpawnOffset.js";
15
+ export { UISpawnRandomLifetime } from "./spawnModules/UISpawnRandomLifetime.js";
16
+ export { UISpawnRandomRotation } from "./spawnModules/UISpawnRandomRotation.js";
17
+ export { UISpawnRandomScale } from "./spawnModules/UISpawnRandomScale.js";
18
+ export { UISpawnRandomTorque } from "./spawnModules/UISpawnRandomTorque.js";
19
+ export { UISpawnRandomVelocity } from "./spawnModules/UISpawnRandomVelocity.js";
20
+ export { UISpawnRectangle } from "./spawnModules/UISpawnRectangle.js";
@@ -1,18 +1,19 @@
1
- export { UIBehaviorDirectionalGravity } from './behaviorModules/UIBehaviorDirectionalGravity.js';
2
- export { UIBehaviorPointGravity } from './behaviorModules/UIBehaviorPointGravity.js';
3
- export { UIBehaviorScaleOverLife } from './behaviorModules/UIBehaviorScaleOverLife.js';
4
- export { UIBehaviorTorqueDamping } from './behaviorModules/UIBehaviorTorqueDamping.js';
5
- export { UIBehaviorTorqueNoise } from './behaviorModules/UIBehaviorTorqueNoise.js';
6
- export { UIBehaviorVelocityDamping } from './behaviorModules/UIBehaviorVelocityDamping.js';
7
- export { UIBehaviorVelocityNoise } from './behaviorModules/UIBehaviorVelocityNoise.js';
8
- export { UIEmitter } from './elements/UIEmitter.js';
9
- export { UIRenderingColorOverLife } from './renderingModules/UIRenderingColorOverLife.js';
10
- export { UIRenderingColorOverVelocity } from './renderingModules/UIRenderingColorOverVelocity.js';
11
- export { UIRenderingTexture } from './renderingModules/UIRenderingTexture.js';
12
- export { UISpawnOffset } from './spawnModules/UISpawnOffset.js';
13
- export { UISpawnRandomLifetime } from './spawnModules/UISpawnRandomLifetime.js';
14
- export { UISpawnRandomRotation } from './spawnModules/UISpawnRandomRotation.js';
15
- export { UISpawnRandomScale } from './spawnModules/UISpawnRandomScale.js';
16
- export { UISpawnRandomTorque } from './spawnModules/UISpawnRandomTorque.js';
17
- export { UISpawnRandomVelocity } from './spawnModules/UISpawnRandomVelocity.js';
18
- export { UISpawnRectangle } from './spawnModules/UISpawnRectangle.js';
1
+ export { UIBehaviorDirectionalGravity } from "./behaviorModules/UIBehaviorDirectionalGravity.js";
2
+ export { UIBehaviorPointGravity } from "./behaviorModules/UIBehaviorPointGravity.js";
3
+ export { UIBehaviorScaleOscillation } from "./behaviorModules/UIBehaviorScaleOscillation.js";
4
+ export { UIBehaviorScaleOverLife } from "./behaviorModules/UIBehaviorScaleOverLife.js";
5
+ export { UIBehaviorTorqueDamping } from "./behaviorModules/UIBehaviorTorqueDamping.js";
6
+ export { UIBehaviorTorqueNoise } from "./behaviorModules/UIBehaviorTorqueNoise.js";
7
+ export { UIBehaviorVelocityDamping } from "./behaviorModules/UIBehaviorVelocityDamping.js";
8
+ export { UIBehaviorVelocityNoise } from "./behaviorModules/UIBehaviorVelocityNoise.js";
9
+ export { UIEmitter } from "./elements/UIEmitter.js";
10
+ export { UIRenderingColorOverLife } from "./renderingModules/UIRenderingColorOverLife.js";
11
+ export { UIRenderingColorOverVelocity } from "./renderingModules/UIRenderingColorOverVelocity.js";
12
+ export { UIRenderingTexture } from "./renderingModules/UIRenderingTexture.js";
13
+ export { UISpawnOffset } from "./spawnModules/UISpawnOffset.js";
14
+ export { UISpawnRandomLifetime } from "./spawnModules/UISpawnRandomLifetime.js";
15
+ export { UISpawnRandomRotation } from "./spawnModules/UISpawnRandomRotation.js";
16
+ export { UISpawnRandomScale } from "./spawnModules/UISpawnRandomScale.js";
17
+ export { UISpawnRandomTorque } from "./spawnModules/UISpawnRandomTorque.js";
18
+ export { UISpawnRandomVelocity } from "./spawnModules/UISpawnRandomVelocity.js";
19
+ export { UISpawnRectangle } from "./spawnModules/UISpawnRectangle.js";
@@ -1,5 +1,5 @@
1
1
  import { InstancedBufferGeometry, ShaderMaterial } from "three";
2
- import type { GLProperty, GLTypeInfo, UIProperty, UIPropertyName } from "../../core/miscellaneous/generic-plane/shared";
2
+ import type { GLProperty, GLTypeInfo, UIProperty, UIPropertyName } from "../../core/miscellaneous/generic-plane/shared.js";
3
3
  export declare const INSTANCED_PARTICLE_GEOMETRY: InstancedBufferGeometry;
4
4
  export declare function collectProperties(keeper: Record<string, GLTypeInfo>, modules: readonly {
5
5
  requiredProperties?: Record<string, UIPropertyName>;
@@ -1,9 +1,8 @@
1
- import { InstancedBufferGeometry, BufferAttribute, Float32BufferAttribute, ShaderMaterial } from 'three';
2
- import { resolveGLSLTypeInfo } from '../../core/miscellaneous/generic-plane/shared.js';
3
- import { checkSRGBSupport } from '../../core/miscellaneous/webglCapabilities.js';
4
- import { UIColor } from '../../core/miscellaneous/color/UIColor.js';
5
-
6
- const INSTANCED_PARTICLE_GEOMETRY = (() => {
1
+ import { BufferAttribute, DoubleSide, Float32BufferAttribute, InstancedBufferGeometry, ShaderMaterial, } from "three";
2
+ import { UIColor } from "../../core/index.js";
3
+ import { resolveGLSLTypeInfo } from "../../core/miscellaneous/generic-plane/shared.js";
4
+ import { checkSRGBSupport } from "../../core/miscellaneous/webglCapabilities.js";
5
+ export const INSTANCED_PARTICLE_GEOMETRY = (() => {
7
6
  const geometry = new InstancedBufferGeometry();
8
7
  const indices = new Uint16Array([0, 2, 1, 2, 3, 1]);
9
8
  geometry.setIndex(new BufferAttribute(indices, 1));
@@ -13,7 +12,7 @@ const INSTANCED_PARTICLE_GEOMETRY = (() => {
13
12
  geometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
14
13
  return geometry;
15
14
  })();
16
- function collectProperties(keeper, modules, debugContext) {
15
+ export function collectProperties(keeper, modules, debugContext) {
17
16
  for (const module of modules) {
18
17
  if (module.requiredProperties === undefined) {
19
18
  continue;
@@ -25,12 +24,12 @@ function collectProperties(keeper, modules, debugContext) {
25
24
  keeper[key] = newTypeInfo;
26
25
  }
27
26
  else if (existingTypeInfo.glslTypeName !== newTypeInfo.glslTypeName) {
28
- throw new Error(`${debugContext}: property conflict for "${key}"`);
27
+ throw new Error(`${debugContext}: property conflict for "${key}" (${existingTypeInfo.glslTypeName} and ${newTypeInfo.glslTypeName})`);
29
28
  }
30
29
  }
31
30
  }
32
31
  }
33
- function collectUniforms(keeper, modules, debugContext) {
32
+ export function collectUniforms(keeper, modules, debugContext) {
34
33
  for (const module of modules) {
35
34
  for (const key in module.requiredUniforms) {
36
35
  const value = module.requiredUniforms[key];
@@ -40,12 +39,12 @@ function collectUniforms(keeper, modules, debugContext) {
40
39
  keeper[key] = { value, glslTypeInfo: newPropertyTypeInfo };
41
40
  }
42
41
  else if (existingGLProperty.glslTypeInfo.glslTypeName !== newPropertyTypeInfo.glslTypeName) {
43
- throw new Error(`${debugContext}: property conflict for "${key}"`);
42
+ throw new Error(`${debugContext}: uniform conflict for "${key}" (${existingGLProperty.glslTypeInfo.glslTypeName} and ${newPropertyTypeInfo.glslTypeName})`);
44
43
  }
45
44
  }
46
45
  }
47
46
  }
48
- function buildParticleVertexShader(uniformDeclarations, attributeDeclarations, varyingDeclarations, vertexAssignments) {
47
+ export function buildParticleVertexShader(uniformDeclarations, attributeDeclarations, varyingDeclarations, vertexAssignments) {
49
48
  return `
50
49
 
51
50
  #define PARTICLE_POSITION_X a_builtin[0][0]
@@ -107,7 +106,7 @@ function buildParticleVertexShader(uniformDeclarations, attributeDeclarations, v
107
106
  }
108
107
  `;
109
108
  }
110
- function buildParticleFragmentShader(uniformDeclarations, varyingDeclarations, sources) {
109
+ export function buildParticleFragmentShader(uniformDeclarations, varyingDeclarations, sources) {
111
110
  const renamedSources = sources.map((source, index) => {
112
111
  return source.replace(/vec4\s+draw\s*\(\s*\)/g, `vec4 draw${index}()`);
113
112
  });
@@ -181,7 +180,7 @@ function buildParticleFragmentShader(uniformDeclarations, varyingDeclarations, s
181
180
  }
182
181
  `;
183
182
  }
184
- function buildParticleMaterial(sources, uniformProperties, varyingProperties) {
183
+ export function buildParticleMaterial(sources, uniformProperties, varyingProperties) {
185
184
  const uniforms = {};
186
185
  const uniformDeclarations = [];
187
186
  const attributeDeclarations = [];
@@ -203,9 +202,9 @@ function buildParticleMaterial(sources, uniformProperties, varyingProperties) {
203
202
  vertexShader: buildParticleVertexShader(uniformDeclarations, attributeDeclarations, varyingDeclarations, vertexAssignments),
204
203
  fragmentShader: buildParticleFragmentShader(uniformDeclarations, varyingDeclarations, sources),
205
204
  transparent: true,
205
+ side: DoubleSide,
206
+ forceSinglePass: true,
206
207
  depthWrite: false,
207
208
  depthTest: true,
208
209
  });
209
210
  }
210
-
211
- export { INSTANCED_PARTICLE_GEOMETRY, buildParticleFragmentShader, buildParticleMaterial, buildParticleVertexShader, collectProperties, collectUniforms };