laymur 0.22.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) 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 +25 -17
  72. package/dist/core/elements/UIElement/UIElement.js +76 -69
  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 -8
  88. package/dist/core/elements/UIProgress/UIProgress.js +60 -58
  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 +20 -1
  132. package/dist/core/miscellaneous/asserts.js +71 -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 +2 -2
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
  143. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  144. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
  146. package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
  147. package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
  148. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  149. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  150. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +14 -17
  156. package/dist/core/miscellaneous/math.js +3 -5
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  158. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  159. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  160. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  175. package/dist/core/miscellaneous/shared.d.ts +1 -1
  176. package/dist/core/miscellaneous/shared.js +4 -7
  177. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  178. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  179. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  180. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  181. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  182. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  183. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  184. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  185. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  186. package/dist/core/miscellaneous/texture/UITextureView.d.ts +3 -3
  187. package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
  188. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  189. package/dist/core/shaders/UIImage.d.ts +9 -0
  190. package/dist/core/shaders/UIImage.js +14 -0
  191. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  192. package/dist/core/shaders/UINineSlice.js +57 -0
  193. package/dist/core/shaders/UIProgress.d.ts +14 -0
  194. package/dist/core/shaders/UIProgress.js +21 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  196. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  199. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  200. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  203. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  204. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  207. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  208. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +27 -4
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
  211. package/dist/debug/UIAspectDebug.d.ts +3 -3
  212. package/dist/debug/UIAspectDebug.js +64 -68
  213. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  214. package/dist/debug/UIConstraintDebug.js +1 -0
  215. package/dist/debug/UIHeightDebug.d.ts +3 -3
  216. package/dist/debug/UIHeightDebug.js +63 -67
  217. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  218. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  219. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  221. package/dist/debug/UILayerDebug.d.ts +1 -1
  222. package/dist/debug/UILayerDebug.js +55 -64
  223. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  224. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  225. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  227. package/dist/debug/UIWidthDebug.d.ts +3 -3
  228. package/dist/debug/UIWidthDebug.js +63 -67
  229. package/dist/debug/index.d.ts +8 -8
  230. package/dist/debug/index.js +8 -8
  231. package/dist/debug/miscellaneous.js +8 -11
  232. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  233. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  234. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  235. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  236. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  237. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  238. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  239. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  242. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  246. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  250. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  251. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  252. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  253. package/dist/particles/elements/UIEmitter.js +100 -88
  254. package/dist/particles/index.d.ts +20 -18
  255. package/dist/particles/index.js +19 -18
  256. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  257. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  258. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
  260. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  261. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  262. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  263. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  264. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  266. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  267. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  268. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  269. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  270. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  271. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  272. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  273. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  274. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  275. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  276. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  277. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  278. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  279. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  280. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  281. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  285. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  287. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  289. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  290. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  291. package/package.json +13 -17
  292. package/dist/_virtual/2d.js +0 -3
  293. package/dist/_virtual/3d.js +0 -3
  294. package/dist/_virtual/4d.js +0 -3
  295. package/dist/_virtual/mod.js +0 -5
  296. package/dist/_virtual/mod2.js +0 -3
  297. package/dist/core/shaders/UIImage.glsl.js +0 -3
  298. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  299. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  300. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  302. package/dist/index.js +0 -52
  303. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  304. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  305. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  306. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  307. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  308. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  309. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  310. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  311. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  312. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  313. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  314. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,6 +1,5 @@
1
- import { Vector3, Quaternion, Matrix4 } from 'three';
2
- import { UIMicroAnchorMode } from './micro/UIMicro.Internal.js';
3
-
1
+ import { Matrix4, Quaternion, Vector3 } from "three";
2
+ import { UIMicroAnchorMode } from "../miscellaneous/micro/UIMicro.Internal.js";
4
3
  const TEMP_POSITION = new Vector3();
5
4
  const TEMP_QUATERNION = new Quaternion();
6
5
  const TEMP_SCALE = new Vector3();
@@ -10,7 +9,7 @@ const Z_AXIS = new Vector3(0, 0, 1);
10
9
  * Computes element transform matrix.
11
10
  * @returns Transform matrix (reused, do not store reference)
12
11
  */
