laymur 0.17.0 → 0.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +5 -0
  2. package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
  5. package/dist/core/constraints/UIConstraint.d.ts +12 -0
  6. package/dist/core/constraints/UIConstraint.js +11 -0
  7. package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
  8. package/dist/core/constraints/UICustomConstraint.js +37 -0
  9. package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
  12. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
  13. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
  16. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
  17. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
  20. package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
  21. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
  23. package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
  24. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
  25. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
  26. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
  27. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
  28. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
  29. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
  30. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
  31. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
  32. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
  33. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
  34. package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
  35. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
  36. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
  37. package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
  38. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
  39. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
  40. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
  41. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
  42. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
  43. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
  44. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
  45. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
  46. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
  47. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
  48. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
  49. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
  50. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
  51. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
  52. package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
  53. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
  54. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
  55. package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
  56. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
  57. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
  58. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
  59. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
  60. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
  61. package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
  62. package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
  63. package/dist/core/elements/UIDummy/UIDummy.js +173 -0
  64. package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
  65. package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
  66. package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
  67. package/dist/core/elements/UIElement/UIElement.js +74 -0
  68. package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
  69. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
  70. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
  71. package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
  72. package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
  73. package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
  74. package/dist/core/elements/UIImage/UIImage.js +85 -0
  75. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
  76. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
  77. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
  78. package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
  79. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
  80. package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
  81. package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
  82. package/dist/core/elements/UIProgress/UIProgress.js +165 -0
  83. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
  84. package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
  85. package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
  86. package/dist/core/elements/UIScene/UIScene.js +157 -0
  87. package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
  88. package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
  89. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  90. package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
  91. package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
  92. package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
  93. package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
  94. package/dist/core/elements/UIText/UIText.d.ts +71 -0
  95. package/dist/core/elements/UIText/UIText.js +265 -0
  96. package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
  97. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
  98. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
  99. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
  100. package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
  101. package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
  102. package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
  103. package/dist/core/layers/UILayer/UILayer.js +113 -0
  104. package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
  105. package/dist/core/miscellaneous/UIExpression.js +128 -0
  106. package/dist/core/miscellaneous/UIMode.d.ts +23 -0
  107. package/dist/core/miscellaneous/UIMode.js +30 -0
  108. package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
  109. package/dist/core/miscellaneous/UIOrientation.js +20 -0
  110. package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
  111. package/dist/core/miscellaneous/UIPriority.js +63 -0
  112. package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
  113. package/dist/core/miscellaneous/UIRelation.js +40 -0
  114. package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
  115. package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
  116. package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
  117. package/dist/core/miscellaneous/area/UIArea.js +5 -0
  118. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
  119. package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
  120. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
  121. package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
  122. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
  123. package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
  124. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
  125. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
  126. package/dist/core/miscellaneous/asserts.d.ts +43 -0
  127. package/dist/core/miscellaneous/asserts.js +163 -0
  128. package/dist/core/miscellaneous/canvas.d.ts +31 -0
  129. package/dist/core/miscellaneous/canvas.js +37 -0
  130. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
  131. package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
  132. package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
  133. package/dist/core/miscellaneous/color/UIColor.js +636 -0
  134. package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
  135. package/dist/core/miscellaneous/computeTransform.js +82 -0
  136. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
  137. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
  138. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
  139. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
  140. package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
  141. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
  142. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
  143. package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
  144. package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
  145. package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
  146. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
  147. package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
  148. package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
  149. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
  150. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
  155. package/dist/core/miscellaneous/math.d.ts +7 -0
  156. package/dist/core/miscellaneous/math.js +11 -0
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
  158. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
  159. package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
  160. package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
  176. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
  177. package/dist/core/miscellaneous/shared.d.ts +46 -0
  178. package/dist/core/miscellaneous/shared.js +37 -0
  179. package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
  180. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
  181. package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
  182. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
  183. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
  184. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
  185. package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
  188. package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
  189. package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
  190. package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
  191. package/dist/core/miscellaneous/webglCapabilities.js +103 -0
  192. package/dist/core/shaders/UIImage.glsl.js +3 -0
  193. package/dist/core/shaders/UINineSlice.glsl.js +3 -0
  194. package/dist/core/shaders/UIProgress.glsl.js +3 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
  196. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
  197. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
  198. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
  199. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
  200. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
  201. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
  202. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
  203. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
  204. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
  205. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
  206. package/dist/index.js +51 -0
  207. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
  208. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
  209. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
  210. package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
  211. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
  212. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
  213. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
  214. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
  215. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
  216. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
  217. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
  218. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
  219. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
  220. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
  221. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
  222. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
  223. package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
  224. package/dist/particles/elements/UIEmitter.Internal.js +11 -0
  225. package/dist/particles/elements/UIEmitter.d.ts +68 -0
  226. package/dist/particles/elements/UIEmitter.js +203 -0
  227. package/dist/particles/index.js +18 -0
  228. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
  229. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
  230. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
  231. package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
  232. package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
  233. package/dist/particles/miscellaneous/miscellaneous.js +67 -0
  234. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
  235. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
  236. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
  237. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
  238. package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
  239. package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
  240. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
  241. package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
  242. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
  243. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
  244. package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
  245. package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
  246. package/dist/particles/spawnModules/UISpawnModule.js +9 -0
  247. package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
  248. package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
  249. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
  250. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
  251. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
  252. package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
  253. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
  254. package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
  255. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
  256. package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
  257. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
  258. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
  259. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
  260. package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
  261. package/package.json +8 -1
  262. package/.claude/settings.local.json +0 -9
  263. package/.editorconfig +0 -14
  264. package/CLAUDE.md +0 -181
  265. package/assets/logotype.png +0 -0
  266. package/eslint.config.js +0 -111
  267. package/rollup.config.js +0 -52
  268. package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
  269. package/src/core/constraints/UIConstraint.ts +0 -20
  270. package/src/core/constraints/UICustomConstraint.ts +0 -62
  271. package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
  272. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
  273. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
  274. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
  275. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
  276. package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
  277. package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
  278. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
  279. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
  280. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
  281. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
  282. package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
  283. package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
  284. package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
  285. package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
  286. package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
  287. package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
  288. package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
  289. package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
  290. package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
  291. package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
  292. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
  293. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
  294. package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
  295. package/src/core/elements/UIDummy/UIDummy.ts +0 -244
  296. package/src/core/elements/UIElement/UIElement.ts +0 -127
  297. package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
  298. package/src/core/elements/UIImage/UIImage.ts +0 -138
  299. package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
  300. package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
  301. package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
  302. package/src/core/elements/UIProgress/UIProgress.ts +0 -259
  303. package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
  304. package/src/core/elements/UIScene/UIScene.ts +0 -259
  305. package/src/core/elements/UIText/UIText.Internal.ts +0 -29
  306. package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
  307. package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
  308. package/src/core/elements/UIText/UIText.ts +0 -376
  309. package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
  310. package/src/core/layers/UILayer/UILayer.ts +0 -156
  311. package/src/core/miscellaneous/UIExpression.ts +0 -142
  312. package/src/core/miscellaneous/UIMode.ts +0 -29
  313. package/src/core/miscellaneous/UIOrientation.ts +0 -18
  314. package/src/core/miscellaneous/UIPriority.ts +0 -63
  315. package/src/core/miscellaneous/UIRelation.ts +0 -39
  316. package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
  317. package/src/core/miscellaneous/area/UIArea.ts +0 -5
  318. package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
  319. package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
  320. package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
  321. package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
  322. package/src/core/miscellaneous/asserts.ts +0 -187
  323. package/src/core/miscellaneous/canvas.ts +0 -73
  324. package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
  325. package/src/core/miscellaneous/color/UIColor.ts +0 -844
  326. package/src/core/miscellaneous/computeTransform.ts +0 -127
  327. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
  328. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
  329. package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
  330. package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
  331. package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
  332. package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
  333. package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
  334. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
  335. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
  336. package/src/core/miscellaneous/math.ts +0 -16
  337. package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
  338. package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
  339. package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
  340. package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
  341. package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
  342. package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
  343. package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
  344. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
  345. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
  346. package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
  347. package/src/core/miscellaneous/shared.ts +0 -73
  348. package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
  349. package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
  350. package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
  351. package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
  352. package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
  353. package/src/core/miscellaneous/webglCapabilities.ts +0 -129
  354. package/src/core/shaders/UIImage.glsl +0 -10
  355. package/src/core/shaders/UINineSlice.glsl +0 -53
  356. package/src/core/shaders/UIProgress.glsl +0 -15
  357. package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
  358. package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
  359. package/src/core/shaders/glsl.d.ts +0 -27
  360. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
  361. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
  362. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
  363. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
  364. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
  365. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
  366. package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
  367. package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
  368. package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
  369. package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
  370. package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
  371. package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
  372. package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
  373. package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
  374. package/src/particles/elements/UIEmitter.Internal.ts +0 -22
  375. package/src/particles/elements/UIEmitter.ts +0 -313
  376. package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
  377. package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
  378. package/src/particles/miscellaneous/miscellaneous.ts +0 -115
  379. package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
  380. package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
  381. package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
  382. package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
  383. package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
  384. package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
  385. package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
  386. package/src/particles/spawnModules/UISpawnModule.ts +0 -22
  387. package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
  388. package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
  389. package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
  390. package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
  391. package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
  392. package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
  393. package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
  394. package/tsconfig.json +0 -29
  395. /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
  396. /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
