@babylonjs/gui 7.34.3 → 7.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/2D/FrameGraph/guiTask.js.map +1 -1
  2. package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
  3. package/2D/adtInstrumentation.js.map +1 -1
  4. package/2D/advancedDynamicTexture.d.ts +1 -1
  5. package/2D/advancedDynamicTexture.js.map +1 -1
  6. package/2D/controls/button.js.map +1 -1
  7. package/2D/controls/checkbox.js.map +1 -1
  8. package/2D/controls/colorpicker.js.map +1 -1
  9. package/2D/controls/container.js.map +1 -1
  10. package/2D/controls/control.js.map +1 -1
  11. package/2D/controls/displayGrid.js.map +1 -1
  12. package/2D/controls/ellipse.js.map +1 -1
  13. package/2D/controls/focusableButton.js.map +1 -1
  14. package/2D/controls/gradient/BaseGradient.js.map +1 -1
  15. package/2D/controls/grid.js.map +1 -1
  16. package/2D/controls/image.js.map +1 -1
  17. package/2D/controls/inputPassword.js.map +1 -1
  18. package/2D/controls/inputText.js.map +1 -1
  19. package/2D/controls/inputTextArea.js.map +1 -1
  20. package/2D/controls/line.js.map +1 -1
  21. package/2D/controls/multiLine.js.map +1 -1
  22. package/2D/controls/radioButton.js.map +1 -1
  23. package/2D/controls/rectangle.js.map +1 -1
  24. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  25. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  26. package/2D/controls/selector.js.map +1 -1
  27. package/2D/controls/sliders/baseSlider.js.map +1 -1
  28. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  29. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  30. package/2D/controls/sliders/scrollBar.js.map +1 -1
  31. package/2D/controls/sliders/slider.js.map +1 -1
  32. package/2D/controls/stackPanel.js.map +1 -1
  33. package/2D/controls/statics.js.map +1 -1
  34. package/2D/controls/textBlock.js.map +1 -1
  35. package/2D/controls/textWrapper.js.map +1 -1
  36. package/2D/controls/toggleButton.js.map +1 -1
  37. package/2D/controls/virtualKeyboard.js.map +1 -1
  38. package/2D/math2D.js.map +1 -1
  39. package/2D/measure.js.map +1 -1
  40. package/2D/multiLinePoint.js.map +1 -1
  41. package/2D/style.js.map +1 -1
  42. package/2D/valueAndUnit.js.map +1 -1
  43. package/2D/xmlLoader.js.map +1 -1
  44. package/3D/behaviors/defaultBehavior.js.map +1 -1
  45. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  46. package/3D/controls/button3D.js.map +1 -1
  47. package/3D/controls/container3D.js.map +1 -1
  48. package/3D/controls/contentDisplay3D.js.map +1 -1
  49. package/3D/controls/control3D.js.map +1 -1
  50. package/3D/controls/cylinderPanel.js.map +1 -1
  51. package/3D/controls/holographicBackplate.js.map +1 -1
  52. package/3D/controls/holographicButton.js.map +1 -1
  53. package/3D/controls/holographicSlate.js.map +1 -1
  54. package/3D/controls/meshButton3D.js.map +1 -1
  55. package/3D/controls/nearMenu.js.map +1 -1
  56. package/3D/controls/planePanel.js.map +1 -1
  57. package/3D/controls/scatterPanel.js.map +1 -1
  58. package/3D/controls/slider3D.js.map +1 -1
  59. package/3D/controls/spherePanel.js.map +1 -1
  60. package/3D/controls/stackPanel3D.js.map +1 -1
  61. package/3D/controls/touchButton3D.js.map +1 -1
  62. package/3D/controls/touchHolographicButton.js.map +1 -1
  63. package/3D/controls/touchHolographicMenu.js.map +1 -1
  64. package/3D/controls/touchMeshButton3D.js.map +1 -1
  65. package/3D/controls/volumeBasedPanel.js.map +1 -1
  66. package/3D/gizmos/gizmoHandle.js.map +1 -1
  67. package/3D/gizmos/slateGizmo.js.map +1 -1
  68. package/3D/gui3DManager.js.map +1 -1
  69. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  70. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  71. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  72. package/3D/materials/handle/handleMaterial.js.map +1 -1
  73. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
  74. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  75. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
  76. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
  77. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  78. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  79. package/legacy/legacy.js.map +1 -1
  80. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,gDAAkC;AACtD,OAAO,EAAE,cAAc,EAAE,qDAAuC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM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C,CAAC;gBAC5E,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;aACpC;SACJ;IACL,CAAC;;AAv/BD;;GAEG;AACW,0CAAmB,GAAG,2CAA2C,AAA9C,CAA+C;AAEhF;;GAEG;AACW,gDAAyB,GAAG,4BAA4B,AAA/B,CAAgC;AAEvE;;GAEG;AACW,+CAAwB,GAAG,2BAA2B,AAA9B,CAA+B;AAErE;;GAEG;AACW,8CAAuB,GAAG,wBAAwB,AAA3B,CAA4B;AAEjE;;GAEG;AACW,+CAAwB,GAAG,oBAAoB,AAAvB,CAAwB","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Control3D } from \"../control3D\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Vector3WithInfo } from \"../../vector3WithInfo\";\r\n\r\nimport { AdvancedDynamicTexture } from \"../../../2D/advancedDynamicTexture\";\r\nimport { Animation } from \"core/Animations/animation\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { Control } from \"../../../2D/controls/control\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport { Grid } from \"../../../2D/controls/grid\";\r\nimport { Image } from \"../../../2D/controls/image\";\r\nimport { MRDLBackglowMaterial } from \"../../materials/mrdl/mrdlBackglowMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../../materials/mrdl/mrdlBackplateMaterial\";\r\nimport { MRDLFrontplateMaterial } from \"../../materials/mrdl/mrdlFrontplateMaterial\";\r\nimport { MRDLInnerquadMaterial } from \"../../materials/mrdl/mrdlInnerquadMaterial\";\r\nimport { Rectangle } from \"../../../2D/controls/rectangle\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { StackPanel } from \"../../../2D/controls/stackPanel\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport { TextBlock } from \"../../../2D/controls/textBlock\";\r\nimport { TouchButton3D } from \"../touchButton3D\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Class used to create the mrtkv3 button\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\r\n /**\r\n * Base Url for the frontplate model.\r\n */\r\n public static MRTK_ASSET_BASE_URL = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the frontplate model.\r\n */\r\n public static FRONTPLATE_MODEL_FILENAME = \"mrtk-fluent-frontplate.glb\";\r\n\r\n /**\r\n * File name for the backplate model.\r\n */\r\n public static BACKPLATE_MODEL_FILENAME = \"mrtk-fluent-backplate.glb\";\r\n\r\n /**\r\n * File name for the backglow model.\r\n */\r\n public static BACKGLOW_MODEL_FILENAME = \"mrtk-fluent-button.glb\";\r\n\r\n /**\r\n * File name for the innerquad model.\r\n */\r\n public static INNERQUAD_MODEL_FILENAME = \"SlateProximity.glb\";\r\n\r\n /**\r\n * Gets or sets the horizontal scaling for the button.\r\n */\r\n public width = 1;\r\n\r\n /**\r\n * Gets or sets the vertical scaling for the button.\r\n */\r\n public height = 1;\r\n\r\n /**\r\n * Gets or sets the bevel radius for the button.\r\n */\r\n public radius = 0.14;\r\n\r\n /**\r\n * Gets or sets the font size of the button text in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public textSizeInPixels = 18;\r\n\r\n /**\r\n * Gets or sets the size of the button image in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public imageSizeInPixels = 40;\r\n\r\n /**\r\n * Gets or sets the color of the button plate.\r\n */\r\n public plateMaterialColor = new Color3(0.4, 0.4, 0.4);\r\n\r\n // Shared variables for meshes\r\n /**\r\n * Gets or sets the depth of the button's front plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public frontPlateDepth = 0.2;\r\n\r\n /**\r\n * Gets or sets the depth of the button's back plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public backPlateDepth = 0.04;\r\n\r\n /**\r\n * Gets or sets the offset value for button's back glow.\r\n * This variable determines the x, y scaling of the button's meshes.\r\n */\r\n public backGlowOffset = 0.1;\r\n\r\n /**\r\n * Gets or sets the value that determines the z scaling and z position for the innerQuad and BackGlow meshes.\r\n */\r\n public flatPlaneDepth = 0.001;\r\n\r\n /**\r\n * Gets or sets the radius for FrontMaterial and innerQuadMaterial.\r\n */\r\n public innerQuadRadius = this.radius - 0.04;\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial.\r\n */\r\n public innerQuadColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled.\r\n */\r\n public innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is hovered.\r\n */\r\n public innerQuadHoverColor = new Color4(1, 1, 1, 0.05);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled and hovered.\r\n */\r\n public innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1);\r\n\r\n // Meshes\r\n private _backPlate: AbstractMesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _backGlow: AbstractMesh;\r\n private _innerQuad: AbstractMesh;\r\n private _collisionPlate: AbstractMesh;\r\n private _frontPlateCollisionMesh: AbstractMesh;\r\n private _isBackplateVisible = true;\r\n\r\n // Content\r\n private _text: string;\r\n private _subtext: string;\r\n private _imageUrl: string;\r\n\r\n // Materials\r\n private _shareMaterials = true;\r\n private _frontMaterial: MRDLFrontplateMaterial;\r\n private _backMaterial: MRDLBackplateMaterial;\r\n private _backGlowMaterial: MRDLBackglowMaterial;\r\n private _innerQuadMaterial: MRDLInnerquadMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n\r\n // Events\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerClickObserver: Nullable<Observer<Vector3WithInfo>>;\r\n private _pointerEnterObserver: Nullable<Observer<Control3D>>;\r\n private _pointerOutObserver: Nullable<Observer<Control3D>>;\r\n private _toggleObserver: Nullable<Observer<boolean>>;\r\n\r\n // Tooltip\r\n private _tooltipFade: Nullable<FadeInOutBehavior>;\r\n private _tooltipTextBlock: Nullable<TextBlock>;\r\n private _tooltipTexture: Nullable<AdvancedDynamicTexture>;\r\n private _tooltipMesh: Nullable<Mesh>;\r\n private _tooltipHoverObserver: Nullable<Observer<Control3D>>;\r\n private _tooltipOutObserver: Nullable<Observer<Control3D>>;\r\n\r\n private _disposeTooltip() {\r\n this._tooltipFade = null;\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.dispose();\r\n }\r\n if (this._tooltipTexture) {\r\n this._tooltipTexture.dispose();\r\n }\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.dispose();\r\n }\r\n this.onPointerEnterObservable.remove(this._tooltipHoverObserver);\r\n this.onPointerOutObservable.remove(this._tooltipOutObserver);\r\n }\r\n\r\n /**\r\n * Rendering ground id of all the mesh in the button\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._backPlate.renderingGroupId = id;\r\n this._textPlate.renderingGroupId = id;\r\n this._frontPlate.renderingGroupId = id;\r\n this._backGlow.renderingGroupId = id;\r\n this._innerQuad.renderingGroupId = id;\r\n\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.renderingGroupId = id;\r\n }\r\n }\r\n public get renderingGroupId(): number {\r\n return this._backPlate.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public override get mesh(): Nullable<AbstractMesh> {\r\n return this._backPlate as AbstractMesh;\r\n }\r\n\r\n /**\r\n * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\r\n * Set this property after adding the button to the GUI3DManager\r\n */\r\n public set tooltipText(text: Nullable<string>) {\r\n if (!text) {\r\n this._disposeTooltip();\r\n return;\r\n }\r\n if (!this._tooltipFade) {\r\n const rightHandedScene = this._backPlate._scene.useRightHandedSystem;\r\n // Create tooltip with mesh and text\r\n this._tooltipMesh = CreatePlane(\"\", { size: 1 }, this._backPlate._scene);\r\n this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._frontPlateCollisionMesh;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n const tooltipBackground = new Rectangle();\r\n tooltipBackground.height = 0.25;\r\n tooltipBackground.width = 0.8;\r\n tooltipBackground.cornerRadius = 25;\r\n tooltipBackground.color = \"#ffffff\";\r\n tooltipBackground.thickness = 20;\r\n tooltipBackground.background = \"#060668\";\r\n this._tooltipTexture.addControl(tooltipBackground);\r\n\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 100;\r\n this._tooltipTexture.addControl(this._tooltipTextBlock);\r\n\r\n // Add hover action to tooltip\r\n this._tooltipFade = new FadeInOutBehavior();\r\n this._tooltipFade.delay = 500;\r\n this._tooltipMesh.addBehavior(this._tooltipFade);\r\n this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(true);\r\n }\r\n });\r\n this._tooltipOutObserver = this.onPointerOutObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(false);\r\n }\r\n });\r\n }\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.text = text;\r\n }\r\n }\r\n\r\n public get tooltipText() {\r\n return this._tooltipTextBlock?.text || null;\r\n }\r\n\r\n /**\r\n * Gets or sets text for the button\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n\r\n this._text = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets subtext for a button with larger width\r\n */\r\n public get subtext(): string {\r\n return this._subtext;\r\n }\r\n\r\n public set subtext(value: string) {\r\n if (this._subtext === value) {\r\n return;\r\n }\r\n\r\n this._subtext = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets the image url for the button\r\n */\r\n public get imageUrl(): string {\r\n return this._imageUrl;\r\n }\r\n\r\n public set imageUrl(value: string) {\r\n if (this._imageUrl === value) {\r\n return;\r\n }\r\n\r\n this._imageUrl = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets the back material used by this button\r\n */\r\n public get backMaterial(): MRDLBackplateMaterial {\r\n return this._backMaterial;\r\n }\r\n\r\n /**\r\n * Gets the front material used by this button\r\n */\r\n public get frontMaterial(): MRDLFrontplateMaterial {\r\n return this._frontMaterial;\r\n }\r\n\r\n /**\r\n * Gets the back glow material used by this button\r\n */\r\n public get backGlowMaterial(): MRDLBackglowMaterial {\r\n return this._backGlowMaterial;\r\n }\r\n\r\n /**\r\n * Gets the inner quad material used by this button\r\n */\r\n public get innerQuadMaterial(): MRDLInnerquadMaterial {\r\n return this._innerQuadMaterial;\r\n }\r\n\r\n /**\r\n * Gets the plate material used by this button\r\n */\r\n public get plateMaterial(): StandardMaterial {\r\n return this._plateMaterial;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this button shares its material with other V3 Buttons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement\r\n */\r\n public set isBackplateVisible(isVisible: boolean) {\r\n if (this.mesh && this._backMaterial) {\r\n if (isVisible && !this._isBackplateVisible) {\r\n this._backPlate.visibility = 1;\r\n } else if (!isVisible && this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n }\r\n\r\n this._isBackplateVisible = isVisible;\r\n }\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param shareMaterials\r\n */\r\n constructor(name?: string, shareMaterials = true) {\r\n super(name);\r\n\r\n this._shareMaterials = shareMaterials;\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(1);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n if (this.isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledHoverColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadHoverColor;\r\n }\r\n }\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(-0.8);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this._pointerClickObserver = this.onPointerClickObservable.add(() => {\r\n if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) {\r\n this._performClickAnimation();\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n });\r\n\r\n this._pointerEnterObserver = this.onPointerEnterObservable.add(() => {\r\n this.pointerEnterAnimation();\r\n });\r\n\r\n this._pointerOutObserver = this.onPointerOutObservable.add(() => {\r\n this.pointerOutAnimation();\r\n });\r\n\r\n this._toggleObserver = this.onToggleObservable.add((isToggled) => {\r\n if (isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n });\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"TouchHolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n let content: Control;\r\n\r\n if (this._getAspectRatio() <= 1) {\r\n // align text and image vertically\r\n content = this._alignContentVertically();\r\n } else {\r\n // align text and image horizontally\r\n content = this._alignContentHorizontally();\r\n }\r\n\r\n this.content = content;\r\n }\r\n\r\n private _getAspectRatio() {\r\n return this.width / this.height;\r\n }\r\n\r\n private _alignContentVertically() {\r\n const panel = new StackPanel();\r\n panel.isVertical = true;\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n image.heightInPixels = 180;\r\n image.widthInPixels = 100;\r\n image.paddingTopInPixels = 40;\r\n image.paddingBottomInPixels = 40;\r\n panel.addControl(image);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock();\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.heightInPixels = 30;\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n return panel;\r\n }\r\n\r\n private _alignContentHorizontally() {\r\n let totalPanelWidthInPixels = 240;\r\n const padding = 15;\r\n\r\n const contentContainer = new Rectangle();\r\n contentContainer.widthInPixels = totalPanelWidthInPixels;\r\n contentContainer.heightInPixels = totalPanelWidthInPixels;\r\n contentContainer.color = \"transparent\";\r\n contentContainer.setPaddingInPixels(padding, padding, padding, padding);\r\n totalPanelWidthInPixels -= padding * 2;\r\n\r\n const panel = new StackPanel();\r\n panel.isVertical = false;\r\n panel.scaleY = this._getAspectRatio();\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const imageContainer = new Rectangle(`${this.name}_image`);\r\n imageContainer.widthInPixels = this.imageSizeInPixels;\r\n imageContainer.heightInPixels = this.imageSizeInPixels;\r\n imageContainer.color = \"transparent\";\r\n totalPanelWidthInPixels -= this.imageSizeInPixels;\r\n\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n\r\n imageContainer.addControl(image);\r\n panel.addControl(imageContainer);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock(`${this.name}_text`);\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.fontSize = this.textSizeInPixels;\r\n text.widthInPixels = totalPanelWidthInPixels;\r\n\r\n if (this._imageUrl) {\r\n text.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n text.paddingLeftInPixels = padding;\r\n }\r\n\r\n if (this._subtext) {\r\n const textContainer = new Grid();\r\n textContainer.addColumnDefinition(1);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.widthInPixels = totalPanelWidthInPixels;\r\n textContainer.heightInPixels = 45;\r\n\r\n const subtext = new TextBlock(`${this.name}_subtext`);\r\n subtext.text = this._subtext;\r\n subtext.color = \"#EEEEEEAB\";\r\n subtext.fontSize = this.textSizeInPixels * 0.75;\r\n subtext.fontWeight = \"600\";\r\n\r\n if (this._imageUrl) {\r\n subtext.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n subtext.paddingLeftInPixels = padding;\r\n }\r\n\r\n textContainer.addControl(text, 0);\r\n textContainer.addControl(subtext, 1);\r\n panel.addControl(textContainer);\r\n } else {\r\n panel.addControl(text);\r\n }\r\n }\r\n\r\n contentContainer.addControl(panel);\r\n return contentContainer;\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n\r\n const backPlateMesh = this._createBackPlate(scene);\r\n const collisionMesh = this._createFrontPlate(scene);\r\n const innerQuadMesh = this._createInnerQuad(scene);\r\n const backGlowMesh = this._createBackGlow(scene);\r\n\r\n this._frontPlateCollisionMesh = collisionMesh;\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.name = `${this.name}_textPlate`;\r\n this._textPlate.isPickable = false;\r\n this._textPlate.scaling.x = this.width;\r\n this._textPlate.parent = collisionMesh;\r\n\r\n this._backPlate = backPlateMesh;\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this.backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(innerQuadMesh);\r\n\r\n if (backGlowMesh) {\r\n this._backPlate.addChild(backGlowMesh);\r\n }\r\n\r\n const tn = new TransformNode(`${this.name}_root`, scene);\r\n this._backPlate.setParent(tn);\r\n\r\n this.collisionMesh = collisionMesh;\r\n this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way\r\n\r\n return tn;\r\n }\r\n\r\n private _createBackPlate(scene: Scene) {\r\n const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene);\r\n backPlateMesh.isPickable = false;\r\n backPlateMesh.visibility = 0;\r\n backPlateMesh.scaling.z = 0.2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const backPlateModel = result.meshes[1];\r\n backPlateModel.visibility = 0;\r\n\r\n if (this._isBackplateVisible) {\r\n backPlateModel.visibility = 1;\r\n backPlateModel.name = `${this.name}_backPlate`;\r\n backPlateModel.isPickable = false;\r\n backPlateModel.scaling.x = this.width;\r\n backPlateModel.scaling.y = this.height;\r\n backPlateModel.parent = backPlateMesh;\r\n }\r\n\r\n if (this._backMaterial) {\r\n backPlateModel.material = this._backMaterial;\r\n }\r\n\r\n this._backPlate = backPlateModel;\r\n });\r\n\r\n return backPlateMesh;\r\n }\r\n\r\n private _createFrontPlate(scene: Scene) {\r\n const collisionMesh = CreateBox(\r\n `${this.name}_frontPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n depth: this.frontPlateDepth,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.isNearPickable = true;\r\n collisionMesh.visibility = 0;\r\n collisionMesh.position = Vector3.Forward(scene.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.FRONTPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const collisionPlate = CreateBox(\r\n `${this.name}_collisionPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n },\r\n scene\r\n );\r\n collisionPlate.isPickable = false;\r\n collisionPlate.scaling.z = this.frontPlateDepth;\r\n collisionPlate.visibility = 0;\r\n collisionPlate.parent = collisionMesh;\r\n this._collisionPlate = collisionPlate;\r\n\r\n const frontPlateModel = result.meshes[1];\r\n frontPlateModel.name = `${this.name}_frontPlate`;\r\n frontPlateModel.isPickable = false;\r\n frontPlateModel.scaling.x = this.width - this.backGlowOffset;\r\n frontPlateModel.scaling.y = this.height - this.backGlowOffset;\r\n frontPlateModel.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.5);\r\n frontPlateModel.parent = collisionPlate;\r\n\r\n if (this.isToggleButton) {\r\n frontPlateModel.visibility = 0;\r\n }\r\n\r\n if (this._frontMaterial) {\r\n frontPlateModel.material = this._frontMaterial;\r\n }\r\n\r\n this._textPlate.scaling.x = 1;\r\n this._textPlate.parent = frontPlateModel;\r\n this._frontPlate = frontPlateModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createInnerQuad(scene: Scene) {\r\n const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene);\r\n innerQuadMesh.isPickable = false;\r\n innerQuadMesh.visibility = 0;\r\n innerQuadMesh.scaling.z = this.flatPlaneDepth;\r\n innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.INNERQUAD_MODEL_FILENAME, scene).then((result) => {\r\n const innerQuadModel = result.meshes[1];\r\n innerQuadModel.name = `${this.name}_innerQuad`;\r\n innerQuadModel.isPickable = false;\r\n innerQuadModel.scaling.x = this.width - this.backGlowOffset;\r\n innerQuadModel.scaling.y = this.height - this.backGlowOffset;\r\n innerQuadModel.parent = innerQuadMesh;\r\n\r\n if (this._innerQuadMaterial) {\r\n innerQuadModel.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._innerQuad = innerQuadModel;\r\n });\r\n\r\n return innerQuadMesh;\r\n }\r\n\r\n private _createBackGlow(scene: Scene) {\r\n if (this.isToggleButton) {\r\n return;\r\n }\r\n\r\n const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene);\r\n backGlowMesh.isPickable = false;\r\n backGlowMesh.visibility = 0;\r\n backGlowMesh.scaling.z = this.flatPlaneDepth;\r\n backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKGLOW_MODEL_FILENAME, scene).then((result) => {\r\n const backGlowModel = result.meshes[1];\r\n backGlowModel.name = `${this.name}_backGlow`;\r\n backGlowModel.isPickable = false;\r\n backGlowModel.scaling.x = this.width - this.backGlowOffset;\r\n backGlowModel.scaling.y = this.height - this.backGlowOffset;\r\n backGlowModel.parent = backGlowMesh;\r\n\r\n if (this._backGlowMaterial) {\r\n backGlowModel.material = this._backGlowMaterial;\r\n }\r\n\r\n this._backGlow = backGlowModel;\r\n });\r\n\r\n return backGlowMesh;\r\n }\r\n\r\n protected override _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = this.plateMaterialColor;\r\n }\r\n\r\n private _performClickAnimation() {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Click Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"backGlowMotion\",\r\n mesh: this._backGlow,\r\n property: \"material.motion\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0],\r\n },\r\n {\r\n frame: 20,\r\n values: [1, 0.0144, 0.0144],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0027713229489760476, 0, 0],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0027713229489760476],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZSlide\",\r\n mesh: this._collisionPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0.0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0, 0.005403332496794331],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZScale\",\r\n mesh: this._collisionPlate,\r\n property: \"scaling.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [this.frontPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [this.backPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [this.frontPlateDepth, 0.0054],\r\n },\r\n {\r\n frame: 45,\r\n values: [this.frontPlateDepth],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = 1;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _performEnterExitAnimation(speedRatio: number) {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Enter Exit Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"frontPlateFadeOut\",\r\n mesh: this._frontPlate,\r\n property: \"material.fadeOut\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0.025045314830017686, 0],\r\n },\r\n {\r\n frame: 40,\r\n values: [1.00205599570012, 0.025045314830017686, 0, 0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"textPlateZSlide\",\r\n mesh: this._textPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0.0, 0.0],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = speedRatio;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = this._backMaterial ?? new MRDLBackplateMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.absoluteSizes = true;\r\n this._backMaterial.radius = this.radius;\r\n this._backMaterial.lineWidth = 0.02;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = this._frontMaterial ?? new MRDLFrontplateMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this.frontMaterial.radius = this.innerQuadRadius;\r\n this.frontMaterial.fadeOut = 0.0;\r\n }\r\n\r\n private _createBackGlowMaterial(mesh: Mesh) {\r\n const glowRadius = this.radius + 0.04;\r\n this._backGlowMaterial = this._backGlowMaterial ?? new MRDLBackglowMaterial(this.name + \"Back Glow Material\", mesh.getScene());\r\n this._backGlowMaterial.bevelRadius = glowRadius;\r\n this._backGlowMaterial.lineWidth = glowRadius;\r\n this._backGlowMaterial.motion = 0.0;\r\n }\r\n\r\n private _createInnerQuadMaterial(mesh: Mesh) {\r\n this._innerQuadMaterial = this._innerQuadMaterial ?? new MRDLInnerquadMaterial(\"inner_quad\", mesh.getScene());\r\n this._innerQuadMaterial.radius = this.innerQuadRadius;\r\n\r\n if (this.isToggleButton) {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n this._plateMaterial = this._plateMaterial ?? new StandardMaterial(this.name + \"Plate Material\", mesh.getScene());\r\n this._plateMaterial.specularColor = Color3.Black();\r\n }\r\n\r\n protected override _onToggle(newState: boolean) {\r\n super._onToggle(newState);\r\n }\r\n\r\n protected override _affectMaterial(mesh: Mesh) {\r\n if (this._shareMaterials) {\r\n // Back\r\n if (!this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] as MRDLBackplateMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] as MRDLFrontplateMaterial;\r\n }\r\n\r\n // Back glow\r\n if (!this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"]) {\r\n this._createBackGlowMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] = this._backGlowMaterial;\r\n } else {\r\n this._backGlowMaterial = this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] as MRDLBackglowMaterial;\r\n }\r\n\r\n // Inner quad\r\n if (!this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"]) {\r\n this._createInnerQuadMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] = this._innerQuadMaterial;\r\n } else {\r\n this._innerQuadMaterial = this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] as MRDLInnerquadMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n this._createBackGlowMaterial(mesh);\r\n this._createInnerQuadMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\r\n }\r\n\r\n if (this._backGlow) {\r\n this._backGlow.material = this._backGlowMaterial;\r\n }\r\n\r\n if (this._innerQuad) {\r\n this._innerQuad.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n this._disposeTooltip();\r\n this.onPointerClickObservable.remove(this._pointerClickObserver);\r\n this.onPointerEnterObservable.remove(this._pointerEnterObserver);\r\n this.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this.onToggleObservable.remove(this._toggleObserver);\r\n\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.dispose();\r\n this._backGlowMaterial.dispose();\r\n this._innerQuadMaterial.dispose();\r\n\r\n if (this._pickedPointObserver) {\r\n this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);\r\n this._pickedPointObserver = null;\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,gDAAkC;AACtD,OAAO,EAAE,cAAc,EAAE,qDAAuC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,qB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ErE;;GAEG;AACW,8CAAuB,GAAG,wBAAwB,AAA3B,CAA4B;AAEjE;;GAEG;AACW,+CAAwB,GAAG,oBAAoB,AAAvB,CAAwB","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Control3D } from \"../control3D\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Vector3WithInfo } from \"../../vector3WithInfo\";\r\n\r\nimport { AdvancedDynamicTexture } from \"../../../2D/advancedDynamicTexture\";\r\nimport { Animation } from \"core/Animations/animation\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { Control } from \"../../../2D/controls/control\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport { Grid } from \"../../../2D/controls/grid\";\r\nimport { Image } from \"../../../2D/controls/image\";\r\nimport { MRDLBackglowMaterial } from \"../../materials/mrdl/mrdlBackglowMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../../materials/mrdl/mrdlBackplateMaterial\";\r\nimport { MRDLFrontplateMaterial } from \"../../materials/mrdl/mrdlFrontplateMaterial\";\r\nimport { MRDLInnerquadMaterial } from \"../../materials/mrdl/mrdlInnerquadMaterial\";\r\nimport { Rectangle } from \"../../../2D/controls/rectangle\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { StackPanel } from \"../../../2D/controls/stackPanel\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport { TextBlock } from \"../../../2D/controls/textBlock\";\r\nimport { TouchButton3D } from \"../touchButton3D\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Class used to create the mrtkv3 button\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\r\n /**\r\n * Base Url for the frontplate model.\r\n */\r\n public static MRTK_ASSET_BASE_URL = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the frontplate model.\r\n */\r\n public static FRONTPLATE_MODEL_FILENAME = \"mrtk-fluent-frontplate.glb\";\r\n\r\n /**\r\n * File name for the backplate model.\r\n */\r\n public static BACKPLATE_MODEL_FILENAME = \"mrtk-fluent-backplate.glb\";\r\n\r\n /**\r\n * File name for the backglow model.\r\n */\r\n public static BACKGLOW_MODEL_FILENAME = \"mrtk-fluent-button.glb\";\r\n\r\n /**\r\n * File name for the innerquad model.\r\n */\r\n public static INNERQUAD_MODEL_FILENAME = \"SlateProximity.glb\";\r\n\r\n /**\r\n * Gets or sets the horizontal scaling for the button.\r\n */\r\n public width = 1;\r\n\r\n /**\r\n * Gets or sets the vertical scaling for the button.\r\n */\r\n public height = 1;\r\n\r\n /**\r\n * Gets or sets the bevel radius for the button.\r\n */\r\n public radius = 0.14;\r\n\r\n /**\r\n * Gets or sets the font size of the button text in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public textSizeInPixels = 18;\r\n\r\n /**\r\n * Gets or sets the size of the button image in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public imageSizeInPixels = 40;\r\n\r\n /**\r\n * Gets or sets the color of the button plate.\r\n */\r\n public plateMaterialColor = new Color3(0.4, 0.4, 0.4);\r\n\r\n // Shared variables for meshes\r\n /**\r\n * Gets or sets the depth of the button's front plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public frontPlateDepth = 0.2;\r\n\r\n /**\r\n * Gets or sets the depth of the button's back plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public backPlateDepth = 0.04;\r\n\r\n /**\r\n * Gets or sets the offset value for button's back glow.\r\n * This variable determines the x, y scaling of the button's meshes.\r\n */\r\n public backGlowOffset = 0.1;\r\n\r\n /**\r\n * Gets or sets the value that determines the z scaling and z position for the innerQuad and BackGlow meshes.\r\n */\r\n public flatPlaneDepth = 0.001;\r\n\r\n /**\r\n * Gets or sets the radius for FrontMaterial and innerQuadMaterial.\r\n */\r\n public innerQuadRadius = this.radius - 0.04;\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial.\r\n */\r\n public innerQuadColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled.\r\n */\r\n public innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is hovered.\r\n */\r\n public innerQuadHoverColor = new Color4(1, 1, 1, 0.05);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled and hovered.\r\n */\r\n public innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1);\r\n\r\n // Meshes\r\n private _backPlate: AbstractMesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _backGlow: AbstractMesh;\r\n private _innerQuad: AbstractMesh;\r\n private _collisionPlate: AbstractMesh;\r\n private _frontPlateCollisionMesh: AbstractMesh;\r\n private _isBackplateVisible = true;\r\n\r\n // Content\r\n private _text: string;\r\n private _subtext: string;\r\n private _imageUrl: string;\r\n\r\n // Materials\r\n private _shareMaterials = true;\r\n private _frontMaterial: MRDLFrontplateMaterial;\r\n private _backMaterial: MRDLBackplateMaterial;\r\n private _backGlowMaterial: MRDLBackglowMaterial;\r\n private _innerQuadMaterial: MRDLInnerquadMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n\r\n // Events\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerClickObserver: Nullable<Observer<Vector3WithInfo>>;\r\n private _pointerEnterObserver: Nullable<Observer<Control3D>>;\r\n private _pointerOutObserver: Nullable<Observer<Control3D>>;\r\n private _toggleObserver: Nullable<Observer<boolean>>;\r\n\r\n // Tooltip\r\n private _tooltipFade: Nullable<FadeInOutBehavior>;\r\n private _tooltipTextBlock: Nullable<TextBlock>;\r\n private _tooltipTexture: Nullable<AdvancedDynamicTexture>;\r\n private _tooltipMesh: Nullable<Mesh>;\r\n private _tooltipHoverObserver: Nullable<Observer<Control3D>>;\r\n private _tooltipOutObserver: Nullable<Observer<Control3D>>;\r\n\r\n private _disposeTooltip() {\r\n this._tooltipFade = null;\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.dispose();\r\n }\r\n if (this._tooltipTexture) {\r\n this._tooltipTexture.dispose();\r\n }\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.dispose();\r\n }\r\n this.onPointerEnterObservable.remove(this._tooltipHoverObserver);\r\n this.onPointerOutObservable.remove(this._tooltipOutObserver);\r\n }\r\n\r\n /**\r\n * Rendering ground id of all the mesh in the button\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._backPlate.renderingGroupId = id;\r\n this._textPlate.renderingGroupId = id;\r\n this._frontPlate.renderingGroupId = id;\r\n this._backGlow.renderingGroupId = id;\r\n this._innerQuad.renderingGroupId = id;\r\n\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.renderingGroupId = id;\r\n }\r\n }\r\n public get renderingGroupId(): number {\r\n return this._backPlate.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public override get mesh(): Nullable<AbstractMesh> {\r\n return this._backPlate as AbstractMesh;\r\n }\r\n\r\n /**\r\n * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\r\n * Set this property after adding the button to the GUI3DManager\r\n */\r\n public set tooltipText(text: Nullable<string>) {\r\n if (!text) {\r\n this._disposeTooltip();\r\n return;\r\n }\r\n if (!this._tooltipFade) {\r\n const rightHandedScene = this._backPlate._scene.useRightHandedSystem;\r\n // Create tooltip with mesh and text\r\n this._tooltipMesh = CreatePlane(\"\", { size: 1 }, this._backPlate._scene);\r\n this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._frontPlateCollisionMesh;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n const tooltipBackground = new Rectangle();\r\n tooltipBackground.height = 0.25;\r\n tooltipBackground.width = 0.8;\r\n tooltipBackground.cornerRadius = 25;\r\n tooltipBackground.color = \"#ffffff\";\r\n tooltipBackground.thickness = 20;\r\n tooltipBackground.background = \"#060668\";\r\n this._tooltipTexture.addControl(tooltipBackground);\r\n\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 100;\r\n this._tooltipTexture.addControl(this._tooltipTextBlock);\r\n\r\n // Add hover action to tooltip\r\n this._tooltipFade = new FadeInOutBehavior();\r\n this._tooltipFade.delay = 500;\r\n this._tooltipMesh.addBehavior(this._tooltipFade);\r\n this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(true);\r\n }\r\n });\r\n this._tooltipOutObserver = this.onPointerOutObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(false);\r\n }\r\n });\r\n }\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.text = text;\r\n }\r\n }\r\n\r\n public get tooltipText() {\r\n return this._tooltipTextBlock?.text || null;\r\n }\r\n\r\n /**\r\n * Gets or sets text for the button\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n\r\n this._text = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets subtext for a button with larger width\r\n */\r\n public get subtext(): string {\r\n return this._subtext;\r\n }\r\n\r\n public set subtext(value: string) {\r\n if (this._subtext === value) {\r\n return;\r\n }\r\n\r\n this._subtext = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets the image url for the button\r\n */\r\n public get imageUrl(): string {\r\n return this._imageUrl;\r\n }\r\n\r\n public set imageUrl(value: string) {\r\n if (this._imageUrl === value) {\r\n return;\r\n }\r\n\r\n this._imageUrl = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets the back material used by this button\r\n */\r\n public get backMaterial(): MRDLBackplateMaterial {\r\n return this._backMaterial;\r\n }\r\n\r\n /**\r\n * Gets the front material used by this button\r\n */\r\n public get frontMaterial(): MRDLFrontplateMaterial {\r\n return this._frontMaterial;\r\n }\r\n\r\n /**\r\n * Gets the back glow material used by this button\r\n */\r\n public get backGlowMaterial(): MRDLBackglowMaterial {\r\n return this._backGlowMaterial;\r\n }\r\n\r\n /**\r\n * Gets the inner quad material used by this button\r\n */\r\n public get innerQuadMaterial(): MRDLInnerquadMaterial {\r\n return this._innerQuadMaterial;\r\n }\r\n\r\n /**\r\n * Gets the plate material used by this button\r\n */\r\n public get plateMaterial(): StandardMaterial {\r\n return this._plateMaterial;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this button shares its material with other V3 Buttons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement\r\n */\r\n public set isBackplateVisible(isVisible: boolean) {\r\n if (this.mesh && this._backMaterial) {\r\n if (isVisible && !this._isBackplateVisible) {\r\n this._backPlate.visibility = 1;\r\n } else if (!isVisible && this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n }\r\n\r\n this._isBackplateVisible = isVisible;\r\n }\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param shareMaterials\r\n */\r\n constructor(name?: string, shareMaterials = true) {\r\n super(name);\r\n\r\n this._shareMaterials = shareMaterials;\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(1);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n if (this.isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledHoverColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadHoverColor;\r\n }\r\n }\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(-0.8);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this._pointerClickObserver = this.onPointerClickObservable.add(() => {\r\n if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) {\r\n this._performClickAnimation();\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n });\r\n\r\n this._pointerEnterObserver = this.onPointerEnterObservable.add(() => {\r\n this.pointerEnterAnimation();\r\n });\r\n\r\n this._pointerOutObserver = this.onPointerOutObservable.add(() => {\r\n this.pointerOutAnimation();\r\n });\r\n\r\n this._toggleObserver = this.onToggleObservable.add((isToggled) => {\r\n if (isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n });\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"TouchHolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n let content: Control;\r\n\r\n if (this._getAspectRatio() <= 1) {\r\n // align text and image vertically\r\n content = this._alignContentVertically();\r\n } else {\r\n // align text and image horizontally\r\n content = this._alignContentHorizontally();\r\n }\r\n\r\n this.content = content;\r\n }\r\n\r\n private _getAspectRatio() {\r\n return this.width / this.height;\r\n }\r\n\r\n private _alignContentVertically() {\r\n const panel = new StackPanel();\r\n panel.isVertical = true;\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n image.heightInPixels = 180;\r\n image.widthInPixels = 100;\r\n image.paddingTopInPixels = 40;\r\n image.paddingBottomInPixels = 40;\r\n panel.addControl(image);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock();\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.heightInPixels = 30;\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n return panel;\r\n }\r\n\r\n private _alignContentHorizontally() {\r\n let totalPanelWidthInPixels = 240;\r\n const padding = 15;\r\n\r\n const contentContainer = new Rectangle();\r\n contentContainer.widthInPixels = totalPanelWidthInPixels;\r\n contentContainer.heightInPixels = totalPanelWidthInPixels;\r\n contentContainer.color = \"transparent\";\r\n contentContainer.setPaddingInPixels(padding, padding, padding, padding);\r\n totalPanelWidthInPixels -= padding * 2;\r\n\r\n const panel = new StackPanel();\r\n panel.isVertical = false;\r\n panel.scaleY = this._getAspectRatio();\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const imageContainer = new Rectangle(`${this.name}_image`);\r\n imageContainer.widthInPixels = this.imageSizeInPixels;\r\n imageContainer.heightInPixels = this.imageSizeInPixels;\r\n imageContainer.color = \"transparent\";\r\n totalPanelWidthInPixels -= this.imageSizeInPixels;\r\n\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n\r\n imageContainer.addControl(image);\r\n panel.addControl(imageContainer);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock(`${this.name}_text`);\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.fontSize = this.textSizeInPixels;\r\n text.widthInPixels = totalPanelWidthInPixels;\r\n\r\n if (this._imageUrl) {\r\n text.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n text.paddingLeftInPixels = padding;\r\n }\r\n\r\n if (this._subtext) {\r\n const textContainer = new Grid();\r\n textContainer.addColumnDefinition(1);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.widthInPixels = totalPanelWidthInPixels;\r\n textContainer.heightInPixels = 45;\r\n\r\n const subtext = new TextBlock(`${this.name}_subtext`);\r\n subtext.text = this._subtext;\r\n subtext.color = \"#EEEEEEAB\";\r\n subtext.fontSize = this.textSizeInPixels * 0.75;\r\n subtext.fontWeight = \"600\";\r\n\r\n if (this._imageUrl) {\r\n subtext.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n subtext.paddingLeftInPixels = padding;\r\n }\r\n\r\n textContainer.addControl(text, 0);\r\n textContainer.addControl(subtext, 1);\r\n panel.addControl(textContainer);\r\n } else {\r\n panel.addControl(text);\r\n }\r\n }\r\n\r\n contentContainer.addControl(panel);\r\n return contentContainer;\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n\r\n const backPlateMesh = this._createBackPlate(scene);\r\n const collisionMesh = this._createFrontPlate(scene);\r\n const innerQuadMesh = this._createInnerQuad(scene);\r\n const backGlowMesh = this._createBackGlow(scene);\r\n\r\n this._frontPlateCollisionMesh = collisionMesh;\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.name = `${this.name}_textPlate`;\r\n this._textPlate.isPickable = false;\r\n this._textPlate.scaling.x = this.width;\r\n this._textPlate.parent = collisionMesh;\r\n\r\n this._backPlate = backPlateMesh;\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this.backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(innerQuadMesh);\r\n\r\n if (backGlowMesh) {\r\n this._backPlate.addChild(backGlowMesh);\r\n }\r\n\r\n const tn = new TransformNode(`${this.name}_root`, scene);\r\n this._backPlate.setParent(tn);\r\n\r\n this.collisionMesh = collisionMesh;\r\n this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way\r\n\r\n return tn;\r\n }\r\n\r\n private _createBackPlate(scene: Scene) {\r\n const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene);\r\n backPlateMesh.isPickable = false;\r\n backPlateMesh.visibility = 0;\r\n backPlateMesh.scaling.z = 0.2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const backPlateModel = result.meshes[1];\r\n backPlateModel.visibility = 0;\r\n\r\n if (this._isBackplateVisible) {\r\n backPlateModel.visibility = 1;\r\n backPlateModel.name = `${this.name}_backPlate`;\r\n backPlateModel.isPickable = false;\r\n backPlateModel.scaling.x = this.width;\r\n backPlateModel.scaling.y = this.height;\r\n backPlateModel.parent = backPlateMesh;\r\n }\r\n\r\n if (this._backMaterial) {\r\n backPlateModel.material = this._backMaterial;\r\n }\r\n\r\n this._backPlate = backPlateModel;\r\n });\r\n\r\n return backPlateMesh;\r\n }\r\n\r\n private _createFrontPlate(scene: Scene) {\r\n const collisionMesh = CreateBox(\r\n `${this.name}_frontPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n depth: this.frontPlateDepth,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.isNearPickable = true;\r\n collisionMesh.visibility = 0;\r\n collisionMesh.position = Vector3.Forward(scene.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.FRONTPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const collisionPlate = CreateBox(\r\n `${this.name}_collisionPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n },\r\n scene\r\n );\r\n collisionPlate.isPickable = false;\r\n collisionPlate.scaling.z = this.frontPlateDepth;\r\n collisionPlate.visibility = 0;\r\n collisionPlate.parent = collisionMesh;\r\n this._collisionPlate = collisionPlate;\r\n\r\n const frontPlateModel = result.meshes[1];\r\n frontPlateModel.name = `${this.name}_frontPlate`;\r\n frontPlateModel.isPickable = false;\r\n frontPlateModel.scaling.x = this.width - this.backGlowOffset;\r\n frontPlateModel.scaling.y = this.height - this.backGlowOffset;\r\n frontPlateModel.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.5);\r\n frontPlateModel.parent = collisionPlate;\r\n\r\n if (this.isToggleButton) {\r\n frontPlateModel.visibility = 0;\r\n }\r\n\r\n if (this._frontMaterial) {\r\n frontPlateModel.material = this._frontMaterial;\r\n }\r\n\r\n this._textPlate.scaling.x = 1;\r\n this._textPlate.parent = frontPlateModel;\r\n this._frontPlate = frontPlateModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createInnerQuad(scene: Scene) {\r\n const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene);\r\n innerQuadMesh.isPickable = false;\r\n innerQuadMesh.visibility = 0;\r\n innerQuadMesh.scaling.z = this.flatPlaneDepth;\r\n innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.INNERQUAD_MODEL_FILENAME, scene).then((result) => {\r\n const innerQuadModel = result.meshes[1];\r\n innerQuadModel.name = `${this.name}_innerQuad`;\r\n innerQuadModel.isPickable = false;\r\n innerQuadModel.scaling.x = this.width - this.backGlowOffset;\r\n innerQuadModel.scaling.y = this.height - this.backGlowOffset;\r\n innerQuadModel.parent = innerQuadMesh;\r\n\r\n if (this._innerQuadMaterial) {\r\n innerQuadModel.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._innerQuad = innerQuadModel;\r\n });\r\n\r\n return innerQuadMesh;\r\n }\r\n\r\n private _createBackGlow(scene: Scene) {\r\n if (this.isToggleButton) {\r\n return;\r\n }\r\n\r\n const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene);\r\n backGlowMesh.isPickable = false;\r\n backGlowMesh.visibility = 0;\r\n backGlowMesh.scaling.z = this.flatPlaneDepth;\r\n backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKGLOW_MODEL_FILENAME, scene).then((result) => {\r\n const backGlowModel = result.meshes[1];\r\n backGlowModel.name = `${this.name}_backGlow`;\r\n backGlowModel.isPickable = false;\r\n backGlowModel.scaling.x = this.width - this.backGlowOffset;\r\n backGlowModel.scaling.y = this.height - this.backGlowOffset;\r\n backGlowModel.parent = backGlowMesh;\r\n\r\n if (this._backGlowMaterial) {\r\n backGlowModel.material = this._backGlowMaterial;\r\n }\r\n\r\n this._backGlow = backGlowModel;\r\n });\r\n\r\n return backGlowMesh;\r\n }\r\n\r\n protected override _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = this.plateMaterialColor;\r\n }\r\n\r\n private _performClickAnimation() {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Click Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"backGlowMotion\",\r\n mesh: this._backGlow,\r\n property: \"material.motion\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0],\r\n },\r\n {\r\n frame: 20,\r\n values: [1, 0.0144, 0.0144],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0027713229489760476, 0, 0],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0027713229489760476],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZSlide\",\r\n mesh: this._collisionPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0.0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0, 0.005403332496794331],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZScale\",\r\n mesh: this._collisionPlate,\r\n property: \"scaling.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [this.frontPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [this.backPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [this.frontPlateDepth, 0.0054],\r\n },\r\n {\r\n frame: 45,\r\n values: [this.frontPlateDepth],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = 1;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _performEnterExitAnimation(speedRatio: number) {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Enter Exit Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"frontPlateFadeOut\",\r\n mesh: this._frontPlate,\r\n property: \"material.fadeOut\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0.025045314830017686, 0],\r\n },\r\n {\r\n frame: 40,\r\n values: [1.00205599570012, 0.025045314830017686, 0, 0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"textPlateZSlide\",\r\n mesh: this._textPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0.0, 0.0],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = speedRatio;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = this._backMaterial ?? new MRDLBackplateMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.absoluteSizes = true;\r\n this._backMaterial.radius = this.radius;\r\n this._backMaterial.lineWidth = 0.02;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = this._frontMaterial ?? new MRDLFrontplateMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this.frontMaterial.radius = this.innerQuadRadius;\r\n this.frontMaterial.fadeOut = 0.0;\r\n }\r\n\r\n private _createBackGlowMaterial(mesh: Mesh) {\r\n const glowRadius = this.radius + 0.04;\r\n this._backGlowMaterial = this._backGlowMaterial ?? new MRDLBackglowMaterial(this.name + \"Back Glow Material\", mesh.getScene());\r\n this._backGlowMaterial.bevelRadius = glowRadius;\r\n this._backGlowMaterial.lineWidth = glowRadius;\r\n this._backGlowMaterial.motion = 0.0;\r\n }\r\n\r\n private _createInnerQuadMaterial(mesh: Mesh) {\r\n this._innerQuadMaterial = this._innerQuadMaterial ?? new MRDLInnerquadMaterial(\"inner_quad\", mesh.getScene());\r\n this._innerQuadMaterial.radius = this.innerQuadRadius;\r\n\r\n if (this.isToggleButton) {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n this._plateMaterial = this._plateMaterial ?? new StandardMaterial(this.name + \"Plate Material\", mesh.getScene());\r\n this._plateMaterial.specularColor = Color3.Black();\r\n }\r\n\r\n protected override _onToggle(newState: boolean) {\r\n super._onToggle(newState);\r\n }\r\n\r\n protected override _affectMaterial(mesh: Mesh) {\r\n if (this._shareMaterials) {\r\n // Back\r\n if (!this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] as MRDLBackplateMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] as MRDLFrontplateMaterial;\r\n }\r\n\r\n // Back glow\r\n if (!this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"]) {\r\n this._createBackGlowMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] = this._backGlowMaterial;\r\n } else {\r\n this._backGlowMaterial = this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] as MRDLBackglowMaterial;\r\n }\r\n\r\n // Inner quad\r\n if (!this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"]) {\r\n this._createInnerQuadMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] = this._innerQuadMaterial;\r\n } else {\r\n this._innerQuadMaterial = this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] as MRDLInnerquadMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n this._createBackGlowMaterial(mesh);\r\n this._createInnerQuadMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\r\n }\r\n\r\n if (this._backGlow) {\r\n this._backGlow.material = this._backGlowMaterial;\r\n }\r\n\r\n if (this._innerQuad) {\r\n this._innerQuad.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n this._disposeTooltip();\r\n this.onPointerClickObservable.remove(this._pointerClickObserver);\r\n this.onPointerEnterObservable.remove(this._pointerEnterObserver);\r\n this.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this.onToggleObservable.remove(this._toggleObserver);\r\n\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.dispose();\r\n this._backGlowMaterial.dispose();\r\n this._innerQuadMaterial.dispose();\r\n\r\n if (this._pickedPointObserver) {\r\n this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);\r\n this._pickedPointObserver = null;\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"button3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/button3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAsB/C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,gBAAgB;IAQ1C;;;;OAIG;IACH,YAAY,IAAa,EAAE,OAAkC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,QAAQ,GAAG;YACZ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,IAAI;YACX,GAAG,OAAO;SACb,CAAC;QAEF,qBAAqB;QAErB,IAAI,CAAC,qBAAqB,GAAG,GAAG,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBACZ,OAAO;aACV;YACkB,IAAI,CAAC,gBAAiB,CAAC,aAAa,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;QAC3E,CAAC,CAAC;QAEF,IAAI,CAAC,mBAAmB,GAAG,GAAG,EAAE;YACT,IAAI,CAAC,gBAAiB,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAC7E,CAAC,CAAC;QAEF,IAAI,CAAC,oBAAoB,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;gBACZ,OAAO;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IAAI,CAAC,QAAQ,CAAC,KAAK;YAC1B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACb,EACD,KAAK,CACR,CAAC;QAEF,IAAI,CAAC,mBAAmB,GAAG,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAO,CAAC;QACpG,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAEhC,OAAO,IAAI,CAAC;IAChB,CAAC;IAEkB,eAAe,CAAC,IAAkB;QACjD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,GAAG,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/E,QAAQ,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;QAExC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QAEjC,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE7B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACvB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;SACnC;IACL,CAAC;CACJ","sourcesContent":["import { Vector4 } from \"core/Maths/math.vector\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { AbstractButton3D } from \"./abstractButton3D\";\r\nimport type { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Options used to create a button in 3D\r\n */\r\nexport interface IButton3DCreationOptions {\r\n /**\r\n * Width of the button. Default: 1\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Height of the button. Default: 1\r\n */\r\n height?: number;\r\n\r\n /**\r\n * Depth of the button. Default: 0.08\r\n */\r\n depth?: number;\r\n}\r\n\r\n/**\r\n * Class used to create a button in 3D\r\n */\r\nexport class Button3D extends AbstractButton3D {\r\n /** @internal */\r\n protected _currentMaterial: Material;\r\n\r\n protected _options: IButton3DCreationOptions;\r\n protected _height: number;\r\n protected _depth: number;\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param options defines the options used to create the button\r\n */\r\n constructor(name?: string, options?: IButton3DCreationOptions) {\r\n super(name);\r\n\r\n this._options = {\r\n width: 1,\r\n height: 1,\r\n depth: 0.08,\r\n ...options,\r\n };\r\n\r\n // Default animations\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Red();\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Black();\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n\r\n this.mesh.scaling.scaleInPlace(0.95);\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n\r\n this.mesh.scaling.scaleInPlace(1.0 / 0.95);\r\n };\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n protected override _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n (<any>this._currentMaterial).emissiveTexture = facadeTexture;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Button3D\";\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n const faceUV = new Array(6);\r\n\r\n for (let i = 0; i < 6; i++) {\r\n faceUV[i] = new Vector4(0, 0, 0, 0);\r\n }\r\n if (scene.useRightHandedSystem) {\r\n // Flip the u on the texture\r\n faceUV[0].copyFromFloats(1, 0, 0, 1);\r\n } else {\r\n faceUV[1].copyFromFloats(0, 0, 1, 1);\r\n }\r\n\r\n const mesh = CreateBox(\r\n this.name + \"_rootMesh\",\r\n {\r\n width: this._options.width,\r\n height: this._options.height,\r\n depth: this._options.depth,\r\n faceUV: faceUV,\r\n wrap: true,\r\n },\r\n scene\r\n );\r\n\r\n this._contentScaleRatioY = (this._contentScaleRatio * this._options.width!) / this._options.height!;\r\n this._setFacadeTextureScaling();\r\n\r\n return mesh;\r\n }\r\n\r\n protected override _affectMaterial(mesh: AbstractMesh) {\r\n const material = new StandardMaterial(this.name + \"Material\", mesh.getScene());\r\n material.specularColor = Color3.Black();\r\n\r\n mesh.material = material;\r\n this._currentMaterial = material;\r\n\r\n this._resetContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n\r\n this._disposeFacadeTexture();\r\n\r\n if (this._currentMaterial) {\r\n this._currentMaterial.dispose();\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"button3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/button3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAsB/C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,gBAAgB;IAQ1C;;;;OAIG;IACH,YAAY,IAAa,EAAE,OAAkC;QACzD,KAAK,CAAC,IAAI,CAAC,CAAC;QA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zB,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC;QAEjC,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE7B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;QACpC,CAAC;IACL,CAAC;CACJ","sourcesContent":["import { Vector4 } from \"core/Maths/math.vector\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { AbstractButton3D } from \"./abstractButton3D\";\r\nimport type { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\n/**\r\n * Options used to create a button in 3D\r\n */\r\nexport interface IButton3DCreationOptions {\r\n /**\r\n * Width of the button. Default: 1\r\n */\r\n width?: number;\r\n\r\n /**\r\n * Height of the button. Default: 1\r\n */\r\n height?: number;\r\n\r\n /**\r\n * Depth of the button. Default: 0.08\r\n */\r\n depth?: number;\r\n}\r\n\r\n/**\r\n * Class used to create a button in 3D\r\n */\r\nexport class Button3D extends AbstractButton3D {\r\n /** @internal */\r\n protected _currentMaterial: Material;\r\n\r\n protected _options: IButton3DCreationOptions;\r\n protected _height: number;\r\n protected _depth: number;\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param options defines the options used to create the button\r\n */\r\n constructor(name?: string, options?: IButton3DCreationOptions) {\r\n super(name);\r\n\r\n this._options = {\r\n width: 1,\r\n height: 1,\r\n depth: 0.08,\r\n ...options,\r\n };\r\n\r\n // Default animations\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Red();\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Black();\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n\r\n this.mesh.scaling.scaleInPlace(0.95);\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n\r\n this.mesh.scaling.scaleInPlace(1.0 / 0.95);\r\n };\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n protected override _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n (<any>this._currentMaterial).emissiveTexture = facadeTexture;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Button3D\";\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n const faceUV = new Array(6);\r\n\r\n for (let i = 0; i < 6; i++) {\r\n faceUV[i] = new Vector4(0, 0, 0, 0);\r\n }\r\n if (scene.useRightHandedSystem) {\r\n // Flip the u on the texture\r\n faceUV[0].copyFromFloats(1, 0, 0, 1);\r\n } else {\r\n faceUV[1].copyFromFloats(0, 0, 1, 1);\r\n }\r\n\r\n const mesh = CreateBox(\r\n this.name + \"_rootMesh\",\r\n {\r\n width: this._options.width,\r\n height: this._options.height,\r\n depth: this._options.depth,\r\n faceUV: faceUV,\r\n wrap: true,\r\n },\r\n scene\r\n );\r\n\r\n this._contentScaleRatioY = (this._contentScaleRatio * this._options.width!) / this._options.height!;\r\n this._setFacadeTextureScaling();\r\n\r\n return mesh;\r\n }\r\n\r\n protected override _affectMaterial(mesh: AbstractMesh) {\r\n const material = new StandardMaterial(this.name + \"Material\", mesh.getScene());\r\n material.specularColor = Color3.Black();\r\n\r\n mesh.material = material;\r\n this._currentMaterial = material;\r\n\r\n this._resetContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n\r\n this._disposeFacadeTexture();\r\n\r\n if (this._currentMaterial) {\r\n this._currentMaterial.dispose();\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"container3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/container3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IAQtC;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAc;QACjC,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,EAAE;YAC7B,OAAO;SACV;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,gBAAgB,EAAE,CAAC;SAC3B;IACL,CAAC;IAED;;;OAGG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,IAAI,CAAC,CAAC;QAvCR,iBAAY,GAAG,KAAK,CAAC;QAE7B;;WAEG;QACO,cAAS,GAAG,IAAI,KAAK,EAAa,CAAC;IAmC7C,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,OAAkB;QACrC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAA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,YAAY;QAC3B,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE;YAClC,OAAO,CAAC,OAAO,EAAE,CAAC;SACrB;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAE1B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;;AAED,8CAA8C;AACvB,6BAAiB,GAAG,CAAC,AAAJ,CAAK;AAE7C,iEAAiE;AAC1C,kCAAsB,GAAG,CAAC,AAAJ,CAAK;AAElD,sEAAsE;AAC/C,0CAA8B,GAAG,CAAC,AAAJ,CAAK;AAE1D,sDAAsD;AAC/B,mCAAuB,GAAG,CAAC,AAAJ,CAAK;AAEnD,gEAAgE;AACzC,2CAA+B,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { Control3D } from \"./control3D\";\r\n\r\n/**\r\n * Class used to create containers for controls\r\n */\r\nexport class Container3D extends Control3D {\r\n private _blockLayout = false;\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n protected _children = new Array<Control3D>();\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n public get children(): Array<Control3D> {\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the layout must be blocked (default is false).\r\n * This is helpful to optimize layout operation when adding multiple children in a row\r\n */\r\n public get blockLayout(): boolean {\r\n return this._blockLayout;\r\n }\r\n\r\n public set blockLayout(value: boolean) {\r\n if (this._blockLayout === value) {\r\n return;\r\n }\r\n\r\n this._blockLayout = value;\r\n\r\n if (!this._blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new container\r\n * @param name defines the container name\r\n */\r\n constructor(name?: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Force the container to update the layout. Please note that it will not take blockLayout property in account\r\n * @returns the current container\r\n */\r\n public updateLayout(): Container3D {\r\n this._arrangeChildren();\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given control is in the children of this control\r\n * @param control defines the control to check\r\n * @returns true if the control is in the child list\r\n */\r\n public containsControl(control: Control3D): boolean {\r\n return this._children.indexOf(control) !== -1;\r\n }\r\n\r\n /**\r\n * Adds a control to the children of this control\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n control.parent = this;\r\n control._host = this._host;\r\n\r\n this._children.push(control);\r\n\r\n if (this._host.utilityLayer) {\r\n control._prepareNode(this._host.utilityLayer.utilityLayerScene);\r\n\r\n if (control.node) {\r\n control.node.parent = this.node;\r\n }\r\n\r\n if (!this.blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * This function will be called everytime a new control is added\r\n */\r\n protected _arrangeChildren() {}\r\n\r\n protected override _createNode(scene: Scene): Nullable<TransformNode> {\r\n return new TransformNode(\"ContainerNode\", scene);\r\n }\r\n\r\n /**\r\n * Removes a control from the children of this control\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._children.splice(index, 1);\r\n\r\n control.parent = null;\r\n control._disposeNode();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Container3D\";\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n for (const control of this._children) {\r\n control.dispose();\r\n }\r\n\r\n this._children.length = 0;\r\n\r\n super.dispose();\r\n }\r\n\r\n /** Control rotation will remain unchanged */\r\n public static readonly UNSET_ORIENTATION = 0;\r\n\r\n /** Control will rotate to make it look at sphere central axis */\r\n public static readonly FACEORIGIN_ORIENTATION = 1;\r\n\r\n /** Control will rotate to make it look back at sphere central axis */\r\n public static readonly FACEORIGINREVERSED_ORIENTATION = 2;\r\n\r\n /** Control will rotate to look at z axis (0, 0, 1) */\r\n public static readonly FACEFORWARD_ORIENTATION = 3;\r\n\r\n /** Control will rotate to look at negative z axis (0, 0, -1) */\r\n public static readonly FACEFORWARDREVERSED_ORIENTATION = 4;\r\n}\r\n"]}
1
+ {"version":3,"file":"container3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/container3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IAQtC;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAc;QACjC,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,EAAE,CAAC;YAC9B,OAAO;QACX,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACrB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC5B,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,IAAI,CAAC,CAAC;QAvCR,iBAAY,GAAG,KAAK,CAAC;QAE7B;;WAEG;QACO,cAAS,GAAG,IAAI,KAAK,EAAa,CAAC;IAmC7C,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,OAAkB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AAC;YAEhC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YACtB,OAAO,CAAC,YAAY,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEkB,YAAY;QAC3B,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnC,OAAO,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAE1B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;;AAED,8CAA8C;AACvB,6BAAiB,GAAG,CAAC,AAAJ,CAAK;AAE7C,iEAAiE;AAC1C,kCAAsB,GAAG,CAAC,AAAJ,CAAK;AAElD,sEAAsE;AAC/C,0CAA8B,GAAG,CAAC,AAAJ,CAAK;AAE1D,sDAAsD;AAC/B,mCAAuB,GAAG,CAAC,AAAJ,CAAK;AAEnD,gEAAgE;AACzC,2CAA+B,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { Control3D } from \"./control3D\";\r\n\r\n/**\r\n * Class used to create containers for controls\r\n */\r\nexport class Container3D extends Control3D {\r\n private _blockLayout = false;\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n protected _children = new Array<Control3D>();\r\n\r\n /**\r\n * Gets the list of child controls\r\n */\r\n public get children(): Array<Control3D> {\r\n return this._children;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the layout must be blocked (default is false).\r\n * This is helpful to optimize layout operation when adding multiple children in a row\r\n */\r\n public get blockLayout(): boolean {\r\n return this._blockLayout;\r\n }\r\n\r\n public set blockLayout(value: boolean) {\r\n if (this._blockLayout === value) {\r\n return;\r\n }\r\n\r\n this._blockLayout = value;\r\n\r\n if (!this._blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new container\r\n * @param name defines the container name\r\n */\r\n constructor(name?: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Force the container to update the layout. Please note that it will not take blockLayout property in account\r\n * @returns the current container\r\n */\r\n public updateLayout(): Container3D {\r\n this._arrangeChildren();\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given control is in the children of this control\r\n * @param control defines the control to check\r\n * @returns true if the control is in the child list\r\n */\r\n public containsControl(control: Control3D): boolean {\r\n return this._children.indexOf(control) !== -1;\r\n }\r\n\r\n /**\r\n * Adds a control to the children of this control\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n control.parent = this;\r\n control._host = this._host;\r\n\r\n this._children.push(control);\r\n\r\n if (this._host.utilityLayer) {\r\n control._prepareNode(this._host.utilityLayer.utilityLayerScene);\r\n\r\n if (control.node) {\r\n control.node.parent = this.node;\r\n }\r\n\r\n if (!this.blockLayout) {\r\n this._arrangeChildren();\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * This function will be called everytime a new control is added\r\n */\r\n protected _arrangeChildren() {}\r\n\r\n protected override _createNode(scene: Scene): Nullable<TransformNode> {\r\n return new TransformNode(\"ContainerNode\", scene);\r\n }\r\n\r\n /**\r\n * Removes a control from the children of this control\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control3D): Container3D {\r\n const index = this._children.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._children.splice(index, 1);\r\n\r\n control.parent = null;\r\n control._disposeNode();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Container3D\";\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public override dispose() {\r\n for (const control of this._children) {\r\n control.dispose();\r\n }\r\n\r\n this._children.length = 0;\r\n\r\n super.dispose();\r\n }\r\n\r\n /** Control rotation will remain unchanged */\r\n public static readonly UNSET_ORIENTATION = 0;\r\n\r\n /** Control will rotate to make it look at sphere central axis */\r\n public static readonly FACEORIGIN_ORIENTATION = 1;\r\n\r\n /** Control will rotate to make it look back at sphere central axis */\r\n public static readonly FACEORIGINREVERSED_ORIENTATION = 2;\r\n\r\n /** Control will rotate to look at z axis (0, 0, 1) */\r\n public static readonly FACEFORWARD_ORIENTATION = 3;\r\n\r\n /** Control will rotate to look at negative z axis (0, 0, -1) */\r\n public static readonly FACEFORWARDREVERSED_ORIENTATION = 4;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"contentDisplay3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/contentDisplay3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAE1D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAA/C;;QAGc,uBAAkB,GAA+C,GAAG,CAAC;QACrE,uBAAkB,GAAG,CAAC,CAAC;IAiFrC,CAAC;IA9EG;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;YACnD,OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,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AI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAW,iBAAiB,CAAC,KAAiD;QAC1E,MAAM,aAAa,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;QACtE,MAAM,cAAc,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QACxE,MAAM,YAAY,GAAG,OAAO,IAAI,CAAC,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;QAC3H,MAAM,aAAa,GAAG,OAAO,IAAI,CAAC,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC;QAC7H,IAAI,aAAa,KAAK,YAAY,IAAI,cAAc,KAAK,aAAa,EAAE;YACpE,OAAO;SACV;QAED,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAES,qBAAqB;QAC3B,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC9B;IACL,CAAC;IAES,aAAa;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,6DAA6D;IACnD,YAAY,CAAC,aAAqC,IAAG,CAAC;CACnE","sourcesContent":["import type { Control } from \"../../2D/controls/control\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\n/**\r\n * The base class for controls that display content\r\n */\r\nexport class ContentDisplay3D extends Control3D {\r\n private _content: Control;\r\n protected _facadeTexture: Nullable<AdvancedDynamicTexture>;\r\n protected _contentResolution: number | { width: number; height: number } = 512;\r\n protected _contentScaleRatio = 2;\r\n protected _contentScaleRatioY?: number;\r\n\r\n /**\r\n * Gets or sets the GUI 2D content used to display the button's facade\r\n */\r\n public get content(): Control {\r\n return this._content;\r\n }\r\n\r\n public set content(value: Control) {\r\n this._content = value;\r\n\r\n if (!value || !this._host || !this._host.utilityLayer) {\r\n return;\r\n }\r\n\r\n if (!this._facadeTexture) {\r\n const width = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.width;\r\n const height = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.height;\r\n this._facadeTexture = new AdvancedDynamicTexture(\"Facade\", width, height, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE);\r\n this._setFacadeTextureScaling();\r\n this._facadeTexture.premulAlpha = true;\r\n } else {\r\n this._facadeTexture.rootContainer.clearControls();\r\n }\r\n\r\n this._facadeTexture.addControl(value);\r\n\r\n this._applyFacade(this._facadeTexture);\r\n }\r\n\r\n protected _setFacadeTextureScaling() {\r\n if (this._facadeTexture) {\r\n if (typeof this._contentResolution !== \"number\") {\r\n this._contentScaleRatioY = (this._contentResolution.height / this._contentResolution.width) * this._contentScaleRatio;\r\n }\r\n this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;\r\n this._facadeTexture.rootContainer.scaleY = this._contentScaleRatioY ?? this._contentScaleRatio;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the texture resolution used to render content (512 by default)\r\n */\r\n public get contentResolution(): number | { width: number; height: number } {\r\n return this._contentResolution;\r\n }\r\n\r\n public set contentResolution(value: number | { width: number; height: number }) {\r\n const incomingWidth = typeof value === \"number\" ? value : value.width;\r\n const incomingHeight = typeof value === \"number\" ? value : value.height;\r\n const currentWidth = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.width;\r\n const currentHeight = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.height;\r\n if (incomingWidth === currentWidth && incomingHeight === currentHeight) {\r\n return;\r\n }\r\n\r\n this._contentResolution = value;\r\n this._resetContent();\r\n }\r\n\r\n protected _disposeFacadeTexture() {\r\n if (this._facadeTexture) {\r\n this._facadeTexture.dispose();\r\n this._facadeTexture = null;\r\n }\r\n }\r\n\r\n protected _resetContent() {\r\n this._disposeFacadeTexture();\r\n this.content = this._content;\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * This function can be overloaded by child classes\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {}\r\n}\r\n"]}
1
+ {"version":3,"file":"contentDisplay3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/contentDisplay3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAE1D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAA/C;;QAGc,uBAAkB,GAA+C,GAAG,CAAC;QACrE,uBAAkB,GAAG,CAAC,CAAC;IAiFrC,CAAC;IA9EG;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CA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B,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,6DAA6D;IACnD,YAAY,CAAC,aAAqC,IAAG,CAAC;CACnE","sourcesContent":["import type { Control } from \"../../2D/controls/control\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\n/**\r\n * The base class for controls that display content\r\n */\r\nexport class ContentDisplay3D extends Control3D {\r\n private _content: Control;\r\n protected _facadeTexture: Nullable<AdvancedDynamicTexture>;\r\n protected _contentResolution: number | { width: number; height: number } = 512;\r\n protected _contentScaleRatio = 2;\r\n protected _contentScaleRatioY?: number;\r\n\r\n /**\r\n * Gets or sets the GUI 2D content used to display the button's facade\r\n */\r\n public get content(): Control {\r\n return this._content;\r\n }\r\n\r\n public set content(value: Control) {\r\n this._content = value;\r\n\r\n if (!value || !this._host || !this._host.utilityLayer) {\r\n return;\r\n }\r\n\r\n if (!this._facadeTexture) {\r\n const width = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.width;\r\n const height = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.height;\r\n this._facadeTexture = new AdvancedDynamicTexture(\"Facade\", width, height, this._host.utilityLayer.utilityLayerScene, true, Texture.TRILINEAR_SAMPLINGMODE);\r\n this._setFacadeTextureScaling();\r\n this._facadeTexture.premulAlpha = true;\r\n } else {\r\n this._facadeTexture.rootContainer.clearControls();\r\n }\r\n\r\n this._facadeTexture.addControl(value);\r\n\r\n this._applyFacade(this._facadeTexture);\r\n }\r\n\r\n protected _setFacadeTextureScaling() {\r\n if (this._facadeTexture) {\r\n if (typeof this._contentResolution !== \"number\") {\r\n this._contentScaleRatioY = (this._contentResolution.height / this._contentResolution.width) * this._contentScaleRatio;\r\n }\r\n this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;\r\n this._facadeTexture.rootContainer.scaleY = this._contentScaleRatioY ?? this._contentScaleRatio;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the texture resolution used to render content (512 by default)\r\n */\r\n public get contentResolution(): number | { width: number; height: number } {\r\n return this._contentResolution;\r\n }\r\n\r\n public set contentResolution(value: number | { width: number; height: number }) {\r\n const incomingWidth = typeof value === \"number\" ? value : value.width;\r\n const incomingHeight = typeof value === \"number\" ? value : value.height;\r\n const currentWidth = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.width;\r\n const currentHeight = typeof this._contentResolution === \"number\" ? this._contentResolution : this._contentResolution.height;\r\n if (incomingWidth === currentWidth && incomingHeight === currentHeight) {\r\n return;\r\n }\r\n\r\n this._contentResolution = value;\r\n this._resetContent();\r\n }\r\n\r\n protected _disposeFacadeTexture() {\r\n if (this._facadeTexture) {\r\n this._facadeTexture.dispose();\r\n this._facadeTexture = null;\r\n }\r\n }\r\n\r\n protected _resetContent() {\r\n this._disposeFacadeTexture();\r\n this.content = this._content;\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * This function can be overloaded by child classes\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {}\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"control3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/control3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,YAAY,EAAE,+CAAiC;AAKxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;GAEG;AACH,MAAM,OAAO,SAAS;IAgBlB,uDAAuD;IACvD,IAAW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,CAAC,CAAC;YAC9C,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,gBAAgB;IACT,YAAY;QACf,IAAI,IAAI,CAAC,KAAK,EAAE;YACZ,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;SACrB;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,YAAY;QACZ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;YACpC,QAAQ,CAAC,MAAM,EAAE,CAAC;SACrB;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IBehaviorAware, Behavior } from \"core/Behaviors/behavior\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport type { GUI3DManager } from \"../gui3DManager\";\r\nimport { Vector3WithInfo } from \"../vector3WithInfo\";\r\nimport type { Container3D } from \"./container3D\";\r\n\r\nimport type { TouchButton3D } from \"./touchButton3D\";\r\n\r\n/**\r\n * Class used as base class for controls\r\n */\r\nexport class Control3D implements IDisposable, IBehaviorAware<Control3D> {\r\n private _node: Nullable<TransformNode>;\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _downPointerIds: { [id: number]: number } = {}; // Store number of pointer downs per ID, from near and far interactions\r\n\r\n protected _isVisible = true;\r\n\r\n /** @internal */\r\n public _host: GUI3DManager;\r\n /** @internal */\r\n public _isScaledByManager = false;\r\n\r\n private _position?: Vector3;\r\n private _scaling?: Vector3;\r\n\r\n /** Gets or sets the control position in world space */\r\n public get position(): Vector3 {\r\n if (!this._node) {\r\n this._position = this._position || Vector3.Zero();\r\n return this._position;\r\n }\r\n\r\n return this._node.position;\r\n }\r\n\r\n public set position(value: Vector3) {\r\n this._position = value;\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._node.position = this._position;\r\n }\r\n\r\n /** Gets or sets the control scaling in world space */\r\n public get scaling(): Vector3 {\r\n if (!this._node) {\r\n this._scaling = this.scaling || new Vector3(1, 1, 1);\r\n return this._scaling;\r\n }\r\n\r\n return this._node.scaling;\r\n }\r\n\r\n public set scaling(value: Vector3) {\r\n this._scaling = value;\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._isScaledByManager = false;\r\n this._node.scaling = this._scaling;\r\n }\r\n\r\n /** Callback used to start pointer enter animation */\r\n public pointerEnterAnimation: () => void;\r\n /** Callback used to start pointer out animation */\r\n public pointerOutAnimation: () => void;\r\n /** Callback used to start pointer down animation */\r\n public pointerDownAnimation: () => void;\r\n /** Callback used to start pointer up animation */\r\n public pointerUpAnimation: () => void;\r\n\r\n /**\r\n * An event triggered when the pointer moves over the control\r\n */\r\n public onPointerMoveObservable = new Observable<Vector3>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control\r\n */\r\n public onPointerOutObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer is up\r\n */\r\n public onPointerUpObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on (with a mouse)\r\n */\r\n public onPointerClickObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * Gets or sets the parent container\r\n */\r\n public parent: Nullable<Container3D>;\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Control3D>>();\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n */\r\n public get behaviors(): Behavior<Control3D>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Attach a behavior to the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public addBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n const scene = this._host.scene;\r\n if (scene.isLoading) {\r\n // We defer the attach when the scene will be loaded\r\n scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public removeBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Control3D>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.setEnabled(value);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the control name\r\n */\r\n constructor(\r\n /** Defines the control name */\r\n public name?: string\r\n ) {}\r\n\r\n /**\r\n * Gets a string representing the class name\r\n */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Control3D\";\r\n }\r\n\r\n /**\r\n * Gets the transform node used by this control\r\n */\r\n public get node(): Nullable<TransformNode> {\r\n return this._node;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this._node instanceof AbstractMesh) {\r\n return this._node as AbstractMesh;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Link the control as child of the given node\r\n * @param node defines the node to link to. Use null to unlink the control\r\n * @returns the current control\r\n */\r\n public linkToTransformNode(node: Nullable<TransformNode>): Control3D {\r\n if (this._node) {\r\n this._node.parent = node;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _prepareNode(scene: Scene): void {\r\n if (!this._node) {\r\n this._node = this._createNode(scene);\r\n\r\n if (!this.node) {\r\n return;\r\n }\r\n if (this._position) {\r\n this.node.position = this._position;\r\n }\r\n if (this._scaling) {\r\n this.node.scaling = this._scaling;\r\n }\r\n this._injectGUI3DReservedDataStore(this.node).control = this; // Store the control on the reservedDataStore field in order to get it when picking\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.isPickable = true;\r\n\r\n this._affectMaterial(mesh);\r\n }\r\n }\r\n }\r\n\r\n protected _injectGUI3DReservedDataStore(node: TransformNode): any {\r\n node.reservedDataStore = node.reservedDataStore ?? {};\r\n node.reservedDataStore.GUI3D = node.reservedDataStore.GUI3D ?? {};\r\n return node.reservedDataStore.GUI3D;\r\n }\r\n\r\n /**\r\n * Node creation.\r\n * Can be overriden by children\r\n * @param scene defines the scene where the node must be attached\r\n * @returns the attached node or null if none. Must return a Mesh or AbstractMesh if there is an attached visible object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n // Do nothing by default\r\n return null;\r\n }\r\n\r\n /**\r\n * Affect a material to the given mesh\r\n * @param mesh defines the mesh which will represent the control\r\n */\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n mesh.material = null;\r\n }\r\n\r\n private _isTouchButton3D(control: Control3D): control is TouchButton3D {\r\n return (control as TouchButton3D)._generatePointerEventType !== undefined;\r\n }\r\n\r\n // Pointers\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control3D, coordinates: Vector3): void {\r\n this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control3D): boolean {\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n\r\n this._enterCount++;\r\n\r\n if (this._enterCount > 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerEnterObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerEnterAnimation) {\r\n this.pointerEnterAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control3D): void {\r\n this._enterCount--;\r\n\r\n if (this._enterCount > 0) {\r\n return;\r\n }\r\n\r\n this._enterCount = 0;\r\n\r\n this.onPointerOutObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerOutAnimation) {\r\n this.pointerOutAnimation();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number): boolean {\r\n this._downCount++;\r\n this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1;\r\n\r\n if (this._downCount !== 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerDownObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerDownAnimation) {\r\n this.pointerDownAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._downCount--;\r\n this._downPointerIds[pointerId]--;\r\n\r\n if (this._downPointerIds[pointerId] <= 0) {\r\n delete this._downPointerIds[pointerId];\r\n }\r\n\r\n if (this._downCount < 0) {\r\n // Handle if forcePointerUp was called prior to this\r\n this._downCount = 0;\r\n return;\r\n }\r\n\r\n if (this._downCount == 0) {\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n this.onPointerClickObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n }\r\n this.onPointerUpObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerUpAnimation) {\r\n this.pointerUpAnimation();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector3.Zero(), +key as number, 0, true);\r\n }\r\n if (this._downCount > 0) {\r\n this._downCount = 1;\r\n this._onPointerUp(this, Vector3.Zero(), 0, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(type: number, pickedPoint: Vector3, originMeshPosition: Nullable<Vector3>, pointerId: number, buttonIndex: number): boolean {\r\n if (this._isTouchButton3D(this) && originMeshPosition) {\r\n type = this._generatePointerEventType(type, originMeshPosition, this._downCount);\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, pickedPoint);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, pickedPoint, pointerId, buttonIndex);\r\n this._host._lastControlDown[pointerId] = this;\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /** @internal */\r\n public _disposeNode(): void {\r\n if (this._node) {\r\n this._node.dispose();\r\n this._node = null;\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n\r\n this._disposeNode();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"control3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/control3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,YAAY,EAAE,+CAAiC;AAKxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;GAEG;AACH,MAAM,OAAO,SAAS;IAgBlB,uDAAuD;IACvD,IAAW,QAAQ;QACf,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAED,IAAW,QAAQ,CAAC,KAAc;QAC9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,OAAO;QACX,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;IACzC,CAAC;IAED,sDAAsD;IACtD,IAAW,OAAO;QACd,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACrD,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,IAAW,OAAO,CAAC,KAAc;QAC7B,IAAI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CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,YAAY;QACZ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACrC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACtB,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IBehaviorAware, Behavior } from \"core/Behaviors/behavior\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport type { GUI3DManager } from \"../gui3DManager\";\r\nimport { Vector3WithInfo } from \"../vector3WithInfo\";\r\nimport type { Container3D } from \"./container3D\";\r\n\r\nimport type { TouchButton3D } from \"./touchButton3D\";\r\n\r\n/**\r\n * Class used as base class for controls\r\n */\r\nexport class Control3D implements IDisposable, IBehaviorAware<Control3D> {\r\n private _node: Nullable<TransformNode>;\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _downPointerIds: { [id: number]: number } = {}; // Store number of pointer downs per ID, from near and far interactions\r\n\r\n protected _isVisible = true;\r\n\r\n /** @internal */\r\n public _host: GUI3DManager;\r\n /** @internal */\r\n public _isScaledByManager = false;\r\n\r\n private _position?: Vector3;\r\n private _scaling?: Vector3;\r\n\r\n /** Gets or sets the control position in world space */\r\n public get position(): Vector3 {\r\n if (!this._node) {\r\n this._position = this._position || Vector3.Zero();\r\n return this._position;\r\n }\r\n\r\n return this._node.position;\r\n }\r\n\r\n public set position(value: Vector3) {\r\n this._position = value;\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._node.position = this._position;\r\n }\r\n\r\n /** Gets or sets the control scaling in world space */\r\n public get scaling(): Vector3 {\r\n if (!this._node) {\r\n this._scaling = this.scaling || new Vector3(1, 1, 1);\r\n return this._scaling;\r\n }\r\n\r\n return this._node.scaling;\r\n }\r\n\r\n public set scaling(value: Vector3) {\r\n this._scaling = value;\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._isScaledByManager = false;\r\n this._node.scaling = this._scaling;\r\n }\r\n\r\n /** Callback used to start pointer enter animation */\r\n public pointerEnterAnimation: () => void;\r\n /** Callback used to start pointer out animation */\r\n public pointerOutAnimation: () => void;\r\n /** Callback used to start pointer down animation */\r\n public pointerDownAnimation: () => void;\r\n /** Callback used to start pointer up animation */\r\n public pointerUpAnimation: () => void;\r\n\r\n /**\r\n * An event triggered when the pointer moves over the control\r\n */\r\n public onPointerMoveObservable = new Observable<Vector3>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control\r\n */\r\n public onPointerOutObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer is up\r\n */\r\n public onPointerUpObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on (with a mouse)\r\n */\r\n public onPointerClickObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * Gets or sets the parent container\r\n */\r\n public parent: Nullable<Container3D>;\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Control3D>>();\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n */\r\n public get behaviors(): Behavior<Control3D>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Attach a behavior to the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public addBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n const scene = this._host.scene;\r\n if (scene.isLoading) {\r\n // We defer the attach when the scene will be loaded\r\n scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public removeBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Control3D>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.setEnabled(value);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the control name\r\n */\r\n constructor(\r\n /** Defines the control name */\r\n public name?: string\r\n ) {}\r\n\r\n /**\r\n * Gets a string representing the class name\r\n */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Control3D\";\r\n }\r\n\r\n /**\r\n * Gets the transform node used by this control\r\n */\r\n public get node(): Nullable<TransformNode> {\r\n return this._node;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this._node instanceof AbstractMesh) {\r\n return this._node as AbstractMesh;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Link the control as child of the given node\r\n * @param node defines the node to link to. Use null to unlink the control\r\n * @returns the current control\r\n */\r\n public linkToTransformNode(node: Nullable<TransformNode>): Control3D {\r\n if (this._node) {\r\n this._node.parent = node;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _prepareNode(scene: Scene): void {\r\n if (!this._node) {\r\n this._node = this._createNode(scene);\r\n\r\n if (!this.node) {\r\n return;\r\n }\r\n if (this._position) {\r\n this.node.position = this._position;\r\n }\r\n if (this._scaling) {\r\n this.node.scaling = this._scaling;\r\n }\r\n this._injectGUI3DReservedDataStore(this.node).control = this; // Store the control on the reservedDataStore field in order to get it when picking\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.isPickable = true;\r\n\r\n this._affectMaterial(mesh);\r\n }\r\n }\r\n }\r\n\r\n protected _injectGUI3DReservedDataStore(node: TransformNode): any {\r\n node.reservedDataStore = node.reservedDataStore ?? {};\r\n node.reservedDataStore.GUI3D = node.reservedDataStore.GUI3D ?? {};\r\n return node.reservedDataStore.GUI3D;\r\n }\r\n\r\n /**\r\n * Node creation.\r\n * Can be overriden by children\r\n * @param scene defines the scene where the node must be attached\r\n * @returns the attached node or null if none. Must return a Mesh or AbstractMesh if there is an attached visible object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n // Do nothing by default\r\n return null;\r\n }\r\n\r\n /**\r\n * Affect a material to the given mesh\r\n * @param mesh defines the mesh which will represent the control\r\n */\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n mesh.material = null;\r\n }\r\n\r\n private _isTouchButton3D(control: Control3D): control is TouchButton3D {\r\n return (control as TouchButton3D)._generatePointerEventType !== undefined;\r\n }\r\n\r\n // Pointers\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control3D, coordinates: Vector3): void {\r\n this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control3D): boolean {\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n\r\n this._enterCount++;\r\n\r\n if (this._enterCount > 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerEnterObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerEnterAnimation) {\r\n this.pointerEnterAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control3D): void {\r\n this._enterCount--;\r\n\r\n if (this._enterCount > 0) {\r\n return;\r\n }\r\n\r\n this._enterCount = 0;\r\n\r\n this.onPointerOutObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerOutAnimation) {\r\n this.pointerOutAnimation();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number): boolean {\r\n this._downCount++;\r\n this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1;\r\n\r\n if (this._downCount !== 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerDownObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerDownAnimation) {\r\n this.pointerDownAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._downCount--;\r\n this._downPointerIds[pointerId]--;\r\n\r\n if (this._downPointerIds[pointerId] <= 0) {\r\n delete this._downPointerIds[pointerId];\r\n }\r\n\r\n if (this._downCount < 0) {\r\n // Handle if forcePointerUp was called prior to this\r\n this._downCount = 0;\r\n return;\r\n }\r\n\r\n if (this._downCount == 0) {\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n this.onPointerClickObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n }\r\n this.onPointerUpObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerUpAnimation) {\r\n this.pointerUpAnimation();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector3.Zero(), +key as number, 0, true);\r\n }\r\n if (this._downCount > 0) {\r\n this._downCount = 1;\r\n this._onPointerUp(this, Vector3.Zero(), 0, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(type: number, pickedPoint: Vector3, originMeshPosition: Nullable<Vector3>, pointerId: number, buttonIndex: number): boolean {\r\n if (this._isTouchButton3D(this) && originMeshPosition) {\r\n type = this._generatePointerEventType(type, originMeshPosition, this._downCount);\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, pickedPoint);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, pickedPoint, pointerId, buttonIndex);\r\n this._host._lastControlDown[pointerId] = this;\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /** @internal */\r\n public _disposeNode(): void {\r\n if (this._node) {\r\n this._node.dispose();\r\n this._node = null;\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n\r\n this._disposeNode();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cylinderPanel.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/cylinderPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,6CAA+B;AAGrE,OAA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gBACzD,MAAM;YACV,KAAK,WAAW,CAAC,uBAAuB;gBACpC,MAAM;YACV,KAAK,WAAW,CAAC,+BAA+B;gBAC5C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,sBAAc,CAAC;gBAC1C,MAAM;SACb;IACL,CAAC;IAEO,mBAAmB,CAAC,MAAe;QACvC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAEtD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAEvC,MAAM,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAErE,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;CACJ","sourcesContent":["import { Tools } from \"core/Misc/tools\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { float } from \"core/types\";\r\n\r\nimport { VolumeBasedPanel } from \"./volumeBasedPanel\";\r\nimport type { Control3D } from \"./control3D\";\r\nimport { Container3D } from \"./container3D\";\r\nimport { Axis, Space } from \"core/Maths/math.axis\";\r\n\r\n/**\r\n * Class used to create a container panel deployed on the surface of a cylinder\r\n */\r\nexport class CylinderPanel extends VolumeBasedPanel {\r\n private _radius = 5.0;\r\n\r\n /**\r\n * Gets or sets the radius of the cylinder where to project controls (5 by default)\r\n */\r\n public get radius(): float {\r\n return this._radius;\r\n }\r\n\r\n public set radius(value: float) {\r\n if (this._radius === value) {\r\n return;\r\n }\r\n\r\n this._radius = value;\r\n\r\n Tools.SetImmediate(() => {\r\n this._arrangeChildren();\r\n });\r\n }\r\n\r\n protected _mapGridNode(control: Control3D, nodePosition: Vector3) {\r\n const mesh = control.mesh;\r\n\r\n if (!mesh) {\r\n return;\r\n }\r\n const newPos = this._cylindricalMapping(nodePosition);\r\n control.position = newPos;\r\n\r\n switch (this.orientation) {\r\n case Container3D.FACEORIGIN_ORIENTATION:\r\n mesh.lookAt(new Vector3(2 * newPos.x, newPos.y, 2 * newPos.z));\r\n break;\r\n case Container3D.FACEORIGINREVERSED_ORIENTATION:\r\n mesh.lookAt(new Vector3(-newPos.x, newPos.y, -newPos.z));\r\n break;\r\n case Container3D.FACEFORWARD_ORIENTATION:\r\n break;\r\n case Container3D.FACEFORWARDREVERSED_ORIENTATION:\r\n mesh.rotate(Axis.Y, Math.PI, Space.LOCAL);\r\n break;\r\n }\r\n }\r\n\r\n private _cylindricalMapping(source: Vector3) {\r\n const newPos = new Vector3(0, source.y, this._radius);\r\n\r\n const yAngle = source.x / this._radius;\r\n\r\n Matrix.RotationYawPitchRollToRef(yAngle, 0, 0, TmpVectors.Matrix[0]);\r\n\r\n return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"cylinderPanel.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/cylinderPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,6CAA+B;AAGrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAS,2CAA6B;AAEnD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,gBAAgB;IAAnD;;QACY,YAAO,GAAG,GAAG,CAAC;IAsD1B,CAAC;IApDG;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,MAAM,CAAC,KAAY;QAC1B,IAA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CAAC,OAAO,CAAC,CAAC;QAEtD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAEvC,MAAM,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAErE,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;CACJ","sourcesContent":["import { Tools } from \"core/Misc/tools\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { float } from \"core/types\";\r\n\r\nimport { VolumeBasedPanel } from \"./volumeBasedPanel\";\r\nimport type { Control3D } from \"./control3D\";\r\nimport { Container3D } from \"./container3D\";\r\nimport { Axis, Space } from \"core/Maths/math.axis\";\r\n\r\n/**\r\n * Class used to create a container panel deployed on the surface of a cylinder\r\n */\r\nexport class CylinderPanel extends VolumeBasedPanel {\r\n private _radius = 5.0;\r\n\r\n /**\r\n * Gets or sets the radius of the cylinder where to project controls (5 by default)\r\n */\r\n public get radius(): float {\r\n return this._radius;\r\n }\r\n\r\n public set radius(value: float) {\r\n if (this._radius === value) {\r\n return;\r\n }\r\n\r\n this._radius = value;\r\n\r\n Tools.SetImmediate(() => {\r\n this._arrangeChildren();\r\n });\r\n }\r\n\r\n protected _mapGridNode(control: Control3D, nodePosition: Vector3) {\r\n const mesh = control.mesh;\r\n\r\n if (!mesh) {\r\n return;\r\n }\r\n const newPos = this._cylindricalMapping(nodePosition);\r\n control.position = newPos;\r\n\r\n switch (this.orientation) {\r\n case Container3D.FACEORIGIN_ORIENTATION:\r\n mesh.lookAt(new Vector3(2 * newPos.x, newPos.y, 2 * newPos.z));\r\n break;\r\n case Container3D.FACEORIGINREVERSED_ORIENTATION:\r\n mesh.lookAt(new Vector3(-newPos.x, newPos.y, -newPos.z));\r\n break;\r\n case Container3D.FACEFORWARD_ORIENTATION:\r\n break;\r\n case Container3D.FACEFORWARDREVERSED_ORIENTATION:\r\n mesh.rotate(Axis.Y, Math.PI, Space.LOCAL);\r\n break;\r\n }\r\n }\r\n\r\n private _cylindricalMapping(source: Vector3) {\r\n const newPos = new Vector3(0, source.y, this._radius);\r\n\r\n const yAngle = source.x / this._radius;\r\n\r\n Matrix.RotationYawPitchRollToRef(yAngle, 0, 0, TmpVectors.Matrix[0]);\r\n\r\n return Vector3.TransformNormal(newPos, TmpVectors.Matrix[0]);\r\n }\r\n}\r\n"]}