@babylonjs/gui 6.37.1 → 6.38.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/2D/advancedDynamicTexture.js +6 -8
  2. package/2D/advancedDynamicTexture.js.map +1 -1
  3. package/2D/controls/container.js +4 -7
  4. package/2D/controls/container.js.map +1 -1
  5. package/2D/controls/control.js +11 -14
  6. package/2D/controls/control.js.map +1 -1
  7. package/2D/controls/gradient/LinearGradient.js +4 -4
  8. package/2D/controls/gradient/LinearGradient.js.map +1 -1
  9. package/2D/controls/gradient/RadialGradient.js +6 -6
  10. package/2D/controls/gradient/RadialGradient.js.map +1 -1
  11. package/2D/controls/grid.js +2 -2
  12. package/2D/controls/grid.js.map +1 -1
  13. package/2D/controls/image.js +4 -8
  14. package/2D/controls/image.js.map +1 -1
  15. package/2D/controls/inputText.js +4 -5
  16. package/2D/controls/inputText.js.map +1 -1
  17. package/2D/controls/inputTextArea.js +7 -9
  18. package/2D/controls/inputTextArea.js.map +1 -1
  19. package/2D/controls/textBlock.js +1 -2
  20. package/2D/controls/textBlock.js.map +1 -1
  21. package/2D/controls/toggleButton.js +3 -4
  22. package/2D/controls/toggleButton.js.map +1 -1
  23. package/3D/controls/MRTK3/touchHolographicButton.js +7 -14
  24. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  25. package/3D/controls/contentDisplay3D.js +1 -2
  26. package/3D/controls/contentDisplay3D.js.map +1 -1
  27. package/3D/controls/control3D.js +2 -3
  28. package/3D/controls/control3D.js.map +1 -1
  29. package/3D/controls/holographicBackplate.js +1 -2
  30. package/3D/controls/holographicBackplate.js.map +1 -1
  31. package/3D/controls/holographicSlate.js +1 -2
  32. package/3D/controls/holographicSlate.js.map +1 -1
  33. package/3D/controls/slider3D.js +10 -13
  34. package/3D/controls/slider3D.js.map +1 -1
  35. package/3D/controls/touchButton3D.js +2 -4
  36. package/3D/controls/touchButton3D.js.map +1 -1
  37. package/3D/controls/touchHolographicButton.js +1 -2
  38. package/3D/controls/touchHolographicButton.js.map +1 -1
  39. package/3D/gui3DManager.js +3 -5
  40. package/3D/gui3DManager.js.map +1 -1
  41. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +1 -2
  42. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  43. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/touchHolographicButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AACnE,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAC1D,OAAO,EAAE,IAAI,EAAE,uCAAyB;AACxC,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,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,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAC9D,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAEhD;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,aAAa;IAmC7C,eAAe;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,IAAI,CAAC,iBAAiB,EAAE;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AAC;QACvB,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAEhE,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;;AAxcD;;GAEG;AACW,qCAAc,GAAW,2CAA2C,AAAtD,CAAuD;AACnF;;GAEG;AACW,qCAAc,GAAW,wBAAwB,AAAnC,CAAoC","sourcesContent":["import 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 { 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\nimport { FluentMaterial } from \"../materials/fluent/fluentMaterial\";\r\nimport { FluentButtonMaterial } from \"../materials/fluentButton/fluentButtonMaterial\";\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 { TouchButton3D } from \"./touchButton3D\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { Scalar } from \"core/Maths/math.scalar\";\r\n\r\n/**\r\n * Class used to create a holographic button in 3D\r\n * @since 5.0.0\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\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-button.glb\";\r\n\r\n private _backPlate: Mesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _text: string;\r\n private _imageUrl: string;\r\n private _shareMaterials = true;\r\n private _isBackplateVisible = true;\r\n private _frontMaterial: FluentButtonMaterial;\r\n private _backMaterial: FluentMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerHoverObserver: Nullable<Observer<Vector3>>;\r\n private _frontPlateDepth = 0.5;\r\n private _backPlateDepth = 0.04;\r\n private _backplateColor = new Color3(0.08, 0.15, 0.55);\r\n private _backplateToggledColor = new Color3(0.25, 0.4, 0.95);\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 * 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 */\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(): FluentButtonMaterial {\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 * 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 this._frontMaterial.leftBlobEnable = true;\r\n this._frontMaterial.rightBlobEnable = true;\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n this._frontMaterial.leftBlobEnable = false;\r\n this._frontMaterial.rightBlobEnable = false;\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n if (this._frontPlate && !this.isActiveNearInteraction) {\r\n this._frontPlate.scaling.z = this._frontPlateDepth * 0.2;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - 0.2 * this._frontPlateDepth) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + 0.2 * this._frontPlateDepth) / 2);\r\n }\r\n };\r\n this.pointerUpAnimation = () => {\r\n if (this._frontPlate) {\r\n this._frontPlate.scaling.z = this._frontPlateDepth;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - this._frontPlateDepth) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + this._frontPlateDepth) / 2);\r\n }\r\n };\r\n\r\n this.onPointerMoveObservable.add((position) => {\r\n if (this._frontPlate && this.isActiveNearInteraction) {\r\n const scale = Vector3.Zero();\r\n if (this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) {\r\n let interactionHeight = this._getInteractionHeight(position, this._backPlate.getAbsolutePosition()) / scale.z;\r\n interactionHeight = Scalar.Clamp(interactionHeight - this._backPlateDepth / 2, 0.2 * this._frontPlateDepth, this._frontPlateDepth);\r\n\r\n this._frontPlate.scaling.z = interactionHeight;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - interactionHeight) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + interactionHeight) / 2);\r\n }\r\n }\r\n });\r\n\r\n this._pointerHoverObserver = this.onPointerMoveObservable.add((hoverPosition: Vector3) => {\r\n this._frontMaterial.globalLeftIndexTipPosition = hoverPosition;\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 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 this.content = panel;\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n const collisionMesh = CreateBox(\r\n `${this.name}_collisionMesh`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\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._frontPlateDepth / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene).then((result) => {\r\n const alphaMesh = CreateBox(\r\n \"${this.name}_alphaMesh\",\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 alphaMesh.isPickable = false;\r\n alphaMesh.material = new StandardMaterial(\"${this.name}_alphaMesh_material\", scene);\r\n alphaMesh.material.alpha = 0.15;\r\n\r\n const importedFrontPlate = result.meshes[1];\r\n importedFrontPlate.name = `${this.name}_frontPlate`;\r\n importedFrontPlate.isPickable = false;\r\n importedFrontPlate.scaling.z = this._frontPlateDepth;\r\n alphaMesh.parent = importedFrontPlate;\r\n importedFrontPlate.parent = collisionMesh;\r\n if (this._frontMaterial) {\r\n importedFrontPlate.material = this._frontMaterial;\r\n }\r\n this._frontPlate = importedFrontPlate;\r\n });\r\n\r\n this._backPlate = CreateBox(\r\n `${this.name}_backPlate`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: this._backPlateDepth,\r\n },\r\n scene\r\n );\r\n\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this._backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\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.position = Vector3.Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(this._textPlate);\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 protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = new Color3(0.4, 0.4, 0.4);\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = new FluentMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.albedoColor = this._backplateColor;\r\n this._backMaterial.renderBorders = true;\r\n this._backMaterial.renderHoverLight = false;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = new FluentButtonMaterial(this.name + \"Front Material\", mesh.getScene());\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 _onToggle(newState: boolean) {\r\n if (this._backMaterial) {\r\n if (newState) {\r\n this._backMaterial.albedoColor = this._backplateToggledColor;\r\n } else {\r\n this._backMaterial.albedoColor = this._backplateColor;\r\n }\r\n }\r\n\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[\"backFluentMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"backFluentMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"backFluentMaterial\"] as FluentMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"frontFluentMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"frontFluentMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"frontFluentMaterial\"] as FluentButtonMaterial;\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._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\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.onPointerMoveObservable.remove(this._pointerHoverObserver);\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":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/touchHolographicButton.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AACnE,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAC1D,OAAO,EAAE,IAAI,EAAE,uCAAyB;AACxC,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,8BA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I,CAAC,CAAC;QAChC,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;QAE/C,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC3B,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC;SACnD;QAED,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;QACvB,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAEhE,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;;AAxcD;;GAEG;AACW,qCAAc,GAAW,2CAA2C,AAAtD,CAAuD;AACnF;;GAEG;AACW,qCAAc,GAAW,wBAAwB,AAAnC,CAAoC","sourcesContent":["import 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 { 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\nimport { FluentMaterial } from \"../materials/fluent/fluentMaterial\";\r\nimport { FluentButtonMaterial } from \"../materials/fluentButton/fluentButtonMaterial\";\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 { TouchButton3D } from \"./touchButton3D\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { Scalar } from \"core/Maths/math.scalar\";\r\n\r\n/**\r\n * Class used to create a holographic button in 3D\r\n * @since 5.0.0\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\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-button.glb\";\r\n\r\n private _backPlate: Mesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _text: string;\r\n private _imageUrl: string;\r\n private _shareMaterials = true;\r\n private _isBackplateVisible = true;\r\n private _frontMaterial: FluentButtonMaterial;\r\n private _backMaterial: FluentMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerHoverObserver: Nullable<Observer<Vector3>>;\r\n private _frontPlateDepth = 0.5;\r\n private _backPlateDepth = 0.04;\r\n private _backplateColor = new Color3(0.08, 0.15, 0.55);\r\n private _backplateToggledColor = new Color3(0.25, 0.4, 0.95);\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 * 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 */\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(): FluentButtonMaterial {\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 * 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 this._frontMaterial.leftBlobEnable = true;\r\n this._frontMaterial.rightBlobEnable = true;\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n this._frontMaterial.leftBlobEnable = false;\r\n this._frontMaterial.rightBlobEnable = false;\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n if (this._frontPlate && !this.isActiveNearInteraction) {\r\n this._frontPlate.scaling.z = this._frontPlateDepth * 0.2;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - 0.2 * this._frontPlateDepth) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + 0.2 * this._frontPlateDepth) / 2);\r\n }\r\n };\r\n this.pointerUpAnimation = () => {\r\n if (this._frontPlate) {\r\n this._frontPlate.scaling.z = this._frontPlateDepth;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - this._frontPlateDepth) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + this._frontPlateDepth) / 2);\r\n }\r\n };\r\n\r\n this.onPointerMoveObservable.add((position) => {\r\n if (this._frontPlate && this.isActiveNearInteraction) {\r\n const scale = Vector3.Zero();\r\n if (this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) {\r\n let interactionHeight = this._getInteractionHeight(position, this._backPlate.getAbsolutePosition()) / scale.z;\r\n interactionHeight = Scalar.Clamp(interactionHeight - this._backPlateDepth / 2, 0.2 * this._frontPlateDepth, this._frontPlateDepth);\r\n\r\n this._frontPlate.scaling.z = interactionHeight;\r\n this._frontPlate.position = Vector3.Forward(this._frontPlate._scene.useRightHandedSystem).scale((this._frontPlateDepth - interactionHeight) / 2);\r\n this._textPlate.position = Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-(this._backPlateDepth + interactionHeight) / 2);\r\n }\r\n }\r\n });\r\n\r\n this._pointerHoverObserver = this.onPointerMoveObservable.add((hoverPosition: Vector3) => {\r\n this._frontMaterial.globalLeftIndexTipPosition = hoverPosition;\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 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 this.content = panel;\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n const collisionMesh = CreateBox(\r\n `${this.name}_collisionMesh`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\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._frontPlateDepth / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene).then((result) => {\r\n const alphaMesh = CreateBox(\r\n \"${this.name}_alphaMesh\",\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 alphaMesh.isPickable = false;\r\n alphaMesh.material = new StandardMaterial(\"${this.name}_alphaMesh_material\", scene);\r\n alphaMesh.material.alpha = 0.15;\r\n\r\n const importedFrontPlate = result.meshes[1];\r\n importedFrontPlate.name = `${this.name}_frontPlate`;\r\n importedFrontPlate.isPickable = false;\r\n importedFrontPlate.scaling.z = this._frontPlateDepth;\r\n alphaMesh.parent = importedFrontPlate;\r\n importedFrontPlate.parent = collisionMesh;\r\n if (this._frontMaterial) {\r\n importedFrontPlate.material = this._frontMaterial;\r\n }\r\n this._frontPlate = importedFrontPlate;\r\n });\r\n\r\n this._backPlate = CreateBox(\r\n `${this.name}_backPlate`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: this._backPlateDepth,\r\n },\r\n scene\r\n );\r\n\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this._backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\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.position = Vector3.Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(this._textPlate);\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 protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = new Color3(0.4, 0.4, 0.4);\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = new FluentMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.albedoColor = this._backplateColor;\r\n this._backMaterial.renderBorders = true;\r\n this._backMaterial.renderHoverLight = false;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = new FluentButtonMaterial(this.name + \"Front Material\", mesh.getScene());\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 _onToggle(newState: boolean) {\r\n if (this._backMaterial) {\r\n if (newState) {\r\n this._backMaterial.albedoColor = this._backplateToggledColor;\r\n } else {\r\n this._backMaterial.albedoColor = this._backplateColor;\r\n }\r\n }\r\n\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[\"backFluentMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"backFluentMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"backFluentMaterial\"] as FluentMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"frontFluentMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"frontFluentMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"frontFluentMaterial\"] as FluentButtonMaterial;\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._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\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.onPointerMoveObservable.remove(this._pointerHoverObserver);\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"]}
