laymur 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
- package/dist/core/constraints/UIConstraint.d.ts +22 -2
- package/dist/core/constraints/UIConstraint.js +26 -3
- package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
- package/dist/core/constraints/UICustomConstraint.js +15 -15
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
- package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
- package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
- package/dist/core/elements/UIDummy/UIDummy.js +59 -42
- package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
- package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
- package/dist/core/elements/UIElement/UIElement.d.ts +11 -11
- package/dist/core/elements/UIElement/UIElement.js +57 -60
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
- package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
- package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
- package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
- package/dist/core/elements/UIImage/UIImage.js +21 -24
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
- package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
- package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
- package/dist/core/elements/UIProgress/UIProgress.js +59 -62
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
- package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
- package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
- package/dist/core/elements/UIScene/UIScene.js +68 -69
- package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
- package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
- package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
- package/dist/core/elements/UIText/UIText.Internal.js +5 -7
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
- package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
- package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
- package/dist/core/elements/UIText/UIText.d.ts +28 -14
- package/dist/core/elements/UIText/UIText.js +181 -141
- package/dist/core/index.d.ts +55 -54
- package/dist/core/index.js +53 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
- package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
- package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
- package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
- package/dist/core/layers/UILayer/UILayer.js +125 -62
- package/dist/core/miscellaneous/UIBlendMode.js +1 -3
- package/dist/core/miscellaneous/UIExpression.js +16 -19
- package/dist/core/miscellaneous/UIMode.js +3 -5
- package/dist/core/miscellaneous/UIOrientation.js +2 -4
- package/dist/core/miscellaneous/UIPriority.js +5 -8
- package/dist/core/miscellaneous/UIRelation.js +5 -8
- package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
- package/dist/core/miscellaneous/area/UIArea.js +1 -3
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
- package/dist/core/miscellaneous/asserts.d.ts +20 -1
- package/dist/core/miscellaneous/asserts.js +71 -19
- package/dist/core/miscellaneous/canvas.js +13 -7
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
- package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.js +202 -205
- package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
- package/dist/core/miscellaneous/computeTransform.js +4 -7
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
- package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +13 -16
- package/dist/core/miscellaneous/math.js +3 -5
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
- package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
- package/dist/core/miscellaneous/shared.d.ts +1 -1
- package/dist/core/miscellaneous/shared.js +4 -7
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
- package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
- package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
- package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
- package/dist/core/miscellaneous/webglCapabilities.js +3 -4
- package/dist/core/shaders/UIImage.d.ts +9 -0
- package/dist/core/shaders/UIImage.js +14 -0
- package/dist/core/shaders/UINineSlice.d.ts +11 -0
- package/dist/core/shaders/UINineSlice.js +57 -0
- package/dist/core/shaders/UIProgress.d.ts +14 -0
- package/dist/core/shaders/UIProgress.js +21 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
- package/dist/debug/UIAspectDebug.d.ts +3 -3
- package/dist/debug/UIAspectDebug.js +64 -68
- package/dist/debug/UIConstraintDebug.d.ts +1 -1
- package/dist/debug/UIConstraintDebug.js +1 -0
- package/dist/debug/UIHeightDebug.d.ts +3 -3
- package/dist/debug/UIHeightDebug.js +63 -67
- package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
- package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
- package/dist/debug/UILayerDebug.d.ts +1 -1
- package/dist/debug/UILayerDebug.js +55 -64
- package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIVerticalDistanceDebug.js +76 -81
- package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
- package/dist/debug/UIWidthDebug.d.ts +3 -3
- package/dist/debug/UIWidthDebug.js +63 -67
- package/dist/debug/index.d.ts +8 -8
- package/dist/debug/index.js +8 -8
- package/dist/debug/miscellaneous.js +8 -11
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
- package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
- package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
- package/dist/particles/elements/UIEmitter.Internal.js +6 -9
- package/dist/particles/elements/UIEmitter.d.ts +17 -11
- package/dist/particles/elements/UIEmitter.js +100 -88
- package/dist/particles/index.d.ts +20 -18
- package/dist/particles/index.js +19 -18
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
- package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
- package/dist/particles/miscellaneous/miscellaneous.js +26 -27
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
- package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
- package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
- package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingTexture.js +7 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
- package/dist/particles/spawnModules/UISpawnModule.js +1 -3
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
- package/package.json +13 -17
- package/dist/_virtual/2d.js +0 -3
- package/dist/_virtual/3d.js +0 -3
- package/dist/_virtual/4d.js +0 -3
- package/dist/_virtual/mod.js +0 -5
- package/dist/_virtual/mod2.js +0 -3
- package/dist/core/shaders/UIImage.glsl.js +0 -3
- package/dist/core/shaders/UINineSlice.glsl.js +0 -3
- package/dist/core/shaders/UIProgress.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
- package/dist/index.js +0 -52
- package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
- package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
- package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
- package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
- package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
- package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
- package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
- package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
- package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Line2 } from
|
|
3
|
-
import { LineGeometry } from
|
|
4
|
-
import { LineMaterial } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class UIHorizontalInterpolationDebug {
|
|
1
|
+
import { CanvasTexture, Object3D, Sprite, SpriteMaterial, Vector3 } from "three";
|
|
2
|
+
import { Line2 } from "three/addons/lines/Line2.js";
|
|
3
|
+
import { LineGeometry } from "three/addons/lines/LineGeometry.js";
|
|
4
|
+
import { LineMaterial } from "three/addons/lines/LineMaterial.js";
|
|
5
|
+
import { UIColor, UIOrientation } from "../core/index.js";
|
|
6
|
+
import { isUIPlaneElement } from "../core/miscellaneous/shared.js";
|
|
7
|
+
import { DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_FAMILY, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_SIZE, DEBUG_LINE_WIDTH, DEBUG_RENDER_ORDER, debugResolutionVector, } from "./miscellaneous.js";
|
|
8
|
+
export class UIHorizontalInterpolationDebug {
|
|
11
9
|
constructor(constraint) {
|
|
12
10
|
this.constraint = constraint;
|
|
13
11
|
this.tint = new UIColor("cyan");
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
12
|
+
this.container = new Object3D();
|
|
13
|
+
this.baseLineMaterial = new LineMaterial({
|
|
16
14
|
linewidth: DEBUG_LINE_WIDTH,
|
|
17
15
|
transparent: true,
|
|
18
16
|
depthTest: false,
|
|
19
17
|
depthWrite: false,
|
|
20
18
|
});
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
19
|
+
this.baseLineGeometry = new LineGeometry();
|
|
20
|
+
this.baseLine = new Line2(this.baseLineGeometry, this.baseLineMaterial);
|
|
21
|
+
this.markerMaterial = new LineMaterial({
|
|
24
22
|
linewidth: DEBUG_LINE_WIDTH,
|
|
25
23
|
transparent: true,
|
|
26
24
|
depthTest: false,
|
|
27
25
|
depthWrite: false,
|
|
28
26
|
});
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
27
|
+
this.markerGeometry = new LineGeometry();
|
|
28
|
+
this.markerLine = new Line2(this.markerGeometry, this.markerMaterial);
|
|
29
|
+
this.visibleInternal = true;
|
|
30
|
+
this.lastRenderedText = "";
|
|
31
|
+
this.onOrientationChanged = () => {
|
|
32
|
+
this.updateContainerVisibility();
|
|
35
33
|
};
|
|
36
|
-
this.
|
|
34
|
+
this.onRendering = (renderer) => {
|
|
37
35
|
const tintDirty = this.tint.dirty;
|
|
38
36
|
if (tintDirty) {
|
|
39
|
-
this.tint.toThreeColor(this.
|
|
40
|
-
this.
|
|
41
|
-
this.tint.toThreeColor(this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
37
|
+
this.tint.toThreeColor(this.baseLineMaterial.color);
|
|
38
|
+
this.baseLineMaterial.opacity = this.tint.a;
|
|
39
|
+
this.tint.toThreeColor(this.markerMaterial.color);
|
|
40
|
+
this.markerMaterial.opacity = this.tint.a;
|
|
41
|
+
this.spriteMaterial.opacity = this.tint.a;
|
|
44
42
|
this.tint.setDirtyFalse();
|
|
45
43
|
}
|
|
46
44
|
renderer.getDrawingBufferSize(debugResolutionVector);
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
45
|
+
this.baseLineMaterial.resolution.copy(debugResolutionVector);
|
|
46
|
+
this.markerMaterial.resolution.copy(debugResolutionVector);
|
|
49
47
|
const elementA = this.constraint.a;
|
|
50
48
|
const elementB = this.constraint.b;
|
|
51
49
|
const elementC = this.constraint.c;
|
|
@@ -61,85 +59,83 @@ class UIHorizontalInterpolationDebug {
|
|
|
61
59
|
? elementC.x + elementC.width * this.constraint.anchorC
|
|
62
60
|
: elementC.x;
|
|
63
61
|
const midY = (anchorAY + anchorBY) / 2;
|
|
64
|
-
this.
|
|
62
|
+
this.baseLineGeometry.setFromPoints([
|
|
65
63
|
new Vector3(anchorAX, midY, 0),
|
|
66
64
|
new Vector3(anchorBX, midY, 0),
|
|
67
65
|
]);
|
|
68
66
|
const markerSize = 12;
|
|
69
|
-
this.
|
|
67
|
+
this.markerGeometry.setFromPoints([
|
|
70
68
|
new Vector3(anchorCX, midY - markerSize, 0),
|
|
71
69
|
new Vector3(anchorCX, midY + markerSize, 0),
|
|
72
70
|
]);
|
|
73
71
|
const nextText = "hi: " + this.constraint.t.toFixed(2);
|
|
74
|
-
if (nextText !== this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
72
|
+
if (nextText !== this.lastRenderedText || tintDirty) {
|
|
73
|
+
this.drawText(nextText);
|
|
74
|
+
this.textTexture.needsUpdate = true;
|
|
75
|
+
this.lastRenderedText = nextText;
|
|
78
76
|
}
|
|
79
|
-
this.
|
|
77
|
+
this.textSprite.position.set(anchorCX, midY + 20, 0);
|
|
80
78
|
};
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
79
|
+
this.baseLine.renderOrder = DEBUG_RENDER_ORDER;
|
|
80
|
+
this.markerLine.renderOrder = DEBUG_RENDER_ORDER;
|
|
81
|
+
this.container.add(this.baseLine);
|
|
82
|
+
this.container.add(this.markerLine);
|
|
85
83
|
const canvas = document.createElement("canvas");
|
|
86
84
|
canvas.width = 256;
|
|
87
85
|
canvas.height = 64;
|
|
88
86
|
const context = canvas.getContext("2d");
|
|
89
87
|
if (context === null) {
|
|
90
|
-
throw new Error("
|
|
88
|
+
throw new Error("UIHorizontalInterpolationDebug.constructor: failed to get 2D context for debug text");
|
|
91
89
|
}
|
|
92
|
-
this.
|
|
93
|
-
this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
map: this.
|
|
90
|
+
this.canvas = canvas;
|
|
91
|
+
this.context = context;
|
|
92
|
+
this.drawText("");
|
|
93
|
+
this.textTexture = new CanvasTexture(canvas);
|
|
94
|
+
this.spriteMaterial = new SpriteMaterial({
|
|
95
|
+
map: this.textTexture,
|
|
98
96
|
transparent: true,
|
|
99
97
|
depthTest: false,
|
|
100
98
|
depthWrite: false,
|
|
101
99
|
});
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
106
|
-
this.constraint.layer.signalRendering.on(this.
|
|
107
|
-
this.constraint.layer.signalOrientationChanged.on(this.
|
|
108
|
-
this.constraint.layer.sceneWrapper.insertCustomObject(this.
|
|
109
|
-
this.
|
|
100
|
+
this.textSprite = new Sprite(this.spriteMaterial);
|
|
101
|
+
this.textSprite.renderOrder = DEBUG_RENDER_ORDER;
|
|
102
|
+
this.textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
|
|
103
|
+
this.container.add(this.textSprite);
|
|
104
|
+
this.constraint.layer.signalRendering.on(this.onRendering);
|
|
105
|
+
this.constraint.layer.signalOrientationChanged.on(this.onOrientationChanged);
|
|
106
|
+
this.constraint.layer.sceneWrapper.insertCustomObject(this.container);
|
|
107
|
+
this.updateContainerVisibility();
|
|
110
108
|
}
|
|
111
109
|
get visible() {
|
|
112
|
-
return this.
|
|
110
|
+
return this.visibleInternal;
|
|
113
111
|
}
|
|
114
112
|
set visible(value) {
|
|
115
|
-
if (value !== this.
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
113
|
+
if (value !== this.visibleInternal) {
|
|
114
|
+
this.visibleInternal = value;
|
|
115
|
+
this.updateContainerVisibility();
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
destroy() {
|
|
121
|
-
this.constraint.layer.signalRendering.off(this.
|
|
122
|
-
this.constraint.layer.signalOrientationChanged.off(this.
|
|
123
|
-
this.constraint.layer.sceneWrapper.removeCustomObject(this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
119
|
+
this.constraint.layer.signalRendering.off(this.onRendering);
|
|
120
|
+
this.constraint.layer.signalOrientationChanged.off(this.onOrientationChanged);
|
|
121
|
+
this.constraint.layer.sceneWrapper.removeCustomObject(this.container);
|
|
122
|
+
this.baseLineGeometry.dispose();
|
|
123
|
+
this.markerGeometry.dispose();
|
|
124
|
+
this.textTexture.dispose();
|
|
127
125
|
}
|
|
128
|
-
|
|
126
|
+
updateContainerVisibility() {
|
|
129
127
|
const orientationActive = this.constraint.orientation === UIOrientation.ALWAYS ||
|
|
130
128
|
this.constraint.orientation === this.constraint.layer.orientation;
|
|
131
|
-
this.
|
|
129
|
+
this.container.visible = this.visibleInternal && orientationActive;
|
|
132
130
|
}
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
131
|
+
drawText(text) {
|
|
132
|
+
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
133
|
+
this.context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
|
|
134
|
+
this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
135
|
+
this.context.fillStyle = this.tint.getHexStringRGB();
|
|
136
|
+
this.context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
|
|
137
|
+
this.context.textAlign = "center";
|
|
138
|
+
this.context.textBaseline = "middle";
|
|
139
|
+
this.context.fillText(text, this.canvas.width / 2, this.canvas.height / 2);
|
|
142
140
|
}
|
|
143
141
|
}
|
|
144
|
-
|
|
145
|
-
export { UIHorizontalInterpolationDebug };
|
|
@@ -1,124 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { UIWidthConstraint } from '../core/constraints/UIWidthConstraint/UIWidthConstraint.js';
|
|
11
|
-
import { UIHorizontalDistanceConstraint } from '../core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js';
|
|
12
|
-
import { UIHorizontalInterpolationConstraint } from '../core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js';
|
|
13
|
-
import { UIVerticalDistanceConstraint } from '../core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js';
|
|
14
|
-
import { UIVerticalInterpolationConstraint } from '../core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js';
|
|
15
|
-
|
|
16
|
-
class UILayerDebug {
|
|
1
|
+
import { UIAspectConstraint, UIHeightConstraint, UIHorizontalDistanceConstraint, UIHorizontalInterpolationConstraint, UIVerticalDistanceConstraint, UIVerticalInterpolationConstraint, UIWidthConstraint, } from "../core/index.js";
|
|
2
|
+
import { UIAspectDebug } from "./UIAspectDebug.js";
|
|
3
|
+
import { UIHeightDebug } from "./UIHeightDebug.js";
|
|
4
|
+
import { UIHorizontalDistanceDebug } from "./UIHorizontalDistanceDebug.js";
|
|
5
|
+
import { UIHorizontalInterpolationDebug } from "./UIHorizontalInterpolationDebug.js";
|
|
6
|
+
import { UIVerticalDistanceDebug } from "./UIVerticalDistanceDebug.js";
|
|
7
|
+
import { UIVerticalInterpolationDebug } from "./UIVerticalInterpolationDebug.js";
|
|
8
|
+
import { UIWidthDebug } from "./UIWidthDebug.js";
|
|
9
|
+
export class UILayerDebug {
|
|
17
10
|
constructor(layer, options) {
|
|
18
11
|
this.layer = layer;
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
12
|
+
this.debug = [];
|
|
13
|
+
this.onConstraintAdded = (layer, constraint) => {
|
|
14
|
+
this.addDebug(constraint);
|
|
22
15
|
};
|
|
23
|
-
this.
|
|
24
|
-
const index = this.
|
|
16
|
+
this.onConstraintRemoved = (layer, constraint) => {
|
|
17
|
+
const index = this.debug.findIndex((d) => d.constraint === constraint);
|
|
25
18
|
if (index !== -1) {
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
19
|
+
this.debug[index].destroy();
|
|
20
|
+
this.debug.splice(index, 1);
|
|
28
21
|
}
|
|
29
22
|
};
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
23
|
+
this.showAspectInternal = options?.showAspect ?? true;
|
|
24
|
+
this.showHeightInternal = options?.showHeight ?? true;
|
|
25
|
+
this.showWidthInternal = options?.showWidth ?? true;
|
|
26
|
+
this.showHorizontalDistanceInternal = options?.showHorizontalDistance ?? true;
|
|
27
|
+
this.showHorizontalInterpolationInternal = options?.showHorizontalInterpolation ?? true;
|
|
28
|
+
this.showVerticalDistanceInternal = options?.showVerticalDistance ?? true;
|
|
29
|
+
this.showVerticalInterpolationInternal = options?.showVerticalInterpolation ?? true;
|
|
37
30
|
for (const constraint of this.layer.constraintRegistry) {
|
|
38
|
-
this.
|
|
31
|
+
this.addDebug(constraint);
|
|
39
32
|
}
|
|
40
|
-
this.layer.signalConstraintAdded.on(this.
|
|
41
|
-
this.layer.signalConstraintRemoved.on(this.
|
|
33
|
+
this.layer.signalConstraintAdded.on(this.onConstraintAdded);
|
|
34
|
+
this.layer.signalConstraintRemoved.on(this.onConstraintRemoved);
|
|
42
35
|
}
|
|
43
36
|
set showAspect(value) {
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
37
|
+
this.showAspectInternal = value;
|
|
38
|
+
this.setVisibility(UIAspectConstraint, value);
|
|
46
39
|
}
|
|
47
40
|
set showHeight(value) {
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
41
|
+
this.showHeightInternal = value;
|
|
42
|
+
this.setVisibility(UIHeightConstraint, value);
|
|
50
43
|
}
|
|
51
44
|
set showWidth(value) {
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
45
|
+
this.showWidthInternal = value;
|
|
46
|
+
this.setVisibility(UIWidthConstraint, value);
|
|
54
47
|
}
|
|
55
48
|
set showHorizontalDistance(value) {
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
49
|
+
this.showHorizontalDistanceInternal = value;
|
|
50
|
+
this.setVisibility(UIHorizontalDistanceConstraint, value);
|
|
58
51
|
}
|
|
59
52
|
set showHorizontalInterpolation(value) {
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
53
|
+
this.showHorizontalInterpolationInternal = value;
|
|
54
|
+
this.setVisibility(UIHorizontalInterpolationConstraint, value);
|
|
62
55
|
}
|
|
63
56
|
set showVerticalDistance(value) {
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
57
|
+
this.showVerticalDistanceInternal = value;
|
|
58
|
+
this.setVisibility(UIVerticalDistanceConstraint, value);
|
|
66
59
|
}
|
|
67
60
|
set showVerticalInterpolation(value) {
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
61
|
+
this.showVerticalInterpolationInternal = value;
|
|
62
|
+
this.setVisibility(UIVerticalInterpolationConstraint, value);
|
|
70
63
|
}
|
|
71
64
|
destroy() {
|
|
72
|
-
this.layer.signalConstraintAdded.off(this.
|
|
73
|
-
this.layer.signalConstraintRemoved.off(this.
|
|
74
|
-
for (const debug of this.
|
|
65
|
+
this.layer.signalConstraintAdded.off(this.onConstraintAdded);
|
|
66
|
+
this.layer.signalConstraintRemoved.off(this.onConstraintRemoved);
|
|
67
|
+
for (const debug of this.debug) {
|
|
75
68
|
debug.destroy();
|
|
76
69
|
}
|
|
77
|
-
this.
|
|
70
|
+
this.debug.length = 0;
|
|
78
71
|
}
|
|
79
|
-
|
|
72
|
+
addDebug(constraint) {
|
|
80
73
|
let debug = null;
|
|
81
74
|
if (constraint instanceof UIAspectConstraint) {
|
|
82
75
|
debug = new UIAspectDebug(constraint);
|
|
83
|
-
debug.visible = this.
|
|
76
|
+
debug.visible = this.showAspectInternal;
|
|
84
77
|
}
|
|
85
78
|
else if (constraint instanceof UIHeightConstraint) {
|
|
86
79
|
debug = new UIHeightDebug(constraint);
|
|
87
|
-
debug.visible = this.
|
|
80
|
+
debug.visible = this.showHeightInternal;
|
|
88
81
|
}
|
|
89
82
|
else if (constraint instanceof UIWidthConstraint) {
|
|
90
83
|
debug = new UIWidthDebug(constraint);
|
|
91
|
-
debug.visible = this.
|
|
84
|
+
debug.visible = this.showWidthInternal;
|
|
92
85
|
}
|
|
93
86
|
else if (constraint instanceof UIHorizontalDistanceConstraint) {
|
|
94
87
|
debug = new UIHorizontalDistanceDebug(constraint);
|
|
95
|
-
debug.visible = this.
|
|
88
|
+
debug.visible = this.showHorizontalDistanceInternal;
|
|
96
89
|
}
|
|
97
90
|
else if (constraint instanceof UIHorizontalInterpolationConstraint) {
|
|
98
91
|
debug = new UIHorizontalInterpolationDebug(constraint);
|
|
99
|
-
debug.visible = this.
|
|
92
|
+
debug.visible = this.showHorizontalInterpolationInternal;
|
|
100
93
|
}
|
|
101
94
|
else if (constraint instanceof UIVerticalDistanceConstraint) {
|
|
102
95
|
debug = new UIVerticalDistanceDebug(constraint);
|
|
103
|
-
debug.visible = this.
|
|
96
|
+
debug.visible = this.showVerticalDistanceInternal;
|
|
104
97
|
}
|
|
105
98
|
else if (constraint instanceof UIVerticalInterpolationConstraint) {
|
|
106
99
|
debug = new UIVerticalInterpolationDebug(constraint);
|
|
107
|
-
debug.visible = this.
|
|
100
|
+
debug.visible = this.showVerticalInterpolationInternal;
|
|
108
101
|
}
|
|
109
102
|
if (debug) {
|
|
110
|
-
this.
|
|
103
|
+
this.debug.push(debug);
|
|
111
104
|
}
|
|
112
105
|
}
|
|
113
|
-
|
|
106
|
+
setVisibility(
|
|
114
107
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- any is necessary here because the constraint class constructor signature is unknown
|
|
115
108
|
constraintClass, visible) {
|
|
116
|
-
for (const debug of this.
|
|
109
|
+
for (const debug of this.debug) {
|
|
117
110
|
if (debug.constraint instanceof constraintClass) {
|
|
118
111
|
debug.visible = visible;
|
|
119
112
|
}
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
115
|
}
|
|
123
|
-
|
|
124
|
-
export { UILayerDebug };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { UIVerticalDistanceConstraint } from "../core";
|
|
2
|
-
import { UIColor } from "../core";
|
|
3
|
-
import type { UIConstraintDebug } from "./UIConstraintDebug";
|
|
1
|
+
import type { UIVerticalDistanceConstraint } from "../core/index.js";
|
|
2
|
+
import { UIColor } from "../core/index.js";
|
|
3
|
+
import type { UIConstraintDebug } from "./UIConstraintDebug.js";
|
|
4
4
|
export declare class UIVerticalDistanceDebug implements UIConstraintDebug {
|
|
5
5
|
readonly constraint: UIVerticalDistanceConstraint;
|
|
6
6
|
readonly tint: UIColor;
|
|
@@ -1,54 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Line2 } from
|
|
3
|
-
import { LineGeometry } from
|
|
4
|
-
import { LineMaterial } from
|
|
5
|
-
import { LineSegments2 } from
|
|
6
|
-
import { LineSegmentsGeometry } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { UILayer } from '../core/layers/UILayer/UILayer.js';
|
|
12
|
-
|
|
13
|
-
class UIVerticalDistanceDebug {
|
|
1
|
+
import { CanvasTexture, Object3D, Sprite, SpriteMaterial, Vector3 } from "three";
|
|
2
|
+
import { Line2 } from "three/addons/lines/Line2.js";
|
|
3
|
+
import { LineGeometry } from "three/addons/lines/LineGeometry.js";
|
|
4
|
+
import { LineMaterial } from "three/addons/lines/LineMaterial.js";
|
|
5
|
+
import { LineSegments2 } from "three/addons/lines/LineSegments2.js";
|
|
6
|
+
import { LineSegmentsGeometry } from "three/addons/lines/LineSegmentsGeometry.js";
|
|
7
|
+
import { UIColor, UILayer, UIOrientation } from "../core/index.js";
|
|
8
|
+
import { isUIPlaneElement } from "../core/miscellaneous/shared.js";
|
|
9
|
+
import { DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_FAMILY, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_SIZE, DEBUG_LINE_WIDTH, DEBUG_RENDER_ORDER, debugResolutionVector, } from "./miscellaneous.js";
|
|
10
|
+
export class UIVerticalDistanceDebug {
|
|
14
11
|
constructor(constraint) {
|
|
15
12
|
this.constraint = constraint;
|
|
16
13
|
this.tint = new UIColor("cyan");
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
14
|
+
this.container = new Object3D();
|
|
15
|
+
this.lineMaterial = new LineMaterial({
|
|
19
16
|
linewidth: DEBUG_LINE_WIDTH,
|
|
20
17
|
transparent: true,
|
|
21
18
|
depthTest: false,
|
|
22
19
|
depthWrite: false,
|
|
23
20
|
});
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
21
|
+
this.lineGeometry = new LineGeometry();
|
|
22
|
+
this.line = new Line2(this.lineGeometry, this.lineMaterial);
|
|
23
|
+
this.tickMaterial = new LineMaterial({
|
|
27
24
|
linewidth: DEBUG_LINE_WIDTH,
|
|
28
25
|
transparent: true,
|
|
29
26
|
depthTest: false,
|
|
30
27
|
depthWrite: false,
|
|
31
28
|
});
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
29
|
+
this.tickGeometry = new LineSegmentsGeometry();
|
|
30
|
+
this.tickLine = new LineSegments2(this.tickGeometry, this.tickMaterial);
|
|
31
|
+
this.visibleInternal = true;
|
|
32
|
+
this.lastRenderedText = "";
|
|
33
|
+
this.onOrientationChanged = () => {
|
|
34
|
+
this.updateContainerVisibility();
|
|
38
35
|
};
|
|
39
|
-
this.
|
|
36
|
+
this.onRendering = (renderer) => {
|
|
40
37
|
const tintDirty = this.tint.dirty;
|
|
41
38
|
if (tintDirty) {
|
|
42
|
-
this.tint.toThreeColor(this.
|
|
43
|
-
this.
|
|
44
|
-
this.tint.toThreeColor(this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
39
|
+
this.tint.toThreeColor(this.lineMaterial.color);
|
|
40
|
+
this.lineMaterial.opacity = this.tint.a;
|
|
41
|
+
this.tint.toThreeColor(this.tickMaterial.color);
|
|
42
|
+
this.tickMaterial.opacity = this.tint.a;
|
|
43
|
+
this.spriteMaterial.opacity = this.tint.a;
|
|
47
44
|
this.tint.setDirtyFalse();
|
|
48
45
|
}
|
|
49
46
|
renderer.getDrawingBufferSize(debugResolutionVector);
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
47
|
+
this.lineMaterial.resolution.copy(debugResolutionVector);
|
|
48
|
+
this.tickMaterial.resolution.copy(debugResolutionVector);
|
|
52
49
|
const elementA = this.constraint.a;
|
|
53
50
|
const elementB = this.constraint.b;
|
|
54
51
|
const anchorAY = isUIPlaneElement(elementA)
|
|
@@ -64,12 +61,12 @@ class UIVerticalDistanceDebug {
|
|
|
64
61
|
: elementB instanceof UILayer
|
|
65
62
|
? anchorAX
|
|
66
63
|
: (anchorAX + anchorBX) / 2;
|
|
67
|
-
this.
|
|
64
|
+
this.lineGeometry.setFromPoints([
|
|
68
65
|
new Vector3(midX, anchorAY, 0),
|
|
69
66
|
new Vector3(midX, anchorBY, 0),
|
|
70
67
|
]);
|
|
71
68
|
const tickSize = 10;
|
|
72
|
-
this.
|
|
69
|
+
this.tickGeometry.setPositions([
|
|
73
70
|
midX - tickSize,
|
|
74
71
|
anchorAY,
|
|
75
72
|
0,
|
|
@@ -84,75 +81,73 @@ class UIVerticalDistanceDebug {
|
|
|
84
81
|
0,
|
|
85
82
|
]);
|
|
86
83
|
const nextText = "VD: " + this.constraint.distance.toFixed(0);
|
|
87
|
-
if (nextText !== this.
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
84
|
+
if (nextText !== this.lastRenderedText || tintDirty) {
|
|
85
|
+
this.drawText(nextText);
|
|
86
|
+
this.textTexture.needsUpdate = true;
|
|
87
|
+
this.lastRenderedText = nextText;
|
|
91
88
|
}
|
|
92
|
-
this.
|
|
89
|
+
this.textSprite.position.set(midX + 20, (anchorAY + anchorBY) / 2, 0);
|
|
93
90
|
};
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
91
|
+
this.line.renderOrder = DEBUG_RENDER_ORDER;
|
|
92
|
+
this.tickLine.renderOrder = DEBUG_RENDER_ORDER;
|
|
93
|
+
this.container.add(this.line);
|
|
94
|
+
this.container.add(this.tickLine);
|
|
98
95
|
const canvas = document.createElement("canvas");
|
|
99
96
|
canvas.width = 256;
|
|
100
97
|
canvas.height = 64;
|
|
101
98
|
const context = canvas.getContext("2d");
|
|
102
99
|
if (context === null) {
|
|
103
|
-
throw new Error("
|
|
100
|
+
throw new Error("UIVerticalDistanceDebug.constructor: failed to get 2D context for debug text");
|
|
104
101
|
}
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
109
|
-
this.
|
|
110
|
-
map: this.
|
|
102
|
+
this.canvas = canvas;
|
|
103
|
+
this.context = context;
|
|
104
|
+
this.drawText("");
|
|
105
|
+
this.textTexture = new CanvasTexture(canvas);
|
|
106
|
+
this.spriteMaterial = new SpriteMaterial({
|
|
107
|
+
map: this.textTexture,
|
|
111
108
|
transparent: true,
|
|
112
109
|
depthTest: false,
|
|
113
110
|
depthWrite: false,
|
|
114
111
|
});
|
|
115
|
-
this.
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
119
|
-
this.constraint.layer.signalRendering.on(this.
|
|
120
|
-
this.constraint.layer.signalOrientationChanged.on(this.
|
|
121
|
-
this.constraint.layer.sceneWrapper.insertCustomObject(this.
|
|
122
|
-
this.
|
|
112
|
+
this.textSprite = new Sprite(this.spriteMaterial);
|
|
113
|
+
this.textSprite.renderOrder = DEBUG_RENDER_ORDER;
|
|
114
|
+
this.textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
|
|
115
|
+
this.container.add(this.textSprite);
|
|
116
|
+
this.constraint.layer.signalRendering.on(this.onRendering);
|
|
117
|
+
this.constraint.layer.signalOrientationChanged.on(this.onOrientationChanged);
|
|
118
|
+
this.constraint.layer.sceneWrapper.insertCustomObject(this.container);
|
|
119
|
+
this.updateContainerVisibility();
|
|
123
120
|
}
|
|
124
121
|
get visible() {
|
|
125
|
-
return this.
|
|
122
|
+
return this.visibleInternal;
|
|
126
123
|
}
|
|
127
124
|
set visible(value) {
|
|
128
|
-
if (value !== this.
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
125
|
+
if (value !== this.visibleInternal) {
|
|
126
|
+
this.visibleInternal = value;
|
|
127
|
+
this.updateContainerVisibility();
|
|
131
128
|
}
|
|
132
129
|
}
|
|
133
130
|
destroy() {
|
|
134
|
-
this.constraint.layer.signalRendering.off(this.
|
|
135
|
-
this.constraint.layer.signalOrientationChanged.off(this.
|
|
136
|
-
this.constraint.layer.sceneWrapper.removeCustomObject(this.
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
139
|
-
this.
|
|
131
|
+
this.constraint.layer.signalRendering.off(this.onRendering);
|
|
132
|
+
this.constraint.layer.signalOrientationChanged.off(this.onOrientationChanged);
|
|
133
|
+
this.constraint.layer.sceneWrapper.removeCustomObject(this.container);
|
|
134
|
+
this.lineGeometry.dispose();
|
|
135
|
+
this.tickGeometry.dispose();
|
|
136
|
+
this.textTexture.dispose();
|
|
140
137
|
}
|
|
141
|
-
|
|
138
|
+
updateContainerVisibility() {
|
|
142
139
|
const orientationActive = this.constraint.orientation === UIOrientation.ALWAYS ||
|
|
143
140
|
this.constraint.orientation === this.constraint.layer.orientation;
|
|
144
|
-
this.
|
|
141
|
+
this.container.visible = this.visibleInternal && orientationActive;
|
|
145
142
|
}
|
|
146
|
-
|
|
147
|
-
this.
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.
|
|
143
|
+
drawText(text) {
|
|
144
|
+
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
145
|
+
this.context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
|
|
146
|
+
this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
147
|
+
this.context.fillStyle = this.tint.getHexStringRGB();
|
|
148
|
+
this.context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
|
|
149
|
+
this.context.textAlign = "center";
|
|
150
|
+
this.context.textBaseline = "middle";
|
|
151
|
+
this.context.fillText(text, this.canvas.width / 2, this.canvas.height / 2);
|
|
155
152
|
}
|
|
156
153
|
}
|
|
157
|
-
|
|
158
|
-
export { UIVerticalDistanceDebug };
|