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.
- package/README.md +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
- package/dist/core/constraints/UIConstraint.d.ts +22 -2
- package/dist/core/constraints/UIConstraint.js +26 -3
- package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
- package/dist/core/constraints/UICustomConstraint.js +15 -15
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
- package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
- package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
- package/dist/core/elements/UIDummy/UIDummy.js +59 -42
- package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
- package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
- package/dist/core/elements/UIElement/UIElement.d.ts +25 -17
- package/dist/core/elements/UIElement/UIElement.js +76 -69
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
- package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
- package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
- package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
- package/dist/core/elements/UIImage/UIImage.js +21 -24
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
- package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
- package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -8
- package/dist/core/elements/UIProgress/UIProgress.js +60 -58
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
- package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
- package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
- package/dist/core/elements/UIScene/UIScene.js +68 -69
- package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
- package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
- package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
- package/dist/core/elements/UIText/UIText.Internal.js +5 -7
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
- package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
- package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
- package/dist/core/elements/UIText/UIText.d.ts +28 -14
- package/dist/core/elements/UIText/UIText.js +181 -141
- package/dist/core/index.d.ts +55 -54
- package/dist/core/index.js +53 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
- package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
- package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
- package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
- package/dist/core/layers/UILayer/UILayer.js +125 -62
- package/dist/core/miscellaneous/UIBlendMode.js +1 -3
- package/dist/core/miscellaneous/UIExpression.js +16 -19
- package/dist/core/miscellaneous/UIMode.js +3 -5
- package/dist/core/miscellaneous/UIOrientation.js +2 -4
- package/dist/core/miscellaneous/UIPriority.js +5 -8
- package/dist/core/miscellaneous/UIRelation.js +5 -8
- package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
- package/dist/core/miscellaneous/area/UIArea.js +1 -3
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
- package/dist/core/miscellaneous/asserts.d.ts +20 -1
- package/dist/core/miscellaneous/asserts.js +71 -19
- package/dist/core/miscellaneous/canvas.js +13 -7
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
- package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.js +202 -205
- package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
- package/dist/core/miscellaneous/computeTransform.js +4 -7
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
- package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +14 -17
- package/dist/core/miscellaneous/math.js +3 -5
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
- package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
- package/dist/core/miscellaneous/shared.d.ts +1 -1
- package/dist/core/miscellaneous/shared.js +4 -7
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
- package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
- package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +3 -3
- package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
- package/dist/core/miscellaneous/webglCapabilities.js +3 -4
- package/dist/core/shaders/UIImage.d.ts +9 -0
- package/dist/core/shaders/UIImage.js +14 -0
- package/dist/core/shaders/UINineSlice.d.ts +11 -0
- package/dist/core/shaders/UINineSlice.js +57 -0
- package/dist/core/shaders/UIProgress.d.ts +14 -0
- package/dist/core/shaders/UIProgress.js +21 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +27 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
- package/dist/debug/UIAspectDebug.d.ts +3 -3
- package/dist/debug/UIAspectDebug.js +64 -68
- package/dist/debug/UIConstraintDebug.d.ts +1 -1
- package/dist/debug/UIConstraintDebug.js +1 -0
- package/dist/debug/UIHeightDebug.d.ts +3 -3
- package/dist/debug/UIHeightDebug.js +63 -67
- package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
- package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
- package/dist/debug/UILayerDebug.d.ts +1 -1
- package/dist/debug/UILayerDebug.js +55 -64
- package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIVerticalDistanceDebug.js +76 -81
- package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
- package/dist/debug/UIWidthDebug.d.ts +3 -3
- package/dist/debug/UIWidthDebug.js +63 -67
- package/dist/debug/index.d.ts +8 -8
- package/dist/debug/index.js +8 -8
- package/dist/debug/miscellaneous.js +8 -11
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
- package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
- package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
- package/dist/particles/elements/UIEmitter.Internal.js +6 -9
- package/dist/particles/elements/UIEmitter.d.ts +17 -11
- package/dist/particles/elements/UIEmitter.js +100 -88
- package/dist/particles/index.d.ts +20 -18
- package/dist/particles/index.js +19 -18
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
- package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
- package/dist/particles/miscellaneous/miscellaneous.js +26 -27
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
- package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
- package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
- package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingTexture.js +7 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
- package/dist/particles/spawnModules/UISpawnModule.js +1 -3
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
- package/package.json +13 -17
- package/dist/_virtual/2d.js +0 -3
- package/dist/_virtual/3d.js +0 -3
- package/dist/_virtual/4d.js +0 -3
- package/dist/_virtual/mod.js +0 -5
- package/dist/_virtual/mod2.js +0 -3
- package/dist/core/shaders/UIImage.glsl.js +0 -3
- package/dist/core/shaders/UINineSlice.glsl.js +0 -3
- package/dist/core/shaders/UIProgress.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
- package/dist/index.js +0 -52
- package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
- package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
- package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
- package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
- package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
- package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
- package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
- package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
- package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InstancedBufferAttribute, Mesh } from "three";
|
|
2
|
-
import type { GLProperty, GLTypeInfo } from "../../core/miscellaneous/generic-plane/shared";
|
|
2
|
+
import type { GLProperty, GLTypeInfo } from "../../core/miscellaneous/generic-plane/shared.js";
|
|
3
3
|
export declare class UIInstancedParticle extends Mesh {
|
|
4
4
|
private readonly capacityStep;
|
|
5
5
|
readonly propertyBuffers: Record<string, InstancedBufferAttribute>;
|
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolvePropertyUniform } from
|
|
3
|
-
import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(sources, uniforms, varyings, expectedCapacity, _private_capacityStep) {
|
|
1
|
+
import { InstancedBufferAttribute, Mesh, StreamDrawUsage } from "three";
|
|
2
|
+
import { resolvePropertyUniform } from "../../core/miscellaneous/generic-plane/shared.js";
|
|
3
|
+
import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { buildParticleMaterial, INSTANCED_PARTICLE_GEOMETRY } from "./UIInstancedParticle.Internal.js";
|
|
5
|
+
export class UIInstancedParticle extends Mesh {
|
|
6
|
+
constructor(sources, uniforms, varyings, expectedCapacity, capacityStep) {
|
|
8
7
|
const instancedGeometry = INSTANCED_PARTICLE_GEOMETRY.clone();
|
|
9
8
|
const shaderMaterial = buildParticleMaterial(sources, uniforms, varyings);
|
|
10
9
|
super(instancedGeometry, shaderMaterial);
|
|
11
|
-
this.
|
|
10
|
+
this.capacityStep = capacityStep;
|
|
12
11
|
this.propertyBuffers = {};
|
|
13
12
|
this.frustumCulled = false;
|
|
14
13
|
this.matrixAutoUpdate = false;
|
|
15
14
|
this.matrixWorldAutoUpdate = false;
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
15
|
+
this.instancedGeometry = instancedGeometry;
|
|
16
|
+
this.instancedGeometry.instanceCount = 0;
|
|
17
|
+
this.shaderMaterial = shaderMaterial;
|
|
18
|
+
this.capacity = Math.max(Math.ceil(expectedCapacity / this.capacityStep) * this.capacityStep, this.capacityStep);
|
|
20
19
|
for (const name in varyings) {
|
|
21
20
|
const { bufferSize } = varyings[name];
|
|
22
|
-
const attribute = new InstancedBufferAttribute(new Float32Array(this.
|
|
21
|
+
const attribute = new InstancedBufferAttribute(new Float32Array(this.capacity * bufferSize), bufferSize);
|
|
23
22
|
attribute.setUsage(StreamDrawUsage);
|
|
24
|
-
this.
|
|
23
|
+
this.instancedGeometry.setAttribute(`a_${name}`, attribute);
|
|
25
24
|
this.propertyBuffers[name] = attribute;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
get instanceCount() {
|
|
29
|
-
return this.
|
|
28
|
+
return this.instancedGeometry.instanceCount;
|
|
30
29
|
}
|
|
31
30
|
createInstances(count) {
|
|
32
|
-
const currentInstanceCount = this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
31
|
+
const currentInstanceCount = this.instancedGeometry.instanceCount;
|
|
32
|
+
this.ensureCapacity(currentInstanceCount + count);
|
|
33
|
+
this.instancedGeometry.instanceCount += count;
|
|
35
34
|
}
|
|
36
35
|
setOrigin(x, y) {
|
|
37
|
-
const uniform = resolvePropertyUniform("origin", this.
|
|
36
|
+
const uniform = resolvePropertyUniform("origin", this.shaderMaterial);
|
|
38
37
|
uniform.value.set(x, y);
|
|
39
38
|
}
|
|
40
39
|
removeDeadParticles() {
|
|
@@ -43,7 +42,7 @@ class UIInstancedParticle extends Mesh {
|
|
|
43
42
|
return;
|
|
44
43
|
}
|
|
45
44
|
const { array: builtinArray, itemSize: builtinItemSize } = builtinBuffer;
|
|
46
|
-
const { instanceCount } = this.
|
|
45
|
+
const { instanceCount } = this.instancedGeometry;
|
|
47
46
|
let writeIndex = 0;
|
|
48
47
|
for (let readIndex = 0; readIndex < instanceCount; readIndex++) {
|
|
49
48
|
const offset = readIndex * builtinItemSize;
|
|
@@ -61,33 +60,31 @@ class UIInstancedParticle extends Mesh {
|
|
|
61
60
|
writeIndex++;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
this.
|
|
63
|
+
this.instancedGeometry.instanceCount = writeIndex;
|
|
65
64
|
}
|
|
66
65
|
drop() {
|
|
67
|
-
this.
|
|
66
|
+
this.instancedGeometry.instanceCount = 0;
|
|
68
67
|
}
|
|
69
68
|
destroy() {
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
69
|
+
this.instancedGeometry.dispose();
|
|
70
|
+
this.shaderMaterial.dispose();
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
if (requiredCapacity <= this.
|
|
72
|
+
ensureCapacity(requiredCapacity) {
|
|
73
|
+
if (requiredCapacity <= this.capacity) {
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
|
-
const newCapacity = Math.ceil(requiredCapacity / this.
|
|
76
|
+
const newCapacity = Math.ceil(requiredCapacity / this.capacityStep) * this.capacityStep;
|
|
78
77
|
for (const name in this.propertyBuffers) {
|
|
79
78
|
const { itemSize, array, usage } = this.propertyBuffers[name];
|
|
80
79
|
const newArray = new Float32Array(newCapacity * itemSize);
|
|
81
80
|
newArray.set(array);
|
|
82
81
|
const newAttribute = new InstancedBufferAttribute(newArray, itemSize);
|
|
83
82
|
newAttribute.setUsage(usage);
|
|
84
|
-
this.
|
|
83
|
+
this.instancedGeometry.setAttribute(`a_${name}`, newAttribute);
|
|
85
84
|
this.propertyBuffers[name] = newAttribute;
|
|
86
85
|
}
|
|
87
|
-
this.
|
|
86
|
+
this.capacity = newCapacity;
|
|
88
87
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- old three.js compatibility fix
|
|
89
|
-
this.
|
|
88
|
+
this.instancedGeometry._maxInstanceCount = newCapacity;
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
export { UIInstancedParticle };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Vector2Tuple } from "three";
|
|
2
2
|
import { DataTexture } from "three";
|
|
3
|
-
import type { UIColor } from "../../core";
|
|
4
|
-
import type { Vector2Like } from "../../core/miscellaneous/math";
|
|
5
|
-
import type { UITextureConfig } from "../../core/miscellaneous/texture/UITextureView.Internal";
|
|
3
|
+
import type { UIColor } from "../../core/index.js";
|
|
4
|
+
import type { Vector2Like } from "../../core/miscellaneous/math.js";
|
|
5
|
+
import type { UITextureConfig } from "../../core/miscellaneous/texture/UITextureView.Internal.js";
|
|
6
6
|
export interface UIRange {
|
|
7
7
|
min: number;
|
|
8
8
|
max: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function resolveUIRangeConfig(config) {
|
|
1
|
+
import { makeNoise2D } from "fast-simplex-noise";
|
|
2
|
+
import { ClampToEdgeWrapping, DataTexture, LinearFilter, RGBAFormat, SRGBColorSpace, Texture, UnsignedByteType, UVMapping, } from "three";
|
|
3
|
+
import { getTextureImageSize } from "../../core/miscellaneous/texture/UITextureView.Internal.js";
|
|
4
|
+
export function resolveUIRangeConfig(config) {
|
|
5
5
|
if (typeof config === "number") {
|
|
6
6
|
return { min: config, max: config };
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ function resolveUIRangeConfig(config) {
|
|
|
10
10
|
}
|
|
11
11
|
return config;
|
|
12
12
|
}
|
|
13
|
-
function resolveUIVector2Config(config) {
|
|
13
|
+
export function resolveUIVector2Config(config) {
|
|
14
14
|
if (typeof config === "number") {
|
|
15
15
|
return { x: config, y: config };
|
|
16
16
|
}
|
|
@@ -19,17 +19,18 @@ function resolveUIVector2Config(config) {
|
|
|
19
19
|
}
|
|
20
20
|
return config;
|
|
21
21
|
}
|
|
22
|
-
function resolveAspect(config) {
|
|
22
|
+
export function resolveAspect(config) {
|
|
23
23
|
if (typeof config === "number") {
|
|
24
24
|
return config;
|
|
25
25
|
}
|
|
26
26
|
if (config instanceof Texture) {
|
|
27
|
-
|
|
27
|
+
const { w, h } = getTextureImageSize(config);
|
|
28
|
+
return w / h;
|
|
28
29
|
}
|
|
29
30
|
return config.sourceSize.w / config.sourceSize.h;
|
|
30
31
|
}
|
|
31
|
-
const generateNoise2D =
|
|
32
|
-
function buildGradientTexture(colors) {
|
|
32
|
+
export const generateNoise2D = makeNoise2D();
|
|
33
|
+
export function buildGradientTexture(colors) {
|
|
33
34
|
const width = colors.length;
|
|
34
35
|
const height = 1;
|
|
35
36
|
const data = new Uint8Array(width * height * 4);
|
|
@@ -45,21 +46,19 @@ function buildGradientTexture(colors) {
|
|
|
45
46
|
texture.needsUpdate = true;
|
|
46
47
|
return texture;
|
|
47
48
|
}
|
|
48
|
-
const BUILTIN_OFFSET_POSITION_X = 0;
|
|
49
|
-
const BUILTIN_OFFSET_POSITION_Y = 1;
|
|
50
|
-
const BUILTIN_OFFSET_VELOCITY_X = 2;
|
|
51
|
-
const BUILTIN_OFFSET_VELOCITY_Y = 3;
|
|
52
|
-
const BUILTIN_OFFSET_SCALE_X = 4;
|
|
53
|
-
const BUILTIN_OFFSET_SCALE_Y = 5;
|
|
54
|
-
const BUILTIN_OFFSET_ROTATION = 6;
|
|
55
|
-
const BUILTIN_OFFSET_TORQUE = 7;
|
|
56
|
-
const BUILTIN_OFFSET_LIFETIME = 8;
|
|
57
|
-
const BUILTIN_OFFSET_AGE = 9;
|
|
58
|
-
const BUILTIN_OFFSET_RANDOM_A = 10;
|
|
59
|
-
const BUILTIN_OFFSET_RANDOM_B = 11;
|
|
60
|
-
const BUILTIN_OFFSET_RANDOM_C = 12;
|
|
61
|
-
const BUILTIN_OFFSET_RANDOM_D = 13;
|
|
62
|
-
const BUILTIN_OFFSET_RANDOM_E = 14;
|
|
63
|
-
const BUILTIN_OFFSET_RANDOM_F = 15;
|
|
64
|
-
|
|
65
|
-
export { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_RANDOM_F, BUILTIN_OFFSET_ROTATION, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y, BUILTIN_OFFSET_TORQUE, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, buildGradientTexture, generateNoise2D, resolveAspect, resolveUIRangeConfig, resolveUIVector2Config };
|
|
49
|
+
export const BUILTIN_OFFSET_POSITION_X = 0;
|
|
50
|
+
export const BUILTIN_OFFSET_POSITION_Y = 1;
|
|
51
|
+
export const BUILTIN_OFFSET_VELOCITY_X = 2;
|
|
52
|
+
export const BUILTIN_OFFSET_VELOCITY_Y = 3;
|
|
53
|
+
export const BUILTIN_OFFSET_SCALE_X = 4;
|
|
54
|
+
export const BUILTIN_OFFSET_SCALE_Y = 5;
|
|
55
|
+
export const BUILTIN_OFFSET_ROTATION = 6;
|
|
56
|
+
export const BUILTIN_OFFSET_TORQUE = 7;
|
|
57
|
+
export const BUILTIN_OFFSET_LIFETIME = 8;
|
|
58
|
+
export const BUILTIN_OFFSET_AGE = 9;
|
|
59
|
+
export const BUILTIN_OFFSET_RANDOM_A = 10;
|
|
60
|
+
export const BUILTIN_OFFSET_RANDOM_B = 11;
|
|
61
|
+
export const BUILTIN_OFFSET_RANDOM_C = 12;
|
|
62
|
+
export const BUILTIN_OFFSET_RANDOM_D = 13;
|
|
63
|
+
export const BUILTIN_OFFSET_RANDOM_E = 14;
|
|
64
|
+
export const BUILTIN_OFFSET_RANDOM_F = 15;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIColor } from "../../core";
|
|
2
|
-
import { UIRenderingModule } from "./UIRenderingModule";
|
|
1
|
+
import type { UIColor } from "../../core/index.js";
|
|
2
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Colors particles based on lifetime progression.
|
|
5
5
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { buildGradientTexture } from
|
|
2
|
-
import source from
|
|
3
|
-
import { UIRenderingModule } from
|
|
4
|
-
|
|
1
|
+
import { buildGradientTexture } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import source from "../shaders/UIRenderingColorOverLife.js";
|
|
3
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
5
4
|
/**
|
|
6
5
|
* Colors particles based on lifetime progression.
|
|
7
6
|
*
|
|
8
7
|
* Interpolates through color gradient as particles age from birth to death.
|
|
9
8
|
*/
|
|
10
|
-
class UIRenderingColorOverLife extends UIRenderingModule {
|
|
9
|
+
export class UIRenderingColorOverLife extends UIRenderingModule {
|
|
11
10
|
/**
|
|
12
11
|
* @param colors - Color gradient stops from birth to death
|
|
13
12
|
*/
|
|
@@ -20,7 +19,7 @@ class UIRenderingColorOverLife extends UIRenderingModule {
|
|
|
20
19
|
/** @internal */
|
|
21
20
|
this.source = source;
|
|
22
21
|
if (colors.length === 0) {
|
|
23
|
-
throw new Error("UIRenderingColorOverLife: colors array cannot be empty");
|
|
22
|
+
throw new Error("UIRenderingColorOverLife.constructor.colors: colors array cannot be empty");
|
|
24
23
|
}
|
|
25
24
|
this.requiredUniforms = { colorOverLifeTexture: buildGradientTexture(colors) };
|
|
26
25
|
}
|
|
@@ -28,5 +27,3 @@ class UIRenderingColorOverLife extends UIRenderingModule {
|
|
|
28
27
|
this.requiredUniforms.colorOverLifeTexture.dispose();
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
export { UIRenderingColorOverLife };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIColor } from "../../core";
|
|
2
|
-
import { UIRenderingModule } from "./UIRenderingModule";
|
|
1
|
+
import type { UIColor } from "../../core/index.js";
|
|
2
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Colors particles based on velocity magnitude.
|
|
5
5
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { buildGradientTexture } from
|
|
2
|
-
import source from
|
|
3
|
-
import { UIRenderingModule } from
|
|
4
|
-
|
|
1
|
+
import { buildGradientTexture } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import source from "../shaders/UIRenderingColorOverVelocity.js";
|
|
3
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
5
4
|
/**
|
|
6
5
|
* Colors particles based on velocity magnitude.
|
|
7
6
|
*
|
|
8
7
|
* Maps velocity from 0 to maxVelocity across the color gradient.
|
|
9
8
|
*/
|
|
10
|
-
class UIRenderingColorOverVelocity extends UIRenderingModule {
|
|
9
|
+
export class UIRenderingColorOverVelocity extends UIRenderingModule {
|
|
11
10
|
/**
|
|
12
11
|
* @param colors - Color gradient from slow to fast
|
|
13
12
|
* @param maxVelocity - Velocity mapped to final color
|
|
@@ -21,10 +20,10 @@ class UIRenderingColorOverVelocity extends UIRenderingModule {
|
|
|
21
20
|
/** @internal */
|
|
22
21
|
this.source = source;
|
|
23
22
|
if (colors.length === 0) {
|
|
24
|
-
throw new Error("UIRenderingColorOverVelocity: colors array cannot be empty");
|
|
23
|
+
throw new Error("UIRenderingColorOverVelocity.constructor.colors: colors array cannot be empty");
|
|
25
24
|
}
|
|
26
25
|
if (maxVelocity <= 0) {
|
|
27
|
-
throw new Error(
|
|
26
|
+
throw new Error(`UIRenderingColorOverVelocity.constructor.maxVelocity: value must be greater than 0, got ${maxVelocity}`);
|
|
28
27
|
}
|
|
29
28
|
this.source = source.replace("COLOR_OVER_VELOCITY_MAX", `COLOR_OVER_VELOCITY_MAX ${maxVelocity.toFixed(2)}`);
|
|
30
29
|
this.requiredUniforms = { colorOverVelocityTexture: buildGradientTexture(colors) };
|
|
@@ -33,5 +32,3 @@ class UIRenderingColorOverVelocity extends UIRenderingModule {
|
|
|
33
32
|
this.requiredUniforms.colorOverVelocityTexture.dispose();
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
export { UIRenderingColorOverVelocity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UITextureConfig } from "../../core/miscellaneous/texture/UITextureView.Internal";
|
|
2
|
-
import { UIRenderingModule } from "./UIRenderingModule";
|
|
1
|
+
import type { UITextureConfig } from "../../core/miscellaneous/texture/UITextureView.Internal.js";
|
|
2
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Renders particles with a texture.
|
|
5
5
|
*
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { UITextureView } from
|
|
2
|
-
import source from
|
|
3
|
-
import { UIRenderingModule } from
|
|
4
|
-
|
|
1
|
+
import { UITextureView } from "../../core/miscellaneous/texture/UITextureView.js";
|
|
2
|
+
import source from "../shaders/UIRenderingTexture.js";
|
|
3
|
+
import { UIRenderingModule } from "./UIRenderingModule.js";
|
|
5
4
|
function buildMultiTextureShader(count) {
|
|
6
5
|
const branches = [];
|
|
7
6
|
for (let i = 0; i < count; i++) {
|
|
@@ -32,7 +31,7 @@ function buildMultiTextureShader(count) {
|
|
|
32
31
|
* When an array is provided, each particle picks one texture randomly using PARTICLE_RANDOM_A.
|
|
33
32
|
* All configs in the array must share the same underlying Three.js Texture object.
|
|
34
33
|
*/
|
|
35
|
-
class UIRenderingTexture extends UIRenderingModule {
|
|
34
|
+
export class UIRenderingTexture extends UIRenderingModule {
|
|
36
35
|
/**
|
|
37
36
|
* @param config - Single texture config or array of configs (same atlas required for arrays)
|
|
38
37
|
*/
|
|
@@ -66,5 +65,3 @@ class UIRenderingTexture extends UIRenderingModule {
|
|
|
66
65
|
this.source = buildMultiTextureShader(views.length);
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
export { UIRenderingTexture };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The empty COLOR_OVER_VELOCITY_MAX macro is a placeholder: UIRenderingColorOverVelocity
|
|
3
|
+
* rewrites the first occurrence of that token into "COLOR_OVER_VELOCITY_MAX <value>",
|
|
4
|
+
* which turns this line into a real definition. The newline after it is load-bearing -
|
|
5
|
+
* a "#define" body runs to end of line, so collapsing it would swallow draw() into
|
|
6
|
+
* the macro and leave the shader without an entry point.
|
|
7
|
+
*/
|
|
8
|
+
declare const source: string;
|
|
9
|
+
export default source;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The empty COLOR_OVER_VELOCITY_MAX macro is a placeholder: UIRenderingColorOverVelocity
|
|
3
|
+
* rewrites the first occurrence of that token into "COLOR_OVER_VELOCITY_MAX <value>",
|
|
4
|
+
* which turns this line into a real definition. The newline after it is load-bearing -
|
|
5
|
+
* a "#define" body runs to end of line, so collapsing it would swallow draw() into
|
|
6
|
+
* the macro and leave the shader without an entry point.
|
|
7
|
+
*/
|
|
8
|
+
const source = `
|
|
9
|
+
#define COLOR_OVER_VELOCITY_MAX
|
|
10
|
+
|
|
11
|
+
vec4 draw() {
|
|
12
|
+
float t = clamp(length(vec2(PARTICLE_VELOCITY_X, PARTICLE_VELOCITY_Y)) / COLOR_OVER_VELOCITY_MAX, 0.0, 1.0);
|
|
13
|
+
return srgbTexture2D(p_colorOverVelocityTexture, vec2(t, 0.5));
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export default source;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Vector2Like } from "../../core/miscellaneous/math";
|
|
2
|
-
import type { UIVector2Config } from "../miscellaneous/miscellaneous";
|
|
3
|
-
import { UISpawnModule } from "./UISpawnModule";
|
|
1
|
+
import type { Vector2Like } from "../../core/miscellaneous/math.js";
|
|
2
|
+
import type { UIVector2Config } from "../miscellaneous/miscellaneous.js";
|
|
3
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
4
4
|
/**
|
|
5
5
|
* Sets particle spawn position offset.
|
|
6
6
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { assertValidNumber } from
|
|
2
|
-
import {
|
|
3
|
-
import { UISpawnModule } from
|
|
4
|
-
|
|
1
|
+
import { assertValidNumber } from "../../core/miscellaneous/asserts.js";
|
|
2
|
+
import { BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, resolveUIVector2Config, } from "../miscellaneous/miscellaneous.js";
|
|
3
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
5
4
|
/**
|
|
6
5
|
* Sets particle spawn position offset.
|
|
7
6
|
*
|
|
8
7
|
* All particles spawned with this module start at the specified position.
|
|
9
8
|
*/
|
|
10
|
-
class UISpawnOffset extends UISpawnModule {
|
|
9
|
+
export class UISpawnOffset extends UISpawnModule {
|
|
11
10
|
/**
|
|
12
11
|
* @param offset - Initial particle position offset
|
|
13
12
|
*/
|
|
@@ -15,25 +14,25 @@ class UISpawnOffset extends UISpawnModule {
|
|
|
15
14
|
super();
|
|
16
15
|
/** @internal */
|
|
17
16
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
18
|
-
this.
|
|
19
|
-
assertValidNumber(this.
|
|
20
|
-
assertValidNumber(this.
|
|
17
|
+
this.offsetInternal = resolveUIVector2Config(offset);
|
|
18
|
+
assertValidNumber(this.offsetInternal.x, "UISpawnOffset.constructor.offset.x");
|
|
19
|
+
assertValidNumber(this.offsetInternal.y, "UISpawnOffset.constructor.offset.y");
|
|
21
20
|
}
|
|
22
21
|
/** Particle position offset */
|
|
23
22
|
get offset() {
|
|
24
|
-
return this.
|
|
23
|
+
return this.offsetInternal;
|
|
25
24
|
}
|
|
26
25
|
/** Particle position offset */
|
|
27
26
|
set offset(value) {
|
|
28
|
-
this.
|
|
29
|
-
assertValidNumber(this.
|
|
30
|
-
assertValidNumber(this.
|
|
27
|
+
this.offsetInternal = resolveUIVector2Config(value);
|
|
28
|
+
assertValidNumber(this.offsetInternal.x, "UISpawnOffset.offset.x");
|
|
29
|
+
assertValidNumber(this.offsetInternal.y, "UISpawnOffset.offset.y");
|
|
31
30
|
}
|
|
32
31
|
/** @internal */
|
|
33
32
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
34
33
|
const { builtin } = properties;
|
|
35
34
|
const { array, itemSize } = builtin;
|
|
36
|
-
const { x: offsetX, y: offsetY } = this.
|
|
35
|
+
const { x: offsetX, y: offsetY } = this.offsetInternal;
|
|
37
36
|
for (let i = instanceBegin; i < instanceEnd; i++) {
|
|
38
37
|
const itemOffset = i * itemSize;
|
|
39
38
|
array[itemOffset + BUILTIN_OFFSET_POSITION_X] = offsetX;
|
|
@@ -42,5 +41,3 @@ class UISpawnOffset extends UISpawnModule {
|
|
|
42
41
|
builtin.needsUpdate = true;
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
export { UISpawnOffset };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UISpawnModule } from "./UISpawnModule";
|
|
1
|
+
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Assigns random lifetime to particles.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidPositiveNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UISpawnModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidPositiveNumber } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Assigns random lifetime to particles.
|
|
8
7
|
*
|
|
9
8
|
* Lifetime is chosen uniformly from the specified range. Age is set to 0.
|
|
10
9
|
*/
|
|
11
|
-
class UISpawnRandomLifetime extends UISpawnModule {
|
|
10
|
+
export class UISpawnRandomLifetime extends UISpawnModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param lifetime - Lifetime range in seconds. Accepts number, tuple, or range object
|
|
14
13
|
*/
|
|
@@ -16,25 +15,25 @@ class UISpawnRandomLifetime extends UISpawnModule {
|
|
|
16
15
|
super();
|
|
17
16
|
/** @internal */
|
|
18
17
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
-
this.
|
|
20
|
-
assertValidPositiveNumber(this.
|
|
21
|
-
assertValidPositiveNumber(this.
|
|
18
|
+
this.lifetimeInternal = resolveUIRangeConfig(lifetime);
|
|
19
|
+
assertValidPositiveNumber(this.lifetimeInternal.min, "UISpawnRandomLifetime.constructor.lifetime.min");
|
|
20
|
+
assertValidPositiveNumber(this.lifetimeInternal.max, "UISpawnRandomLifetime.constructor.lifetime.max");
|
|
22
21
|
}
|
|
23
22
|
/** Lifetime range in seconds */
|
|
24
23
|
get lifetime() {
|
|
25
|
-
return this.
|
|
24
|
+
return this.lifetimeInternal;
|
|
26
25
|
}
|
|
27
26
|
/** Lifetime range in seconds */
|
|
28
27
|
set lifetime(value) {
|
|
29
|
-
this.
|
|
30
|
-
assertValidPositiveNumber(this.
|
|
31
|
-
assertValidPositiveNumber(this.
|
|
28
|
+
this.lifetimeInternal = resolveUIRangeConfig(value);
|
|
29
|
+
assertValidPositiveNumber(this.lifetimeInternal.min, "UISpawnRandomLifetime.lifetime.min");
|
|
30
|
+
assertValidPositiveNumber(this.lifetimeInternal.max, "UISpawnRandomLifetime.lifetime.max");
|
|
32
31
|
}
|
|
33
32
|
/** @internal */
|
|
34
33
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
35
34
|
const { builtin } = properties;
|
|
36
35
|
const { array, itemSize } = builtin;
|
|
37
|
-
const { min: lifetimeMin, max: lifetimeMax } = this.
|
|
36
|
+
const { min: lifetimeMin, max: lifetimeMax } = this.lifetimeInternal;
|
|
38
37
|
for (let i = instanceBegin; i < instanceEnd; i++) {
|
|
39
38
|
const itemOffset = i * itemSize;
|
|
40
39
|
array[itemOffset + BUILTIN_OFFSET_LIFETIME] = MathUtils.randFloat(lifetimeMin, lifetimeMax);
|
|
@@ -43,5 +42,3 @@ class UISpawnRandomLifetime extends UISpawnModule {
|
|
|
43
42
|
builtin.needsUpdate = true;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
export { UISpawnRandomLifetime };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UISpawnModule } from "./UISpawnModule";
|
|
1
|
+
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Assigns random rotation to particles.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UISpawnModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNumber } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_ROTATION, resolveUIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UISpawnModule } from "./UISpawnModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Assigns random rotation to particles.
|
|
8
7
|
*
|
|
9
8
|
* Initial rotation is chosen uniformly from the specified range.
|
|
10
9
|
*/
|
|
11
|
-
class UISpawnRandomRotation extends UISpawnModule {
|
|
10
|
+
export class UISpawnRandomRotation extends UISpawnModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param rotation - Rotation range in radians. Accepts number, tuple, or range object
|
|
14
13
|
*/
|
|
@@ -16,30 +15,28 @@ class UISpawnRandomRotation extends UISpawnModule {
|
|
|
16
15
|
super();
|
|
17
16
|
/** @internal */
|
|
18
17
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
-
this.
|
|
20
|
-
assertValidNumber(this.
|
|
21
|
-
assertValidNumber(this.
|
|
18
|
+
this.rotationInternal = resolveUIRangeConfig(rotation);
|
|
19
|
+
assertValidNumber(this.rotationInternal.min, "UISpawnRandomRotation.constructor.rotation.min");
|
|
20
|
+
assertValidNumber(this.rotationInternal.max, "UISpawnRandomRotation.constructor.rotation.max");
|
|
22
21
|
}
|
|
23
22
|
/** Rotation range in radians */
|
|
24
23
|
get rotation() {
|
|
25
|
-
return this.
|
|
24
|
+
return this.rotationInternal;
|
|
26
25
|
}
|
|
27
26
|
/** Rotation range in radians */
|
|
28
27
|
set rotation(value) {
|
|
29
|
-
this.
|
|
30
|
-
assertValidNumber(this.
|
|
31
|
-
assertValidNumber(this.
|
|
28
|
+
this.rotationInternal = resolveUIRangeConfig(value);
|
|
29
|
+
assertValidNumber(this.rotationInternal.min, "UISpawnRandomRotation.rotation.min");
|
|
30
|
+
assertValidNumber(this.rotationInternal.max, "UISpawnRandomRotation.rotation.max");
|
|
32
31
|
}
|
|
33
32
|
/** @internal */
|
|
34
33
|
spawn(properties, instanceBegin, instanceEnd) {
|
|
35
34
|
const { builtin } = properties;
|
|
36
35
|
const { array, itemSize } = builtin;
|
|
37
|
-
const { min: rotationMin, max: rotationMax } = this.
|
|
36
|
+
const { min: rotationMin, max: rotationMax } = this.rotationInternal;
|
|
38
37
|
for (let i = instanceBegin; i < instanceEnd; i++) {
|
|
39
38
|
array[i * itemSize + BUILTIN_OFFSET_ROTATION] = MathUtils.randFloat(rotationMin, rotationMax);
|
|
40
39
|
}
|
|
41
40
|
builtin.needsUpdate = true;
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
export { UISpawnRandomRotation };
|