@@ -76,8 +76,7 @@ export class GUI3DManager {
76
76
  this._utilityLayer.onlyCheckPointerDownEvents = false;
77
77
  this._utilityLayer.pickUtilitySceneFirst = false;
78
78
  this._utilityLayer.mainSceneTrackerPredicate = (mesh) => {
79
- var _a, _b, _c;
80
- return mesh && ((_c = (_b = (_a = mesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) === null || _b === void 0 ? void 0 : _b.control) === null || _c === void 0 ? void 0 : _c._node);
79
+ return mesh && mesh.reservedDataStore?.GUI3D?.control?._node;
81
80
  };
82
81
  // Root
83
82
  this._rootContainer = new Container3D("RootContainer");
@@ -110,7 +109,6 @@ export class GUI3DManager {
110
109
  this.onPickedPointChangedObservable.notifyObservers(null);
111
110
  }
112
111
  _doPicking(pi) {
113
- var _a, _b, _c;
114
112
  if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) {
115
113
  return false;
116
114
  }
@@ -128,8 +126,8 @@ export class GUI3DManager {
128
126
  if (pickingInfo.pickedPoint) {
129
127
  this.onPickedPointChangedObservable.notifyObservers(pickingInfo.pickedPoint);
130
128
  }
131
- const control = (_b = (_a = pickingInfo.pickedMesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) === null || _b === void 0 ? void 0 : _b.control;
132
- if (!!control && !control._processObservables(pi.type, pickingInfo.pickedPoint, ((_c = pickingInfo.originMesh) === null || _c === void 0 ? void 0 : _c.position) || null, pointerId, buttonIndex)) {
129
+ const control = pickingInfo.pickedMesh.reservedDataStore?.GUI3D?.control;
130
+ if (!!control && !control._processObservables(pi.type, pickingInfo.pickedPoint, pickingInfo.originMesh?.position || null, pointerId, buttonIndex)) {
133
131
  if (pi.type === PointerEventTypes.POINTERMOVE) {
134
132
  if (this._lastControlOver[pointerId]) {
135
133
  this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]);
@@ -1 +1 @@
1
- {"version":3,"file":"gui3DManager.js","sourceRoot":"","sources":["../../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qBAAqB,GAAG,EAAE,CAAC;QAEhC,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,aAAa,EAAE;YAChD,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YAC3E,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;SACnC;QAED,IAAI,CAAC,8BAA8B,CAAC,KAAK,EAAE,CAAC;QAC5C,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QAEjC,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC;QAE3F,IAAI,iBAAiB,EAAE;YACnB,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACvB,iBAAiB,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBACpE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;aAChC;SACJ;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,IAAI,IAAI,CAAC,qBAAqB,EAAE;gBAC5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBACnE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;SAChC;IACL,CAAC;;AArQgB,mCAAsB,GAAW,KAAK,AAAhB,CAAiB","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { PointerInfo } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { HemisphericLight } from \"core/Lights/hemisphericLight\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { UtilityLayerRenderer } from \"core/Rendering/utilityLayerRenderer\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport { Container3D } from \"./controls/container3D\";\r\nimport type { Control3D } from \"./controls/control3D\";\r\nimport type { IPointerEvent } from \"core/Events/deviceInputEvents\";\r\n\r\n/**\r\n * Class used to manage 3D user interface\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui3D\r\n */\r\nexport class GUI3DManager implements IDisposable {\r\n private _scene: Scene;\r\n private _sceneDisposeObserver: Nullable<Observer<Scene>>;\r\n private _utilityLayer: Nullable<UtilityLayerRenderer>;\r\n private _rootContainer: Container3D;\r\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\r\n private _pointerOutObserver: Nullable<Observer<number>>;\r\n private _customControlScaling = 1.0;\r\n /** @internal */\r\n public _lastPickedControl: Control3D;\r\n /** @internal */\r\n public _lastControlOver: { [pointerId: number]: Control3D } = {};\r\n /** @internal */\r\n public _lastControlDown: { [pointerId: number]: Control3D } = {};\r\n\r\n protected static MRTK_REALISTIC_SCALING: number = 0.032;\r\n\r\n /**\r\n * Observable raised when the point picked by the pointer events changed\r\n */\r\n public onPickedPointChangedObservable = new Observable<Nullable<Vector3>>();\r\n\r\n /**\r\n * Observable raised when a picking happens\r\n */\r\n public onPickingObservable = new Observable<Nullable<AbstractMesh>>();\r\n\r\n // Shared resources\r\n /** @internal */\r\n public _sharedMaterials: { [key: string]: Material } = {};\r\n\r\n /** @internal */\r\n public _touchSharedMaterials: { [key: string]: Material } = {};\r\n\r\n /** Gets the hosting scene */\r\n public get scene(): Scene {\r\n return this._scene;\r\n }\r\n\r\n /** Gets associated utility layer */\r\n public get utilityLayer(): Nullable<UtilityLayerRenderer> {\r\n return this._utilityLayer;\r\n }\r\n\r\n /** Gets the scaling for all UI elements owned by this manager */\r\n public get controlScaling() {\r\n return this._customControlScaling;\r\n }\r\n\r\n /** Sets the scaling adjustment for all UI elements owned by this manager */\r\n public set controlScaling(newScale: number) {\r\n if (this._customControlScaling !== newScale && newScale > 0) {\r\n const scaleRatio = newScale / this._customControlScaling;\r\n this._customControlScaling = newScale;\r\n\r\n this._rootContainer.children.forEach((control: Control3D) => {\r\n control.scaling.scaleInPlace(scaleRatio);\r\n\r\n if (newScale !== 1) {\r\n control._isScaledByManager = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n /** Gets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */\r\n public get useRealisticScaling() {\r\n return this.controlScaling === GUI3DManager.MRTK_REALISTIC_SCALING;\r\n }\r\n\r\n /** Sets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */\r\n public set useRealisticScaling(newValue: boolean) {\r\n this.controlScaling = newValue ? GUI3DManager.MRTK_REALISTIC_SCALING : 1;\r\n }\r\n\r\n /**\r\n * Creates a new GUI3DManager\r\n * @param scene\r\n */\r\n public constructor(scene?: Scene) {\r\n this._scene = scene || EngineStore.LastCreatedScene!;\r\n this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => {\r\n this._sceneDisposeObserver = null;\r\n this._utilityLayer = null;\r\n this.dispose();\r\n });\r\n\r\n this._utilityLayer = UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene);\r\n this._utilityLayer.onlyCheckPointerDownEvents = false;\r\n this._utilityLayer.pickUtilitySceneFirst = false;\r\n this._utilityLayer.mainSceneTrackerPredicate = (mesh: Nullable<AbstractMesh>) => {\r\n return mesh && mesh.reservedDataStore?.GUI3D?.control?._node;\r\n };\r\n\r\n // Root\r\n this._rootContainer = new Container3D(\"RootContainer\");\r\n this._rootContainer._host = this;\r\n const utilityLayerScene = this._utilityLayer.utilityLayerScene;\r\n\r\n // Events\r\n this._pointerOutObserver = this._utilityLayer.onPointerOutObservable.add((pointerId) => {\r\n this._handlePointerOut(pointerId, true);\r\n });\r\n\r\n this._pointerObserver = utilityLayerScene.onPointerObservable.add((pi) => {\r\n this._doPicking(pi);\r\n });\r\n\r\n // Scene\r\n this._utilityLayer.utilityLayerScene.autoClear = false;\r\n this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;\r\n new HemisphericLight(\"hemi\", Vector3.Up(), this._utilityLayer.utilityLayerScene);\r\n }\r\n\r\n private _handlePointerOut(pointerId: number, isPointerUp: boolean) {\r\n const previousControlOver = this._lastControlOver[pointerId];\r\n if (previousControlOver) {\r\n previousControlOver._onPointerOut(previousControlOver);\r\n delete this._lastControlOver[pointerId];\r\n }\r\n\r\n if (isPointerUp) {\r\n if (this._lastControlDown[pointerId]) {\r\n this._lastControlDown[pointerId].forcePointerUp();\r\n delete this._lastControlDown[pointerId];\r\n }\r\n }\r\n\r\n this.onPickedPointChangedObservable.notifyObservers(null);\r\n }\r\n\r\n private _doPicking(pi: PointerInfo): boolean {\r\n if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) {\r\n return false;\r\n }\r\n\r\n const pointerEvent = <IPointerEvent>pi.event;\r\n\r\n const pointerId = pointerEvent.pointerId || 0;\r\n const buttonIndex = pointerEvent.button;\r\n\r\n const pickingInfo = pi.pickInfo;\r\n if (pickingInfo) {\r\n this.onPickingObservable.notifyObservers(pickingInfo.pickedMesh);\r\n }\r\n\r\n if (!pickingInfo || !pickingInfo.hit) {\r\n this._handlePointerOut(pointerId, pi.type === PointerEventTypes.POINTERUP);\r\n return false;\r\n }\r\n\r\n if (pickingInfo.pickedPoint) {\r\n this.onPickedPointChangedObservable.notifyObservers(pickingInfo.pickedPoint);\r\n }\r\n\r\n const control = <Control3D>pickingInfo.pickedMesh!.reservedDataStore?.GUI3D?.control;\r\n if (!!control && !control._processObservables(pi.type, pickingInfo.pickedPoint!, pickingInfo.originMesh?.position || null, pointerId, buttonIndex)) {\r\n if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]);\r\n }\r\n\r\n delete this._lastControlOver[pointerId];\r\n }\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERUP) {\r\n if (this._lastControlDown[pointerEvent.pointerId]) {\r\n this._lastControlDown[pointerEvent.pointerId].forcePointerUp();\r\n delete this._lastControlDown[pointerEvent.pointerId];\r\n }\r\n\r\n if (pointerEvent.pointerType === \"touch\" || (pointerEvent.pointerType === \"xr\" && this._scene.getEngine().hostInformation.isMobile)) {\r\n this._handlePointerOut(pointerId, false);\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets the root container\r\n */\r\n public get rootContainer(): Container3D {\r\n return this._rootContainer;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given control is in the root child list\r\n * @param control defines the control to check\r\n * @returns true if the control is in the root child list\r\n */\r\n public containsControl(control: Control3D): boolean {\r\n return this._rootContainer.containsControl(control);\r\n }\r\n\r\n /**\r\n * Adds a control to the root child list\r\n * @param control defines the control to add\r\n * @returns the current manager\r\n */\r\n public addControl(control: Control3D): GUI3DManager {\r\n this._rootContainer.addControl(control);\r\n if (this._customControlScaling !== 1) {\r\n control.scaling.scaleInPlace(this._customControlScaling);\r\n control._isScaledByManager = true;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the root child list\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control3D): GUI3DManager {\r\n this._rootContainer.removeControl(control);\r\n if (control._isScaledByManager) {\r\n control.scaling.scaleInPlace(1 / this._customControlScaling);\r\n control._isScaledByManager = false;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this._rootContainer.dispose();\r\n\r\n for (const materialName in this._sharedMaterials) {\r\n if (!Object.prototype.hasOwnProperty.call(this._sharedMaterials, materialName)) {\r\n continue;\r\n }\r\n\r\n this._sharedMaterials[materialName].dispose();\r\n }\r\n\r\n this._sharedMaterials = {};\r\n\r\n for (const materialName in this._touchSharedMaterials) {\r\n if (!Object.prototype.hasOwnProperty.call(this._touchSharedMaterials, materialName)) {\r\n continue;\r\n }\r\n\r\n this._touchSharedMaterials[materialName].dispose();\r\n }\r\n\r\n this._touchSharedMaterials = {};\r\n\r\n if (this._pointerOutObserver && this._utilityLayer) {\r\n this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this._pointerOutObserver = null;\r\n }\r\n\r\n this.onPickedPointChangedObservable.clear();\r\n this.onPickingObservable.clear();\r\n\r\n const utilityLayerScene = this._utilityLayer ? this._utilityLayer.utilityLayerScene : null;\r\n\r\n if (utilityLayerScene) {\r\n if (this._pointerObserver) {\r\n utilityLayerScene.onPointerObservable.remove(this._pointerObserver);\r\n this._pointerObserver = null;\r\n }\r\n }\r\n if (this._scene) {\r\n if (this._sceneDisposeObserver) {\r\n this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);\r\n this._sceneDisposeObserver = null;\r\n }\r\n }\r\n\r\n if (this._utilityLayer) {\r\n this._utilityLayer.dispose();\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"gui3DManager.js","sourceRoot":"","sources":["../../../../dev/gui/src/3D/gui3DManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAEjD,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,mDAAqC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,0DAA4C;AAC3E,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAGvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD;;;GAGG;AACH,MAAM,OAAO,YAAY;IAkCrB,6B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C,IAAI,CAAC;QAE3F,IAAI,iBAAiB,EAAE;YACnB,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACvB,iBAAiB,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBACpE,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;aAChC;SACJ;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,IAAI,IAAI,CAAC,qBAAqB,EAAE;gBAC5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBACnE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC;SAChC;IACL,CAAC;;AArQgB,mCAAsB,GAAW,KAAK,AAAhB,CAAiB","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { PointerInfo } from \"core/Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport { HemisphericLight } from \"core/Lights/hemisphericLight\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { UtilityLayerRenderer } from \"core/Rendering/utilityLayerRenderer\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport { Container3D } from \"./controls/container3D\";\r\nimport type { Control3D } from \"./controls/control3D\";\r\nimport type { IPointerEvent } from \"core/Events/deviceInputEvents\";\r\n\r\n/**\r\n * Class used to manage 3D user interface\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui3D\r\n */\r\nexport class GUI3DManager implements IDisposable {\r\n private _scene: Scene;\r\n private _sceneDisposeObserver: Nullable<Observer<Scene>>;\r\n private _utilityLayer: Nullable<UtilityLayerRenderer>;\r\n private _rootContainer: Container3D;\r\n private _pointerObserver: Nullable<Observer<PointerInfo>>;\r\n private _pointerOutObserver: Nullable<Observer<number>>;\r\n private _customControlScaling = 1.0;\r\n /** @internal */\r\n public _lastPickedControl: Control3D;\r\n /** @internal */\r\n public _lastControlOver: { [pointerId: number]: Control3D } = {};\r\n /** @internal */\r\n public _lastControlDown: { [pointerId: number]: Control3D } = {};\r\n\r\n protected static MRTK_REALISTIC_SCALING: number = 0.032;\r\n\r\n /**\r\n * Observable raised when the point picked by the pointer events changed\r\n */\r\n public onPickedPointChangedObservable = new Observable<Nullable<Vector3>>();\r\n\r\n /**\r\n * Observable raised when a picking happens\r\n */\r\n public onPickingObservable = new Observable<Nullable<AbstractMesh>>();\r\n\r\n // Shared resources\r\n /** @internal */\r\n public _sharedMaterials: { [key: string]: Material } = {};\r\n\r\n /** @internal */\r\n public _touchSharedMaterials: { [key: string]: Material } = {};\r\n\r\n /** Gets the hosting scene */\r\n public get scene(): Scene {\r\n return this._scene;\r\n }\r\n\r\n /** Gets associated utility layer */\r\n public get utilityLayer(): Nullable<UtilityLayerRenderer> {\r\n return this._utilityLayer;\r\n }\r\n\r\n /** Gets the scaling for all UI elements owned by this manager */\r\n public get controlScaling() {\r\n return this._customControlScaling;\r\n }\r\n\r\n /** Sets the scaling adjustment for all UI elements owned by this manager */\r\n public set controlScaling(newScale: number) {\r\n if (this._customControlScaling !== newScale && newScale > 0) {\r\n const scaleRatio = newScale / this._customControlScaling;\r\n this._customControlScaling = newScale;\r\n\r\n this._rootContainer.children.forEach((control: Control3D) => {\r\n control.scaling.scaleInPlace(scaleRatio);\r\n\r\n if (newScale !== 1) {\r\n control._isScaledByManager = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n /** Gets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */\r\n public get useRealisticScaling() {\r\n return this.controlScaling === GUI3DManager.MRTK_REALISTIC_SCALING;\r\n }\r\n\r\n /** Sets if controls attached to this manager are realistically sized, based on the fact that 1 unit length is 1 meter */\r\n public set useRealisticScaling(newValue: boolean) {\r\n this.controlScaling = newValue ? GUI3DManager.MRTK_REALISTIC_SCALING : 1;\r\n }\r\n\r\n /**\r\n * Creates a new GUI3DManager\r\n * @param scene\r\n */\r\n public constructor(scene?: Scene) {\r\n this._scene = scene || EngineStore.LastCreatedScene!;\r\n this._sceneDisposeObserver = this._scene.onDisposeObservable.add(() => {\r\n this._sceneDisposeObserver = null;\r\n this._utilityLayer = null;\r\n this.dispose();\r\n });\r\n\r\n this._utilityLayer = UtilityLayerRenderer._CreateDefaultUtilityLayerFromScene(this._scene);\r\n this._utilityLayer.onlyCheckPointerDownEvents = false;\r\n this._utilityLayer.pickUtilitySceneFirst = false;\r\n this._utilityLayer.mainSceneTrackerPredicate = (mesh: Nullable<AbstractMesh>) => {\r\n return mesh && mesh.reservedDataStore?.GUI3D?.control?._node;\r\n };\r\n\r\n // Root\r\n this._rootContainer = new Container3D(\"RootContainer\");\r\n this._rootContainer._host = this;\r\n const utilityLayerScene = this._utilityLayer.utilityLayerScene;\r\n\r\n // Events\r\n this._pointerOutObserver = this._utilityLayer.onPointerOutObservable.add((pointerId) => {\r\n this._handlePointerOut(pointerId, true);\r\n });\r\n\r\n this._pointerObserver = utilityLayerScene.onPointerObservable.add((pi) => {\r\n this._doPicking(pi);\r\n });\r\n\r\n // Scene\r\n this._utilityLayer.utilityLayerScene.autoClear = false;\r\n this._utilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;\r\n new HemisphericLight(\"hemi\", Vector3.Up(), this._utilityLayer.utilityLayerScene);\r\n }\r\n\r\n private _handlePointerOut(pointerId: number, isPointerUp: boolean) {\r\n const previousControlOver = this._lastControlOver[pointerId];\r\n if (previousControlOver) {\r\n previousControlOver._onPointerOut(previousControlOver);\r\n delete this._lastControlOver[pointerId];\r\n }\r\n\r\n if (isPointerUp) {\r\n if (this._lastControlDown[pointerId]) {\r\n this._lastControlDown[pointerId].forcePointerUp();\r\n delete this._lastControlDown[pointerId];\r\n }\r\n }\r\n\r\n this.onPickedPointChangedObservable.notifyObservers(null);\r\n }\r\n\r\n private _doPicking(pi: PointerInfo): boolean {\r\n if (!this._utilityLayer || !this._utilityLayer.shouldRender || !this._utilityLayer.utilityLayerScene.activeCamera) {\r\n return false;\r\n }\r\n\r\n const pointerEvent = <IPointerEvent>pi.event;\r\n\r\n const pointerId = pointerEvent.pointerId || 0;\r\n const buttonIndex = pointerEvent.button;\r\n\r\n const pickingInfo = pi.pickInfo;\r\n if (pickingInfo) {\r\n this.onPickingObservable.notifyObservers(pickingInfo.pickedMesh);\r\n }\r\n\r\n if (!pickingInfo || !pickingInfo.hit) {\r\n this._handlePointerOut(pointerId, pi.type === PointerEventTypes.POINTERUP);\r\n return false;\r\n }\r\n\r\n if (pickingInfo.pickedPoint) {\r\n this.onPickedPointChangedObservable.notifyObservers(pickingInfo.pickedPoint);\r\n }\r\n\r\n const control = <Control3D>pickingInfo.pickedMesh!.reservedDataStore?.GUI3D?.control;\r\n if (!!control && !control._processObservables(pi.type, pickingInfo.pickedPoint!, pickingInfo.originMesh?.position || null, pointerId, buttonIndex)) {\r\n if (pi.type === PointerEventTypes.POINTERMOVE) {\r\n if (this._lastControlOver[pointerId]) {\r\n this._lastControlOver[pointerId]._onPointerOut(this._lastControlOver[pointerId]);\r\n }\r\n\r\n delete this._lastControlOver[pointerId];\r\n }\r\n }\r\n\r\n if (pi.type === PointerEventTypes.POINTERUP) {\r\n if (this._lastControlDown[pointerEvent.pointerId]) {\r\n this._lastControlDown[pointerEvent.pointerId].forcePointerUp();\r\n delete this._lastControlDown[pointerEvent.pointerId];\r\n }\r\n\r\n if (pointerEvent.pointerType === \"touch\" || (pointerEvent.pointerType === \"xr\" && this._scene.getEngine().hostInformation.isMobile)) {\r\n this._handlePointerOut(pointerId, false);\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets the root container\r\n */\r\n public get rootContainer(): Container3D {\r\n return this._rootContainer;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given control is in the root child list\r\n * @param control defines the control to check\r\n * @returns true if the control is in the root child list\r\n */\r\n public containsControl(control: Control3D): boolean {\r\n return this._rootContainer.containsControl(control);\r\n }\r\n\r\n /**\r\n * Adds a control to the root child list\r\n * @param control defines the control to add\r\n * @returns the current manager\r\n */\r\n public addControl(control: Control3D): GUI3DManager {\r\n this._rootContainer.addControl(control);\r\n if (this._customControlScaling !== 1) {\r\n control.scaling.scaleInPlace(this._customControlScaling);\r\n control._isScaledByManager = true;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the root child list\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control3D): GUI3DManager {\r\n this._rootContainer.removeControl(control);\r\n if (control._isScaledByManager) {\r\n control.scaling.scaleInPlace(1 / this._customControlScaling);\r\n control._isScaledByManager = false;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this._rootContainer.dispose();\r\n\r\n for (const materialName in this._sharedMaterials) {\r\n if (!Object.prototype.hasOwnProperty.call(this._sharedMaterials, materialName)) {\r\n continue;\r\n }\r\n\r\n this._sharedMaterials[materialName].dispose();\r\n }\r\n\r\n this._sharedMaterials = {};\r\n\r\n for (const materialName in this._touchSharedMaterials) {\r\n if (!Object.prototype.hasOwnProperty.call(this._touchSharedMaterials, materialName)) {\r\n continue;\r\n }\r\n\r\n this._touchSharedMaterials[materialName].dispose();\r\n }\r\n\r\n this._touchSharedMaterials = {};\r\n\r\n if (this._pointerOutObserver && this._utilityLayer) {\r\n this._utilityLayer.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this._pointerOutObserver = null;\r\n }\r\n\r\n this.onPickedPointChangedObservable.clear();\r\n this.onPickingObservable.clear();\r\n\r\n const utilityLayerScene = this._utilityLayer ? this._utilityLayer.utilityLayerScene : null;\r\n\r\n if (utilityLayerScene) {\r\n if (this._pointerObserver) {\r\n utilityLayerScene.onPointerObservable.remove(this._pointerObserver);\r\n this._pointerObserver = null;\r\n }\r\n }\r\n if (this._scene) {\r\n if (this._sceneDisposeObserver) {\r\n this._scene.onDisposeObservable.remove(this._sceneDisposeObserver);\r\n this._sceneDisposeObserver = null;\r\n }\r\n }\r\n\r\n if (this._utilityLayer) {\r\n this._utilityLayer.dispose();\r\n }\r\n }\r\n}\r\n"]}
@@ -279,7 +279,6 @@ export class FluentBackplateMaterial extends PushMaterial {
279
279
  return true;
280
280
  }
281
281
  bindForSubMesh(world, mesh, subMesh) {
282
- var _a, _b;
283
282
  const defines = subMesh.materialDefines;
284
283
  if (!defines) {
285
284
  return;
@@ -292,7 +291,7 @@ export class FluentBackplateMaterial extends PushMaterial {
292
291
  // Matrices
293
292
  this.bindOnlyWorldMatrix(world);
294
293
  this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
295
- this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : Vector3.ZeroReadOnly);
294
+ this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
296
295
  // "Round Rect"
297
296
  this._activeEffect.setFloat("_Radius_", this.radius);
298
297
  this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
@@ -1 +1 @@
1
- {"version":3,"file":"fluentBackplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,kBAAkB,EAAE,2CAA6B;AAE1F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAG1D,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAC1D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AAG,yEAAyE,AAA5E,CAA6E;AAE3G;;GAEG;AACW,sCAAc,GAAG,gFAAgF,AAAnF,CAAoF;AASzG;IADN,SAAS,EAAE;uDACS;AAMd;IADN,SAAS,EAAE;0DACY;AAOjB;IADN,SAAS,EAAE;8DACiB;AAStB;IADN,SAAS,EAAE;0DACqD;AAM1D;IADN,SAAS,EAAE;0DACkD;AAMvD;IADN,SAAS,EAAE;8DACgB;AAMrB;IADN,SAAS,EAAE;4DACc;AAMnB;IADN,SAAS,EAAE;iEACgB;AAMrB;IADN,SAAS,EAAE;gEACkB;AAMvB;IADN,SAAS,EAAE;+DACiB;AAMtB;IADN,SAAS,EAAE;6DACe;AAMpB;IADN,SAAS,EAAE;0DACS;AAMd;IADN,SAAS,EAAE;yDACQ;AAMb;IADN,SAAS,EAAE;8DACgB;AAMrB;IADN,SAAS,EAAE;2DACU;AAMf;IADN,SAAS,EAAE;0DACS;AASd;IADN,SAAS,EAAE;+DAC4C;AAMjD;IADN,SAAS,EAAE;+DACiB;AAYtB;IADN,SAAS,EAAE;qEACoB;AAMzB;IADN,SAAS,EAAE;yEACwB;AAS7B;IADN,SAAS,EAAE;wDACO;AAeZ;IADN,kBAAkB,EAAE;2EAC8B;AAO5C;IADN,kBAAkB,EAAE;4EAC+B;AAoTxD,aAAa,CAAC,qCAAqC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { SerializationHelper, serialize, serializeAsVector3 } from \"core/Misc/decorators\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\nimport \"./shaders/fluentBackplate.fragment\";\r\nimport \"./shaders/fluentBackplate.vertex\";\r\n\r\n/** @internal */\r\nclass FluentBackplateMaterialDefines extends MaterialDefines {\r\n public BLOB_ENABLE = true;\r\n public BLOB_ENABLE_2 = true;\r\n public SMOOTH_EDGES = true;\r\n public IRIDESCENT_MAP_ENABLE = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\n/**\r\n * Class used to render square buttons with fluent design\r\n */\r\nexport class FluentBackplateMaterial extends PushMaterial {\r\n /**\r\n * URL pointing to the texture used to define the coloring for the fluent blob effect.\r\n */\r\n public static BLOB_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png\";\r\n\r\n /**\r\n * URL pointing to the texture used to define iridescent map.\r\n */\r\n public static IM_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png\";\r\n\r\n private _blobTexture: Texture;\r\n private _iridescentMap: Texture;\r\n\r\n /**\r\n * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.\r\n */\r\n @serialize()\r\n public radius = 0.03;\r\n\r\n /**\r\n * Gets or sets the line width of the backplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.01;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backplate.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /** @internal */\r\n public _filterWidth = 1;\r\n\r\n /**\r\n * Gets or sets the base color of the backplate.\r\n */\r\n @serialize()\r\n public baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);\r\n\r\n /**\r\n * Gets or sets the line color of the backplate.\r\n */\r\n @serialize()\r\n public lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);\r\n\r\n /**\r\n * Gets or sets the intensity of the fluent hover glow effect.\r\n */\r\n @serialize()\r\n public blobIntensity = 0.98;\r\n\r\n /**\r\n * Gets or sets the far size of the fluent hover glow effect.\r\n */\r\n @serialize()\r\n public blobFarSize = 0.04;\r\n\r\n /**\r\n * Gets or sets the distance considered \"near\" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).\r\n */\r\n @serialize()\r\n public blobNearDistance = 0;\r\n\r\n /**\r\n * Gets or sets the distance considered \"far\" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).\r\n */\r\n @serialize()\r\n public blobFarDistance = 0.08;\r\n\r\n /**\r\n * Gets or sets the length of the fluent hover glow effect fade.\r\n */\r\n @serialize()\r\n public blobFadeLength = 0.08;\r\n\r\n /**\r\n * Gets or sets the size of the fluent hover glow effect when the left pointer is considered \"near\" to the backplate (see blobNearDistance).\r\n */\r\n @serialize()\r\n public blobNearSize = 0.22;\r\n\r\n /**\r\n * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public blobPulse = 0;\r\n\r\n /**\r\n * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.\r\n */\r\n @serialize()\r\n public blobFade = 0;\r\n\r\n /**\r\n * Gets or sets the size of the fluent hover glow effect when the right pointer is considered \"near\" to the backplate (see blobNearDistance).\r\n */\r\n @serialize()\r\n public blobNearSize2 = 0.22;\r\n\r\n /**\r\n * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public blobPulse2 = 0;\r\n\r\n /**\r\n * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.\r\n */\r\n @serialize()\r\n public blobFade2 = 0;\r\n\r\n /** @internal */\r\n public _rate = 0.135;\r\n\r\n /**\r\n * Gets or sets the color of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightColor = new Color4(0.98, 0.98, 0.98, 1);\r\n\r\n /**\r\n * Gets or sets the width of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightWidth = 0.25;\r\n\r\n /** @internal */\r\n public _highlightTransform = new Vector4(1, 1, 0, 0);\r\n\r\n /** @internal */\r\n public _highlight = 1;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect.\r\n */\r\n @serialize()\r\n public iridescenceIntensity = 0;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect on the backplate edges.\r\n */\r\n @serialize()\r\n public iridescenceEdgeIntensity = 1;\r\n\r\n /** @internal */\r\n public _angle = -45;\r\n\r\n /**\r\n * Gets or sets the opacity of the backplate (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public fadeOut = 1;\r\n\r\n /** @internal */\r\n public _reflected = true;\r\n\r\n /** @internal */\r\n public _frequency = 1;\r\n\r\n /** @internal */\r\n public _verticalOffset = 0;\r\n\r\n /**\r\n * Gets or sets the world-space position of the tip of the left index finger.\r\n */\r\n @serializeAsVector3()\r\n public globalLeftIndexTipPosition = Vector3.Zero();\r\n private _globalLeftIndexTipPosition4 = Vector4.Zero();\r\n\r\n /**\r\n * Gets or sets the world-space position of the tip of the right index finger.\r\n */\r\n @serializeAsVector3()\r\n public globalRightIndexTipPosition = Vector3.Zero();\r\n private _globalRightIndexTipPosition4 = Vector4.Zero();\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_DISABLE;\r\n this.backFaceCulling = false;\r\n\r\n this._blobTexture = new Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n this._iridescentMap = new Texture(FluentBackplateMaterial.IM_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return false;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new FluentBackplateMaterialDefines();\r\n }\r\n\r\n const defines = <FluentBackplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"fluentBackplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Filter_Width_\",\r\n \"_Base_Color_\",\r\n \"_Line_Color_\",\r\n \"_Radius_Top_Left_\",\r\n \"_Radius_Top_Right_\",\r\n \"_Radius_Bottom_Left_\",\r\n \"_Radius_Bottom_Right_\",\r\n \"_Blob_Position_\",\r\n \"_Blob_Intensity_\",\r\n \"_Blob_Near_Size_\",\r\n \"_Blob_Far_Size_\",\r\n \"_Blob_Near_Distance_\",\r\n \"_Blob_Far_Distance_\",\r\n \"_Blob_Fade_Length_\",\r\n \"_Blob_Pulse_\",\r\n \"_Blob_Fade_\",\r\n \"_Blob_Texture_\",\r\n \"_Blob_Position_2_\",\r\n \"_Blob_Near_Size_2_\",\r\n \"_Blob_Pulse_2_\",\r\n \"_Blob_Fade_2_\",\r\n \"_Rate_\",\r\n \"_Highlight_Color_\",\r\n \"_Highlight_Width_\",\r\n \"_Highlight_Transform_\",\r\n \"_Highlight_\",\r\n \"_Iridescence_Intensity_\",\r\n \"_Iridescence_Edge_Intensity_\",\r\n \"_Angle_\",\r\n \"_Fade_Out_\",\r\n \"_Reflected_\",\r\n \"_Frequency_\",\r\n \"_Vertical_Offset_\",\r\n \"_Iridescent_Map_\",\r\n \"_Use_Global_Left_Index_\",\r\n \"_Use_Global_Right_Index_\",\r\n \"Global_Left_Index_Tip_Position\",\r\n \"Global_Right_Index_Tip_Position\",\r\n ];\r\n const samplers: string[] = [\"_Blob_Texture_\", \"_Iridescent_Map_\"];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const defines = <FluentBackplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Base_Color_\", this.baseColor);\r\n this._activeEffect.setDirectColor4(\"_Line_Color_\", this.lineColor);\r\n\r\n // \"Radii Multipliers\"\r\n this._activeEffect.setFloat(\"_Radius_Top_Left_\", 1);\r\n this._activeEffect.setFloat(\"_Radius_Top_Right_\", 1.0);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Left_\", 1.0);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Right_\", 1.0);\r\n\r\n // \"Blob\"\r\n //define BLOB_ENABLE true;\r\n this._activeEffect.setFloat(\"_Blob_Intensity_\", this.blobIntensity);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_\", this.blobNearSize);\r\n this._activeEffect.setFloat(\"_Blob_Far_Size_\", this.blobFarSize);\r\n this._activeEffect.setFloat(\"_Blob_Near_Distance_\", this.blobNearDistance);\r\n this._activeEffect.setFloat(\"_Blob_Far_Distance_\", this.blobFarDistance);\r\n this._activeEffect.setFloat(\"_Blob_Fade_Length_\", this.blobFadeLength);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_\", this.blobPulse);\r\n this._activeEffect.setFloat(\"_Blob_Fade_\", this.blobFade);\r\n\r\n // \"Blob Texture\"\r\n this._activeEffect.setTexture(\"_Blob_Texture_\", this._blobTexture);\r\n\r\n // \"Blob 2\"\r\n //define BLOB_ENABLE_2 true;\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_2_\", this.blobNearSize2);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_2_\", this.blobPulse2);\r\n this._activeEffect.setFloat(\"_Blob_Fade_2_\", this.blobFade2);\r\n\r\n // \"Line Highlight\"\r\n this._activeEffect.setFloat(\"_Rate_\", this._rate);\r\n this._activeEffect.setDirectColor4(\"_Highlight_Color_\", this.highlightColor);\r\n this._activeEffect.setFloat(\"_Highlight_Width_\", this.highlightWidth);\r\n this._activeEffect.setVector4(\"_Highlight_Transform_\", this._highlightTransform);\r\n this._activeEffect.setFloat(\"_Highlight_\", this._highlight);\r\n\r\n // \"Iridescence\"\r\n this._activeEffect.setFloat(\"_Iridescence_Intensity_\", this.iridescenceIntensity);\r\n this._activeEffect.setFloat(\"_Iridescence_Edge_Intensity_\", this.iridescenceEdgeIntensity);\r\n this._activeEffect.setFloat(\"_Angle_\", this._angle);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n // \"ChooseAngle\"\r\n this._activeEffect.setFloat(\"_Reflected_\", this._reflected ? 1.0 : 0.0);\r\n\r\n // \"Multiply\"\r\n this._activeEffect.setFloat(\"_Frequency_\", this._frequency);\r\n this._activeEffect.setFloat(\"_Vertical_Offset_\", this._verticalOffset);\r\n\r\n // \"Color Texture\"\r\n //define IRIDESCENT_MAP_ENABLE true;\r\n this._activeEffect.setTexture(\"_Iridescent_Map_\", this._iridescentMap);\r\n\r\n // \"Global\"\r\n this._activeEffect.setFloat(\"_Use_Global_Left_Index_\", 1.0);\r\n this._activeEffect.setFloat(\"_Use_Global_Right_Index_\", 1.0);\r\n\r\n this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);\r\n this._activeEffect.setVector4(\"Global_Left_Index_Tip_Position\", this._globalLeftIndexTipPosition4);\r\n\r\n this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);\r\n this._activeEffect.setVector4(\"Global_Right_Index_Tip_Position\", this._globalRightIndexTipPosition4);\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n\r\n this._blobTexture.dispose();\r\n this._iridescentMap.dispose();\r\n }\r\n\r\n public clone(name: string): FluentBackplateMaterial {\r\n return SerializationHelper.Clone(() => new FluentBackplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.FluentBackplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FluentBackplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): FluentBackplateMaterial {\r\n return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.FluentBackplateMaterial\", FluentBackplateMaterial);\r\n"]}
1
+ {"version":3,"file":"fluentBackplateMaterial.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/materials/fluentBackplate/fluentBackplateMaterial.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,kBAAkB,EAAE,2CAA6B;AAE1F,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAG1D,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAC1D,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAE/D,OAAO,EAAE,YAAY,EAAE,kDAAoC;AAC3D,OAAO,EAAE,YAAY,EAAE,0CAA4B;AAKnD,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,eAAe,EAAE,qDAAuC;AACjE,OAAO,EAAE,SAAS,EAAE,6CAA+B;AAEnD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,kCAAkC,CAAC;AAE1C,gBAAgB;AAChB,MAAM,8BAA+B,SAAQ,eAAe;IAMxD;QACI,KAAK,EAAE,CAAC;QANL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AS,EAAE;yDACQ;AAMb;IADN,SAAS,EAAE;8DACgB;AAMrB;IADN,SAAS,EAAE;2DACU;AAMf;IADN,SAAS,EAAE;0DACS;AASd;IADN,SAAS,EAAE;+DAC4C;AAMjD;IADN,SAAS,EAAE;+DACiB;AAYtB;IADN,SAAS,EAAE;qEACoB;AAMzB;IADN,SAAS,EAAE;yEACwB;AAS7B;IADN,SAAS,EAAE;wDACO;AAeZ;IADN,kBAAkB,EAAE;2EAC8B;AAO5C;IADN,kBAAkB,EAAE;4EAC+B;AAoTxD,aAAa,CAAC,qCAAqC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { SerializationHelper, serialize, serializeAsVector3 } from \"core/Misc/decorators\";\r\nimport type { Matrix } from \"core/Maths/math.vector\";\r\nimport { Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport { MaterialHelper } from \"core/Materials/materialHelper\";\r\nimport type { IEffectCreationOptions } from \"core/Materials/effect\";\r\nimport { PushMaterial } from \"core/Materials/pushMaterial\";\r\nimport { VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"core/Meshes/subMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { EffectFallbacks } from \"core/Materials/effectFallbacks\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\nimport \"./shaders/fluentBackplate.fragment\";\r\nimport \"./shaders/fluentBackplate.vertex\";\r\n\r\n/** @internal */\r\nclass FluentBackplateMaterialDefines extends MaterialDefines {\r\n public BLOB_ENABLE = true;\r\n public BLOB_ENABLE_2 = true;\r\n public SMOOTH_EDGES = true;\r\n public IRIDESCENT_MAP_ENABLE = true;\r\n\r\n constructor() {\r\n super();\r\n this._needNormals = true;\r\n this.rebuild();\r\n }\r\n}\r\n\r\n/**\r\n * Class used to render square buttons with fluent design\r\n */\r\nexport class FluentBackplateMaterial extends PushMaterial {\r\n /**\r\n * URL pointing to the texture used to define the coloring for the fluent blob effect.\r\n */\r\n public static BLOB_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png\";\r\n\r\n /**\r\n * URL pointing to the texture used to define iridescent map.\r\n */\r\n public static IM_TEXTURE_URL = \"https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png\";\r\n\r\n private _blobTexture: Texture;\r\n private _iridescentMap: Texture;\r\n\r\n /**\r\n * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.\r\n */\r\n @serialize()\r\n public radius = 0.03;\r\n\r\n /**\r\n * Gets or sets the line width of the backplate.\r\n */\r\n @serialize()\r\n public lineWidth = 0.01;\r\n\r\n /**\r\n * Gets or sets whether to use absolute sizes when calculating effects on the backplate.\r\n * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.\r\n */\r\n @serialize()\r\n public absoluteSizes = false;\r\n\r\n /** @internal */\r\n public _filterWidth = 1;\r\n\r\n /**\r\n * Gets or sets the base color of the backplate.\r\n */\r\n @serialize()\r\n public baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);\r\n\r\n /**\r\n * Gets or sets the line color of the backplate.\r\n */\r\n @serialize()\r\n public lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);\r\n\r\n /**\r\n * Gets or sets the intensity of the fluent hover glow effect.\r\n */\r\n @serialize()\r\n public blobIntensity = 0.98;\r\n\r\n /**\r\n * Gets or sets the far size of the fluent hover glow effect.\r\n */\r\n @serialize()\r\n public blobFarSize = 0.04;\r\n\r\n /**\r\n * Gets or sets the distance considered \"near\" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).\r\n */\r\n @serialize()\r\n public blobNearDistance = 0;\r\n\r\n /**\r\n * Gets or sets the distance considered \"far\" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).\r\n */\r\n @serialize()\r\n public blobFarDistance = 0.08;\r\n\r\n /**\r\n * Gets or sets the length of the fluent hover glow effect fade.\r\n */\r\n @serialize()\r\n public blobFadeLength = 0.08;\r\n\r\n /**\r\n * Gets or sets the size of the fluent hover glow effect when the left pointer is considered \"near\" to the backplate (see blobNearDistance).\r\n */\r\n @serialize()\r\n public blobNearSize = 0.22;\r\n\r\n /**\r\n * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public blobPulse = 0;\r\n\r\n /**\r\n * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.\r\n */\r\n @serialize()\r\n public blobFade = 0;\r\n\r\n /**\r\n * Gets or sets the size of the fluent hover glow effect when the right pointer is considered \"near\" to the backplate (see blobNearDistance).\r\n */\r\n @serialize()\r\n public blobNearSize2 = 0.22;\r\n\r\n /**\r\n * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public blobPulse2 = 0;\r\n\r\n /**\r\n * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.\r\n */\r\n @serialize()\r\n public blobFade2 = 0;\r\n\r\n /** @internal */\r\n public _rate = 0.135;\r\n\r\n /**\r\n * Gets or sets the color of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightColor = new Color4(0.98, 0.98, 0.98, 1);\r\n\r\n /**\r\n * Gets or sets the width of the highlights on the backplate line.\r\n */\r\n @serialize()\r\n public highlightWidth = 0.25;\r\n\r\n /** @internal */\r\n public _highlightTransform = new Vector4(1, 1, 0, 0);\r\n\r\n /** @internal */\r\n public _highlight = 1;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect.\r\n */\r\n @serialize()\r\n public iridescenceIntensity = 0;\r\n\r\n /**\r\n * Gets or sets the intensity of the iridescence effect on the backplate edges.\r\n */\r\n @serialize()\r\n public iridescenceEdgeIntensity = 1;\r\n\r\n /** @internal */\r\n public _angle = -45;\r\n\r\n /**\r\n * Gets or sets the opacity of the backplate (0.0 - 1.0).\r\n */\r\n @serialize()\r\n public fadeOut = 1;\r\n\r\n /** @internal */\r\n public _reflected = true;\r\n\r\n /** @internal */\r\n public _frequency = 1;\r\n\r\n /** @internal */\r\n public _verticalOffset = 0;\r\n\r\n /**\r\n * Gets or sets the world-space position of the tip of the left index finger.\r\n */\r\n @serializeAsVector3()\r\n public globalLeftIndexTipPosition = Vector3.Zero();\r\n private _globalLeftIndexTipPosition4 = Vector4.Zero();\r\n\r\n /**\r\n * Gets or sets the world-space position of the tip of the right index finger.\r\n */\r\n @serializeAsVector3()\r\n public globalRightIndexTipPosition = Vector3.Zero();\r\n private _globalRightIndexTipPosition4 = Vector4.Zero();\r\n\r\n constructor(name: string, scene?: Scene) {\r\n super(name, scene);\r\n this.alphaMode = Constants.ALPHA_DISABLE;\r\n this.backFaceCulling = false;\r\n\r\n this._blobTexture = new Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n this._iridescentMap = new Texture(FluentBackplateMaterial.IM_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);\r\n }\r\n\r\n public needAlphaBlending(): boolean {\r\n return false;\r\n }\r\n\r\n public needAlphaTesting(): boolean {\r\n return false;\r\n }\r\n\r\n public getAlphaTestTexture(): Nullable<BaseTexture> {\r\n return null;\r\n }\r\n\r\n public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean {\r\n if (this.isFrozen) {\r\n if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {\r\n return true;\r\n }\r\n }\r\n\r\n if (!subMesh.materialDefines) {\r\n subMesh.materialDefines = new FluentBackplateMaterialDefines();\r\n }\r\n\r\n const defines = <FluentBackplateMaterialDefines>subMesh.materialDefines;\r\n const scene = this.getScene();\r\n\r\n if (this._isReadyForSubMesh(subMesh)) {\r\n return true;\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n // Attribs\r\n MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);\r\n\r\n // Get correct effect\r\n if (defines.isDirty) {\r\n defines.markAsProcessed();\r\n\r\n scene.resetCachedMaterial();\r\n\r\n // Fallbacks\r\n const fallbacks = new EffectFallbacks();\r\n if (defines.FOG) {\r\n fallbacks.addFallback(1, \"FOG\");\r\n }\r\n\r\n MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);\r\n\r\n defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;\r\n\r\n //Attributes\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n if (defines.NORMAL) {\r\n attribs.push(VertexBuffer.NormalKind);\r\n }\r\n\r\n if (defines.UV1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n }\r\n\r\n if (defines.UV2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n }\r\n\r\n if (defines.VERTEXCOLOR) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n }\r\n\r\n if (defines.TANGENT) {\r\n attribs.push(VertexBuffer.TangentKind);\r\n }\r\n\r\n MaterialHelper.PrepareAttributesForInstances(attribs, defines);\r\n\r\n // Legacy browser patch\r\n const shaderName = \"fluentBackplate\";\r\n const join = defines.toString();\r\n\r\n const uniforms = [\r\n \"world\",\r\n \"viewProjection\",\r\n \"cameraPosition\",\r\n \"_Radius_\",\r\n \"_Line_Width_\",\r\n \"_Absolute_Sizes_\",\r\n \"_Filter_Width_\",\r\n \"_Base_Color_\",\r\n \"_Line_Color_\",\r\n \"_Radius_Top_Left_\",\r\n \"_Radius_Top_Right_\",\r\n \"_Radius_Bottom_Left_\",\r\n \"_Radius_Bottom_Right_\",\r\n \"_Blob_Position_\",\r\n \"_Blob_Intensity_\",\r\n \"_Blob_Near_Size_\",\r\n \"_Blob_Far_Size_\",\r\n \"_Blob_Near_Distance_\",\r\n \"_Blob_Far_Distance_\",\r\n \"_Blob_Fade_Length_\",\r\n \"_Blob_Pulse_\",\r\n \"_Blob_Fade_\",\r\n \"_Blob_Texture_\",\r\n \"_Blob_Position_2_\",\r\n \"_Blob_Near_Size_2_\",\r\n \"_Blob_Pulse_2_\",\r\n \"_Blob_Fade_2_\",\r\n \"_Rate_\",\r\n \"_Highlight_Color_\",\r\n \"_Highlight_Width_\",\r\n \"_Highlight_Transform_\",\r\n \"_Highlight_\",\r\n \"_Iridescence_Intensity_\",\r\n \"_Iridescence_Edge_Intensity_\",\r\n \"_Angle_\",\r\n \"_Fade_Out_\",\r\n \"_Reflected_\",\r\n \"_Frequency_\",\r\n \"_Vertical_Offset_\",\r\n \"_Iridescent_Map_\",\r\n \"_Use_Global_Left_Index_\",\r\n \"_Use_Global_Right_Index_\",\r\n \"Global_Left_Index_Tip_Position\",\r\n \"Global_Right_Index_Tip_Position\",\r\n ];\r\n const samplers: string[] = [\"_Blob_Texture_\", \"_Iridescent_Map_\"];\r\n const uniformBuffers: string[] = [];\r\n\r\n MaterialHelper.PrepareUniformsAndSamplersList(<IEffectCreationOptions>{\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: defines,\r\n maxSimultaneousLights: 4,\r\n });\r\n\r\n subMesh.setEffect(\r\n scene.getEngine().createEffect(\r\n shaderName,\r\n <IEffectCreationOptions>{\r\n attributes: attribs,\r\n uniformsNames: uniforms,\r\n uniformBuffersNames: uniformBuffers,\r\n samplers: samplers,\r\n defines: join,\r\n fallbacks: fallbacks,\r\n onCompiled: this.onCompiled,\r\n onError: this.onError,\r\n indexParameters: { maxSimultaneousLights: 4 },\r\n },\r\n engine\r\n ),\r\n defines,\r\n this._materialContext\r\n );\r\n }\r\n if (!subMesh.effect || !subMesh.effect.isReady()) {\r\n return false;\r\n }\r\n\r\n defines._renderId = scene.getRenderId();\r\n subMesh.effect._wasPreviouslyReady = true;\r\n\r\n return true;\r\n }\r\n\r\n public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {\r\n const defines = <FluentBackplateMaterialDefines>subMesh.materialDefines;\r\n if (!defines) {\r\n return;\r\n }\r\n\r\n const effect = subMesh.effect;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n this._activeEffect = effect;\r\n\r\n // Matrices\r\n this.bindOnlyWorldMatrix(world);\r\n this._activeEffect.setMatrix(\"viewProjection\", this.getScene().getTransformMatrix());\r\n this._activeEffect.setVector3(\"cameraPosition\", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);\r\n\r\n // \"Round Rect\"\r\n this._activeEffect.setFloat(\"_Radius_\", this.radius);\r\n this._activeEffect.setFloat(\"_Line_Width_\", this.lineWidth);\r\n this._activeEffect.setFloat(\"_Absolute_Sizes_\", this.absoluteSizes ? 1.0 : 0.0);\r\n this._activeEffect.setFloat(\"_Filter_Width_\", this._filterWidth);\r\n this._activeEffect.setDirectColor4(\"_Base_Color_\", this.baseColor);\r\n this._activeEffect.setDirectColor4(\"_Line_Color_\", this.lineColor);\r\n\r\n // \"Radii Multipliers\"\r\n this._activeEffect.setFloat(\"_Radius_Top_Left_\", 1);\r\n this._activeEffect.setFloat(\"_Radius_Top_Right_\", 1.0);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Left_\", 1.0);\r\n this._activeEffect.setFloat(\"_Radius_Bottom_Right_\", 1.0);\r\n\r\n // \"Blob\"\r\n //define BLOB_ENABLE true;\r\n this._activeEffect.setFloat(\"_Blob_Intensity_\", this.blobIntensity);\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_\", this.blobNearSize);\r\n this._activeEffect.setFloat(\"_Blob_Far_Size_\", this.blobFarSize);\r\n this._activeEffect.setFloat(\"_Blob_Near_Distance_\", this.blobNearDistance);\r\n this._activeEffect.setFloat(\"_Blob_Far_Distance_\", this.blobFarDistance);\r\n this._activeEffect.setFloat(\"_Blob_Fade_Length_\", this.blobFadeLength);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_\", this.blobPulse);\r\n this._activeEffect.setFloat(\"_Blob_Fade_\", this.blobFade);\r\n\r\n // \"Blob Texture\"\r\n this._activeEffect.setTexture(\"_Blob_Texture_\", this._blobTexture);\r\n\r\n // \"Blob 2\"\r\n //define BLOB_ENABLE_2 true;\r\n this._activeEffect.setFloat(\"_Blob_Near_Size_2_\", this.blobNearSize2);\r\n this._activeEffect.setFloat(\"_Blob_Pulse_2_\", this.blobPulse2);\r\n this._activeEffect.setFloat(\"_Blob_Fade_2_\", this.blobFade2);\r\n\r\n // \"Line Highlight\"\r\n this._activeEffect.setFloat(\"_Rate_\", this._rate);\r\n this._activeEffect.setDirectColor4(\"_Highlight_Color_\", this.highlightColor);\r\n this._activeEffect.setFloat(\"_Highlight_Width_\", this.highlightWidth);\r\n this._activeEffect.setVector4(\"_Highlight_Transform_\", this._highlightTransform);\r\n this._activeEffect.setFloat(\"_Highlight_\", this._highlight);\r\n\r\n // \"Iridescence\"\r\n this._activeEffect.setFloat(\"_Iridescence_Intensity_\", this.iridescenceIntensity);\r\n this._activeEffect.setFloat(\"_Iridescence_Edge_Intensity_\", this.iridescenceEdgeIntensity);\r\n this._activeEffect.setFloat(\"_Angle_\", this._angle);\r\n\r\n // \"Fade\"\r\n this._activeEffect.setFloat(\"_Fade_Out_\", this.fadeOut);\r\n\r\n // \"Antialiasing\"\r\n //define SMOOTH_EDGES true;\r\n\r\n // \"ChooseAngle\"\r\n this._activeEffect.setFloat(\"_Reflected_\", this._reflected ? 1.0 : 0.0);\r\n\r\n // \"Multiply\"\r\n this._activeEffect.setFloat(\"_Frequency_\", this._frequency);\r\n this._activeEffect.setFloat(\"_Vertical_Offset_\", this._verticalOffset);\r\n\r\n // \"Color Texture\"\r\n //define IRIDESCENT_MAP_ENABLE true;\r\n this._activeEffect.setTexture(\"_Iridescent_Map_\", this._iridescentMap);\r\n\r\n // \"Global\"\r\n this._activeEffect.setFloat(\"_Use_Global_Left_Index_\", 1.0);\r\n this._activeEffect.setFloat(\"_Use_Global_Right_Index_\", 1.0);\r\n\r\n this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);\r\n this._activeEffect.setVector4(\"Global_Left_Index_Tip_Position\", this._globalLeftIndexTipPosition4);\r\n\r\n this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);\r\n this._activeEffect.setVector4(\"Global_Right_Index_Tip_Position\", this._globalRightIndexTipPosition4);\r\n\r\n this._afterBind(mesh, this._activeEffect);\r\n }\r\n\r\n /**\r\n * Get the list of animatables in the material.\r\n * @returns the list of animatables object used in the material\r\n */\r\n public getAnimatables(): IAnimatable[] {\r\n return [];\r\n }\r\n\r\n public dispose(forceDisposeEffect?: boolean): void {\r\n super.dispose(forceDisposeEffect);\r\n\r\n this._blobTexture.dispose();\r\n this._iridescentMap.dispose();\r\n }\r\n\r\n public clone(name: string): FluentBackplateMaterial {\r\n return SerializationHelper.Clone(() => new FluentBackplateMaterial(name, this.getScene()), this);\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.FluentBackplateMaterial\";\r\n return serializationObject;\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FluentBackplateMaterial\";\r\n }\r\n\r\n // Statics\r\n public static Parse(source: any, scene: Scene, rootUrl: string): FluentBackplateMaterial {\r\n return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene), source, scene, rootUrl);\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GUI.FluentBackplateMaterial\", FluentBackplateMaterial);\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/gui",
3
- "version": "6.37.1",
3
+ "version": "6.38.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@babylonjs/core": "^6.37.1",
21
+ "@babylonjs/core": "^6.38.1",
22
22
  "@dev/build-tools": "^1.0.0",
23
23
  "@lts/gui": "1.0.0"
24
24
  },