laymur 0.16.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/README.md +84 -208
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/{constraints → core/constraints}/UIConstraint.d.ts +2 -2
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.Internal.d.ts +3 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.d.ts +3 -3
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/{elements → core/elements}/UIDummy/UIDummy.d.ts +2 -2
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIElement/UIElement.d.ts +2 -2
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/{miscellaneous → core/miscellaneous}/math.d.ts +2 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -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/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.d.ts +2 -2
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -9246
- 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.d.ts +18 -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 +27 -36
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UICustomConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIDummy/UIDummy.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIElement/UIElement.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Interfaces.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Measuring.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Rendering.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.d.ts +0 -0
- /package/dist/{index.d.ts → core/index.d.ts} +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIExpression.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIOrientation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIPriority.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIRelation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UITransparencyMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIArea.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaCircle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaPolygon.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRoundedRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/asserts.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/canvas.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/computeTransform.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunction.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionCircular.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionDirectional.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicy.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCover.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCross.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCrossInverted.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFit.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedHeight.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedWidth.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyNone.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/webglCapabilities.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Vector2Like } from "../../core/miscellaneous/math";
|
|
2
|
+
import { type UIVector2Config } from "../miscellaneous/miscellaneous";
|
|
3
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
4
|
+
/**
|
|
5
|
+
* Applies constant acceleration to all particles.
|
|
6
|
+
*
|
|
7
|
+
* Adds the direction vector to particle velocity each frame.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UIBehaviorDirectionalGravity extends UIBehaviorModule<{
|
|
10
|
+
builtin: "Matrix4";
|
|
11
|
+
}> {
|
|
12
|
+
private directionInternal;
|
|
13
|
+
/**
|
|
14
|
+
* @param direction - Acceleration vector in units/second²
|
|
15
|
+
*/
|
|
16
|
+
constructor(direction: Vector2Like);
|
|
17
|
+
/** Acceleration vector in units/second² */
|
|
18
|
+
get direction(): Vector2Like;
|
|
19
|
+
/** Acceleration vector in units/second² */
|
|
20
|
+
set direction(value: UIVector2Config);
|
|
21
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { assertValidNumber } from '../../core/miscellaneous/asserts.js';
|
|
2
|
+
import { resolveUIVector2Config, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
|
|
3
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Applies constant acceleration to all particles.
|
|
7
|
+
*
|
|
8
|
+
* Adds the direction vector to particle velocity each frame.
|
|
9
|
+
*/
|
|
10
|
+
class UIBehaviorDirectionalGravity extends UIBehaviorModule {
|
|
11
|
+
/**
|
|
12
|
+
* @param direction - Acceleration vector in units/second²
|
|
13
|
+
*/
|
|
14
|
+
constructor(direction) {
|
|
15
|
+
super();
|
|
16
|
+
/** @internal */
|
|
17
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
18
|
+
this._private_directionInternal = resolveUIVector2Config(direction);
|
|
19
|
+
assertValidNumber(this._private_directionInternal.x, "UIBehaviorDirectionalGravity.constructor.direction.x");
|
|
20
|
+
assertValidNumber(this._private_directionInternal.y, "UIBehaviorDirectionalGravity.constructor.direction.y");
|
|
21
|
+
}
|
|
22
|
+
/** Acceleration vector in units/second² */
|
|
23
|
+
get direction() {
|
|
24
|
+
return this._private_directionInternal;
|
|
25
|
+
}
|
|
26
|
+
/** Acceleration vector in units/second² */
|
|
27
|
+
set direction(value) {
|
|
28
|
+
this._private_directionInternal = resolveUIVector2Config(value);
|
|
29
|
+
assertValidNumber(this._private_directionInternal.x, "UIBehaviorDirectionalGravity.direction.x");
|
|
30
|
+
assertValidNumber(this._private_directionInternal.y, "UIBehaviorDirectionalGravity.direction.y");
|
|
31
|
+
}
|
|
32
|
+
/** @internal */
|
|
33
|
+
update(properties, instanceCount, deltaTime) {
|
|
34
|
+
const { builtin } = properties;
|
|
35
|
+
const { array, itemSize } = builtin;
|
|
36
|
+
const offsetX = this._private_directionInternal.x * deltaTime;
|
|
37
|
+
const offsetY = this._private_directionInternal.y * deltaTime;
|
|
38
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
39
|
+
const itemOffset = i * itemSize;
|
|
40
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += offsetX;
|
|
41
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += offsetY;
|
|
42
|
+
}
|
|
43
|
+
builtin.needsUpdate = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { UIBehaviorDirectionalGravity };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { InstancedBufferAttribute } from "three";
|
|
2
|
+
import type { UIPropertyName } from "../../core/miscellaneous/generic-plane/shared";
|
|
3
|
+
/**
|
|
4
|
+
* Base class for particle behavior modules.
|
|
5
|
+
*
|
|
6
|
+
* Behavior modules update particle properties each frame.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class UIBehaviorModule<T extends Record<string, UIPropertyName> = Record<string, UIPropertyName>> {
|
|
9
|
+
abstract readonly requiredProperties: T;
|
|
10
|
+
abstract update(properties: {
|
|
11
|
+
[K in keyof T]: InstancedBufferAttribute;
|
|
12
|
+
}, instanceCount: number, deltaTime: number): void;
|
|
13
|
+
destroy?(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Vector2Like } from "../../core/miscellaneous/math";
|
|
2
|
+
import { type UIRange, type UIRangeConfig, type UIVector2Config } from "../miscellaneous/miscellaneous";
|
|
3
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
4
|
+
/**
|
|
5
|
+
* Applies gravity attraction toward a point.
|
|
6
|
+
*
|
|
7
|
+
* Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UIBehaviorPointGravity extends UIBehaviorModule<{
|
|
10
|
+
builtin: "Matrix4";
|
|
11
|
+
}> {
|
|
12
|
+
private centerInternal;
|
|
13
|
+
private strengthInternal;
|
|
14
|
+
private exponentInternal;
|
|
15
|
+
private thresholdInternal;
|
|
16
|
+
/**
|
|
17
|
+
* @param center - Gravity center position
|
|
18
|
+
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
19
|
+
* @param exponent - Distance power exponent range. Accepts number, tuple, or range object
|
|
20
|
+
* @param threshold - Minimum distance range. Accepts number, tuple, or range object
|
|
21
|
+
*/
|
|
22
|
+
constructor(center: Vector2Like, strength: UIRangeConfig, exponent?: UIRangeConfig, threshold?: UIRangeConfig);
|
|
23
|
+
/** Gravity center position */
|
|
24
|
+
get center(): Vector2Like;
|
|
25
|
+
/** Force multiplier range */
|
|
26
|
+
get strength(): UIRange;
|
|
27
|
+
/** Distance power exponent range */
|
|
28
|
+
get exponent(): UIRange;
|
|
29
|
+
/** Minimum distance range */
|
|
30
|
+
get threshold(): UIRange;
|
|
31
|
+
/** Gravity center position */
|
|
32
|
+
set center(value: UIVector2Config);
|
|
33
|
+
/** Force multiplier range */
|
|
34
|
+
set strength(value: UIRangeConfig);
|
|
35
|
+
/** Distance power exponent range */
|
|
36
|
+
set exponent(value: UIRangeConfig);
|
|
37
|
+
/** Minimum distance range */
|
|
38
|
+
set threshold(value: UIRangeConfig);
|
|
39
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidNumber } from '../../core/miscellaneous/asserts.js';
|
|
3
|
+
import { resolveUIVector2Config, resolveUIRangeConfig, 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 } from '../miscellaneous/miscellaneous.js';
|
|
4
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Applies gravity attraction toward a point.
|
|
8
|
+
*
|
|
9
|
+
* Force follows inverse power law: strength / distance^exponent. Particles closer than threshold are unaffected.
|
|
10
|
+
*/
|
|
11
|
+
class UIBehaviorPointGravity extends UIBehaviorModule {
|
|
12
|
+
/**
|
|
13
|
+
* @param center - Gravity center position
|
|
14
|
+
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
15
|
+
* @param exponent - Distance power exponent range. Accepts number, tuple, or range object
|
|
16
|
+
* @param threshold - Minimum distance range. Accepts number, tuple, or range object
|
|
17
|
+
*/
|
|
18
|
+
constructor(center, strength, exponent = 2, threshold = 1) {
|
|
19
|
+
super();
|
|
20
|
+
/** @internal */
|
|
21
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
22
|
+
this._private_centerInternal = resolveUIVector2Config(center);
|
|
23
|
+
assertValidNumber(this._private_centerInternal.x, "UIBehaviorPointGravity.constructor.center.x");
|
|
24
|
+
assertValidNumber(this._private_centerInternal.y, "UIBehaviorPointGravity.constructor.center.y");
|
|
25
|
+
this._private_strengthInternal = resolveUIRangeConfig(strength);
|
|
26
|
+
assertValidNumber(this._private_strengthInternal.min, "UIBehaviorPointGravity.constructor.strength.min");
|
|
27
|
+
assertValidNumber(this._private_strengthInternal.max, "UIBehaviorPointGravity.constructor.strength.max");
|
|
28
|
+
this._private_exponentInternal = resolveUIRangeConfig(exponent);
|
|
29
|
+
assertValidNumber(this._private_exponentInternal.min, "UIBehaviorPointGravity.constructor.exponent.min");
|
|
30
|
+
assertValidNumber(this._private_exponentInternal.max, "UIBehaviorPointGravity.constructor.exponent.max");
|
|
31
|
+
this._private_thresholdInternal = resolveUIRangeConfig(threshold);
|
|
32
|
+
assertValidNumber(this._private_thresholdInternal.min, "UIBehaviorPointGravity.constructor.threshold.min");
|
|
33
|
+
assertValidNumber(this._private_thresholdInternal.max, "UIBehaviorPointGravity.constructor.threshold.max");
|
|
34
|
+
}
|
|
35
|
+
/** Gravity center position */
|
|
36
|
+
get center() {
|
|
37
|
+
return this._private_centerInternal;
|
|
38
|
+
}
|
|
39
|
+
/** Force multiplier range */
|
|
40
|
+
get strength() {
|
|
41
|
+
return this._private_strengthInternal;
|
|
42
|
+
}
|
|
43
|
+
/** Distance power exponent range */
|
|
44
|
+
get exponent() {
|
|
45
|
+
return this._private_exponentInternal;
|
|
46
|
+
}
|
|
47
|
+
/** Minimum distance range */
|
|
48
|
+
get threshold() {
|
|
49
|
+
return this._private_thresholdInternal;
|
|
50
|
+
}
|
|
51
|
+
/** Gravity center position */
|
|
52
|
+
set center(value) {
|
|
53
|
+
this._private_centerInternal = resolveUIVector2Config(value);
|
|
54
|
+
assertValidNumber(this._private_centerInternal.x, "UIBehaviorPointGravity.center.x");
|
|
55
|
+
assertValidNumber(this._private_centerInternal.y, "UIBehaviorPointGravity.center.y");
|
|
56
|
+
}
|
|
57
|
+
/** Force multiplier range */
|
|
58
|
+
set strength(value) {
|
|
59
|
+
this._private_strengthInternal = resolveUIRangeConfig(value);
|
|
60
|
+
assertValidNumber(this._private_strengthInternal.min, "UIBehaviorPointGravity.strength.min");
|
|
61
|
+
assertValidNumber(this._private_strengthInternal.max, "UIBehaviorPointGravity.strength.max");
|
|
62
|
+
}
|
|
63
|
+
/** Distance power exponent range */
|
|
64
|
+
set exponent(value) {
|
|
65
|
+
this._private_exponentInternal = resolveUIRangeConfig(value);
|
|
66
|
+
assertValidNumber(this._private_exponentInternal.min, "UIBehaviorPointGravity.exponent.min");
|
|
67
|
+
assertValidNumber(this._private_exponentInternal.max, "UIBehaviorPointGravity.exponent.max");
|
|
68
|
+
}
|
|
69
|
+
/** Minimum distance range */
|
|
70
|
+
set threshold(value) {
|
|
71
|
+
this._private_thresholdInternal = resolveUIRangeConfig(value);
|
|
72
|
+
assertValidNumber(this._private_thresholdInternal.min, "UIBehaviorPointGravity.threshold.min");
|
|
73
|
+
assertValidNumber(this._private_thresholdInternal.max, "UIBehaviorPointGravity.threshold.max");
|
|
74
|
+
}
|
|
75
|
+
/** @internal */
|
|
76
|
+
update(properties, instanceCount, deltaTime) {
|
|
77
|
+
const { builtin } = properties;
|
|
78
|
+
const { array, itemSize } = builtin;
|
|
79
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
80
|
+
const itemOffset = i * itemSize;
|
|
81
|
+
const dx = this._private_centerInternal.x - array[itemOffset + BUILTIN_OFFSET_POSITION_X];
|
|
82
|
+
const dy = this._private_centerInternal.y - array[itemOffset + BUILTIN_OFFSET_POSITION_Y];
|
|
83
|
+
// Constant over the life of a particle but different for each particle
|
|
84
|
+
const thresholdT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
85
|
+
const threshold = MathUtils.lerp(this.threshold.min, this.threshold.max, thresholdT);
|
|
86
|
+
const thresholdSquared = threshold * threshold;
|
|
87
|
+
const distanceSquared = dx * dx + dy * dy;
|
|
88
|
+
if (distanceSquared < thresholdSquared) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
// Constant over the life of a particle but different for each particle
|
|
92
|
+
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
93
|
+
const strength = MathUtils.lerp(this._private_strengthInternal.min, this._private_strengthInternal.max, strengthT);
|
|
94
|
+
// Constant over the life of a particle but different for each particle
|
|
95
|
+
const exponentT = array[itemOffset + BUILTIN_OFFSET_RANDOM_C];
|
|
96
|
+
const exponent = MathUtils.lerp(this._private_exponentInternal.min, this._private_exponentInternal.max, exponentT);
|
|
97
|
+
const distance = Math.sqrt(distanceSquared);
|
|
98
|
+
const forceMagnitude = strength / Math.pow(distance, exponent);
|
|
99
|
+
const directionX = dx / distance;
|
|
100
|
+
const directionY = dy / distance;
|
|
101
|
+
const accelerationX = directionX * forceMagnitude;
|
|
102
|
+
const accelerationY = directionY * forceMagnitude;
|
|
103
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] += accelerationX * deltaTime;
|
|
104
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] += accelerationY * deltaTime;
|
|
105
|
+
}
|
|
106
|
+
builtin.needsUpdate = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export { UIBehaviorPointGravity };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type UIAspectConfig, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
3
|
+
/**
|
|
4
|
+
* Animates particle scale over lifetime.
|
|
5
|
+
*
|
|
6
|
+
* Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIBehaviorScaleOverLife extends UIBehaviorModule<{
|
|
9
|
+
builtin: "Matrix4";
|
|
10
|
+
}> {
|
|
11
|
+
private readonly scales;
|
|
12
|
+
private aspectInternal;
|
|
13
|
+
/**
|
|
14
|
+
* @param scales - Scale anchor points. Each accepts number, tuple, or range object
|
|
15
|
+
* @param aspect - Width/height ratio. Accepts number or texture
|
|
16
|
+
*/
|
|
17
|
+
constructor(scales: UIRangeConfig[], aspect?: UIAspectConfig);
|
|
18
|
+
/** Width/height aspect ratio */
|
|
19
|
+
get aspect(): number;
|
|
20
|
+
/** Width/height aspect ratio */
|
|
21
|
+
set aspect(value: UIAspectConfig);
|
|
22
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidNonNegativeNumber, assertValidPositiveNumber } from '../../core/miscellaneous/asserts.js';
|
|
3
|
+
import { resolveUIRangeConfig, resolveAspect, BUILTIN_OFFSET_AGE, BUILTIN_OFFSET_LIFETIME, BUILTIN_OFFSET_RANDOM_D, BUILTIN_OFFSET_SCALE_X, BUILTIN_OFFSET_SCALE_Y } from '../miscellaneous/miscellaneous.js';
|
|
4
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Animates particle scale over lifetime.
|
|
8
|
+
*
|
|
9
|
+
* Interpolates between scale anchors based on particle age. Requires at least 2 anchors.
|
|
10
|
+
*/
|
|
11
|
+
class UIBehaviorScaleOverLife extends UIBehaviorModule {
|
|
12
|
+
/**
|
|
13
|
+
* @param scales - Scale anchor points. Each accepts number, tuple, or range object
|
|
14
|
+
* @param aspect - Width/height ratio. Accepts number or texture
|
|
15
|
+
*/
|
|
16
|
+
constructor(scales, aspect = 1) {
|
|
17
|
+
super();
|
|
18
|
+
/** @internal */
|
|
19
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
|
+
this._private_scales = [];
|
|
21
|
+
if (scales.length < 2) {
|
|
22
|
+
throw new Error("UIBehaviorScaleOverLife.scales: the number of scale anchors must be more than two");
|
|
23
|
+
}
|
|
24
|
+
for (let i = 0; i < scales.length; i++) {
|
|
25
|
+
const scale = resolveUIRangeConfig(scales[i]);
|
|
26
|
+
assertValidNonNegativeNumber(scale.min, `UIBehaviorScaleOverLife.constructor.scales[${i}].min`);
|
|
27
|
+
assertValidNonNegativeNumber(scale.max, `UIBehaviorScaleOverLife.constructor.scales[${i}].max`);
|
|
28
|
+
this._private_scales.push(scale);
|
|
29
|
+
}
|
|
30
|
+
this._private_aspectInternal = resolveAspect(aspect);
|
|
31
|
+
assertValidPositiveNumber(this._private_aspectInternal, "UIBehaviorScaleOverLife.constructor.aspect");
|
|
32
|
+
}
|
|
33
|
+
/** Width/height aspect ratio */
|
|
34
|
+
get aspect() {
|
|
35
|
+
return this._private_aspectInternal;
|
|
36
|
+
}
|
|
37
|
+
/** Width/height aspect ratio */
|
|
38
|
+
set aspect(value) {
|
|
39
|
+
this._private_aspectInternal = resolveAspect(value);
|
|
40
|
+
assertValidPositiveNumber(this._private_aspectInternal, "UIBehaviorScaleOverLife.aspect");
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
update(properties, instanceCount) {
|
|
44
|
+
const { builtin } = properties;
|
|
45
|
+
const { array, itemSize } = builtin;
|
|
46
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
47
|
+
const itemOffset = i * itemSize;
|
|
48
|
+
const lifeT = Math.min(array[itemOffset + BUILTIN_OFFSET_AGE] / array[itemOffset + BUILTIN_OFFSET_LIFETIME], 1);
|
|
49
|
+
const segment = (this._private_scales.length - 1) * lifeT;
|
|
50
|
+
const index = Math.floor(segment);
|
|
51
|
+
// Constant over the life of a particle but different for each particle
|
|
52
|
+
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_D];
|
|
53
|
+
const localT = segment - index;
|
|
54
|
+
const scaleRange0 = this._private_scales[index];
|
|
55
|
+
const scaleRange1 = this._private_scales[index + 1];
|
|
56
|
+
const scale0 = MathUtils.lerp(scaleRange0.min, scaleRange0.max, scaleT);
|
|
57
|
+
const scale1 = MathUtils.lerp(scaleRange1.min, scaleRange1.max, scaleT);
|
|
58
|
+
const interpolatedScale = scale0 + (scale1 - scale0) * localT;
|
|
59
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_X] = interpolatedScale * this._private_aspectInternal;
|
|
60
|
+
array[itemOffset + BUILTIN_OFFSET_SCALE_Y] = interpolatedScale;
|
|
61
|
+
}
|
|
62
|
+
builtin.needsUpdate = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { UIBehaviorScaleOverLife };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
3
|
+
/**
|
|
4
|
+
* Reduces particle angular velocity over time.
|
|
5
|
+
*
|
|
6
|
+
* Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIBehaviorTorqueDamping extends UIBehaviorModule<{
|
|
9
|
+
builtin: "Matrix4";
|
|
10
|
+
}> {
|
|
11
|
+
private dampingInternal;
|
|
12
|
+
/**
|
|
13
|
+
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
|
+
*/
|
|
15
|
+
constructor(damping: number);
|
|
16
|
+
/** Damping coefficient range (0-1) */
|
|
17
|
+
get damping(): UIRange;
|
|
18
|
+
/** Damping coefficient range (0-1) */
|
|
19
|
+
set damping(value: UIRangeConfig);
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidNonNegativeNumber } from '../../core/miscellaneous/asserts.js';
|
|
3
|
+
import { resolveUIRangeConfig, BUILTIN_OFFSET_RANDOM_E, BUILTIN_OFFSET_TORQUE } from '../miscellaneous/miscellaneous.js';
|
|
4
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reduces particle angular velocity over time.
|
|
8
|
+
*
|
|
9
|
+
* Applies exponential decay to torque. Damping of 0 means no effect, 1 means instant stop.
|
|
10
|
+
*/
|
|
11
|
+
class UIBehaviorTorqueDamping extends UIBehaviorModule {
|
|
12
|
+
/**
|
|
13
|
+
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
|
+
*/
|
|
15
|
+
constructor(damping) {
|
|
16
|
+
super();
|
|
17
|
+
/** @internal */
|
|
18
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
+
this._private_dampingInternal = resolveUIRangeConfig(damping);
|
|
20
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.min, `UIBehaviorTorqueDamping.constructor.damping.min`);
|
|
21
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.max, `UIBehaviorTorqueDamping.constructor.damping.max`);
|
|
22
|
+
}
|
|
23
|
+
/** Damping coefficient range (0-1) */
|
|
24
|
+
get damping() {
|
|
25
|
+
return this._private_dampingInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Damping coefficient range (0-1) */
|
|
28
|
+
set damping(value) {
|
|
29
|
+
this._private_dampingInternal = resolveUIRangeConfig(value);
|
|
30
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.min, `UIBehaviorTorqueDamping.damping.min`);
|
|
31
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.max, `UIBehaviorTorqueDamping.damping.max`);
|
|
32
|
+
}
|
|
33
|
+
/** @internal */
|
|
34
|
+
update(properties, instanceCount, deltaTime) {
|
|
35
|
+
const { builtin } = properties;
|
|
36
|
+
const { array, itemSize } = builtin;
|
|
37
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
38
|
+
const itemOffset = i * itemSize;
|
|
39
|
+
// Constant over the life of a particle but different for each particle
|
|
40
|
+
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_E];
|
|
41
|
+
const dampingFactor = Math.pow(1 - MathUtils.lerp(this._private_dampingInternal.min, this._private_dampingInternal.max, dampingT), deltaTime);
|
|
42
|
+
array[itemOffset + BUILTIN_OFFSET_TORQUE] *= dampingFactor;
|
|
43
|
+
}
|
|
44
|
+
builtin.needsUpdate = true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { UIBehaviorTorqueDamping };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
3
|
+
/**
|
|
4
|
+
* Applies noise-based angular acceleration to particles.
|
|
5
|
+
*
|
|
6
|
+
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIBehaviorTorqueNoise extends UIBehaviorModule<{
|
|
9
|
+
builtin: "Matrix4";
|
|
10
|
+
}> {
|
|
11
|
+
private scaleInternal;
|
|
12
|
+
private strengthInternal;
|
|
13
|
+
/**
|
|
14
|
+
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
15
|
+
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
16
|
+
*/
|
|
17
|
+
constructor(scale: number, strength: number);
|
|
18
|
+
/** Noise frequency range */
|
|
19
|
+
get scale(): UIRange;
|
|
20
|
+
/** Force multiplier range */
|
|
21
|
+
get strength(): UIRange;
|
|
22
|
+
/** Noise frequency range */
|
|
23
|
+
set scale(value: UIRangeConfig);
|
|
24
|
+
/** Force multiplier range */
|
|
25
|
+
set strength(value: UIRangeConfig);
|
|
26
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidPositiveNumber, assertValidNonNegativeNumber } from '../../core/miscellaneous/asserts.js';
|
|
3
|
+
import { resolveUIRangeConfig, BUILTIN_OFFSET_RANDOM_F, generateNoise2D, BUILTIN_OFFSET_POSITION_Y, BUILTIN_OFFSET_POSITION_X, BUILTIN_OFFSET_RANDOM_A, BUILTIN_OFFSET_TORQUE } from '../miscellaneous/miscellaneous.js';
|
|
4
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Applies noise-based angular acceleration to particles.
|
|
8
|
+
*
|
|
9
|
+
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
10
|
+
*/
|
|
11
|
+
class UIBehaviorTorqueNoise extends UIBehaviorModule {
|
|
12
|
+
/**
|
|
13
|
+
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
14
|
+
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
15
|
+
*/
|
|
16
|
+
constructor(scale, strength) {
|
|
17
|
+
super();
|
|
18
|
+
/** @internal */
|
|
19
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
20
|
+
this._private_scaleInternal = resolveUIRangeConfig(scale);
|
|
21
|
+
assertValidPositiveNumber(this._private_scaleInternal.min, `UIBehaviorTorqueNoise.constructor.scale.min`);
|
|
22
|
+
assertValidPositiveNumber(this._private_scaleInternal.max, `UIBehaviorTorqueNoise.constructor.scale.max`);
|
|
23
|
+
this._private_strengthInternal = resolveUIRangeConfig(strength);
|
|
24
|
+
assertValidNonNegativeNumber(this._private_strengthInternal.min, `UIBehaviorTorqueNoise.constructor.strength.min`);
|
|
25
|
+
assertValidNonNegativeNumber(this._private_strengthInternal.max, `UIBehaviorTorqueNoise.constructor.strength.max`);
|
|
26
|
+
}
|
|
27
|
+
/** Noise frequency range */
|
|
28
|
+
get scale() {
|
|
29
|
+
return this._private_scaleInternal;
|
|
30
|
+
}
|
|
31
|
+
/** Force multiplier range */
|
|
32
|
+
get strength() {
|
|
33
|
+
return this._private_strengthInternal;
|
|
34
|
+
}
|
|
35
|
+
/** Noise frequency range */
|
|
36
|
+
set scale(value) {
|
|
37
|
+
this._private_scaleInternal = resolveUIRangeConfig(value);
|
|
38
|
+
assertValidPositiveNumber(this._private_scaleInternal.min, `UIBehaviorTorqueNoise.scale.min`);
|
|
39
|
+
assertValidPositiveNumber(this._private_scaleInternal.max, `UIBehaviorTorqueNoise.scale.max`);
|
|
40
|
+
}
|
|
41
|
+
/** Force multiplier range */
|
|
42
|
+
set strength(value) {
|
|
43
|
+
this._private_strengthInternal = resolveUIRangeConfig(value);
|
|
44
|
+
assertValidNonNegativeNumber(this._private_strengthInternal.min, `UIBehaviorTorqueNoise.strength.min`);
|
|
45
|
+
assertValidNonNegativeNumber(this._private_strengthInternal.max, `UIBehaviorTorqueNoise.strength.max`);
|
|
46
|
+
}
|
|
47
|
+
/** @internal */
|
|
48
|
+
update(properties, instanceCount, deltaTime) {
|
|
49
|
+
const { builtin } = properties;
|
|
50
|
+
const { array, itemSize } = builtin;
|
|
51
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
52
|
+
const itemOffset = i * itemSize;
|
|
53
|
+
// Constant over the life of a particle but different for each particle
|
|
54
|
+
const scaleT = array[itemOffset + BUILTIN_OFFSET_RANDOM_F];
|
|
55
|
+
const scale = MathUtils.lerp(this._private_scaleInternal.min, this._private_scaleInternal.max, scaleT);
|
|
56
|
+
const noise = generateNoise2D(array[itemOffset + BUILTIN_OFFSET_POSITION_X] * scale, array[itemOffset + BUILTIN_OFFSET_POSITION_Y] * scale);
|
|
57
|
+
// Constant over the life of a particle but different for each particle
|
|
58
|
+
const strengthT = array[itemOffset + BUILTIN_OFFSET_RANDOM_A];
|
|
59
|
+
const strength = MathUtils.lerp(this._private_strengthInternal.min, this._private_strengthInternal.max, strengthT);
|
|
60
|
+
array[itemOffset + BUILTIN_OFFSET_TORQUE] += noise * strength * deltaTime;
|
|
61
|
+
}
|
|
62
|
+
builtin.needsUpdate = true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { UIBehaviorTorqueNoise };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
3
|
+
/**
|
|
4
|
+
* Reduces particle velocity over time.
|
|
5
|
+
*
|
|
6
|
+
* Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIBehaviorVelocityDamping extends UIBehaviorModule<{
|
|
9
|
+
builtin: "Matrix4";
|
|
10
|
+
}> {
|
|
11
|
+
private dampingInternal;
|
|
12
|
+
/**
|
|
13
|
+
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
|
+
*/
|
|
15
|
+
constructor(damping: UIRangeConfig);
|
|
16
|
+
/** Damping coefficient range (0-1) */
|
|
17
|
+
get damping(): UIRange;
|
|
18
|
+
/** Damping coefficient range (0-1) */
|
|
19
|
+
set damping(value: UIRangeConfig);
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidNonNegativeNumber } from '../../core/miscellaneous/asserts.js';
|
|
3
|
+
import { resolveUIRangeConfig, BUILTIN_OFFSET_RANDOM_B, BUILTIN_OFFSET_VELOCITY_X, BUILTIN_OFFSET_VELOCITY_Y } from '../miscellaneous/miscellaneous.js';
|
|
4
|
+
import { UIBehaviorModule } from './UIBehaviorModule.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reduces particle velocity over time.
|
|
8
|
+
*
|
|
9
|
+
* Applies exponential decay to velocity. Damping of 0 means no effect, 1 means instant stop.
|
|
10
|
+
*/
|
|
11
|
+
class UIBehaviorVelocityDamping extends UIBehaviorModule {
|
|
12
|
+
/**
|
|
13
|
+
* @param damping - Damping coefficient range (0-1). Accepts number, tuple, or range object
|
|
14
|
+
*/
|
|
15
|
+
constructor(damping) {
|
|
16
|
+
super();
|
|
17
|
+
/** @internal */
|
|
18
|
+
this.requiredProperties = { builtin: "Matrix4" };
|
|
19
|
+
this._private_dampingInternal = resolveUIRangeConfig(damping);
|
|
20
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.min, `UIBehaviorVelocityDamping.constructor.damping.min`);
|
|
21
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.max, `UIBehaviorVelocityDamping.constructor.damping.max`);
|
|
22
|
+
}
|
|
23
|
+
/** Damping coefficient range (0-1) */
|
|
24
|
+
get damping() {
|
|
25
|
+
return this._private_dampingInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Damping coefficient range (0-1) */
|
|
28
|
+
set damping(value) {
|
|
29
|
+
this._private_dampingInternal = resolveUIRangeConfig(value);
|
|
30
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.min, `UIBehaviorVelocityDamping.damping.min`);
|
|
31
|
+
assertValidNonNegativeNumber(this._private_dampingInternal.max, `UIBehaviorVelocityDamping.damping.max`);
|
|
32
|
+
}
|
|
33
|
+
/** @internal */
|
|
34
|
+
update(properties, instanceCount, deltaTime) {
|
|
35
|
+
const { builtin } = properties;
|
|
36
|
+
const { array, itemSize } = builtin;
|
|
37
|
+
for (let i = 0; i < instanceCount; i++) {
|
|
38
|
+
const itemOffset = i * itemSize;
|
|
39
|
+
// Constant over the life of a particle but different for each particle
|
|
40
|
+
const dampingT = array[itemOffset + BUILTIN_OFFSET_RANDOM_B];
|
|
41
|
+
const dampingFactor = Math.pow(1 - MathUtils.lerp(this._private_dampingInternal.min, this._private_dampingInternal.max, dampingT), deltaTime);
|
|
42
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_X] *= dampingFactor;
|
|
43
|
+
array[itemOffset + BUILTIN_OFFSET_VELOCITY_Y] *= dampingFactor;
|
|
44
|
+
}
|
|
45
|
+
builtin.needsUpdate = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { UIBehaviorVelocityDamping };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type UIRange, type UIRangeConfig } from "../miscellaneous/miscellaneous";
|
|
2
|
+
import { UIBehaviorModule } from "./UIBehaviorModule";
|
|
3
|
+
/**
|
|
4
|
+
* Applies noise-based acceleration to particles.
|
|
5
|
+
*
|
|
6
|
+
* Uses 2D noise based on particle position. Higher scale means finer noise detail.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UIBehaviorVelocityNoise extends UIBehaviorModule<{
|
|
9
|
+
builtin: "Matrix4";
|
|
10
|
+
}> {
|
|
11
|
+
private scaleInternal;
|
|
12
|
+
private strengthInternal;
|
|
13
|
+
/**
|
|
14
|
+
* @param scale - Noise frequency range. Accepts number, tuple, or range object
|
|
15
|
+
* @param strength - Force multiplier range. Accepts number, tuple, or range object
|
|
16
|
+
*/
|
|
17
|
+
constructor(scale?: number, strength?: number);
|
|
18
|
+
/** Noise frequency range */
|
|
19
|
+
get scale(): UIRange;
|
|
20
|
+
/** Force multiplier range */
|
|
21
|
+
get strength(): UIRange;
|
|
22
|
+
/** Noise frequency range */
|
|
23
|
+
set scale(value: UIRangeConfig);
|
|
24
|
+
/** Force multiplier range */
|
|
25
|
+
set strength(value: UIRangeConfig);
|
|
26
|
+
}
|