laymur 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/core/constraints/UIConstraint.d.ts +12 -0
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
- package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
- package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.d.ts +71 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.d.ts +23 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.d.ts +43 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.d.ts +31 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/core/miscellaneous/math.d.ts +7 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.d.ts +46 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -9
- package/.editorconfig +0 -14
- package/CLAUDE.md +0 -181
- package/assets/logotype.png +0 -0
- package/eslint.config.js +0 -111
- package/rollup.config.js +0 -52
- package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
- package/src/core/constraints/UIConstraint.ts +0 -20
- package/src/core/constraints/UICustomConstraint.ts +0 -62
- package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
- package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
- package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
- package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
- package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
- package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
- package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
- package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
- package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
- package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
- package/src/core/elements/UIDummy/UIDummy.ts +0 -244
- package/src/core/elements/UIElement/UIElement.ts +0 -127
- package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
- package/src/core/elements/UIImage/UIImage.ts +0 -138
- package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
- package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
- package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
- package/src/core/elements/UIProgress/UIProgress.ts +0 -259
- package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
- package/src/core/elements/UIScene/UIScene.ts +0 -259
- package/src/core/elements/UIText/UIText.Internal.ts +0 -29
- package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
- package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
- package/src/core/elements/UIText/UIText.ts +0 -376
- package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
- package/src/core/layers/UILayer/UILayer.ts +0 -156
- package/src/core/miscellaneous/UIExpression.ts +0 -142
- package/src/core/miscellaneous/UIMode.ts +0 -29
- package/src/core/miscellaneous/UIOrientation.ts +0 -18
- package/src/core/miscellaneous/UIPriority.ts +0 -63
- package/src/core/miscellaneous/UIRelation.ts +0 -39
- package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
- package/src/core/miscellaneous/area/UIArea.ts +0 -5
- package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
- package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
- package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
- package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
- package/src/core/miscellaneous/asserts.ts +0 -187
- package/src/core/miscellaneous/canvas.ts +0 -73
- package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
- package/src/core/miscellaneous/color/UIColor.ts +0 -844
- package/src/core/miscellaneous/computeTransform.ts +0 -127
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
- package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
- package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
- package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
- package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
- package/src/core/miscellaneous/math.ts +0 -16
- package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
- package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
- package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
- package/src/core/miscellaneous/shared.ts +0 -73
- package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
- package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
- package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
- package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
- package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
- package/src/core/miscellaneous/webglCapabilities.ts +0 -129
- package/src/core/shaders/UIImage.glsl +0 -10
- package/src/core/shaders/UINineSlice.glsl +0 -53
- package/src/core/shaders/UIProgress.glsl +0 -15
- package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
- package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
- package/src/core/shaders/glsl.d.ts +0 -27
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
- package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
- package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
- package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
- package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
- package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
- package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
- package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
- package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
- package/src/particles/elements/UIEmitter.Internal.ts +0 -22
- package/src/particles/elements/UIEmitter.ts +0 -313
- package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
- package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
- package/src/particles/miscellaneous/miscellaneous.ts +0 -115
- package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
- package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
- package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
- package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
- package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
- package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
- package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
- package/src/particles/spawnModules/UISpawnModule.ts +0 -22
- package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
- package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
- package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
- package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
- package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
- package/tsconfig.json +0 -29
- /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
- /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { MathUtils, type InstancedBufferAttribute } from "three";
|
|
2
|
-
import { assertValidNumber } from "../../core/miscellaneous/asserts";
|
|
3
|
-
import type { Vector2Like } from "../../core/miscellaneous/math";
|
|
4
|
-
import {
|
|
5
|
-
BUILTIN_OFFSET_POSITION_X,
|
|
6
|
-
BUILTIN_OFFSET_POSITION_Y,
|
|
7
|
-
BUILTIN_OFFSET_RANDOM_A,
|
|
8
|
-
BUILTIN_OFFSET_RANDOM_B,
|
|
9
|
-
BUILTIN_OFFSET_RANDOM_C,
|
|
10
|
-
BUILTIN_OFFSET_VELOCITY_X,
|
|
11
|
-
BUILTIN_OFFSET_VELOCITY_Y,
|
|
12
|
-
resolveUIRangeConfig,
|
|
13
|
-
resolveUIVector2Config,
|
|
14
|
-
type UIRange,
|
|
15
|
-
type UIRangeConfig,
|
|
16
|
-
type UIVector2Config,
|
|
17
|
-
} from "../miscellaneous/miscellaneous";
|
|
18
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Applies gravity attraction toward a point.
|
|
22
|
-
*
|
|
23
|
-
* Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
|
|
24
|
-
*/
|
|
25
|
-
export class UIBehaviorPointGravity extends UIBehaviorModule<{ builtin: "Matrix4" }> {
|
|
26
|
-
/** @internal */
|
|
27
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
28
|
-
private centerInternal: Vector2Like;
|
|
29
|
-
private strengthInternal: UIRange;
|
|
30
|
-
private exponentInternal: UIRange;
|
|
31
|
-
private thresholdInternal: UIRange;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @param center - Gravity center position
|
|
35
|
-
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
36
|
-
* @param exponent - Distance power exponent range. Accepts number, tuple, or range object
|
|
37
|
-
* @param threshold - Minimum distance range. Accepts number, tuple, or range object
|
|
38
|
-
*/
|
|
39
|
-
constructor(
|
|
40
|
-
center: Vector2Like,
|
|
41
|
-
strength: UIRangeConfig,
|
|
42
|
-
exponent: UIRangeConfig = 2,
|
|
43
|
-
threshold: UIRangeConfig = 1,
|
|
44
|
-
) {
|
|
45
|
-
super();
|
|
46
|
-
this.centerInternal = resolveUIVector2Config(center);
|
|
47
|
-
assertValidNumber(this.centerInternal.x, "UIBehaviorPointGravity.constructor.center.x");
|
|
48
|
-
assertValidNumber(this.centerInternal.y, "UIBehaviorPointGravity.constructor.center.y");
|
|
49
|
-
|
|
50
|
-
this.strengthInternal = resolveUIRangeConfig(strength);
|
|
51
|
-
assertValidNumber(this.strengthInternal.min, "UIBehaviorPointGravity.constructor.strength.min");
|
|
52
|
-
assertValidNumber(this.strengthInternal.max, "UIBehaviorPointGravity.constructor.strength.max");
|
|
53
|
-
|
|
54
|
-
this.exponentInternal = resolveUIRangeConfig(exponent);
|
|
55
|
-
assertValidNumber(this.exponentInternal.min, "UIBehaviorPointGravity.constructor.exponent.min");
|
|
56
|
-
assertValidNumber(this.exponentInternal.max, "UIBehaviorPointGravity.constructor.exponent.max");
|
|
57
|
-
|
|
58
|
-
this.thresholdInternal = resolveUIRangeConfig(threshold);
|
|
59
|
-
assertValidNumber(
|
|
60
|
-
this.thresholdInternal.min,
|
|
61
|
-
"UIBehaviorPointGravity.constructor.threshold.min",
|
|
62
|
-
);
|
|
63
|
-
assertValidNumber(
|
|
64
|
-
this.thresholdInternal.max,
|
|
65
|
-
"UIBehaviorPointGravity.constructor.threshold.max",
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Gravity center position */
|
|
70
|
-
public get center(): Vector2Like {
|
|
71
|
-
return this.centerInternal;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** Force multiplier range */
|
|
75
|
-
public get strength(): UIRange {
|
|
76
|
-
return this.strengthInternal;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/** Distance power exponent range */
|
|
80
|
-
public get exponent(): UIRange {
|
|
81
|
-
return this.exponentInternal;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Minimum distance range */
|
|
85
|
-
public get threshold(): UIRange {
|
|
86
|
-
return this.thresholdInternal;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Gravity center position */
|
|
90
|
-
public set center(value: UIVector2Config) {
|
|
91
|
-
this.centerInternal = resolveUIVector2Config(value);
|
|
92
|
-
assertValidNumber(this.centerInternal.x, "UIBehaviorPointGravity.center.x");
|
|
93
|
-
assertValidNumber(this.centerInternal.y, "UIBehaviorPointGravity.center.y");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Force multiplier range */
|
|
97
|
-
public set strength(value: UIRangeConfig) {
|
|
98
|
-
this.strengthInternal = resolveUIRangeConfig(value);
|
|
99
|
-
assertValidNumber(this.strengthInternal.min, "UIBehaviorPointGravity.strength.min");
|
|
100
|
-
assertValidNumber(this.strengthInternal.max, "UIBehaviorPointGravity.strength.max");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** Distance power exponent range */
|
|
104
|
-
public set exponent(value: UIRangeConfig) {
|
|
105
|
-
this.exponentInternal = resolveUIRangeConfig(value);
|
|
106
|
-
assertValidNumber(this.exponentInternal.min, "UIBehaviorPointGravity.exponent.min");
|
|
107
|
-
assertValidNumber(this.exponentInternal.max, "UIBehaviorPointGravity.exponent.max");
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Minimum distance range */
|
|
111
|
-
public set threshold(value: UIRangeConfig) {
|
|
112
|
-
this.thresholdInternal = resolveUIRangeConfig(value);
|
|
113
|
-
assertValidNumber(this.thresholdInternal.min, "UIBehaviorPointGravity.threshold.min");
|
|
114
|
-
assertValidNumber(this.thresholdInternal.max, "UIBehaviorPointGravity.threshold.max");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** @internal */
|
|
118
|
-
public update(
|
|
119
|
-
properties: { builtin: InstancedBufferAttribute },
|
|
120
|
-
instanceCount: number,
|
|
121
|
-
deltaTime: number,
|
|
122
|
-
): void {
|
|
123
|
-
const { builtin } = properties;
|
|
124
|
-
const { array, itemSize } = builtin;
|
|
125
|
-
|
|
126
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
127
|
-
const itemOffset = i * itemSize;
|
|
128
|
-
|
|
129
|
-
const dx = this.centerInternal.x - array[itemOffset + BUILTIN_OFFSET_POSITION_X];
|
|
130
|
-
const dy = this.centerInternal.y - array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
|
|
131
|
-
|
|
132
|
-
// Constant over the life of a particle but different for each particle
|
|
133
|
-
const thresholdT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
134
|
-
const threshold = MathUtils.lerp(this.threshold.min, this.threshold.max, thresholdT);
|
|
135
|
-
|
|
136
|
-
const thresholdSquared = threshold * threshold;
|
|
137
|
-
const distanceSquared = dx * dx + dy * dy;
|
|
138
|
-
if (distanceSquared < thresholdSquared) {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Constant over the life of a particle but different for each particle
|
|
143
|
-
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
144
|
-
const strength = MathUtils.lerp(
|
|
145
|
-
this.strengthInternal.min,
|
|
146
|
-
this.strengthInternal.max,
|
|
147
|
-
strengthT,
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
// Constant over the life of a particle but different for each particle
|
|
151
|
-
const exponentT = array[itemOffset + BUILTIN_OFFSET_RANDOM_C];
|
|
152
|
-
const exponent = MathUtils.lerp(
|
|
153
|
-
this.exponentInternal.min,
|
|
154
|
-
this.exponentInternal.max,
|
|
155
|
-
exponentT,
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
const distance = Math.sqrt(distanceSquared);
|
|
159
|
-
const forceMagnitude = strength / Math.pow(distance, exponent);
|
|
160
|
-
|
|
161
|
-
const directionX = dx / distance;
|
|
162
|
-
const directionY = dy / distance;
|
|
163
|
-
|
|
164
|
-
const accelerationX = directionX * forceMagnitude;
|
|
165
|
-
const accelerationY = directionY * forceMagnitude;
|
|
166
|
-
|
|
167
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += accelerationX * deltaTime;
|
|
168
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += accelerationY * deltaTime;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
builtin.needsUpdate = true;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { MathUtils, type InstancedBufferAttribute } from "three";
|
|
2
|
-
import {
|
|
3
|
-
assertValidNonNegativeNumber,
|
|
4
|
-
assertValidPositiveNumber,
|
|
5
|
-
} from "../../core/miscellaneous/asserts";
|
|
6
|
-
import {
|
|
7
|
-
BUILTIN_OFFSET_AGE,
|
|
8
|
-
BUILTIN_OFFSET_LIFETIME,
|
|
9
|
-
BUILTIN_OFFSET_RANDOM_D,
|
|
10
|
-
BUILTIN_OFFSET_SCALE_X,
|
|
11
|
-
BUILTIN_OFFSET_SCALE_Y,
|
|
12
|
-
resolveAspect,
|
|
13
|
-
resolveUIRangeConfig,
|
|
14
|
-
type UIAspectConfig,
|
|
15
|
-
type UIRange,
|
|
16
|
-
type UIRangeConfig,
|
|
17
|
-
} from "../miscellaneous/miscellaneous";
|
|
18
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Animates particle scale over lifetime.
|
|
22
|
-
*
|
|
23
|
-
* Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
|
|
24
|
-
*/
|
|
25
|
-
export class UIBehaviorScaleOverLife extends UIBehaviorModule<{ builtin: "Matrix4" }> {
|
|
26
|
-
/** @internal */
|
|
27
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
28
|
-
private readonly scales: UIRange[] = [];
|
|
29
|
-
private aspectInternal: number;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @param scales - Scale anchor points. Each accepts number, tuple, or range object
|
|
33
|
-
* @param aspect - Width/height ratio. Accepts number or texture
|
|
34
|
-
*/
|
|
35
|
-
constructor(scales: UIRangeConfig[], aspect: UIAspectConfig = 1) {
|
|
36
|
-
super();
|
|
37
|
-
|
|
38
|
-
if (scales.length < 2) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
"UIBehaviorScaleOverLife.scales: the number of scale anchors must be more than two",
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
for (let i = 0; i < scales.length; i++) {
|
|
45
|
-
const scale = resolveUIRangeConfig(scales[i]);
|
|
46
|
-
assertValidNonNegativeNumber(
|
|
47
|
-
scale.min,
|
|
48
|
-
`UIBehaviorScaleOverLife.constructor.scales[${i}].min`,
|
|
49
|
-
);
|
|
50
|
-
assertValidNonNegativeNumber(
|
|
51
|
-
scale.max,
|
|
52
|
-
`UIBehaviorScaleOverLife.constructor.scales[${i}].max`,
|
|
53
|
-
);
|
|
54
|
-
this.scales.push(scale);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
this.aspectInternal = resolveAspect(aspect);
|
|
58
|
-
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOverLife.constructor.aspect");
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Width/height aspect ratio */
|
|
62
|
-
public get aspect(): number {
|
|
63
|
-
return this.aspectInternal;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** Width/height aspect ratio */
|
|
67
|
-
public set aspect(value: UIAspectConfig) {
|
|
68
|
-
this.aspectInternal = resolveAspect(value);
|
|
69
|
-
assertValidPositiveNumber(this.aspectInternal, "UIBehaviorScaleOverLife.aspect");
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** @internal */
|
|
73
|
-
public update(properties: { builtin: InstancedBufferAttribute }, instanceCount: number): void {
|
|
74
|
-
const { builtin } = properties;
|
|
75
|
-
const { array, itemSize } = builtin;
|
|
76
|
-
|
|
77
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
78
|
-
const itemOffset = i * itemSize;
|
|
79
|
-
const lifeT = Math.min(
|
|
80
|
-
array[itemOffset + BUILTIN_OFFSET_AGE] / array[itemOffset + BUILTIN_OFFSET_LIFETIME],
|
|
81
|
-
1,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const segment = (this.scales.length - 1) * lifeT;
|
|
85
|
-
const index = Math.floor(segment);
|
|
86
|
-
|
|
87
|
-
// Constant over the life of a particle but different for each particle
|
|
88
|
-
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_D];
|
|
89
|
-
|
|
90
|
-
const localT = segment - index;
|
|
91
|
-
const scaleRange0 = this.scales[index];
|
|
92
|
-
const scaleRange1 = this.scales[index + 1];
|
|
93
|
-
const scale0 = MathUtils.lerp(scaleRange0.min, scaleRange0.max, scaleT);
|
|
94
|
-
const scale1 = MathUtils.lerp(scaleRange1.min, scaleRange1.max, scaleT);
|
|
95
|
-
|
|
96
|
-
const interpolatedScale = scale0 + (scale1 - scale0) * localT;
|
|
97
|
-
|
|
98
|
-
array[itemOffset + BUILTIN_OFFSET_SCALE_X] = interpolatedScale * this.aspectInternal;
|
|
99
|
-
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] = interpolatedScale;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
builtin.needsUpdate = true;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { MathUtils, type InstancedBufferAttribute } from "three";
|
|
2
|
-
import { assertValidNonNegativeNumber } from "../../core/miscellaneous/asserts";
|
|
3
|
-
import {
|
|
4
|
-
BUILTIN_OFFSET_RANDOM_E,
|
|
5
|
-
BUILTIN_OFFSET_TORQUE,
|
|
6
|
-
resolveUIRangeConfig,
|
|
7
|
-
type UIRange,
|
|
8
|
-
type UIRangeConfig,
|
|
9
|
-
} from "../miscellaneous/miscellaneous";
|
|
10
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Reduces particle angular velocity over time.
|
|
14
|
-
*
|
|
15
|
-
* Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
|
|
16
|
-
*/
|
|
17
|
-
export class UIBehaviorTorqueDamping extends UIBehaviorModule<{
|
|
18
|
-
builtin: "Matrix4";
|
|
19
|
-
}> {
|
|
20
|
-
/** @internal */
|
|
21
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
22
|
-
private dampingInternal: UIRange;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
26
|
-
*/
|
|
27
|
-
constructor(damping: number) {
|
|
28
|
-
super();
|
|
29
|
-
this.dampingInternal = resolveUIRangeConfig(damping);
|
|
30
|
-
assertValidNonNegativeNumber(
|
|
31
|
-
this.dampingInternal.min,
|
|
32
|
-
`UIBehaviorTorqueDamping.constructor.damping.min`,
|
|
33
|
-
);
|
|
34
|
-
assertValidNonNegativeNumber(
|
|
35
|
-
this.dampingInternal.max,
|
|
36
|
-
`UIBehaviorTorqueDamping.constructor.damping.max`,
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Damping coefficient range (0-1) */
|
|
41
|
-
public get damping(): UIRange {
|
|
42
|
-
return this.dampingInternal;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Damping coefficient range (0-1) */
|
|
46
|
-
public set damping(value: UIRangeConfig) {
|
|
47
|
-
this.dampingInternal = resolveUIRangeConfig(value);
|
|
48
|
-
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorTorqueDamping.damping.min`);
|
|
49
|
-
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorTorqueDamping.damping.max`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** @internal */
|
|
53
|
-
public update(
|
|
54
|
-
properties: { builtin: InstancedBufferAttribute },
|
|
55
|
-
instanceCount: number,
|
|
56
|
-
deltaTime: number,
|
|
57
|
-
): void {
|
|
58
|
-
const { builtin } = properties;
|
|
59
|
-
const { array, itemSize } = builtin;
|
|
60
|
-
|
|
61
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
62
|
-
const itemOffset = i * itemSize;
|
|
63
|
-
|
|
64
|
-
// Constant over the life of a particle but different for each particle
|
|
65
|
-
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_E];
|
|
66
|
-
const dampingFactor = Math.pow(
|
|
67
|
-
1 - MathUtils.lerp(this.dampingInternal.min, this.dampingInternal.max, dampingT),
|
|
68
|
-
deltaTime,
|
|
69
|
-
);
|
|
70
|
-
array[itemOffset + BUILTIN_OFFSET_TORQUE] *= dampingFactor;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
builtin.needsUpdate = true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { MathUtils, type InstancedBufferAttribute } from "three";
|
|
2
|
-
import {
|
|
3
|
-
assertValidNonNegativeNumber,
|
|
4
|
-
assertValidPositiveNumber,
|
|
5
|
-
} from "../../core/miscellaneous/asserts";
|
|
6
|
-
import {
|
|
7
|
-
BUILTIN_OFFSET_POSITION_X,
|
|
8
|
-
BUILTIN_OFFSET_POSITION_Y,
|
|
9
|
-
BUILTIN_OFFSET_RANDOM_A,
|
|
10
|
-
BUILTIN_OFFSET_RANDOM_F,
|
|
11
|
-
BUILTIN_OFFSET_TORQUE,
|
|
12
|
-
generateNoise2D,
|
|
13
|
-
resolveUIRangeConfig,
|
|
14
|
-
type UIRange,
|
|
15
|
-
type UIRangeConfig,
|
|
16
|
-
} from "../miscellaneous/miscellaneous";
|
|
17
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Applies noise-based angular acceleration to particles.
|
|
21
|
-
*
|
|
22
|
-
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
23
|
-
*/
|
|
24
|
-
export class UIBehaviorTorqueNoise extends UIBehaviorModule<{ builtin: "Matrix4" }> {
|
|
25
|
-
/** @internal */
|
|
26
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
27
|
-
private scaleInternal: UIRange;
|
|
28
|
-
private strengthInternal: UIRange;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
32
|
-
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
33
|
-
*/
|
|
34
|
-
constructor(scale: number, strength: number) {
|
|
35
|
-
super();
|
|
36
|
-
this.scaleInternal = resolveUIRangeConfig(scale);
|
|
37
|
-
assertValidPositiveNumber(
|
|
38
|
-
this.scaleInternal.min,
|
|
39
|
-
`UIBehaviorTorqueNoise.constructor.scale.min`,
|
|
40
|
-
);
|
|
41
|
-
assertValidPositiveNumber(
|
|
42
|
-
this.scaleInternal.max,
|
|
43
|
-
`UIBehaviorTorqueNoise.constructor.scale.max`,
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
this.strengthInternal = resolveUIRangeConfig(strength);
|
|
47
|
-
assertValidNonNegativeNumber(
|
|
48
|
-
this.strengthInternal.min,
|
|
49
|
-
`UIBehaviorTorqueNoise.constructor.strength.min`,
|
|
50
|
-
);
|
|
51
|
-
assertValidNonNegativeNumber(
|
|
52
|
-
this.strengthInternal.max,
|
|
53
|
-
`UIBehaviorTorqueNoise.constructor.strength.max`,
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Noise frequency range */
|
|
58
|
-
public get scale(): UIRange {
|
|
59
|
-
return this.scaleInternal;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Force multiplier range */
|
|
63
|
-
public get strength(): UIRange {
|
|
64
|
-
return this.strengthInternal;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Noise frequency range */
|
|
68
|
-
public set scale(value: UIRangeConfig) {
|
|
69
|
-
this.scaleInternal = resolveUIRangeConfig(value);
|
|
70
|
-
assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorTorqueNoise.scale.min`);
|
|
71
|
-
assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorTorqueNoise.scale.max`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** Force multiplier range */
|
|
75
|
-
public set strength(value: UIRangeConfig) {
|
|
76
|
-
this.strengthInternal = resolveUIRangeConfig(value);
|
|
77
|
-
assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorTorqueNoise.strength.min`);
|
|
78
|
-
assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorTorqueNoise.strength.max`);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
public update(
|
|
83
|
-
properties: { builtin: InstancedBufferAttribute },
|
|
84
|
-
instanceCount: number,
|
|
85
|
-
deltaTime: number,
|
|
86
|
-
): void {
|
|
87
|
-
const { builtin } = properties;
|
|
88
|
-
const { array, itemSize } = builtin;
|
|
89
|
-
|
|
90
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
91
|
-
const itemOffset = i * itemSize;
|
|
92
|
-
|
|
93
|
-
// Constant over the life of a particle but different for each particle
|
|
94
|
-
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_F];
|
|
95
|
-
const scale = MathUtils.lerp(this.scaleInternal.min, this.scaleInternal.max, scaleT);
|
|
96
|
-
|
|
97
|
-
const noise = generateNoise2D(
|
|
98
|
-
array[itemOffset + BUILTIN_OFFSET_POSITION_X] * scale,
|
|
99
|
-
array[itemOffset + BUILTIN_OFFSET_POSITION_Y] * scale,
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// Constant over the life of a particle but different for each particle
|
|
103
|
-
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
104
|
-
const strength = MathUtils.lerp(
|
|
105
|
-
this.strengthInternal.min,
|
|
106
|
-
this.strengthInternal.max,
|
|
107
|
-
strengthT,
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
array[itemOffset + BUILTIN_OFFSET_TORQUE] += noise * strength * deltaTime;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
builtin.needsUpdate = true;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { InstancedBufferAttribute } from "three";
|
|
2
|
-
import { MathUtils } from "three";
|
|
3
|
-
import { assertValidNonNegativeNumber } from "../../core/miscellaneous/asserts";
|
|
4
|
-
import {
|
|
5
|
-
BUILTIN_OFFSET_RANDOM_B,
|
|
6
|
-
BUILTIN_OFFSET_VELOCITY_X,
|
|
7
|
-
BUILTIN_OFFSET_VELOCITY_Y,
|
|
8
|
-
resolveUIRangeConfig,
|
|
9
|
-
type UIRange,
|
|
10
|
-
type UIRangeConfig,
|
|
11
|
-
} from "../miscellaneous/miscellaneous";
|
|
12
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Reduces particle velocity over time.
|
|
16
|
-
*
|
|
17
|
-
* Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
|
|
18
|
-
*/
|
|
19
|
-
export class UIBehaviorVelocityDamping extends UIBehaviorModule<{ builtin: "Matrix4" }> {
|
|
20
|
-
/** @internal */
|
|
21
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
22
|
-
private dampingInternal: UIRange;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
26
|
-
*/
|
|
27
|
-
constructor(damping: UIRangeConfig) {
|
|
28
|
-
super();
|
|
29
|
-
this.dampingInternal = resolveUIRangeConfig(damping);
|
|
30
|
-
assertValidNonNegativeNumber(
|
|
31
|
-
this.dampingInternal.min,
|
|
32
|
-
`UIBehaviorVelocityDamping.constructor.damping.min`,
|
|
33
|
-
);
|
|
34
|
-
assertValidNonNegativeNumber(
|
|
35
|
-
this.dampingInternal.max,
|
|
36
|
-
`UIBehaviorVelocityDamping.constructor.damping.max`,
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Damping coefficient range (0-1) */
|
|
41
|
-
public get damping(): UIRange {
|
|
42
|
-
return this.dampingInternal;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Damping coefficient range (0-1) */
|
|
46
|
-
public set damping(value: UIRangeConfig) {
|
|
47
|
-
this.dampingInternal = resolveUIRangeConfig(value);
|
|
48
|
-
assertValidNonNegativeNumber(this.dampingInternal.min, `UIBehaviorVelocityDamping.damping.min`);
|
|
49
|
-
assertValidNonNegativeNumber(this.dampingInternal.max, `UIBehaviorVelocityDamping.damping.max`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** @internal */
|
|
53
|
-
public update(
|
|
54
|
-
properties: { builtin: InstancedBufferAttribute },
|
|
55
|
-
instanceCount: number,
|
|
56
|
-
deltaTime: number,
|
|
57
|
-
): void {
|
|
58
|
-
const { builtin } = properties;
|
|
59
|
-
const { array, itemSize } = builtin;
|
|
60
|
-
|
|
61
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
62
|
-
const itemOffset = i * itemSize;
|
|
63
|
-
|
|
64
|
-
// Constant over the life of a particle but different for each particle
|
|
65
|
-
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
66
|
-
const dampingFactor = Math.pow(
|
|
67
|
-
1 - MathUtils.lerp(this.dampingInternal.min, this.dampingInternal.max, dampingT),
|
|
68
|
-
deltaTime,
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] *= dampingFactor;
|
|
72
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] *= dampingFactor;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
builtin.needsUpdate = true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { MathUtils, type InstancedBufferAttribute } from "three";
|
|
2
|
-
import {
|
|
3
|
-
assertValidNonNegativeNumber,
|
|
4
|
-
assertValidPositiveNumber,
|
|
5
|
-
} from "../../core/miscellaneous/asserts";
|
|
6
|
-
import {
|
|
7
|
-
BUILTIN_OFFSET_POSITION_X,
|
|
8
|
-
BUILTIN_OFFSET_POSITION_Y,
|
|
9
|
-
BUILTIN_OFFSET_RANDOM_C,
|
|
10
|
-
BUILTIN_OFFSET_RANDOM_D,
|
|
11
|
-
BUILTIN_OFFSET_VELOCITY_X,
|
|
12
|
-
BUILTIN_OFFSET_VELOCITY_Y,
|
|
13
|
-
generateNoise2D,
|
|
14
|
-
resolveUIRangeConfig,
|
|
15
|
-
type UIRange,
|
|
16
|
-
type UIRangeConfig,
|
|
17
|
-
} from "../miscellaneous/miscellaneous";
|
|
18
|
-
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Applies noise-based acceleration to particles.
|
|
22
|
-
*
|
|
23
|
-
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
24
|
-
*/
|
|
25
|
-
export class UIBehaviorVelocityNoise extends UIBehaviorModule<{ builtin: "Matrix4" }> {
|
|
26
|
-
/** @internal */
|
|
27
|
-
public readonly requiredProperties = { builtin: "Matrix4" } as const;
|
|
28
|
-
private scaleInternal: UIRange;
|
|
29
|
-
private strengthInternal: UIRange;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
33
|
-
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
34
|
-
*/
|
|
35
|
-
constructor(scale = 100, strength = 500) {
|
|
36
|
-
super();
|
|
37
|
-
this.scaleInternal = resolveUIRangeConfig(scale);
|
|
38
|
-
assertValidPositiveNumber(
|
|
39
|
-
this.scaleInternal.min,
|
|
40
|
-
`UIBehaviorVelocityNoise.constructor.scale.min`,
|
|
41
|
-
);
|
|
42
|
-
assertValidPositiveNumber(
|
|
43
|
-
this.scaleInternal.max,
|
|
44
|
-
`UIBehaviorVelocityNoise.constructor.scale.max`,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
this.strengthInternal = resolveUIRangeConfig(strength);
|
|
48
|
-
assertValidNonNegativeNumber(
|
|
49
|
-
this.strengthInternal.min,
|
|
50
|
-
`UIBehaviorVelocityNoise.constructor.strength.min`,
|
|
51
|
-
);
|
|
52
|
-
assertValidNonNegativeNumber(
|
|
53
|
-
this.strengthInternal.max,
|
|
54
|
-
`UIBehaviorVelocityNoise.constructor.strength.max`,
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Noise frequency range */
|
|
59
|
-
public get scale(): UIRange {
|
|
60
|
-
return this.scaleInternal;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** Force multiplier range */
|
|
64
|
-
public get strength(): UIRange {
|
|
65
|
-
return this.strengthInternal;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** Noise frequency range */
|
|
69
|
-
public set scale(value: UIRangeConfig) {
|
|
70
|
-
this.scaleInternal = resolveUIRangeConfig(value);
|
|
71
|
-
assertValidPositiveNumber(this.scaleInternal.min, `UIBehaviorVelocityNoise.scale.min`);
|
|
72
|
-
assertValidPositiveNumber(this.scaleInternal.max, `UIBehaviorVelocityNoise.scale.max`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Force multiplier range */
|
|
76
|
-
public set strength(value: UIRangeConfig) {
|
|
77
|
-
this.strengthInternal = resolveUIRangeConfig(value);
|
|
78
|
-
assertValidNonNegativeNumber(this.strengthInternal.min, `UIBehaviorVelocityNoise.strength.min`);
|
|
79
|
-
assertValidNonNegativeNumber(this.strengthInternal.max, `UIBehaviorVelocityNoise.strength.max`);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** @internal */
|
|
83
|
-
public update(
|
|
84
|
-
properties: { builtin: InstancedBufferAttribute },
|
|
85
|
-
instanceCount: number,
|
|
86
|
-
deltaTime: number,
|
|
87
|
-
): void {
|
|
88
|
-
const { builtin } = properties;
|
|
89
|
-
const { array, itemSize } = builtin;
|
|
90
|
-
|
|
91
|
-
for (let i = 0; i < instanceCount; i++) {
|
|
92
|
-
const itemOffset = i * itemSize;
|
|
93
|
-
|
|
94
|
-
const x = array[itemOffset + BUILTIN_OFFSET_POSITION_X];
|
|
95
|
-
const y = array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
|
|
96
|
-
|
|
97
|
-
// Constant over the life of a particle but different for each particle
|
|
98
|
-
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_C];
|
|
99
|
-
const scale = MathUtils.lerp(this.scaleInternal.min, this.scaleInternal.max, scaleT);
|
|
100
|
-
|
|
101
|
-
const noiseX = generateNoise2D(x * scale, y * scale);
|
|
102
|
-
const noiseY = generateNoise2D((x + 100) * scale, (y + 100) * scale);
|
|
103
|
-
|
|
104
|
-
// Constant over the life of a particle but different for each particle
|
|
105
|
-
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_D];
|
|
106
|
-
const strength = MathUtils.lerp(
|
|
107
|
-
this.strengthInternal.min,
|
|
108
|
-
this.strengthInternal.max,
|
|
109
|
-
strengthT,
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += noiseX * strength * deltaTime;
|
|
113
|
-
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += noiseY * strength * deltaTime;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
builtin.needsUpdate = true;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { UIMode } from "../../core";
|
|
2
|
-
import type { UIAnchorOptions } from "../../core/elements/UIAnchor/UIAnchor.Internal";
|
|
3
|
-
|
|
4
|
-
export interface UIEmitterOptions extends UIAnchorOptions {
|
|
5
|
-
expectedCapacity: number;
|
|
6
|
-
capacityStep: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface UIEmitterPlayOptions {
|
|
10
|
-
duration: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function ignoreInput(): boolean {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type UIEmitterMode = UIMode.HIDDEN | UIMode.VISIBLE;
|
|
18
|
-
|
|
19
|
-
export const EMITTER_DEFAULT_MODE: UIEmitterMode = UIMode.VISIBLE;
|
|
20
|
-
export const EMITTER_DEFAULT_EXPECTED_CAPACITY = 32;
|
|
21
|
-
export const EMITTER_DEFAULT_CAPACITY_STEP = 32;
|
|
22
|
-
export const EMITTER_DEFAULT_AUTOMATICALLY_DESTROY_MODULES = true;
|