@babylonjs/gui 7.3.1 → 7.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/2D/advancedDynamicTexture.js.map +1 -1
  2. package/2D/controls/button.js.map +1 -1
  3. package/2D/controls/checkbox.js.map +1 -1
  4. package/2D/controls/colorpicker.js.map +1 -1
  5. package/2D/controls/container.js.map +1 -1
  6. package/2D/controls/control.d.ts +2 -1
  7. package/2D/controls/control.js +5 -2
  8. package/2D/controls/control.js.map +1 -1
  9. package/2D/controls/displayGrid.js.map +1 -1
  10. package/2D/controls/ellipse.js.map +1 -1
  11. package/2D/controls/focusableButton.js.map +1 -1
  12. package/2D/controls/gradient/LinearGradient.js.map +1 -1
  13. package/2D/controls/gradient/RadialGradient.js.map +1 -1
  14. package/2D/controls/grid.js.map +1 -1
  15. package/2D/controls/image.js.map +1 -1
  16. package/2D/controls/inputPassword.js.map +1 -1
  17. package/2D/controls/inputText.js.map +1 -1
  18. package/2D/controls/inputTextArea.js.map +1 -1
  19. package/2D/controls/line.js.map +1 -1
  20. package/2D/controls/multiLine.js.map +1 -1
  21. package/2D/controls/radioButton.js.map +1 -1
  22. package/2D/controls/rectangle.js.map +1 -1
  23. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  24. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  25. package/2D/controls/selector.js.map +1 -1
  26. package/2D/controls/sliders/baseSlider.js.map +1 -1
  27. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  28. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  29. package/2D/controls/sliders/scrollBar.js.map +1 -1
  30. package/2D/controls/sliders/slider.js.map +1 -1
  31. package/2D/controls/stackPanel.js.map +1 -1
  32. package/2D/controls/textBlock.js.map +1 -1
  33. package/2D/controls/toggleButton.js.map +1 -1
  34. package/2D/controls/virtualKeyboard.js.map +1 -1
  35. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  36. package/3D/controls/abstractButton3D.js.map +1 -1
  37. package/3D/controls/button3D.js.map +1 -1
  38. package/3D/controls/container3D.js.map +1 -1
  39. package/3D/controls/handMenu.js.map +1 -1
  40. package/3D/controls/holographicBackplate.js.map +1 -1
  41. package/3D/controls/holographicButton.js.map +1 -1
  42. package/3D/controls/holographicSlate.js.map +1 -1
  43. package/3D/controls/meshButton3D.js.map +1 -1
  44. package/3D/controls/nearMenu.js.map +1 -1
  45. package/3D/controls/scatterPanel.js.map +1 -1
  46. package/3D/controls/slider3D.js.map +1 -1
  47. package/3D/controls/stackPanel3D.js.map +1 -1
  48. package/3D/controls/touchButton3D.js.map +1 -1
  49. package/3D/controls/touchHolographicButton.js.map +1 -1
  50. package/3D/controls/touchHolographicMenu.js.map +1 -1
  51. package/3D/controls/touchMeshButton3D.js.map +1 -1
  52. package/3D/controls/volumeBasedPanel.js.map +1 -1
  53. package/3D/gizmos/slateGizmo.js.map +1 -1
  54. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  55. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  56. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  57. package/3D/materials/handle/handleMaterial.js.map +1 -1
  58. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
  59. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  60. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
  61. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
  62. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  63. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  64. 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,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QACvB,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjE,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAErD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;YAElC,IAAI,IAAI,CAAC,oBAAoB,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,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 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 _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 _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 _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 _onToggle(newState: boolean) {\r\n super._onToggle(newState);\r\n }\r\n\r\n protected _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 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/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ourcesContent":["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":"abstractButton3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/abstractButton3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAClD;;;OAGG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAES,YAAY;QAClB,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED,mBAAmB;IACT,WAAW,CAAC,KAAY;QAC9B,OAAO,IAAI,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACJ","sourcesContent":["import { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { ContentDisplay3D } from \"./contentDisplay3D\";\r\n\r\n/**\r\n * Class used as a root to all buttons\r\n */\r\nexport class AbstractButton3D extends ContentDisplay3D {\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n */\r\n constructor(name?: string) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"AbstractButton3D\";\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n return new TransformNode(\"button\" + this.name, scene);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"abstractButton3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/abstractButton3D.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAClD;;;OAGG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAEkB,YAAY;QAC3B,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED,mBAAmB;IACA,WAAW,CAAC,KAAY;QACvC,OAAO,IAAI,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACJ","sourcesContent":["import { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { ContentDisplay3D } from \"./contentDisplay3D\";\r\n\r\n/**\r\n * Class used as a root to all buttons\r\n */\r\nexport class AbstractButton3D extends ContentDisplay3D {\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n */\r\n constructor(name?: string) {\r\n super(name);\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"AbstractButton3D\";\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n return new TransformNode(\"button\" + this.name, scene);\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,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AAC,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 _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n (<any>this._currentMaterial).emissiveTexture = facadeTexture;\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Button3D\";\r\n }\r\n\r\n // Mesh association\r\n protected _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 _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 dispose() {\r\n super.dispose();\r\n\r\n this._disposeFacadeTexture();\r\n\r\n if (this._currentMaterial) {\r\n this._currentM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I,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 +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;SA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,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,OAAkB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAEhC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YACtB,OAAO,CAAC,YAAY,EAAE,CAAC;SAC1B;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,YAAY;QAClB,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,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 _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 _getTypeName(): string {\r\n return \"Container3D\";\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public 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;YAC7B,OAAO;SACV;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,IAAI,CAAC,IAAI,CAAC,YAAY,EA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AC,KAAY;QACvC,OAAO,IAAI,aAAa,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,OAAkB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAEhC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YACtB,OAAO,CAAC,YAAY,EAAE,CAAC;SAC1B;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;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 +1 @@
1
- {"version":3,"file":"handMenu.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/handMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,mEAAqD;AAGtF;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,oBAAoB;IAG9C;;OAEG;IACH,IAAW,sBAAsB;QAC7B,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAES,WAAW,CAAC,KAAY;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAU,CAAC;QAE/C,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,YAAY,EAAyB,EAAE,IAAa;QAChD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,uBAAuB,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAC5D,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { TouchHolographicMenu } from \"./touchHolographicMenu\";\r\nimport { HandConstraintBehavior } from \"core/Behaviors/Meshes/handConstraintBehavior\";\r\nimport type { WebXRExperienceHelper } from \"core/XR/webXRExperienceHelper\";\r\n\r\n/**\r\n * Hand menu that displays buttons and floats around the hand.\r\n * @since 5.0.0\r\n */\r\nexport class HandMenu extends TouchHolographicMenu {\r\n private _handConstraintBehavior: HandConstraintBehavior;\r\n\r\n /**\r\n * The hand constraint behavior setting the transformation of this node\r\n */\r\n public get handConstraintBehavior() {\r\n return this._handConstraintBehavior;\r\n }\r\n\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n const node = super._createNode(scene)! as Mesh;\r\n\r\n this._handConstraintBehavior.attach(node);\r\n\r\n return node;\r\n }\r\n\r\n /**\r\n * Creates a hand menu GUI 3D control\r\n * @param xr the WebXRExperienceHelper used to link this control to the enabled WebXRHandTracking feature\r\n * @param name name of the hand menu\r\n */\r\n constructor(xr: WebXRExperienceHelper, name?: string) {\r\n super(name);\r\n\r\n this._handConstraintBehavior = new HandConstraintBehavior();\r\n this._handConstraintBehavior.linkToXRExperience(xr);\r\n this.backPlateMargin = 0.15;\r\n this.rows = 3;\r\n }\r\n\r\n /**\r\n * Disposes the hand menu\r\n */\r\n public dispose() {\r\n super.dispose();\r\n\r\n this._handConstraintBehavior.detach();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"handMenu.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/handMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,mEAAqD;AAGtF;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,oBAAoB;IAG9C;;OAEG;IACH,IAAW,sBAAsB;QAC7B,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAEkB,WAAW,CAAC,KAAY;QACvC,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAU,CAAC;QAE/C,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE1C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACH,YAAY,EAAyB,EAAE,IAAa;QAChD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,uBAAuB,GAAG,IAAI,sBAAsB,EAAE,CAAC;QAC5D,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAClB,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,CAAC;IAC1C,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { TouchHolographicMenu } from \"./touchHolographicMenu\";\r\nimport { HandConstraintBehavior } from \"core/Behaviors/Meshes/handConstraintBehavior\";\r\nimport type { WebXRExperienceHelper } from \"core/XR/webXRExperienceHelper\";\r\n\r\n/**\r\n * Hand menu that displays buttons and floats around the hand.\r\n * @since 5.0.0\r\n */\r\nexport class HandMenu extends TouchHolographicMenu {\r\n private _handConstraintBehavior: HandConstraintBehavior;\r\n\r\n /**\r\n * The hand constraint behavior setting the transformation of this node\r\n */\r\n public get handConstraintBehavior() {\r\n return this._handConstraintBehavior;\r\n }\r\n\r\n protected override _createNode(scene: Scene): Nullable<TransformNode> {\r\n const node = super._createNode(scene)! as Mesh;\r\n\r\n this._handConstraintBehavior.attach(node);\r\n\r\n return node;\r\n }\r\n\r\n /**\r\n * Creates a hand menu GUI 3D control\r\n * @param xr the WebXRExperienceHelper used to link this control to the enabled WebXRHandTracking feature\r\n * @param name name of the hand menu\r\n */\r\n constructor(xr: WebXRExperienceHelper, name?: string) {\r\n super(name);\r\n\r\n this._handConstraintBehavior = new HandConstraintBehavior();\r\n this._handConstraintBehavior.linkToXRExperience(xr);\r\n this.backPlateMargin = 0.15;\r\n this.rows = 3;\r\n }\r\n\r\n /**\r\n * Disposes the hand menu\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n\r\n this._handConstraintBehavior.detach();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"holographicBackplate.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicBackplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAGvD;;;GAGG;AACH,MAAM,OAAO,oBAAq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es/mesh\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { FluentBackplateMaterial } from \"../materials/fluentBackplate/fluentBackplateMaterial\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to create a holographic backplate in 3D\r\n * @since 5.0.0\r\n */\r\nexport class HolographicBackplate extends Control3D {\r\n /**\r\n * Base Url for the button model.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n /**\r\n * File name for the button model.\r\n */\r\n public static MODEL_FILENAME: string = \"mrtk-fluent-backplate.glb\";\r\n\r\n private _model: AbstractMesh;\r\n private _material: FluentBackplateMaterial;\r\n\r\n /**\r\n * Rendering ground id of the backplate mesh.\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._model.renderingGroupId = id;\r\n }\r\n public get renderingGroupId(): number {\r\n return this._model.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the material used by the backplate\r\n */\r\n public get material(): FluentBackplateMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this backplate shares its material with other HolographicBackplates\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Creates a new holographic backplate\r\n * @param name defines the control name\r\n * @param _shareMaterials\r\n */\r\n constructor(\r\n name?: string,\r\n private _shareMaterials = true\r\n ) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"HolographicBackplate\";\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n const collisionMesh = CreateBox(\r\n (this.name ?? \"HolographicBackplate\") + \"_CollisionMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 1.0,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.visibility = 0;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene).then((result) => {\r\n const importedModel = result.meshes[1];\r\n importedModel.name = `${this.name}_frontPlate`;\r\n importedModel.isPickable = false;\r\n importedModel.parent = collisionMesh;\r\n if (this._material) {\r\n importedModel.material = this._material;\r\n }\r\n this._model = importedModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createMaterial(mesh: Mesh) {\r\n this._material = new FluentBackplateMaterial(this.name + \" Material\", mesh.getScene());\r\n }\r\n\r\n protected _affectMaterial(mesh: Mesh) {\r\n // Back\r\n if (this._shareMaterials) {\r\n if (!this._host._touchSharedMaterials[\"fluentBackplateMaterial\"]) {\r\n this._createMaterial(mesh);\r\n this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] = this._material;\r\n } else {\r\n this._material = this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] as FluentBackplateMaterial;\r\n }\r\n } else {\r\n this._createMaterial(mesh);\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n if (!this.shareMaterials) {\r\n this._material.dispose();\r\n }\r\n\r\n this._model.dispose();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"holographicBackplate.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicBackplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAGvD;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAa/C;;OAEG;IACH,IAAW,gBAAgB,CAAC,EAAU;QAClC,IAAI,CAAC,MAAM,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SAAS,CAAC;aAC3C;YACD,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,aAAa,CAAC;IACzB,CAAC;IAEO,eAAe,CAAC,IAAU;QAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,uBAAuB,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3F,CAAC;IAEkB,eAAe,CAAC,IAAU;QACzC,OAAO;QACP,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,EAAE;gBAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;aAChF;iBAAM;gBACH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAA4B,CAAC;aAC3G;SACJ;aAAM;YACH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC9B;IACL,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,wCAAwC;QAEzD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;;AA7GD;;GAEG;AACW,mCAAc,GAAW,2CAA2C,CAAC;AACnF;;GAEG;AACW,mCAAc,GAAW,2BAA2B,CAAC","sourcesContent":["import type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { FluentBackplateMaterial } from \"../materials/fluentBackplate/fluentBackplateMaterial\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to create a holographic backplate in 3D\r\n * @since 5.0.0\r\n */\r\nexport class HolographicBackplate extends Control3D {\r\n /**\r\n * Base Url for the button model.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n /**\r\n * File name for the button model.\r\n */\r\n public static MODEL_FILENAME: string = \"mrtk-fluent-backplate.glb\";\r\n\r\n private _model: AbstractMesh;\r\n private _material: FluentBackplateMaterial;\r\n\r\n /**\r\n * Rendering ground id of the backplate mesh.\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._model.renderingGroupId = id;\r\n }\r\n public get renderingGroupId(): number {\r\n return this._model.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the material used by the backplate\r\n */\r\n public get material(): FluentBackplateMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this backplate shares its material with other HolographicBackplates\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Creates a new holographic backplate\r\n * @param name defines the control name\r\n * @param _shareMaterials\r\n */\r\n constructor(\r\n name?: string,\r\n private _shareMaterials = true\r\n ) {\r\n super(name);\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"HolographicBackplate\";\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n const collisionMesh = CreateBox(\r\n (this.name ?? \"HolographicBackplate\") + \"_CollisionMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 1.0,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.visibility = 0;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene).then((result) => {\r\n const importedModel = result.meshes[1];\r\n importedModel.name = `${this.name}_frontPlate`;\r\n importedModel.isPickable = false;\r\n importedModel.parent = collisionMesh;\r\n if (this._material) {\r\n importedModel.material = this._material;\r\n }\r\n this._model = importedModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createMaterial(mesh: Mesh) {\r\n this._material = new FluentBackplateMaterial(this.name + \" Material\", mesh.getScene());\r\n }\r\n\r\n protected override _affectMaterial(mesh: Mesh) {\r\n // Back\r\n if (this._shareMaterials) {\r\n if (!this._host._touchSharedMaterials[\"fluentBackplateMaterial\"]) {\r\n this._createMaterial(mesh);\r\n this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] = this._material;\r\n } else {\r\n this._material = this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] as FluentBackplateMaterial;\r\n }\r\n } else {\r\n this._createMaterial(mesh);\r\n }\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 if (!this.shareMaterials) {\r\n this._material.dispose();\r\n }\r\n\r\n this._model.dispose();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"holographicButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AAEnE,OAAO,EAAE,IAAI,EAAE,uCAAyB;AACxC,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,M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C,cAAc,CAAC;QAE/C,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,wCAAwC;QAEzD,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAE9B,IAAI,IAAI,CAAC,oBAAoB,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBAC5E,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;aACpC;SACJ;IACL,CAAC;CACJ","sourcesContent":["import { Button3D } from \"./button3D\";\r\n\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Mesh } from \"core/Meshes/mesh\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { FluentMaterial } from \"../materials/fluent/fluentMaterial\";\r\nimport { StackPanel } from \"../../2D/controls/stackPanel\";\r\nimport { Image } from \"../../2D/controls/image\";\r\nimport { TextBlock } from \"../../2D/controls/textBlock\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Control3D } from \"./control3D\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\n\r\n/**\r\n * Class used to create a holographic button in 3D\r\n */\r\nexport class HolographicButton extends Button3D {\r\n private _backPlate: Mesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: Mesh;\r\n private _text: string;\r\n private _imageUrl: string;\r\n private _shareMaterials = true;\r\n private _frontMaterial: FluentMaterial;\r\n private _backMaterial: FluentMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\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\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 * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\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 const tooltipBackground = CreatePlane(\"\", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene);\r\n const mat = new StandardMaterial(\"\", this._backPlate._scene);\r\n mat.diffuseColor = Color3.FromHexString(\"#212121\");\r\n tooltipBackground.material = mat;\r\n tooltipBackground.isPickable = false;\r\n this._tooltipMesh.addChild(tooltipBackground);\r\n tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05);\r\n this._tooltipMesh.scaling.y = 1 / 3;\r\n this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._backPlate;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.scaleY = 3;\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 130;\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 if (this._tooltipTextBlock) {\r\n return this._tooltipTextBlock.text;\r\n }\r\n return 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 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(): FluentMaterial {\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(): FluentMaterial {\r\n return this._frontMaterial;\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 HolographicButtons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\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 // Default animations\r\n this.pointerEnterAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n this._frontPlate.setEnabled(true);\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n this._frontPlate.setEnabled(false);\r\n };\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"HolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n this._disposeFacadeTexture();\r\n\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.paddingTop = \"40px\";\r\n image.height = \"180px\";\r\n image.width = \"100px\";\r\n image.paddingBottom = \"40px\";\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.height = \"30px\";\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n if (this._frontPlate) {\r\n this.content = panel;\r\n }\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n this._backPlate = CreateBox(\r\n this.name + \"BackMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 0.08,\r\n },\r\n scene\r\n );\r\n\r\n this._frontPlate = CreateBox(\r\n this.name + \"FrontMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 0.08,\r\n },\r\n scene\r\n );\r\n\r\n this._frontPlate.parent = this._backPlate;\r\n this._frontPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);\r\n this._frontPlate.isPickable = false;\r\n this._frontPlate.setEnabled(false);\r\n\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.parent = this._backPlate;\r\n this._textPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);\r\n this._textPlate.isPickable = false;\r\n\r\n return this._backPlate;\r\n }\r\n\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = new FluentMaterial(this.name + \"Back Material\", mesh.getScene());\r\n this._backMaterial.renderHoverLight = true;\r\n this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => {\r\n if (pickedPoint) {\r\n this._backMaterial.hoverPosition = pickedPoint;\r\n this._backMaterial.hoverColor.a = 1.0;\r\n } else {\r\n this._backMaterial.hoverColor.a = 0;\r\n }\r\n });\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = new FluentMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this._frontMaterial.innerGlowColorIntensity = 0; // No inner glow\r\n this._frontMaterial.alpha = 0.5; // Additive\r\n this._frontMaterial.renderBorders = true;\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n this._plateMaterial = new StandardMaterial(this.name + \"Plate Material\", mesh.getScene());\r\n this._plateMaterial.specularColor = Color3.Black();\r\n }\r\n\r\n protected _affectMaterial(mesh: Mesh) {\r\n // Back\r\n if (this._shareMaterials) {\r\n if (!this._host._sharedMaterials[\"backFluentMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._sharedMaterials[\"backFluentMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._sharedMaterials[\"backFluentMaterial\"] as FluentMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._sharedMaterials[\"frontFluentMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._sharedMaterials[\"frontFluentMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._sharedMaterials[\"frontFluentMaterial\"] as FluentMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._frontPlate.material = this._frontMaterial;\r\n this._textPlate.material = this._plateMaterial;\r\n\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n this._disposeTooltip();\r\n\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.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":"holographicButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AAEnE,OAAO,EAAE,IAAI,EAAE,uCAAyB;AACxC,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAE9D;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,QAAQ;IAoBnC,eAAe;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACxB,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,CAAC;SACpC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE;YACnB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;SAC/B;QACD,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjE,IAAI,C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qB,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;aAC5E;iBAAM;gBACH,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,qBAAqB,CAAmB,CAAC;aAC9F;SACJ;aAAM;YACH,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAC/B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACnC;QAED,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;QAE/C,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACa,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,wCAAwC;QAEzD,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAE9B,IAAI,IAAI,CAAC,oBAAoB,EAAE;gBAC3B,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;gBAC5E,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;aACpC;SACJ;IACL,CAAC;CACJ","sourcesContent":["import { Button3D } from \"./button3D\";\r\n\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Mesh } from \"core/Meshes/mesh\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nimport { FluentMaterial } from \"../materials/fluent/fluentMaterial\";\r\nimport { StackPanel } from \"../../2D/controls/stackPanel\";\r\nimport { Image } from \"../../2D/controls/image\";\r\nimport { TextBlock } from \"../../2D/controls/textBlock\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Control3D } from \"./control3D\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\n\r\n/**\r\n * Class used to create a holographic button in 3D\r\n */\r\nexport class HolographicButton extends Button3D {\r\n private _backPlate: Mesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: Mesh;\r\n private _text: string;\r\n private _imageUrl: string;\r\n private _shareMaterials = true;\r\n private _frontMaterial: FluentMaterial;\r\n private _backMaterial: FluentMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\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\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 * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\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 const tooltipBackground = CreatePlane(\"\", { size: 1, sideOrientation: Mesh.DOUBLESIDE }, this._backPlate._scene);\r\n const mat = new StandardMaterial(\"\", this._backPlate._scene);\r\n mat.diffuseColor = Color3.FromHexString(\"#212121\");\r\n tooltipBackground.material = mat;\r\n tooltipBackground.isPickable = false;\r\n this._tooltipMesh.addChild(tooltipBackground);\r\n tooltipBackground.position = Vector3.Forward(rightHandedScene).scale(0.05);\r\n this._tooltipMesh.scaling.y = 1 / 3;\r\n this._tooltipMesh.position = Vector3.Up().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._backPlate;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.scaleY = 3;\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 130;\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 if (this._tooltipTextBlock) {\r\n return this._tooltipTextBlock.text;\r\n }\r\n return 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 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(): FluentMaterial {\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(): FluentMaterial {\r\n return this._frontMaterial;\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 HolographicButtons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\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 // Default animations\r\n this.pointerEnterAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n this._frontPlate.setEnabled(true);\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (!this.mesh) {\r\n return;\r\n }\r\n this._frontPlate.setEnabled(false);\r\n };\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"HolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n this._disposeFacadeTexture();\r\n\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.paddingTop = \"40px\";\r\n image.height = \"180px\";\r\n image.width = \"100px\";\r\n image.paddingBottom = \"40px\";\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.height = \"30px\";\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n if (this._frontPlate) {\r\n this.content = panel;\r\n }\r\n }\r\n\r\n // Mesh association\r\n protected override _createNode(scene: Scene): TransformNode {\r\n this._backPlate = CreateBox(\r\n this.name + \"BackMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 0.08,\r\n },\r\n scene\r\n );\r\n\r\n this._frontPlate = CreateBox(\r\n this.name + \"FrontMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 0.08,\r\n },\r\n scene\r\n );\r\n\r\n this._frontPlate.parent = this._backPlate;\r\n this._frontPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);\r\n this._frontPlate.isPickable = false;\r\n this._frontPlate.setEnabled(false);\r\n\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.parent = this._backPlate;\r\n this._textPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.08);\r\n this._textPlate.isPickable = false;\r\n\r\n return this._backPlate;\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 }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = new FluentMaterial(this.name + \"Back Material\", mesh.getScene());\r\n this._backMaterial.renderHoverLight = true;\r\n this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => {\r\n if (pickedPoint) {\r\n this._backMaterial.hoverPosition = pickedPoint;\r\n this._backMaterial.hoverColor.a = 1.0;\r\n } else {\r\n this._backMaterial.hoverColor.a = 0;\r\n }\r\n });\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = new FluentMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this._frontMaterial.innerGlowColorIntensity = 0; // No inner glow\r\n this._frontMaterial.alpha = 0.5; // Additive\r\n this._frontMaterial.renderBorders = true;\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n 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 _affectMaterial(mesh: Mesh) {\r\n // Back\r\n if (this._shareMaterials) {\r\n if (!this._host._sharedMaterials[\"backFluentMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._sharedMaterials[\"backFluentMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._sharedMaterials[\"backFluentMaterial\"] as FluentMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._sharedMaterials[\"frontFluentMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._sharedMaterials[\"frontFluentMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._sharedMaterials[\"frontFluentMaterial\"] as FluentMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._frontPlate.material = this._frontMaterial;\r\n this._textPlate.material = this._plateMaterial;\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\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.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"]}