@@ -0,0 +1,82 @@
1
+ import { Vector3, Quaternion, Matrix4 } from 'three';
2
+ import { UIMicroAnchorMode } from './micro/UIMicro.Internal.js';
3
+
4
+ const TEMP_POSITION = new Vector3();
5
+ const TEMP_QUATERNION = new Quaternion();
6
+ const TEMP_SCALE = new Vector3();
7
+ const TEMP_MATRIX = new Matrix4();
8
+ const Z_AXIS = new Vector3(0, 0, 1);
9
+ /**
10
+ * Computes element transform matrix.
11
+ * @returns Transform matrix (reused, do not store reference)
12
+ */
13
+ function computeTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode) {
14
+ const scaledWidth = width * microScaleX;
15
+ const scaledHeight = height * microScaleY;
16
+ const anchorOffsetX = microAnchorX * scaledWidth;
17
+ const anchorOffsetY = microAnchorY * scaledHeight;
18
+ const cos = Math.cos(microRotation);
19
+ const sin = Math.sin(microRotation);
20
+ const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;
21
+ const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;
22
+ if (microAnchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {
23
+ TEMP_POSITION.x = x + microX - rotatedAnchorX;
24
+ TEMP_POSITION.y = y + microY - rotatedAnchorY;
25
+ }
26
+ else {
27
+ const rawAnchorOffsetX = microAnchorX * width;
28
+ const rawAnchorOffsetY = microAnchorY * height;
29
+ TEMP_POSITION.x = x + rawAnchorOffsetX - rotatedAnchorX + microX;
30
+ TEMP_POSITION.y = y + rawAnchorOffsetY - rotatedAnchorY + microY;
31
+ }
32
+ TEMP_POSITION.z = zIndex;
33
+ TEMP_SCALE.x = scaledWidth;
34
+ TEMP_SCALE.y = scaledHeight;
35
+ TEMP_QUATERNION.setFromAxisAngle(Z_AXIS, microRotation);
36
+ TEMP_MATRIX.compose(TEMP_POSITION, TEMP_QUATERNION, TEMP_SCALE);
37
+ return TEMP_MATRIX;
38
+ }
39
+ /**
40
+ * Computes transform matrix for trimmed sprite.
41
+ * @param width Source width including trimmed areas
42
+ * @param height Source height including trimmed areas
43
+ * @param trimLeft Pixels trimmed from left
44
+ * @param trimRight Pixels trimmed from right
45
+ * @param trimTop Pixels trimmed from top
46
+ * @param trimBottom Pixels trimmed from bottom
47
+ * @returns Transform matrix (reused, do not store reference)
48
+ */
49
+ function computeTrimmedTransformMatrix(x, y, width, height, zIndex, microX, microY, microAnchorX, microAnchorY, microScaleX, microScaleY, microRotation, microAnchorMode, trimLeft, trimRight, trimTop, trimBottom) {
50
+ const trimmedWidth = width - trimLeft - trimRight;
51
+ const trimmedHeight = height - trimTop - trimBottom;
52
+ const scaledWidth = width * microScaleX;
53
+ const scaledHeight = height * microScaleY;
54
+ const anchorOffsetX = microAnchorX * scaledWidth;
55
+ const anchorOffsetY = microAnchorY * scaledHeight;
56
+ const cos = Math.cos(microRotation);
57
+ const sin = Math.sin(microRotation);
58
+ const rotatedAnchorX = anchorOffsetX * cos - anchorOffsetY * sin;
59
+ const rotatedAnchorY = anchorOffsetX * sin + anchorOffsetY * cos;
60
+ const trimOffsetX = trimLeft * microScaleX;
61
+ const trimOffsetY = trimBottom * microScaleY;
62
+ const rotatedTrimX = trimOffsetX * cos - trimOffsetY * sin;
63
+ const rotatedTrimY = trimOffsetX * sin + trimOffsetY * cos;
64
+ if (microAnchorMode === UIMicroAnchorMode.POSITION_ROTATION_SCALE) {
65
+ TEMP_POSITION.x = x + microX - rotatedAnchorX + rotatedTrimX;
66
+ TEMP_POSITION.y = y + microY - rotatedAnchorY + rotatedTrimY;
67
+ }
68
+ else {
69
+ const rawAnchorOffsetX = microAnchorX * width;
70
+ const rawAnchorOffsetY = microAnchorY * height;
71
+ TEMP_POSITION.x = x + rawAnchorOffsetX - rotatedAnchorX + microX + rotatedTrimX;
72
+ TEMP_POSITION.y = y + rawAnchorOffsetY - rotatedAnchorY + microY + rotatedTrimY;
73
+ }
74
+ TEMP_POSITION.z = zIndex;
75
+ TEMP_SCALE.x = trimmedWidth * microScaleX;
76
+ TEMP_SCALE.y = trimmedHeight * microScaleY;
77
+ TEMP_QUATERNION.setFromAxisAngle(Z_AXIS, microRotation);
78
+ TEMP_MATRIX.compose(TEMP_POSITION, TEMP_QUATERNION, TEMP_SCALE);
79
+ return TEMP_MATRIX;
80
+ }
81
+
82
+ export { computeTransformMatrix, computeTrimmedTransformMatrix };
@@ -0,0 +1,19 @@
1
+ import { InstancedBufferAttribute, InstancedBufferGeometry, ShaderMaterial } from "three";
2
+ import { UITransparencyMode } from "../../UITransparencyMode";
3
+ import type { GLProperty, UIProperty } from "../shared";
4
+ export declare const INSTANCED_PLANE_GEOMETRY: InstancedBufferGeometry;
5
+ export declare const CAPACITY_STEP = 4;
6
+ export declare const INITIAL_CAPACITY = 1;
7
+ export declare function writePropertyToArray(value: UIProperty, array: Float32Array, offset: number): void;
8
+ export declare function buildEmptyInstancedBufferAttribute(value: UIProperty, capacity: number): InstancedBufferAttribute;
9
+ export declare function buildMaterial(source: string, uniformProperties: Record<string, GLProperty>, varyingProperties: Record<string, GLProperty>, transparency: UITransparencyMode): ShaderMaterial;
10
+ export declare function reconstructValue(referenceValue: UIProperty, array: Float32Array, offset: number): UIProperty;
11
+ /**
12
+ * Shift buffer region within the same array.
13
+ * Uses copyWithin for efficient memory moves with correct overlap handling.
14
+ */
15
+ export declare function shiftBufferRegion(array: Float32Array, itemSize: number, fromIndex: number, count: number, delta: number): void;
16
+ /**
17
+ * Copy data between two different buffers.
18
+ */
19
+ export declare function copyBetweenBuffers(src: Float32Array, srcOffset: number, dst: Float32Array, dstOffset: number, length: number): void;
@@ -0,0 +1,168 @@
1
+ import { InstancedBufferGeometry, Uint16BufferAttribute, Float32BufferAttribute, Vector4, ShaderMaterial, InstancedBufferAttribute, Vector2, Vector3, Matrix3, Matrix4 } from 'three';
2
+ import { UIColor } from '../../color/UIColor.js';
3
+ import { UITransparencyMode } from '../../UITransparencyMode.js';
4
+ import { buildGenericPlaneFragmentShader, DEFAULT_ALPHA_TEST, resolveGLSLTypeInfo } from '../shared.js';
5
+
6
+ const INSTANCED_PLANE_GEOMETRY = (() => {
7
+ const geometry = new InstancedBufferGeometry();
8
+ const indices = new Uint16Array([0, 2, 1, 2, 3, 1]);
9
+ geometry.setIndex(new Uint16BufferAttribute(indices, 1));
10
+ const positions = new Float32Array([0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0]);
11
+ geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
12
+ const uvs = new Float32Array([0, 1, 1, 1, 0, 0, 1, 0]);
13
+ geometry.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
14
+ return geometry;
15
+ })();
16
+ const CAPACITY_STEP = 4;
17
+ const INITIAL_CAPACITY = 1;
18
+ const TEMP_COLOR_VECTOR = new Vector4();
19
+ function writePropertyToArray(value, array, offset) {
20
+ if (value instanceof UIColor) {
21
+ value.toGLSLColor(TEMP_COLOR_VECTOR);
22
+ array[offset] = TEMP_COLOR_VECTOR.x;
23
+ array[offset + 1] = TEMP_COLOR_VECTOR.y;
24
+ array[offset + 2] = TEMP_COLOR_VECTOR.z;
25
+ array[offset + 3] = TEMP_COLOR_VECTOR.w;
26
+ }
27
+ else if (value instanceof Vector2) {
28
+ array[offset] = value.x;
29
+ array[offset + 1] = value.y;
30
+ }
31
+ else if (value instanceof Vector3) {
32
+ array[offset] = value.x;
33
+ array[offset + 1] = value.y;
34
+ array[offset + 2] = value.z;
35
+ }
36
+ else if (value instanceof Vector4) {
37
+ array[offset] = value.x;
38
+ array[offset + 1] = value.y;
39
+ array[offset + 2] = value.z;
40
+ array[offset + 3] = value.w;
41
+ }
42
+ else if (value instanceof Matrix3 || value instanceof Matrix4) {
43
+ const elements = value.elements;
44
+ for (let j = 0; j < elements.length; j++) {
45
+ array[offset + j] = elements[j];
46
+ }
47
+ }
48
+ else if (typeof value === "number") {
49
+ array[offset] = value;
50
+ }
51
+ }
52
+ function buildEmptyInstancedBufferAttribute(value, capacity) {
53
+ const info = resolveGLSLTypeInfo(value);
54
+ if (!info.instantiable) {
55
+ throw new Error(`buildEmptyInstancedBufferAttribute.value: cannot create instanced attribute for non-instantiable type`);
56
+ }
57
+ return new InstancedBufferAttribute(new Float32Array(capacity * info.bufferSize), info.bufferSize);
58
+ }
59
+ function buildMaterial(source, uniformProperties, varyingProperties, transparency) {
60
+ const uniforms = {};
61
+ const uniformDeclarations = [];
62
+ const attributeDeclarations = [];
63
+ const varyingDeclarations = [];
64
+ const vertexAssignments = [];
65
+ for (const name in uniformProperties) {
66
+ const { value, glslTypeInfo } = uniformProperties[name];
67
+ uniforms[`p_${name}`] = {
68
+ value: value instanceof UIColor ? value.toGLSLColor() : value,
69
+ };
70
+ uniformDeclarations.push(`uniform ${glslTypeInfo.glslTypeName} p_${name};`);
71
+ }
72
+ for (const name in varyingProperties) {
73
+ const { glslTypeInfo } = varyingProperties[name];
74
+ attributeDeclarations.push(`attribute ${glslTypeInfo.glslTypeName} a_${name};`);
75
+ varyingDeclarations.push(`varying ${glslTypeInfo.glslTypeName} p_${name};`);
76
+ vertexAssignments.push(`p_${name} = a_${name};`);
77
+ }
78
+ const vertexShader = `
79
+ // User attributes
80
+ ${attributeDeclarations.join("\n")}
81
+
82
+ // Uniforms
83
+ ${uniformDeclarations.join("\n")}
84
+
85
+ // Builtin varyings
86
+ varying vec3 p_position;
87
+ varying vec2 p_uv;
88
+
89
+ // User varyings
90
+ ${varyingDeclarations.join("\n")}
91
+
92
+ void main() {
93
+ if (a_instanceVisibility < 0.5) {
94
+ gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
95
+ return;
96
+ }
97
+
98
+ ${vertexAssignments.join("\n")}
99
+
100
+ p_position = position;
101
+ p_uv = uv;
102
+
103
+ gl_Position = projectionMatrix * a_instanceTransform * vec4(position, 1.0);
104
+ }
105
+ `;
106
+ const fragmentShader = buildGenericPlaneFragmentShader(uniformDeclarations, varyingDeclarations, source);
107
+ return new ShaderMaterial({
108
+ uniforms,
109
+ vertexShader,
110
+ fragmentShader,
111
+ transparent: transparency === UITransparencyMode.BLEND,
112
+ alphaTest: transparency === UITransparencyMode.CLIP ? DEFAULT_ALPHA_TEST : 0.0,
113
+ alphaHash: transparency === UITransparencyMode.HASH,
114
+ depthWrite: transparency !== UITransparencyMode.BLEND,
115
+ depthTest: true,
116
+ });
117
+ }
118
+ function reconstructValue(referenceValue, array, offset) {
119
+ if (typeof referenceValue === "number") {
120
+ return array[offset];
121
+ }
122
+ if (referenceValue instanceof Vector2) {
123
+ return new Vector2(array[offset], array[offset + 1]);
124
+ }
125
+ if (referenceValue instanceof Vector3) {
126
+ return new Vector3(array[offset], array[offset + 1], array[offset + 2]);
127
+ }
128
+ if (referenceValue instanceof Vector4) {
129
+ return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
130
+ }
131
+ if (referenceValue instanceof UIColor) {
132
+ return new UIColor().setGLSLColor(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);
133
+ }
134
+ if (referenceValue instanceof Matrix3) {
135
+ const matrix = new Matrix3();
136
+ matrix.fromArray(array, offset);
137
+ return matrix;
138
+ }
139
+ if (referenceValue instanceof Matrix4) {
140
+ const matrix = new Matrix4();
141
+ matrix.fromArray(array, offset);
142
+ return matrix;
143
+ }
144
+ throw new Error(`reconstructValue.referenceValue: cannot reconstruct value for type`);
145
+ }
146
+ /**
147
+ * Shift buffer region within the same array.
148
+ * Uses copyWithin for efficient memory moves with correct overlap handling.
149
+ */
150
+ function shiftBufferRegion(array, itemSize, fromIndex, count, delta) {
151
+ if (count <= 0 || delta === 0) {
152
+ return;
153
+ }
154
+ const srcOffset = fromIndex * itemSize;
155
+ const dstOffset = (fromIndex + delta) * itemSize;
156
+ const length = count * itemSize;
157
+ array.copyWithin(dstOffset, srcOffset, srcOffset + length);
158
+ }
159
+ /**
160
+ * Copy data between two different buffers.
161
+ */
162
+ function copyBetweenBuffers(src, srcOffset, dst, dstOffset, length) {
163
+ for (let i = 0; i < length; i++) {
164
+ dst[dstOffset + i] = src[srcOffset + i];
165
+ }
166
+ }
167
+
168
+ export { CAPACITY_STEP, INITIAL_CAPACITY, INSTANCED_PLANE_GEOMETRY, buildEmptyInstancedBufferAttribute, buildMaterial, copyBetweenBuffers, reconstructValue, shiftBufferRegion, writePropertyToArray };
@@ -0,0 +1,349 @@
1
+ import { Mesh, 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
+
5
+ /**
6
+ * Instanced shader plane mesh for batched rendering.
7
+ *
8
+ * Operates on indices, not handlers. Registry manages handler→index mapping.
9
+ * Elements are ordered by zIndex (ascending) within the buffer.
10
+ *
11
+ * @internal
12
+ */
13
+ class UIGenericInstancedPlane extends Mesh {
14
+ constructor(source, properties, transparency, initialCapacity = INITIAL_CAPACITY) {
15
+ const uniformProperties = {};
16
+ const varyingProperties = {
17
+ instanceVisibility: {
18
+ value: 1,
19
+ glslTypeInfo: resolveGLSLTypeInfo("number"),
20
+ },
21
+ instanceTransform: {
22
+ value: new Matrix4().identity(),
23
+ glslTypeInfo: resolveGLSLTypeInfo("Matrix4"),
24
+ },
25
+ };
26
+ for (const name in properties) {
27
+ const descriptor = properties[name];
28
+ if (descriptor.glslTypeInfo.instantiable) {
29
+ varyingProperties[name] = descriptor;
30
+ }
31
+ else {
32
+ uniformProperties[name] = descriptor;
33
+ }
34
+ }
35
+ const instancedGeometry = INSTANCED_PLANE_GEOMETRY.clone();
36
+ const shaderMaterial = buildMaterial(source, uniformProperties, varyingProperties, transparency);
37
+ super(instancedGeometry, shaderMaterial);
38
+ this.frustumCulled = false;
39
+ this.matrixAutoUpdate = false;
40
+ this.matrixWorldAutoUpdate = false;
41
+ this.source = source;
42
+ this.transparency = transparency;
43
+ this._private_instancedGeometry = instancedGeometry;
44
+ this._private_shaderMaterial = shaderMaterial;
45
+ this._private_uniformProperties = uniformProperties;
46
+ this._private_varyingProperties = varyingProperties;
47
+ this._private_propertyBuffers = new Map();
48
+ this._private_capacity = Math.max(Math.ceil(initialCapacity / CAPACITY_STEP) * CAPACITY_STEP, CAPACITY_STEP);
49
+ this._private_instancesCountInternal = 0;
50
+ this._private_instancedGeometry.instanceCount = 0;
51
+ for (const name in this._private_varyingProperties) {
52
+ const { value } = this._private_varyingProperties[name];
53
+ const attribute = buildEmptyInstancedBufferAttribute(value, this._private_capacity);
54
+ this._private_instancedGeometry.setAttribute(`a_${name}`, attribute);
55
+ this._private_propertyBuffers.set(name, attribute);
56
+ }
57
+ for (const name in this._private_uniformProperties) {
58
+ const { value } = this._private_uniformProperties[name];
59
+ const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
60
+ uniform.value = value;
61
+ }
62
+ this._private_shaderMaterial.uniformsNeedUpdate = true;
63
+ }
64
+ /** Current number of active instances */
65
+ get instancesCount() {
66
+ return this._private_instancesCountInternal;
67
+ }
68
+ /**
69
+ * Insert instance at given index. Elements at [index..end) are shifted right.
70
+ */
71
+ insertAt(index, properties, transform, visibility) {
72
+ if (index < 0 || index > this._private_instancesCountInternal) {
73
+ throw new Error(`UIGenericInstancedPlane.insertAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
74
+ }
75
+ this._private_ensureCapacity(this._private_instancesCountInternal + 1);
76
+ if (index < this._private_instancesCountInternal) {
77
+ this._private_shiftBuffersRight(index, 1);
78
+ }
79
+ this._private_writeToBuffers(index, properties, transform, visibility);
80
+ this._private_instancesCountInternal++;
81
+ this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
82
+ }
83
+ /**
84
+ * Remove instance at given index. Elements at [index+1..end) are shifted left.
85
+ */
86
+ removeAt(index) {
87
+ if (index < 0 || index >= this._private_instancesCountInternal) {
88
+ throw new Error(`UIGenericInstancedPlane.removeAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
89
+ }
90
+ if (index < this._private_instancesCountInternal - 1) {
91
+ this._private_shiftBuffersLeft(index + 1, 1);
92
+ }
93
+ this._private_instancesCountInternal--;
94
+ this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
95
+ }
96
+ /** Update properties at given index */
97
+ setPropertiesAt(index, properties) {
98
+ if (index < 0 || index >= this._private_instancesCountInternal) {
99
+ throw new Error(`UIGenericInstancedPlane.setPropertiesAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
100
+ }
101
+ for (const name in properties) {
102
+ const { value, glslTypeInfo } = properties[name];
103
+ if (glslTypeInfo.instantiable) {
104
+ const attribute = this._private_resolveAttribute(name);
105
+ const offset = index * attribute.itemSize;
106
+ writePropertyToArray(value, attribute.array, offset);
107
+ attribute.needsUpdate = true;
108
+ }
109
+ else {
110
+ const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
111
+ uniform.value = value;
112
+ this._private_shaderMaterial.uniformsNeedUpdate = true;
113
+ }
114
+ }
115
+ }
116
+ /** Update transform at given index */
117
+ setTransformAt(index, transform) {
118
+ if (index < 0 || index >= this._private_instancesCountInternal) {
119
+ throw new Error(`UIGenericInstancedPlane.setTransformAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
120
+ }
121
+ const attribute = this._private_resolveAttribute("instanceTransform");
122
+ const array = attribute.array;
123
+ const offset = index * 16;
124
+ const elements = transform.elements;
125
+ for (let j = 0; j < 16; j++) {
126
+ array[offset + j] = elements[j];
127
+ }
128
+ attribute.needsUpdate = true;
129
+ }
130
+ /** Update visibility at given index */
131
+ setVisibilityAt(index, visible) {
132
+ if (index < 0 || index >= this._private_instancesCountInternal) {
133
+ throw new Error(`UIGenericInstancedPlane.setVisibilityAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
134
+ }
135
+ const attribute = this._private_resolveAttribute("instanceVisibility");
136
+ const array = attribute.array;
137
+ array[index] = visible ? 1 : 0;
138
+ attribute.needsUpdate = true;
139
+ }
140
+ /**
141
+ * Extract complete instance data at given index.
142
+ * Returns cloned data safe for external use.
143
+ */
144
+ extractDataAt(index) {
145
+ if (index < 0 || index >= this._private_instancesCountInternal) {
146
+ throw new Error(`UIGenericInstancedPlane.extractDataAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
147
+ }
148
+ const properties = {};
149
+ for (const name in this._private_uniformProperties) {
150
+ const prop = this._private_uniformProperties[name];
151
+ properties[name] = {
152
+ value: cloneProperty(prop.value),
153
+ glslTypeInfo: prop.glslTypeInfo,
154
+ };
155
+ }
156
+ for (const name in this._private_varyingProperties) {
157
+ if (name === "instanceVisibility" || name === "instanceTransform") {
158
+ continue;
159
+ }
160
+ const { value, glslTypeInfo } = this._private_varyingProperties[name];
161
+ const attribute = this._private_propertyBuffers.get(name);
162
+ const array = attribute.array;
163
+ const offset = index * attribute.itemSize;
164
+ properties[name] = {
165
+ value: reconstructValue(value, array, offset),
166
+ glslTypeInfo,
167
+ };
168
+ }
169
+ const transformAttribute = this._private_propertyBuffers.get("instanceTransform");
170
+ const transformArray = transformAttribute.array;
171
+ const transform = new Matrix4();
172
+ transform.fromArray(transformArray, index * 16);
173
+ const visibilityAttribute = this._private_propertyBuffers.get("instanceVisibility");
174
+ const visibilityArray = visibilityAttribute.array;
175
+ const visibility = visibilityArray[index] >= 0.5;
176
+ return {
177
+ source: this.source,
178
+ properties,
179
+ transform,
180
+ visibility,
181
+ transparency: this.transparency,
182
+ };
183
+ }
184
+ /** Get zIndex at given index (from transform buffer) */
185
+ getZIndexAt(index) {
186
+ if (index < 0 || index >= this._private_instancesCountInternal) {
187
+ throw new Error(`UIGenericInstancedPlane.getZIndexAt.index: out of bounds (index=${index}, count=${this._private_instancesCountInternal})`);
188
+ }
189
+ const attribute = this._private_propertyBuffers.get("instanceTransform");
190
+ return extractZIndexFromBuffer(attribute.array, index);
191
+ }
192
+ /**
193
+ * Merge another instanced plane into this one (append).
194
+ * Other plane becomes empty after merge.
195
+ */
196
+ merge(other) {
197
+ if (other._private_instancesCountInternal === 0) {
198
+ return;
199
+ }
200
+ this._private_ensureCapacity(this._private_instancesCountInternal + other._private_instancesCountInternal);
201
+ for (const [name, thisAttribute] of this._private_propertyBuffers) {
202
+ const otherAttribute = other._private_propertyBuffers.get(name);
203
+ if (!otherAttribute) {
204
+ throw new Error(`UIGenericInstancedPlane.merge: missing attribute ${name} in source`);
205
+ }
206
+ const itemSize = thisAttribute.itemSize;
207
+ const srcArray = otherAttribute.array;
208
+ const dstArray = thisAttribute.array;
209
+ copyBetweenBuffers(srcArray, 0, dstArray, this._private_instancesCountInternal * itemSize, other._private_instancesCountInternal * itemSize);
210
+ thisAttribute.needsUpdate = true;
211
+ }
212
+ this._private_instancesCountInternal += other._private_instancesCountInternal;
213
+ this._private_instancedGeometry.instanceCount = this._private_instancesCountInternal;
214
+ other._private_instancesCountInternal = 0;
215
+ other._private_instancedGeometry.instanceCount = 0;
216
+ }
217
+ /**
218
+ * Split this plane at given index.
219
+ * Returns new plane with elements [atIndex..end).
220
+ * This plane keeps elements [0..atIndex).
221
+ */
222
+ split(atIndex) {
223
+ if (atIndex <= 0 || atIndex >= this._private_instancesCountInternal) {
224
+ throw new Error(`UIGenericInstancedPlane.split.atIndex: must be in range (0, count) (atIndex=${atIndex}, count=${this._private_instancesCountInternal})`);
225
+ }
226
+ const tailCount = this._private_instancesCountInternal - atIndex;
227
+ const newPlane = new UIGenericInstancedPlane(this.source, cloneGLProperties({
228
+ ...this._private_uniformProperties,
229
+ ...this._private_varyingProperties,
230
+ }), this.transparency, tailCount);
231
+ for (const [name, thisAttribute] of this._private_propertyBuffers) {
232
+ const newAttribute = newPlane._private_propertyBuffers.get(name);
233
+ if (!newAttribute) {
234
+ throw new Error(`UIGenericInstancedPlane.split: missing attribute ${name} in new plane`);
235
+ }
236
+ const itemSize = thisAttribute.itemSize;
237
+ const srcArray = thisAttribute.array;
238
+ const dstArray = newAttribute.array;
239
+ copyBetweenBuffers(srcArray, atIndex * itemSize, dstArray, 0, tailCount * itemSize);
240
+ newAttribute.needsUpdate = true;
241
+ }
242
+ newPlane._private_instancesCountInternal = tailCount;
243
+ newPlane._private_instancedGeometry.instanceCount = tailCount;
244
+ this._private_instancesCountInternal = atIndex;
245
+ this._private_instancedGeometry.instanceCount = atIndex;
246
+ return newPlane;
247
+ }
248
+ /**
249
+ * Check if this plane can accept elements with given parameters.
250
+ */
251
+ isCompatibleWith(source, properties, transparency) {
252
+ if (this.source !== source) {
253
+ return false;
254
+ }
255
+ if (this.transparency !== transparency) {
256
+ return false;
257
+ }
258
+ const result = arePropertiesPartiallyCompatible({ ...this._private_uniformProperties, ...this._private_varyingProperties }, properties);
259
+ return result;
260
+ }
261
+ /** Get all properties configuration (for compatibility checks) */
262
+ getProperties() {
263
+ return { ...this._private_uniformProperties, ...this._private_varyingProperties };
264
+ }
265
+ /** Remove all instances, reset to empty state */
266
+ clearInstances() {
267
+ this._private_instancesCountInternal = 0;
268
+ this._private_instancedGeometry.instanceCount = 0;
269
+ }
270
+ /** Dispose geometry, material, and clear buffers */
271
+ destroy() {
272
+ this._private_instancedGeometry.dispose();
273
+ this._private_shaderMaterial.dispose();
274
+ this._private_propertyBuffers.clear();
275
+ }
276
+ _private_ensureCapacity(requiredCapacity) {
277
+ if (requiredCapacity <= this._private_capacity) {
278
+ return;
279
+ }
280
+ const newCapacity = Math.ceil(requiredCapacity / CAPACITY_STEP) * CAPACITY_STEP;
281
+ for (const [name, oldAttribute] of this._private_propertyBuffers) {
282
+ const itemSize = oldAttribute.itemSize;
283
+ const newArray = new Float32Array(newCapacity * itemSize);
284
+ newArray.set(oldAttribute.array);
285
+ const newAttribute = new InstancedBufferAttribute(newArray, itemSize);
286
+ this._private_instancedGeometry.setAttribute(`a_${name}`, newAttribute);
287
+ this._private_propertyBuffers.set(name, newAttribute);
288
+ }
289
+ this._private_capacity = newCapacity;
290
+ }
291
+ _private_shiftBuffersRight(fromIndex, delta) {
292
+ const elementsToMove = this._private_instancesCountInternal - fromIndex;
293
+ if (elementsToMove <= 0) {
294
+ return;
295
+ }
296
+ for (const attribute of this._private_propertyBuffers.values()) {
297
+ shiftBufferRegion(attribute.array, attribute.itemSize, fromIndex, elementsToMove, delta);
298
+ attribute.needsUpdate = true;
299
+ }
300
+ }
301
+ _private_shiftBuffersLeft(fromIndex, delta) {
302
+ const elementsToMove = this._private_instancesCountInternal - fromIndex;
303
+ if (elementsToMove <= 0) {
304
+ return;
305
+ }
306
+ for (const attribute of this._private_propertyBuffers.values()) {
307
+ shiftBufferRegion(attribute.array, attribute.itemSize, fromIndex, elementsToMove, -delta);
308
+ attribute.needsUpdate = true;
309
+ }
310
+ }
311
+ _private_writeToBuffers(index, properties, transform, visibility) {
312
+ const visibilityAttribute = this._private_resolveAttribute("instanceVisibility");
313
+ visibilityAttribute.array[index] = visibility ? 1 : 0;
314
+ visibilityAttribute.needsUpdate = true;
315
+ const transformAttribute = this._private_resolveAttribute("instanceTransform");
316
+ const transformArray = transformAttribute.array;
317
+ const transformOffset = index * 16;
318
+ const elements = transform.elements;
319
+ for (let j = 0; j < 16; j++) {
320
+ transformArray[transformOffset + j] = elements[j];
321
+ }
322
+ transformAttribute.needsUpdate = true;
323
+ for (const name in properties) {
324
+ const { value, glslTypeInfo } = properties[name];
325
+ if (glslTypeInfo.instantiable) {
326
+ const attribute = this._private_propertyBuffers.get(name);
327
+ if (attribute) {
328
+ const offset = index * attribute.itemSize;
329
+ writePropertyToArray(value, attribute.array, offset);
330
+ attribute.needsUpdate = true;
331
+ }
332
+ }
333
+ else {
334
+ const uniform = resolvePropertyUniform(name, this._private_shaderMaterial);
335
+ uniform.value = value;
336
+ this._private_shaderMaterial.uniformsNeedUpdate = true;
337
+ }
338
+ }
339
+ }
340
+ _private_resolveAttribute(name) {
341
+ const attribute = this._private_propertyBuffers.get(name);
342
+ if (attribute === undefined) {
343
+ throw new Error(`UIGenericInstancedPlane.resolveAttribute.name: unknown attribute "${name}"`);
344
+ }
345
+ return attribute;
346
+ }
347
+ }
348
+
349
+ export { UIGenericInstancedPlane };
@@ -2,17 +2,15 @@ import type { Matrix4 } from "three";
2
2
  import type { UITransparencyMode } from "../../UITransparencyMode";
3
3
  import type { GLProperty } from "../shared";
4
4
  import type { UIGenericInstancedPlane } from "../UIGenericInstancedPlane/UIGenericInstancedPlane";
5
-
6
5
  export interface PlaneDescriptor {
7
- mesh: UIGenericInstancedPlane;
8
- instanceIndex: number;
6
+ mesh: UIGenericInstancedPlane;
7
+ instanceIndex: number;
9
8
  }
10
-
11
9
  export interface PlaneState {
12
- source: string;
13
- properties: Record<string, GLProperty>;
14
- transform: Matrix4;
15
- visibility: boolean;
16
- transparency: UITransparencyMode;
17
- zIndex: number;
10
+ source: string;
11
+ properties: Record<string, GLProperty>;
12
+ transform: Matrix4;
13
+ visibility: boolean;
14
+ transparency: UITransparencyMode;
15
+ zIndex: number;
18
16
  }