13
- function computeTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode) {
12
+ export function computeTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode) {
14
13
  const scaledWidth = width * microScaleX;
15
14
  const scaledHeight = height * microScaleY;
16
15
  const anchorOffsetX = microAnchorX * scaledWidth;
@@ -46,7 +45,7 @@ function computeTransformMatrix(x, y, width, height, zIndex, microX, microY, mic
46
45
  * @param trimBottom Pixels trimmed from bottom
47
46
  * @returns Transform matrix (reused, do not store reference)
48
47
  */
49
- function computeTrimmedTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode, trimLeft, trimRight, trimTop, trimBottom) {
48
+ export function computeTrimmedTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode, trimLeft, trimRight, trimTop, trimBottom) {
50
49
  const trimmedWidth = width - trimLeft - trimRight;
51
50
  const trimmedHeight = height - trimTop - trimBottom;
52
51
  const scaledWidth = width * microScaleX;
@@ -78,5 +77,3 @@ function computeTrimmedTransformMatrix(x, y, width, height, zIndex, microX, micr
78
77
  TEMP_MATRIX.compose(TEMP_POSITION, TEMP_QUATERNION, TEMP_SCALE);
79
78
  return TEMP_MATRIX;
80
79
  }
81
-
82
- export { computeTransformMatrix, computeTrimmedTransformMatrix };
@@ -1,6 +1,6 @@
1
1
  import { InstancedBufferAttribute, InstancedBufferGeometry, ShaderMaterial } from "three";
2
- import { UITransparencyMode } from "../../UITransparencyMode";
3
- import type { GLProperty, UIProperty } from "../shared";
2
+ import { UITransparencyMode } from "../../UITransparencyMode.js";
3
+ import type { GLProperty, UIProperty } from "../shared.js";
4
4
  export declare const INSTANCED_PLANE_GEOMETRY: InstancedBufferGeometry;
5
5
  export declare const CAPACITY_STEP = 4;
6
6
  export declare const INITIAL_CAPACITY = 1;
@@ -1,9 +1,8 @@
1
- import { InstancedBufferGeometry, Uint16BufferAttribute, Float32BufferAttribute, Vector4, ShaderMaterial, DoubleSide, InstancedBufferAttribute, Vector2, Vector3, Matrix3, Matrix4 } from 'three';
2
- import { UIColor } from '../../color/UIColor.js';
3
- import { UITransparencyMode } from '../../UITransparencyMode.js';
4
- import { buildGenericPlaneFragmentShader, resolveGLSLTypeInfo } from '../shared.js';
5
-
6
- const INSTANCED_PLANE_GEOMETRY = (() => {
1
+ import { DoubleSide, Float32BufferAttribute, InstancedBufferAttribute, InstancedBufferGeometry, Matrix3, Matrix4, ShaderMaterial, Uint16BufferAttribute, Vector2, Vector3, Vector4, } from "three";
2
+ import { UIColor } from "../../color/UIColor.js";
3
+ import { UITransparencyMode } from "../../UITransparencyMode.js";
4
+ import { buildGenericPlaneFragmentShader, resolveGLSLTypeInfo } from "../shared.js";
5
+ export const INSTANCED_PLANE_GEOMETRY = (() => {
7
6
  const geometry = new InstancedBufferGeometry();
8
7
  const indices = new Uint16Array([0, 2, 1, 2, 3, 1]);
9
8
  geometry.setIndex(new Uint16BufferAttribute(indices, 1));
@@ -13,10 +12,10 @@ const INSTANCED_PLANE_GEOMETRY = (() => {
13
12
  geometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
14
13
  return geometry;
15
14
  })();
16
- const CAPACITY_STEP = 4;
17
- const INITIAL_CAPACITY = 1;
15
+ export const CAPACITY_STEP = 4;
16
+ export const INITIAL_CAPACITY = 1;
18
17
  const TEMP_COLOR_VECTOR = new Vector4();
19
- function writePropertyToArray(value, array, offset) {
18
+ export function writePropertyToArray(value, array, offset) {
20
19
  if (value instanceof UIColor) {
21
20
  value.toGLSLColor(TEMP_COLOR_VECTOR);
22
21
  array[offset] = TEMP_COLOR_VECTOR.x;
@@ -49,14 +48,14 @@ function writePropertyToArray(value, array, offset) {
49
48
  array[offset] = value;
50
49
  }
51
50
  }
52
- function buildEmptyInstancedBufferAttribute(value, capacity) {
51
+ export function buildEmptyInstancedBufferAttribute(value, capacity) {
53
52
  const info = resolveGLSLTypeInfo(value);
54
53
  if (!info.instantiable) {
55
54
  throw new Error(`buildEmptyInstancedBufferAttribute.value: cannot create instanced attribute for non-instantiable type`);
56
55
  }
57
56
  return new InstancedBufferAttribute(new Float32Array(capacity * info.bufferSize), info.bufferSize);
58
57
  }
59
- function buildMaterial(source, uniformProperties, varyingProperties, transparency) {
58
+ export function buildMaterial(source, uniformProperties, varyingProperties, transparency) {
60
59
  const uniforms = {};
61
60
  const uniformDeclarations = [];
62
61
  const attributeDeclarations = [];
@@ -120,7 +119,7 @@ function buildMaterial(source, uniformProperties, varyingProperties, transparenc
120
119
  premultipliedAlpha,
121
120
  });
122
121
  }
123
- function reconstructValue(referenceValue, array, offset) {
122
+ export function reconstructValue(referenceValue, array, offset) {
124
123
  if (typeof referenceValue === "number") {
125
124
  return array[offset];
126
125
  }
@@ -152,7 +151,7 @@ function reconstructValue(referenceValue, array, offset) {
152
151
  * Shift buffer region within the same array.
153
152
  * Uses copyWithin for efficient memory moves with correct overlap handling.
154
153
  */
155
- function shiftBufferRegion(array, itemSize, fromIndex, count, delta) {
154
+ export function shiftBufferRegion(array, itemSize, fromIndex, count, delta) {
156
155
  if (count <= 0 || delta === 0) {
157
156
  return;
158
157
  }
@@ -164,10 +163,8 @@ function shiftBufferRegion(array, itemSize, fromIndex, count, delta) {
164
163
  /**
165
164
  * Copy data between two different buffers.
166
165
  */
167
- function copyBetweenBuffers(src, srcOffset, dst, dstOffset, length) {
166
+ export function copyBetweenBuffers(src, srcOffset, dst, dstOffset, length) {
168
167
  for (let i = 0; i < length; i++) {
169
168
  dst[dstOffset + i] = src[srcOffset + i];
170
169
  }
171
170
  }
172
-
173
- export { CAPACITY_STEP, INITIAL_CAPACITY, INSTANCED_PLANE_GEOMETRY, buildEmptyInstancedBufferAttribute, buildMaterial, copyBetweenBuffers, reconstructValue, shiftBufferRegion, writePropertyToArray };
@@ -1,7 +1,6 @@
1
- import { Mesh, Vector3, Matrix4, InstancedBufferAttribute } from 'three';
2
- import { resolveGLSLTypeInfo, resolvePropertyUniform, cloneProperty, extractZIndexFromBuffer, cloneGLProperties, arePropertiesPartiallyCompatible } from '../shared.js';
3
- import { INITIAL_CAPACITY, INSTANCED_PLANE_GEOMETRY, buildMaterial, CAPACITY_STEP, buildEmptyInstancedBufferAttribute, writePropertyToArray, reconstructValue, copyBetweenBuffers, shiftBufferRegion } from './UIGenericInstancedPlane.Internal.js';
4
-
1
+ import { InstancedBufferAttribute, Matrix4, Mesh, Vector3 } from "three";
2
+ import { arePropertiesPartiallyCompatible, cloneGLProperties, cloneProperty, extractZIndexFromBuffer, resolveGLSLTypeInfo, resolvePropertyUniform, } from "../shared.js";
3
+ import { buildEmptyInstancedBufferAttribute, buildMaterial, CAPACITY_STEP, copyBetweenBuffers, INITIAL_CAPACITY, INSTANCED_PLANE_GEOMETRY, reconstructValue, shiftBufferRegion, writePropertyToArray, } from "./UIGenericInstancedPlane.Internal.js";
5
4
  /**
6
5
  * Instanced shader plane mesh for batched rendering.
7
6
  *
@@ -10,7 +9,7 @@ import { INITIAL_CAPACITY, INSTANCED_PLANE_GEOMETRY, buildMaterial, CAPACITY_STE
10
9
  *
11
10
  * @internal
12
11
  */
13
- class UIGenericInstancedPlane extends Mesh {
12
+ export class UIGenericInstancedPlane extends Mesh {
14
13
  constructor(source, properties, transparency, initialCapacity = INITIAL_CAPACITY) {
15
14
  const uniformProperties = {};
16
15
  const varyingProperties = {
@@ -48,85 +47,85 @@ class UIGenericInstancedPlane extends Mesh {
48
47
  this.matrixWorldAutoUpdate = false;
49
48
  this.source = source;
50
49
  this.transparency = transparency;
51
- this._private_instancedGeometry = instancedGeometry;
52
- this._private_shaderMaterial = shaderMaterial;
53
- this._private_uniformProperties = uniformProperties;
54
- this._private_varyingProperties = varyingProperties;
55
- this._private_propertyBuffers = new Map();
56
- this._private_capacity = Math.max(Math.ceil(initialCapacity / CAPACITY_STEP) * CAPACITY_STEP, CAPACITY_STEP);
57
- this._private_instancesCountInternal = 0;
58
- this._private_instancedGeometry.instanceCount = 0;
59
- for (const name in this._private_varyingProperties) {
60
- const { value } = this._private_varyingProperties[name];
61
- const attribute = buildEmptyInstancedBufferAttribute(value, this._private_capacity);
62
- this._private_instancedGeometry.setAttribute(`a_${name}`, attribute);
63
- this._private_propertyBuffers.set(name, attribute);
64
- }
65
- for (const name in this._private_uniformProperties) {
66
- const { value } = this._private_uniformProperties[name];
67
- const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
50
+ this.instancedGeometry = instancedGeometry;
51
+ this.shaderMaterial = shaderMaterial;
52
+ this.uniformProperties = uniformProperties;
53
+ this.varyingProperties = varyingProperties;
54
+ this.propertyBuffers = new Map();
55
+ this.capacity = Math.max(Math.ceil(initialCapacity / CAPACITY_STEP) * CAPACITY_STEP, CAPACITY_STEP);
56
+ this.instancesCountInternal = 0;
57
+ this.instancedGeometry.instanceCount = 0;
58
+ for (const name in this.varyingProperties) {
59
+ const { value } = this.varyingProperties[name];
60
+ const attribute = buildEmptyInstancedBufferAttribute(value, this.capacity);
61
+ this.instancedGeometry.setAttribute(`a_${name}`, attribute);
62
+ this.propertyBuffers.set(name, attribute);
63
+ }
64
+ for (const name in this.uniformProperties) {
65
+ const { value } = this.uniformProperties[name];
66
+ const uniform = resolvePropertyUniform(name, this.shaderMaterial);
68
67
  uniform.value = value;
69
68
  }
70
- this._private_shaderMaterial.uniformsNeedUpdate = true;
69
+ this.shaderMaterial.uniformsNeedUpdate = true;
71
70
  }
72
71
  /** Current number of active instances */
73
72
  get instancesCount() {
74
- return this._private_instancesCountInternal;
73
+ return this.instancesCountInternal;
75
74
  }
76
75
  /**
77
76
  * Insert instance at given index. Elements at [index..end) are shifted right.
78
77
  */
79
78
  insertAt(index, properties, transform, visibility, blend, hsl) {
80
- if (index < 0 || index > this._private_instancesCountInternal) {
81
- throw new Error(`UIGenericInstancedPlane.insertAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
79
+ if (index < 0 || index > this.instancesCountInternal) {
80
+ throw new Error(`UIGenericInstancedPlane.insertAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
82
81
  }
83
- this._private_ensureCapacity(this._private_instancesCountInternal + 1);
84
- if (index < this._private_instancesCountInternal) {
85
- this._private_shiftBuffersRight(index, 1);
82
+ this.ensureCapacity(this.instancesCountInternal + 1);
83
+ if (index < this.instancesCountInternal) {
84
+ this.shiftBuffersRight(index, 1);
86
85
  }
87
- this._private_writeToBuffers(index, properties, transform, visibility, blend, hsl);
88
- this._private_instancesCountInternal++;
89
- this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
86
+ this.writeToBuffers(index, properties, transform, visibility, blend, hsl);
87
+ this.instancesCountInternal++;
88
+ this.instancedGeometry.instanceCount = this.instancesCountInternal;
90
89
  }
91
90
  /**
92
91
  * Remove instance at given index. Elements at [index+1..end) are shifted left.
93
92
  */
94
93
  removeAt(index) {
95
- if (index < 0 || index >= this._private_instancesCountInternal) {
96
- throw new Error(`UIGenericInstancedPlane.removeAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
94
+ if (index < 0 || index >= this.instancesCountInternal) {
95
+ throw new Error(`UIGenericInstancedPlane.removeAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
97
96
  }
98
- if (index < this._private_instancesCountInternal - 1) {
99
- this._private_shiftBuffersLeft(index + 1, 1);
97
+ if (index < this.instancesCountInternal - 1) {
98
+ this.shiftBuffersLeft(index + 1, 1);
100
99
  }
101
- this._private_instancesCountInternal--;
102
- this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
100
+ this.instancesCountInternal--;
101
+ this.instancedGeometry.instanceCount = this.instancesCountInternal;
103
102
  }
104
103
  /** Update properties at given index */
105
104
  setPropertiesAt(index, properties) {
106
- if (index < 0 || index >= this._private_instancesCountInternal) {
107
- throw new Error(`UIGenericInstancedPlane.setPropertiesAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
105
+ if (index < 0 || index >= this.instancesCountInternal) {
106
+ throw new Error(`UIGenericInstancedPlane.setPropertiesAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
108
107
  }
109
108
  for (const name in properties) {
110
109
  const { value, glslTypeInfo } = properties[name];
111
110
  if (glslTypeInfo.instantiable) {
112
- const attribute = this._private_resolveAttribute(name);
111
+ const attribute = this.resolveAttribute(name);
113
112
  const offset = index * attribute.itemSize;
114
113
  writePropertyToArray(value, attribute.array, offset);
115
114
  attribute.needsUpdate = true;
116
115
  }
117
116
  else {
118
- const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
117
+ const uniform = resolvePropertyUniform(name, this.shaderMaterial);
119
118
  uniform.value = value;
120
- this._private_shaderMaterial.uniformsNeedUpdate = true;
119
+ this.shaderMaterial.uniformsNeedUpdate = true;
121
120
  }
122
121
  }
123
122
  }
124
123
  /** Update transform at given index */
125
124
  setTransformAt(index, transform) {
126
- if (index < 0 || index >= this._private_instancesCountInternal) {
127
- throw new Error(`UIGenericInstancedPlane.setTransformAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
125
+ if (index < 0 || index >= this.instancesCountInternal) {
126
+ throw new Error(`UIGenericInstancedPlane.setTransformAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
128
127
  }
129
- const attribute = this._private_resolveAttribute("instanceTransform");
128
+ const attribute = this.resolveAttribute("instanceTransform");
130
129
  const array = attribute.array;
131
130
  const offset = index * 16;
132
131
  const elements = transform.elements;
@@ -137,30 +136,30 @@ class UIGenericInstancedPlane extends Mesh {
137
136
  }
138
137
  /** Update visibility at given index */
139
138
  setVisibilityAt(index, visible) {
140
- if (index < 0 || index >= this._private_instancesCountInternal) {
141
- throw new Error(`UIGenericInstancedPlane.setVisibilityAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
139
+ if (index < 0 || index >= this.instancesCountInternal) {
140
+ throw new Error(`UIGenericInstancedPlane.setVisibilityAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
142
141
  }
143
- const attribute = this._private_resolveAttribute("instanceVisibility");
142
+ const attribute = this.resolveAttribute("instanceVisibility");
144
143
  const array = attribute.array;
145
144
  array[index] = visible ? 1 : 0;
146
145
  attribute.needsUpdate = true;
147
146
  }
148
147
  /** Update blend factor at given index (1 = normal over, 0 = additive) */
149
148
  setBlendAt(index, blend) {
150
- if (index < 0 || index >= this._private_instancesCountInternal) {
151
- throw new Error(`UIGenericInstancedPlane.setBlendAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
149
+ if (index < 0 || index >= this.instancesCountInternal) {
150
+ throw new Error(`UIGenericInstancedPlane.setBlendAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
152
151
  }
153
- const attribute = this._private_resolveAttribute("instanceBlend");
152
+ const attribute = this.resolveAttribute("instanceBlend");
154
153
  const array = attribute.array;
155
154
  array[index] = blend;
156
155
  attribute.needsUpdate = true;
157
156
  }
158
157
  /** Update HSL adjustment at given index (hue in turns, saturation multiplier, lightness offset) */
159
158
  setHSLAt(index, hsl) {
160
- if (index < 0 || index >= this._private_instancesCountInternal) {
161
- throw new Error(`UIGenericInstancedPlane.setHSLAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
159
+ if (index < 0 || index >= this.instancesCountInternal) {
160
+ throw new Error(`UIGenericInstancedPlane.setHSLAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
162
161
  }
163
- const attribute = this._private_resolveAttribute("instanceHSL");
162
+ const attribute = this.resolveAttribute("instanceHSL");
164
163
  const array = attribute.array;
165
164
  const offset = index * 3;
166
165
  array[offset] = hsl.h;
@@ -173,26 +172,26 @@ class UIGenericInstancedPlane extends Mesh {
173
172
  * Returns cloned data safe for external use.
174
173
  */
175
174
  extractDataAt(index) {
176
- if (index < 0 || index >= this._private_instancesCountInternal) {
177
- throw new Error(`UIGenericInstancedPlane.extractDataAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
175
+ if (index < 0 || index >= this.instancesCountInternal) {
176
+ throw new Error(`UIGenericInstancedPlane.extractDataAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
178
177
  }
179
178
  const properties = {};
180
- for (const name in this._private_uniformProperties) {
181
- const prop = this._private_uniformProperties[name];
179
+ for (const name in this.uniformProperties) {
180
+ const prop = this.uniformProperties[name];
182
181
  properties[name] = {
183
182
  value: cloneProperty(prop.value),
184
183
  glslTypeInfo: prop.glslTypeInfo,
185
184
  };
186
185
  }
187
- for (const name in this._private_varyingProperties) {
186
+ for (const name in this.varyingProperties) {
188
187
  if (name === "instanceVisibility" ||
189
188
  name === "instanceTransform" ||
190
189
  name === "instanceBlend" ||
191
190
  name === "instanceHSL") {
192
191
  continue;
193
192
  }
194
- const { value, glslTypeInfo } = this._private_varyingProperties[name];
195
- const attribute = this._private_propertyBuffers.get(name);
193
+ const { value, glslTypeInfo } = this.varyingProperties[name];
194
+ const attribute = this.propertyBuffers.get(name);
196
195
  const array = attribute.array;
197
196
  const offset = index * attribute.itemSize;
198
197
  properties[name] = {
@@ -200,11 +199,11 @@ class UIGenericInstancedPlane extends Mesh {
200
199
  glslTypeInfo,
201
200
  };
202
201
  }
203
- const transformAttribute = this._private_propertyBuffers.get("instanceTransform");
202
+ const transformAttribute = this.propertyBuffers.get("instanceTransform");
204
203
  const transformArray = transformAttribute.array;
205
204
  const transform = new Matrix4();
206
205
  transform.fromArray(transformArray, index * 16);
207
- const visibilityAttribute = this._private_propertyBuffers.get("instanceVisibility");
206
+ const visibilityAttribute = this.propertyBuffers.get("instanceVisibility");
208
207
  const visibilityArray = visibilityAttribute.array;
209
208
  const visibility = visibilityArray[index] >= 0.5;
210
209
  return {
@@ -217,10 +216,10 @@ class UIGenericInstancedPlane extends Mesh {
217
216
  }
218
217
  /** Get zIndex at given index (from transform buffer) */
219
218
  getZIndexAt(index) {
220
- if (index < 0 || index >= this._private_instancesCountInternal) {
221
- throw new Error(`UIGenericInstancedPlane.getZIndexAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
219
+ if (index < 0 || index >= this.instancesCountInternal) {
220
+ throw new Error(`UIGenericInstancedPlane.getZIndexAt.index: out of bounds (index=${index}, count=${this.instancesCountInternal})`);
222
221
  }
223
- const attribute = this._private_propertyBuffers.get("instanceTransform");
222
+ const attribute = this.propertyBuffers.get("instanceTransform");
224
223
  return extractZIndexFromBuffer(attribute.array, index);
225
224
  }
226
225
  /**
@@ -228,25 +227,25 @@ class UIGenericInstancedPlane extends Mesh {
228
227
  * Other plane becomes empty after merge.
229
228
  */
230
229
  merge(other) {
231
- if (other._private_instancesCountInternal === 0) {
230
+ if (other.instancesCountInternal === 0) {
232
231
  return;
233
232
  }
234
- this._private_ensureCapacity(this._private_instancesCountInternal + other._private_instancesCountInternal);
235
- for (const [name, thisAttribute] of this._private_propertyBuffers) {
236
- const otherAttribute = other._private_propertyBuffers.get(name);
233
+ this.ensureCapacity(this.instancesCountInternal + other.instancesCountInternal);
234
+ for (const [name, thisAttribute] of this.propertyBuffers) {
235
+ const otherAttribute = other.propertyBuffers.get(name);
237
236
  if (!otherAttribute) {
238
237
  throw new Error(`UIGenericInstancedPlane.merge: missing attribute ${name} in source`);
239
238
  }
240
239
  const itemSize = thisAttribute.itemSize;
241
240
  const srcArray = otherAttribute.array;
242
241
  const dstArray = thisAttribute.array;
243
- copyBetweenBuffers(srcArray, 0, dstArray, this._private_instancesCountInternal * itemSize, other._private_instancesCountInternal * itemSize);
242
+ copyBetweenBuffers(srcArray, 0, dstArray, this.instancesCountInternal * itemSize, other.instancesCountInternal * itemSize);
244
243
  thisAttribute.needsUpdate = true;
245
244
  }
246
- this._private_instancesCountInternal += other._private_instancesCountInternal;
247
- this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
248
- other._private_instancesCountInternal = 0;
249
- other._private_instancedGeometry.instanceCount = 0;
245
+ this.instancesCountInternal += other.instancesCountInternal;
246
+ this.instancedGeometry.instanceCount = this.instancesCountInternal;
247
+ other.instancesCountInternal = 0;
248
+ other.instancedGeometry.instanceCount = 0;
250
249
  }
251
250
  /**
252
251
  * Split this plane at given index.
@@ -254,16 +253,16 @@ class UIGenericInstancedPlane extends Mesh {
254
253
  * This plane keeps elements [0..atIndex).
255
254
  */
256
255
  split(atIndex) {
257
- if (atIndex <= 0 || atIndex >= this._private_instancesCountInternal) {
258
- throw new Error(`UIGenericInstancedPlane.split.atIndex: must be in range (0, count) (atIndex=${atIndex}, count=${this._private_instancesCountInternal})`);
256
+ if (atIndex <= 0 || atIndex >= this.instancesCountInternal) {
257
+ throw new Error(`UIGenericInstancedPlane.split.atIndex: must be in range (0, count) (atIndex=${atIndex}, count=${this.instancesCountInternal})`);
259
258
  }
260
- const tailCount = this._private_instancesCountInternal - atIndex;
259
+ const tailCount = this.instancesCountInternal - atIndex;
261
260
  const newPlane = new UIGenericInstancedPlane(this.source, cloneGLProperties({
262
- ...this._private_uniformProperties,
263
- ...this._private_varyingProperties,
261
+ ...this.uniformProperties,
262
+ ...this.varyingProperties,
264
263
  }), this.transparency, tailCount);
265
- for (const [name, thisAttribute] of this._private_propertyBuffers) {
266
- const newAttribute = newPlane._private_propertyBuffers.get(name);
264
+ for (const [name, thisAttribute] of this.propertyBuffers) {
265
+ const newAttribute = newPlane.propertyBuffers.get(name);
267
266
  if (!newAttribute) {
268
267
  throw new Error(`UIGenericInstancedPlane.split: missing attribute ${name} in new plane`);
269
268
  }
@@ -273,10 +272,10 @@ class UIGenericInstancedPlane extends Mesh {
273
272
  copyBetweenBuffers(srcArray, atIndex * itemSize, dstArray, 0, tailCount * itemSize);
274
273
  newAttribute.needsUpdate = true;
275
274
  }
276
- newPlane._private_instancesCountInternal = tailCount;
277
- newPlane._private_instancedGeometry.instanceCount = tailCount;
278
- this._private_instancesCountInternal = atIndex;
279
- this._private_instancedGeometry.instanceCount = atIndex;
275
+ newPlane.instancesCountInternal = tailCount;
276
+ newPlane.instancedGeometry.instanceCount = tailCount;
277
+ this.instancesCountInternal = atIndex;
278
+ this.instancedGeometry.instanceCount = atIndex;
280
279
  return newPlane;
281
280
  }
282
281
  /**
@@ -289,74 +288,74 @@ class UIGenericInstancedPlane extends Mesh {
289
288
  if (this.transparency !== transparency) {
290
289
  return false;
291
290
  }
292
- const result = arePropertiesPartiallyCompatible({ ...this._private_uniformProperties, ...this._private_varyingProperties }, properties);
291
+ const result = arePropertiesPartiallyCompatible({ ...this.uniformProperties, ...this.varyingProperties }, properties);
293
292
  return result;
294
293
  }
295
294
  /** Get all properties configuration (for compatibility checks) */
296
295
  getProperties() {
297
- return { ...this._private_uniformProperties, ...this._private_varyingProperties };
296
+ return { ...this.uniformProperties, ...this.varyingProperties };
298
297
  }
299
298
  /** Remove all instances, reset to empty state */
300
299
  clearInstances() {
301
- this._private_instancesCountInternal = 0;
302
- this._private_instancedGeometry.instanceCount = 0;
300
+ this.instancesCountInternal = 0;
301
+ this.instancedGeometry.instanceCount = 0;
303
302
  }
304
303
  /** Dispose geometry, material, and clear buffers */
305
304
  destroy() {
306
- this._private_instancedGeometry.dispose();
307
- this._private_shaderMaterial.dispose();
308
- this._private_propertyBuffers.clear();
305
+ this.instancedGeometry.dispose();
306
+ this.shaderMaterial.dispose();
307
+ this.propertyBuffers.clear();
309
308
  }
310
- _private_ensureCapacity(requiredCapacity) {
311
- if (requiredCapacity <= this._private_capacity) {
309
+ ensureCapacity(requiredCapacity) {
310
+ if (requiredCapacity <= this.capacity) {
312
311
  return;
313
312
  }
314
313
  const newCapacity = Math.ceil(requiredCapacity / CAPACITY_STEP) * CAPACITY_STEP;
315
- for (const [name, oldAttribute] of this._private_propertyBuffers) {
314
+ for (const [name, oldAttribute] of this.propertyBuffers) {
316
315
  const itemSize = oldAttribute.itemSize;
317
316
  const newArray = new Float32Array(newCapacity * itemSize);
318
317
  newArray.set(oldAttribute.array);
319
318
  const newAttribute = new InstancedBufferAttribute(newArray, itemSize);
320
- this._private_instancedGeometry.setAttribute(`a_${name}`, newAttribute);
321
- this._private_propertyBuffers.set(name, newAttribute);
319
+ this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);
320
+ this.propertyBuffers.set(name, newAttribute);
322
321
  }
323
- this._private_capacity = newCapacity;
322
+ this.capacity = newCapacity;
324
323
  }
325
- _private_shiftBuffersRight(fromIndex, delta) {
326
- const elementsToMove = this._private_instancesCountInternal - fromIndex;
324
+ shiftBuffersRight(fromIndex, delta) {
325
+ const elementsToMove = this.instancesCountInternal - fromIndex;
327
326
  if (elementsToMove <= 0) {
328
327
  return;
329
328
  }
330
- for (const attribute of this._private_propertyBuffers.values()) {
329
+ for (const attribute of this.propertyBuffers.values()) {
331
330
  shiftBufferRegion(attribute.array, attribute.itemSize, fromIndex, elementsToMove, delta);
332
331
  attribute.needsUpdate = true;
333
332
  }
334
333
  }
335
- _private_shiftBuffersLeft(fromIndex, delta) {
336
- const elementsToMove = this._private_instancesCountInternal - fromIndex;
334
+ shiftBuffersLeft(fromIndex, delta) {
335
+ const elementsToMove = this.instancesCountInternal - fromIndex;
337
336
  if (elementsToMove <= 0) {
338
337
  return;
339
338
  }
340
- for (const attribute of this._private_propertyBuffers.values()) {
339
+ for (const attribute of this.propertyBuffers.values()) {
341
340
  shiftBufferRegion(attribute.array, attribute.itemSize, fromIndex, elementsToMove, -delta);
342
341
  attribute.needsUpdate = true;
343
342
  }
344
343
  }
345
- _private_writeToBuffers(index, properties, transform, visibility, blend, hsl) {
346
- const visibilityAttribute = this._private_resolveAttribute("instanceVisibility");
344
+ writeToBuffers(index, properties, transform, visibility, blend, hsl) {
345
+ const visibilityAttribute = this.resolveAttribute("instanceVisibility");
347
346
  visibilityAttribute.array[index] = visibility ? 1 : 0;
348
347
  visibilityAttribute.needsUpdate = true;
349
- const blendAttribute = this._private_resolveAttribute("instanceBlend");
348
+ const blendAttribute = this.resolveAttribute("instanceBlend");
350
349
  blendAttribute.array[index] = blend;
351
350
  blendAttribute.needsUpdate = true;
352
- const hslAttribute = this._private_resolveAttribute("instanceHSL");
351
+ const hslAttribute = this.resolveAttribute("instanceHSL");
353
352
  const hslArray = hslAttribute.array;
354
353
  const hslOffset = index * 3;
355
354
  hslArray[hslOffset] = hsl.h;
356
355
  hslArray[hslOffset + 1] = hsl.s;
357
356
  hslArray[hslOffset + 2] = hsl.l;
358
357
  hslAttribute.needsUpdate = true;
359
- const transformAttribute = this._private_resolveAttribute("instanceTransform");
358
+ const transformAttribute = this.resolveAttribute("instanceTransform");
360
359
  const transformArray = transformAttribute.array;
361
360
  const transformOffset = index * 16;
362
361
  const elements = transform.elements;
@@ -367,7 +366,7 @@ class UIGenericInstancedPlane extends Mesh {
367
366
  for (const name in properties) {
368
367
  const { value, glslTypeInfo } = properties[name];
369
368
  if (glslTypeInfo.instantiable) {
370
- const attribute = this._private_propertyBuffers.get(name);
369
+ const attribute = this.propertyBuffers.get(name);
371
370
  if (attribute) {
372
371
  const offset = index * attribute.itemSize;
373
372
  writePropertyToArray(value, attribute.array, offset);
@@ -375,19 +374,17 @@ class UIGenericInstancedPlane extends Mesh {
375
374
  }
376
375
  }
377
376
  else {
378
- const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
377
+ const uniform = resolvePropertyUniform(name, this.shaderMaterial);
379
378
  uniform.value = value;
380
- this._private_shaderMaterial.uniformsNeedUpdate = true;
379
+ this.shaderMaterial.uniformsNeedUpdate = true;
381
380
  }
382
381
  }
383
382
  }
384
- _private_resolveAttribute(name) {
385
- const attribute = this._private_propertyBuffers.get(name);
383
+ resolveAttribute(name) {
384
+ const attribute = this.propertyBuffers.get(name);
386
385
  if (attribute === undefined) {
387
386
  throw new Error(`UIGenericInstancedPlane.resolveAttribute.name: unknown attribute "${name}"`);
388
387
  }
389
388
  return attribute;
390
389
  }
391
390
  }
392
-
393
- export { UIGenericInstancedPlane };
@@ -1,7 +1,7 @@
1
1
  import type { Matrix4 } from "three";
2
- import type { UITransparencyMode } from "../../UITransparencyMode";
3
- import type { GLProperty, HSLAdjustment } from "../shared";
4
- import type { UIGenericInstancedPlane } from "../UIGenericInstancedPlane/UIGenericInstancedPlane";
2
+ import type { UITransparencyMode } from "../../UITransparencyMode.js";
3
+ import type { GLProperty, HSLAdjustment } from "../shared.js";
4
+ import type { UIGenericInstancedPlane } from "../UIGenericInstancedPlane/UIGenericInstancedPlane.js";
5
5
  export interface PlaneDescriptor {
6
6
  mesh: UIGenericInstancedPlane;
7
7
  instanceIndex: number;