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,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UIBehaviorModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNumber } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_RANDOM_C, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, resolveUIRangeConfig, resolveUIVector2Config, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Applies gravity attraction toward a point.
|
|
8
7
|
*
|
|
9
8
|
* Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
|
|
10
9
|
*/
|
|
11
|
-
class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
10
|
+
export class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param center - Gravity center position
|
|
14
13
|
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
@@ -19,58 +18,58 @@ class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
|
19
18
|
super();
|
|
20
19
|
/** @internal */
|
|
21
20
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
22
|
-
this.
|
|
23
|
-
assertValidNumber(this.
|
|
24
|
-
assertValidNumber(this.
|
|
25
|
-
this.
|
|
26
|
-
assertValidNumber(this.
|
|
27
|
-
assertValidNumber(this.
|
|
28
|
-
this.
|
|
29
|
-
assertValidNumber(this.
|
|
30
|
-
assertValidNumber(this.
|
|
31
|
-
this.
|
|
32
|
-
assertValidNumber(this.
|
|
33
|
-
assertValidNumber(this.
|
|
21
|
+
this.centerInternal = resolveUIVector2Config(center);
|
|
22
|
+
assertValidNumber(this.centerInternal.x, "UIBehaviorPointGravity.constructor.center.x");
|
|
23
|
+
assertValidNumber(this.centerInternal.y, "UIBehaviorPointGravity.constructor.center.y");
|
|
24
|
+
this.strengthInternal = resolveUIRangeConfig(strength);
|
|
25
|
+
assertValidNumber(this.strengthInternal.min, "UIBehaviorPointGravity.constructor.strength.min");
|
|
26
|
+
assertValidNumber(this.strengthInternal.max, "UIBehaviorPointGravity.constructor.strength.max");
|
|
27
|
+
this.exponentInternal = resolveUIRangeConfig(exponent);
|
|
28
|
+
assertValidNumber(this.exponentInternal.min, "UIBehaviorPointGravity.constructor.exponent.min");
|
|
29
|
+
assertValidNumber(this.exponentInternal.max, "UIBehaviorPointGravity.constructor.exponent.max");
|
|
30
|
+
this.thresholdInternal = resolveUIRangeConfig(threshold);
|
|
31
|
+
assertValidNumber(this.thresholdInternal.min, "UIBehaviorPointGravity.constructor.threshold.min");
|
|
32
|
+
assertValidNumber(this.thresholdInternal.max, "UIBehaviorPointGravity.constructor.threshold.max");
|
|
34
33
|
}
|
|
35
34
|
/** Gravity center position */
|
|
36
35
|
get center() {
|
|
37
|
-
return this.
|
|
36
|
+
return this.centerInternal;
|
|
38
37
|
}
|
|
39
38
|
/** Force multiplier range */
|
|
40
39
|
get strength() {
|
|
41
|
-
return this.
|
|
40
|
+
return this.strengthInternal;
|
|
42
41
|
}
|
|
43
42
|
/** Distance power exponent range */
|
|
44
43
|
get exponent() {
|
|
45
|
-
return this.
|
|
44
|
+
return this.exponentInternal;
|
|
46
45
|
}
|
|
47
46
|
/** Minimum distance range */
|
|
48
47
|
get threshold() {
|
|
49
|
-
return this.
|
|
48
|
+
return this.thresholdInternal;
|
|
50
49
|
}
|
|
51
50
|
/** Gravity center position */
|
|
52
51
|
set center(value) {
|
|
53
|
-
this.
|
|
54
|
-
assertValidNumber(this.
|
|
55
|
-
assertValidNumber(this.
|
|
52
|
+
this.centerInternal = resolveUIVector2Config(value);
|
|
53
|
+
assertValidNumber(this.centerInternal.x, "UIBehaviorPointGravity.center.x");
|
|
54
|
+
assertValidNumber(this.centerInternal.y, "UIBehaviorPointGravity.center.y");
|
|
56
55
|
}
|
|
57
56
|
/** Force multiplier range */
|
|
58
57
|
set strength(value) {
|
|
59
|
-
this.
|
|
60
|
-
assertValidNumber(this.
|
|
61
|
-
assertValidNumber(this.
|
|
58
|
+
this.strengthInternal = resolveUIRangeConfig(value);
|
|
59
|
+
assertValidNumber(this.strengthInternal.min, "UIBehaviorPointGravity.strength.min");
|
|
60
|
+
assertValidNumber(this.strengthInternal.max, "UIBehaviorPointGravity.strength.max");
|
|
62
61
|
}
|
|
63
62
|
/** Distance power exponent range */
|
|
64
63
|
set exponent(value) {
|
|
65
|
-
this.
|
|
66
|
-
assertValidNumber(this.
|
|
67
|
-
assertValidNumber(this.
|
|
64
|
+
this.exponentInternal = resolveUIRangeConfig(value);
|
|
65
|
+
assertValidNumber(this.exponentInternal.min, "UIBehaviorPointGravity.exponent.min");
|
|
66
|
+
assertValidNumber(this.exponentInternal.max, "UIBehaviorPointGravity.exponent.max");
|
|
68
67
|
}
|
|
69
68
|
/** Minimum distance range */
|
|
70
69
|
set threshold(value) {
|
|
71
|
-
this.
|
|
72
|
-
assertValidNumber(this.
|
|
73
|
-
assertValidNumber(this.
|
|
70
|
+
this.thresholdInternal = resolveUIRangeConfig(value);
|
|
71
|
+
assertValidNumber(this.thresholdInternal.min, "UIBehaviorPointGravity.threshold.min");
|
|
72
|
+
assertValidNumber(this.thresholdInternal.max, "UIBehaviorPointGravity.threshold.max");
|
|
74
73
|
}
|
|
75
74
|
/** @internal */
|
|
76
75
|
update(properties, instanceCount, deltaTime) {
|
|
@@ -78,8 +77,8 @@ class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
|
78
77
|
const { array, itemSize } = builtin;
|
|
79
78
|
for (let i = 0; i < instanceCount; i++) {
|
|
80
79
|
const itemOffset = i * itemSize;
|
|
81
|
-
const dx = this.
|
|
82
|
-
const dy = this.
|
|
80
|
+
const dx = this.centerInternal.x - array[itemOffset + BUILTIN_OFFSET_POSITION_X];
|
|
81
|
+
const dy = this.centerInternal.y - array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
|
|
83
82
|
const thresholdT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
84
83
|
const threshold = MathUtils.lerp(this.threshold.min, this.threshold.max, thresholdT);
|
|
85
84
|
const thresholdSquared = threshold * threshold;
|
|
@@ -88,9 +87,9 @@ class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
|
88
87
|
continue;
|
|
89
88
|
}
|
|
90
89
|
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
91
|
-
const strength = MathUtils.lerp(this.
|
|
90
|
+
const strength = MathUtils.lerp(this.strengthInternal.min, this.strengthInternal.max, strengthT);
|
|
92
91
|
const exponentT = array[itemOffset + BUILTIN_OFFSET_RANDOM_C];
|
|
93
|
-
const exponent = MathUtils.lerp(this.
|
|
92
|
+
const exponent = MathUtils.lerp(this.exponentInternal.min, this.exponentInternal.max, exponentT);
|
|
94
93
|
const distance = Math.sqrt(distanceSquared);
|
|
95
94
|
const forceMagnitude = strength / Math.pow(distance, exponent);
|
|
96
95
|
const directionX = dx / distance;
|
|
@@ -103,5 +102,3 @@ class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
|
103
102
|
builtin.needsUpdate = true;
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
export { UIBehaviorPointGravity };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { UIAspectConfig, UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
|
+
/** Axis whose scale oscillates */
|
|
4
|
+
export type UIScaleOscillationAxis = "x" | "y";
|
|
5
|
+
/**
|
|
6
|
+
* Oscillates particle scale along one axis, like a paper piece turning its edge to the viewer.
|
|
7
|
+
*
|
|
8
|
+
* The oscillating axis is derived from the other one every frame, so the module composes with
|
|
9
|
+
* any scale source: put it after `UISpawnRandomScale` or `UIBehaviorScaleOverLife` in the sequence.
|
|
10
|
+
* Each particle gets its own frequency and phase. With depth 1 the scale passes through zero and
|
|
11
|
+
* turns negative, which shows the mirrored back side.
|
|
12
|
+
*/
|
|
13
|
+
export declare class UIBehaviorScaleOscillation extends UIBehaviorModule<{
|
|
14
|
+
builtin: "Matrix4";
|
|
15
|
+
}> {
|
|
16
|
+
private readonly axisInternal;
|
|
17
|
+
private frequencyInternal;
|
|
18
|
+
private depthInternal;
|
|
19
|
+
private aspectInternal;
|
|
20
|
+
/**
|
|
21
|
+
* @param axis - Axis whose scale oscillates
|
|
22
|
+
* @param frequency - Oscillations per second. Accepts number, tuple, or range object
|
|
23
|
+
* @param depth - 0 keeps the scale, 0.5 swings it between full and zero, 1 between full and mirrored
|
|
24
|
+
* @param aspect - Width/height ratio, the same as given to the scale module. Accepts number or texture
|
|
25
|
+
*/
|
|
26
|
+
constructor(axis: UIScaleOscillationAxis, frequency: UIRangeConfig, depth?: number, aspect?: UIAspectConfig);
|
|
27
|
+
/** Axis whose scale oscillates */
|
|
28
|
+
get axis(): UIScaleOscillationAxis;
|
|
29
|
+
/** Oscillations per second */
|
|
30
|
+
get frequency(): UIRange;
|
|
31
|
+
/** Swing of the scale: 0 none, 0.5 down to zero, 1 down to mirrored */
|
|
32
|
+
get depth(): number;
|
|
33
|
+
/** Width/height aspect ratio */
|
|
34
|
+
get aspect(): number;
|
|
35
|
+
/** Oscillations per second */
|
|
36
|
+
set frequency(value: UIRangeConfig);
|
|
37
|
+
/** Swing of the scale: 0 none, 0.5 down to zero, 1 down to mirrored */
|
|
38
|
+
set depth(value: number);
|
|
39
|
+
/** Width/height aspect ratio */
|
|
40
|
+
set aspect(value: UIAspectConfig);
|
|
41
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber, assertValidPositiveNumber, } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_RANDOM_F, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y, resolveAspect, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
5
|
+
/**
|
|
6
|
+
* Oscillates particle scale along one axis, like a paper piece turning its edge to the viewer.
|
|
7
|
+
*
|
|
8
|
+
* The oscillating axis is derived from the other one every frame, so the module composes with
|
|
9
|
+
* any scale source: put it after `UISpawnRandomScale` or `UIBehaviorScaleOverLife` in the sequence.
|
|
10
|
+
* Each particle gets its own frequency and phase. With depth 1 the scale passes through zero and
|
|
11
|
+
* turns negative, which shows the mirrored back side.
|
|
12
|
+
*/
|
|
13
|
+
export class UIBehaviorScaleOscillation extends UIBehaviorModule {
|
|
14
|
+
/**
|
|
15
|
+
* @param axis - Axis whose scale oscillates
|
|
16
|
+
* @param frequency - Oscillations per second. Accepts number, tuple, or range object
|
|
17
|
+
* @param depth - 0 keeps the scale, 0.5 swings it between full and zero, 1 between full and mirrored
|
|
18
|
+
* @param aspect - Width/height ratio, the same as given to the scale module. Accepts number or texture
|
|
19
|
+
*/
|
|
20
|
+
constructor(axis, frequency, depth = 1, aspect = 1) {
|
|
21
|
+
super();
|
|
22
|
+
/** @internal */
|
|
23
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
24
|
+
this.axisInternal = axis;
|
|
25
|
+
this.frequencyInternal = resolveUIRangeConfig(frequency);
|
|
26
|
+
assertValidNonNegativeNumber(this.frequencyInternal.min, "UIBehaviorScaleOscillation.constructor.frequency.min");
|
|
27
|
+
assertValidNonNegativeNumber(this.frequencyInternal.max, "UIBehaviorScaleOscillation.constructor.frequency.max");
|
|
28
|
+
this.depthInternal = depth;
|
|
29
|
+
assertValidNonNegativeNumber(this.depthInternal, "UIBehaviorScaleOscillation.constructor.depth");
|
|
30
|
+
this.aspectInternal = resolveAspect(aspect);
|
|
31
|
+
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOscillation.constructor.aspect");
|
|
32
|
+
}
|
|
33
|
+
/** Axis whose scale oscillates */
|
|
34
|
+
get axis() {
|
|
35
|
+
return this.axisInternal;
|
|
36
|
+
}
|
|
37
|
+
/** Oscillations per second */
|
|
38
|
+
get frequency() {
|
|
39
|
+
return this.frequencyInternal;
|
|
40
|
+
}
|
|
41
|
+
/** Swing of the scale: 0 none, 0.5 down to zero, 1 down to mirrored */
|
|
42
|
+
get depth() {
|
|
43
|
+
return this.depthInternal;
|
|
44
|
+
}
|
|
45
|
+
/** Width/height aspect ratio */
|
|
46
|
+
get aspect() {
|
|
47
|
+
return this.aspectInternal;
|
|
48
|
+
}
|
|
49
|
+
/** Oscillations per second */
|
|
50
|
+
set frequency(value) {
|
|
51
|
+
this.frequencyInternal = resolveUIRangeConfig(value);
|
|
52
|
+
assertValidNonNegativeNumber(this.frequencyInternal.min, "UIBehaviorScaleOscillation.frequency.min");
|
|
53
|
+
assertValidNonNegativeNumber(this.frequencyInternal.max, "UIBehaviorScaleOscillation.frequency.max");
|
|
54
|
+
}
|
|
55
|
+
/** Swing of the scale: 0 none, 0.5 down to zero, 1 down to mirrored */
|
|
56
|
+
set depth(value) {
|
|
57
|
+
assertValidNonNegativeNumber(value, "UIBehaviorScaleOscillation.depth");
|
|
58
|
+
this.depthInternal = value;
|
|
59
|
+
}
|
|
60
|
+
/** Width/height aspect ratio */
|
|
61
|
+
set aspect(value) {
|
|
62
|
+
this.aspectInternal = resolveAspect(value);
|
|
63
|
+
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOscillation.aspect");
|
|
64
|
+
}
|
|
65
|
+
/** @internal */
|
|
66
|
+
update(properties, instanceCount) {
|
|
67
|
+
const { builtin } = properties;
|
|
68
|
+
const { array, itemSize } = builtin;
|
|
69
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
70
|
+
const itemOffset = i * itemSize;
|
|
71
|
+
const frequencyT = array[itemOffset + BUILTIN_OFFSET_RANDOM_E];
|
|
72
|
+
const frequency = MathUtils.lerp(this.frequencyInternal.min, this.frequencyInternal.max, frequencyT);
|
|
73
|
+
const phase = array[itemOffset + BUILTIN_OFFSET_RANDOM_F] * Math.PI * 2;
|
|
74
|
+
const angle = array[itemOffset + BUILTIN_OFFSET_AGE] * frequency * Math.PI * 2 + phase;
|
|
75
|
+
const factor = 1 - this.depthInternal * (1 - Math.cos(angle));
|
|
76
|
+
if (this.axisInternal === "x") {
|
|
77
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_X] =
|
|
78
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] * this.aspectInternal * factor;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] =
|
|
82
|
+
(array[itemOffset + BUILTIN_OFFSET_SCALE_X] / this.aspectInternal) * factor;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
builtin.needsUpdate = true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIAspectConfig, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
1
|
+
import type { UIAspectConfig, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Animates particle scale over lifetime.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNonNegativeNumber, assertValidPositiveNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UIBehaviorModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber, assertValidPositiveNumber, } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y, resolveAspect, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Animates particle scale over lifetime.
|
|
8
7
|
*
|
|
9
8
|
* Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
|
|
10
9
|
*/
|
|
11
|
-
class UIBehaviorScaleOverLife extends UIBehaviorModule {
|
|
10
|
+
export class UIBehaviorScaleOverLife extends UIBehaviorModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param scales - Scale anchor points. Each accepts number, tuple, or range object
|
|
14
13
|
* @param aspect - Width/height ratio. Accepts number or texture
|
|
@@ -17,27 +16,27 @@ class UIBehaviorScaleOverLife extends UIBehaviorModule {
|
|
|
17
16
|
super();
|
|
18
17
|
/** @internal */
|
|
19
18
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
|
-
this.
|
|
19
|
+
this.scales = [];
|
|
21
20
|
if (scales.length < 2) {
|
|
22
|
-
throw new Error(
|
|
21
|
+
throw new Error(`UIBehaviorScaleOverLife.constructor.scales: at least two scale anchors are required, got ${scales.length}`);
|
|
23
22
|
}
|
|
24
23
|
for (let i = 0; i < scales.length; i++) {
|
|
25
24
|
const scale = resolveUIRangeConfig(scales[i]);
|
|
26
25
|
assertValidNonNegativeNumber(scale.min, `UIBehaviorScaleOverLife.constructor.scales[${i}].min`);
|
|
27
26
|
assertValidNonNegativeNumber(scale.max, `UIBehaviorScaleOverLife.constructor.scales[${i}].max`);
|
|
28
|
-
this.
|
|
27
|
+
this.scales.push(scale);
|
|
29
28
|
}
|
|
30
|
-
this.
|
|
31
|
-
assertValidPositiveNumber(this.
|
|
29
|
+
this.aspectInternal = resolveAspect(aspect);
|
|
30
|
+
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOverLife.constructor.aspect");
|
|
32
31
|
}
|
|
33
32
|
/** Width/height aspect ratio */
|
|
34
33
|
get aspect() {
|
|
35
|
-
return this.
|
|
34
|
+
return this.aspectInternal;
|
|
36
35
|
}
|
|
37
36
|
/** Width/height aspect ratio */
|
|
38
37
|
set aspect(value) {
|
|
39
|
-
this.
|
|
40
|
-
assertValidPositiveNumber(this.
|
|
38
|
+
this.aspectInternal = resolveAspect(value);
|
|
39
|
+
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOverLife.aspect");
|
|
41
40
|
}
|
|
42
41
|
/** @internal */
|
|
43
42
|
update(properties, instanceCount) {
|
|
@@ -46,20 +45,18 @@ class UIBehaviorScaleOverLife extends UIBehaviorModule {
|
|
|
46
45
|
for (let i = 0; i < instanceCount; i++) {
|
|
47
46
|
const itemOffset = i * itemSize;
|
|
48
47
|
const lifeT = Math.min(array[itemOffset + BUILTIN_OFFSET_AGE] / array[itemOffset + BUILTIN_OFFSET_LIFETIME], 1);
|
|
49
|
-
const segment = (this.
|
|
48
|
+
const segment = (this.scales.length - 1) * lifeT;
|
|
50
49
|
const index = Math.floor(segment);
|
|
51
50
|
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_D];
|
|
52
51
|
const localT = segment - index;
|
|
53
|
-
const scaleRange0 = this.
|
|
54
|
-
const scaleRange1 = this.
|
|
52
|
+
const scaleRange0 = this.scales[index];
|
|
53
|
+
const scaleRange1 = this.scales[index + 1];
|
|
55
54
|
const scale0 = MathUtils.lerp(scaleRange0.min, scaleRange0.max, scaleT);
|
|
56
55
|
const scale1 = MathUtils.lerp(scaleRange1.min, scaleRange1.max, scaleT);
|
|
57
56
|
const interpolatedScale = scale0 + (scale1 - scale0) * localT;
|
|
58
|
-
array[itemOffset + BUILTIN_OFFSET_SCALE_X] = interpolatedScale * this.
|
|
57
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_X] = interpolatedScale * this.aspectInternal;
|
|
59
58
|
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] = interpolatedScale;
|
|
60
59
|
}
|
|
61
60
|
builtin.needsUpdate = true;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
export { UIBehaviorScaleOverLife };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
1
|
+
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Reduces particle angular velocity over time.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNonNegativeNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UIBehaviorModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_TORQUE, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Reduces particle angular velocity over time.
|
|
8
7
|
*
|
|
9
8
|
* Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
|
|
10
9
|
*/
|
|
11
|
-
class UIBehaviorTorqueDamping extends UIBehaviorModule {
|
|
10
|
+
export class UIBehaviorTorqueDamping extends UIBehaviorModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
13
|
*/
|
|
@@ -16,19 +15,19 @@ class UIBehaviorTorqueDamping extends UIBehaviorModule {
|
|
|
16
15
|
super();
|
|
17
16
|
/** @internal */
|
|
18
17
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
-
this.
|
|
20
|
-
assertValidNonNegativeNumber(this.
|
|
21
|
-
assertValidNonNegativeNumber(this.
|
|
18
|
+
this.dampingInternal = resolveUIRangeConfig(damping);
|
|
19
|
+
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorTorqueDamping.constructor.damping.min`);
|
|
20
|
+
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorTorqueDamping.constructor.damping.max`);
|
|
22
21
|
}
|
|
23
22
|
/** Damping coefficient range (0-1) */
|
|
24
23
|
get damping() {
|
|
25
|
-
return this.
|
|
24
|
+
return this.dampingInternal;
|
|
26
25
|
}
|
|
27
26
|
/** Damping coefficient range (0-1) */
|
|
28
27
|
set damping(value) {
|
|
29
|
-
this.
|
|
30
|
-
assertValidNonNegativeNumber(this.
|
|
31
|
-
assertValidNonNegativeNumber(this.
|
|
28
|
+
this.dampingInternal = resolveUIRangeConfig(value);
|
|
29
|
+
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorTorqueDamping.damping.min`);
|
|
30
|
+
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorTorqueDamping.damping.max`);
|
|
32
31
|
}
|
|
33
32
|
/** @internal */
|
|
34
33
|
update(properties, instanceCount, deltaTime) {
|
|
@@ -37,11 +36,9 @@ class UIBehaviorTorqueDamping extends UIBehaviorModule {
|
|
|
37
36
|
for (let i = 0; i < instanceCount; i++) {
|
|
38
37
|
const itemOffset = i * itemSize;
|
|
39
38
|
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_E];
|
|
40
|
-
const dampingFactor = Math.pow(1 - MathUtils.lerp(this.
|
|
39
|
+
const dampingFactor = Math.pow(1 - MathUtils.lerp(this.dampingInternal.min, this.dampingInternal.max, dampingT), deltaTime);
|
|
41
40
|
array[itemOffset + BUILTIN_OFFSET_TORQUE] *= dampingFactor;
|
|
42
41
|
}
|
|
43
42
|
builtin.needsUpdate = true;
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
|
-
export { UIBehaviorTorqueDamping };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
1
|
+
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Applies noise-based angular acceleration to particles.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidPositiveNumber,
|
|
3
|
-
import {
|
|
4
|
-
import { UIBehaviorModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber, assertValidPositiveNumber, } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_RANDOM_F, BUILTIN_OFFSET_TORQUE, generateNoise2D, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Applies noise-based angular acceleration to particles.
|
|
8
7
|
*
|
|
9
8
|
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
10
9
|
*/
|
|
11
|
-
class UIBehaviorTorqueNoise extends UIBehaviorModule {
|
|
10
|
+
export class UIBehaviorTorqueNoise extends UIBehaviorModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
14
13
|
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
@@ -17,32 +16,32 @@ class UIBehaviorTorqueNoise extends UIBehaviorModule {
|
|
|
17
16
|
super();
|
|
18
17
|
/** @internal */
|
|
19
18
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
|
-
this.
|
|
21
|
-
assertValidPositiveNumber(this.
|
|
22
|
-
assertValidPositiveNumber(this.
|
|
23
|
-
this.
|
|
24
|
-
assertValidNonNegativeNumber(this.
|
|
25
|
-
assertValidNonNegativeNumber(this.
|
|
19
|
+
this.scaleInternal = resolveUIRangeConfig(scale);
|
|
20
|
+
assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorTorqueNoise.constructor.scale.min`);
|
|
21
|
+
assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorTorqueNoise.constructor.scale.max`);
|
|
22
|
+
this.strengthInternal = resolveUIRangeConfig(strength);
|
|
23
|
+
assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorTorqueNoise.constructor.strength.min`);
|
|
24
|
+
assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorTorqueNoise.constructor.strength.max`);
|
|
26
25
|
}
|
|
27
26
|
/** Noise frequency range */
|
|
28
27
|
get scale() {
|
|
29
|
-
return this.
|
|
28
|
+
return this.scaleInternal;
|
|
30
29
|
}
|
|
31
30
|
/** Force multiplier range */
|
|
32
31
|
get strength() {
|
|
33
|
-
return this.
|
|
32
|
+
return this.strengthInternal;
|
|
34
33
|
}
|
|
35
34
|
/** Noise frequency range */
|
|
36
35
|
set scale(value) {
|
|
37
|
-
this.
|
|
38
|
-
assertValidPositiveNumber(this.
|
|
39
|
-
assertValidPositiveNumber(this.
|
|
36
|
+
this.scaleInternal = resolveUIRangeConfig(value);
|
|
37
|
+
assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorTorqueNoise.scale.min`);
|
|
38
|
+
assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorTorqueNoise.scale.max`);
|
|
40
39
|
}
|
|
41
40
|
/** Force multiplier range */
|
|
42
41
|
set strength(value) {
|
|
43
|
-
this.
|
|
44
|
-
assertValidNonNegativeNumber(this.
|
|
45
|
-
assertValidNonNegativeNumber(this.
|
|
42
|
+
this.strengthInternal = resolveUIRangeConfig(value);
|
|
43
|
+
assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorTorqueNoise.strength.min`);
|
|
44
|
+
assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorTorqueNoise.strength.max`);
|
|
46
45
|
}
|
|
47
46
|
/** @internal */
|
|
48
47
|
update(properties, instanceCount, deltaTime) {
|
|
@@ -51,14 +50,12 @@ class UIBehaviorTorqueNoise extends UIBehaviorModule {
|
|
|
51
50
|
for (let i = 0; i < instanceCount; i++) {
|
|
52
51
|
const itemOffset = i * itemSize;
|
|
53
52
|
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_F];
|
|
54
|
-
const scale = MathUtils.lerp(this.
|
|
53
|
+
const scale = MathUtils.lerp(this.scaleInternal.min, this.scaleInternal.max, scaleT);
|
|
55
54
|
const noise = generateNoise2D(array[itemOffset + BUILTIN_OFFSET_POSITION_X] * scale, array[itemOffset + BUILTIN_OFFSET_POSITION_Y] * scale);
|
|
56
55
|
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
57
|
-
const strength = MathUtils.lerp(this.
|
|
56
|
+
const strength = MathUtils.lerp(this.strengthInternal.min, this.strengthInternal.max, strengthT);
|
|
58
57
|
array[itemOffset + BUILTIN_OFFSET_TORQUE] += noise * strength * deltaTime;
|
|
59
58
|
}
|
|
60
59
|
builtin.needsUpdate = true;
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
export { UIBehaviorTorqueNoise };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
1
|
+
import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Reduces particle velocity over time.
|
|
5
5
|
*
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNonNegativeNumber } from
|
|
3
|
-
import {
|
|
4
|
-
import { UIBehaviorModule } from
|
|
5
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber } from "../../core/miscellaneous/asserts.js";
|
|
3
|
+
import { BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y, resolveUIRangeConfig, } from "../miscellaneous/miscellaneous.js";
|
|
4
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
6
5
|
/**
|
|
7
6
|
* Reduces particle velocity over time.
|
|
8
7
|
*
|
|
9
8
|
* Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
|
|
10
9
|
*/
|
|
11
|
-
class UIBehaviorVelocityDamping extends UIBehaviorModule {
|
|
10
|
+
export class UIBehaviorVelocityDamping extends UIBehaviorModule {
|
|
12
11
|
/**
|
|
13
12
|
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
13
|
*/
|
|
@@ -16,19 +15,19 @@ class UIBehaviorVelocityDamping extends UIBehaviorModule {
|
|
|
16
15
|
super();
|
|
17
16
|
/** @internal */
|
|
18
17
|
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
-
this.
|
|
20
|
-
assertValidNonNegativeNumber(this.
|
|
21
|
-
assertValidNonNegativeNumber(this.
|
|
18
|
+
this.dampingInternal = resolveUIRangeConfig(damping);
|
|
19
|
+
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorVelocityDamping.constructor.damping.min`);
|
|
20
|
+
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorVelocityDamping.constructor.damping.max`);
|
|
22
21
|
}
|
|
23
22
|
/** Damping coefficient range (0-1) */
|
|
24
23
|
get damping() {
|
|
25
|
-
return this.
|
|
24
|
+
return this.dampingInternal;
|
|
26
25
|
}
|
|
27
26
|
/** Damping coefficient range (0-1) */
|
|
28
27
|
set damping(value) {
|
|
29
|
-
this.
|
|
30
|
-
assertValidNonNegativeNumber(this.
|
|
31
|
-
assertValidNonNegativeNumber(this.
|
|
28
|
+
this.dampingInternal = resolveUIRangeConfig(value);
|
|
29
|
+
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorVelocityDamping.damping.min`);
|
|
30
|
+
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorVelocityDamping.damping.max`);
|
|
32
31
|
}
|
|
33
32
|
/** @internal */
|
|
34
33
|
update(properties, instanceCount, deltaTime) {
|
|
@@ -37,12 +36,10 @@ class UIBehaviorVelocityDamping extends UIBehaviorModule {
|
|
|
37
36
|
for (let i = 0; i < instanceCount; i++) {
|
|
38
37
|
const itemOffset = i * itemSize;
|
|
39
38
|
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
40
|
-
const dampingFactor = Math.pow(1 - MathUtils.lerp(this.
|
|
39
|
+
const dampingFactor = Math.pow(1 - MathUtils.lerp(this.dampingInternal.min, this.dampingInternal.max, dampingT), deltaTime);
|
|
41
40
|
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] *= dampingFactor;
|
|
42
41
|
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] *= dampingFactor;
|
|
43
42
|
}
|
|
44
43
|
builtin.needsUpdate = true;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
export { UIBehaviorVelocityDamping };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
1
|
+
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous.js";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule.js";
|
|
3
3
|
/**
|
|
4
4
|
* Applies noise-based acceleration to particles.
|
|
5
5
|
*
|