@babylonjs/gui 6.38.0 → 6.38.1
Sign up to get free protection for your applications and to get access to all the features.
- package/2D/advancedDynamicTexture.js +6 -8
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/container.js +4 -7
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js +11 -14
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/gradient/LinearGradient.js +4 -4
- package/2D/controls/gradient/LinearGradient.js.map +1 -1
- package/2D/controls/gradient/RadialGradient.js +6 -6
- package/2D/controls/gradient/RadialGradient.js.map +1 -1
- package/2D/controls/grid.js +2 -2
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js +4 -8
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputText.js +4 -5
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js +7 -9
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/textBlock.js +1 -2
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/toggleButton.js +3 -4
- package/2D/controls/toggleButton.js.map +1 -1
- package/3D/controls/MRTK3/touchHolographicButton.js +7 -14
- package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +1 -2
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js +2 -3
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/holographicBackplate.js +1 -2
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicSlate.js +1 -2
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/slider3D.js +10 -13
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/touchButton3D.js +2 -4
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +1 -2
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/gui3DManager.js +3 -5
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +1 -2
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,gDAAkC;AACtD,OAAO,EAAE,cAAc,EAAE,qDAAuC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,sDAAwC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,gDAAkC;AAC1D,OAAO,EAA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GAAG,4BAA4B,AAA/B,CAAgC;AAEvE;;GAEG;AACW,+CAAwB,GAAG,2BAA2B,AAA9B,CAA+B;AAErE;;GAEG;AACW,8CAAuB,GAAG,wBAAwB,AAA3B,CAA4B;AAEjE;;GAEG;AACW,+CAAwB,GAAG,oBAAoB,AAAvB,CAAwB","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Control3D } from \"../control3D\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Vector3WithInfo } from \"../../vector3WithInfo\";\r\n\r\nimport { AdvancedDynamicTexture } from \"../../../2D/advancedDynamicTexture\";\r\nimport { Animation } from \"core/Animations/animation\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { Control } from \"../../../2D/controls/control\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport { Grid } from \"../../../2D/controls/grid\";\r\nimport { Image } from \"../../../2D/controls/image\";\r\nimport { MRDLBackglowMaterial } from \"../../materials/mrdl/mrdlBackglowMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../../materials/mrdl/mrdlBackplateMaterial\";\r\nimport { MRDLFrontplateMaterial } from \"../../materials/mrdl/mrdlFrontplateMaterial\";\r\nimport { MRDLInnerquadMaterial } from \"../../materials/mrdl/mrdlInnerquadMaterial\";\r\nimport { Rectangle } from \"../../../2D/controls/rectangle\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { StackPanel } from \"../../../2D/controls/stackPanel\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport { TextBlock } from \"../../../2D/controls/textBlock\";\r\nimport { TouchButton3D } from \"../touchButton3D\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Class used to create the mrtkv3 button\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\r\n /**\r\n * Base Url for the frontplate model.\r\n */\r\n public static MRTK_ASSET_BASE_URL = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the frontplate model.\r\n */\r\n public static FRONTPLATE_MODEL_FILENAME = \"mrtk-fluent-frontplate.glb\";\r\n\r\n /**\r\n * File name for the backplate model.\r\n */\r\n public static BACKPLATE_MODEL_FILENAME = \"mrtk-fluent-backplate.glb\";\r\n\r\n /**\r\n * File name for the backglow model.\r\n */\r\n public static BACKGLOW_MODEL_FILENAME = \"mrtk-fluent-button.glb\";\r\n\r\n /**\r\n * File name for the innerquad model.\r\n */\r\n public static INNERQUAD_MODEL_FILENAME = \"SlateProximity.glb\";\r\n\r\n /**\r\n * Gets or sets the horizontal scaling for the button.\r\n */\r\n public width = 1;\r\n\r\n /**\r\n * Gets or sets the vertical scaling for the button.\r\n */\r\n public height = 1;\r\n\r\n /**\r\n * Gets or sets the bevel radius for the button.\r\n */\r\n public radius = 0.14;\r\n\r\n /**\r\n * Gets or sets the font size of the button text in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public textSizeInPixels = 18;\r\n\r\n /**\r\n * Gets or sets the size of the button image in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public imageSizeInPixels = 40;\r\n\r\n /**\r\n * Gets or sets the color of the button plate.\r\n */\r\n public plateMaterialColor = new Color3(0.4, 0.4, 0.4);\r\n\r\n // Shared variables for meshes\r\n /**\r\n * Gets or sets the depth of the button's front plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public frontPlateDepth = 0.2;\r\n\r\n /**\r\n * Gets or sets the depth of the button's back plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public backPlateDepth = 0.04;\r\n\r\n /**\r\n * Gets or sets the offset value for button's back glow.\r\n * This variable determines the x, y scaling of the button's meshes.\r\n */\r\n public backGlowOffset = 0.1;\r\n\r\n /**\r\n * Gets or sets the value that determines the z scaling and z position for the innerQuad and BackGlow meshes.\r\n */\r\n public flatPlaneDepth = 0.001;\r\n\r\n /**\r\n * Gets or sets the radius for FrontMaterial and innerQuadMaterial.\r\n */\r\n public innerQuadRadius = this.radius - 0.04;\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial.\r\n */\r\n public innerQuadColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled.\r\n */\r\n public innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is hovered.\r\n */\r\n public innerQuadHoverColor = new Color4(1, 1, 1, 0.05);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled and hovered.\r\n */\r\n public innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1);\r\n\r\n // Meshes\r\n private _backPlate: AbstractMesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _backGlow: AbstractMesh;\r\n private _innerQuad: AbstractMesh;\r\n private _collisionPlate: AbstractMesh;\r\n private _frontPlateCollisionMesh: AbstractMesh;\r\n private _isBackplateVisible = true;\r\n\r\n // Content\r\n private _text: string;\r\n private _subtext: string;\r\n private _imageUrl: string;\r\n\r\n // Materials\r\n private _shareMaterials = true;\r\n private _frontMaterial: MRDLFrontplateMaterial;\r\n private _backMaterial: MRDLBackplateMaterial;\r\n private _backGlowMaterial: MRDLBackglowMaterial;\r\n private _innerQuadMaterial: MRDLInnerquadMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n\r\n // Events\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerClickObserver: Nullable<Observer<Vector3WithInfo>>;\r\n private _pointerEnterObserver: Nullable<Observer<Control3D>>;\r\n private _pointerOutObserver: Nullable<Observer<Control3D>>;\r\n private _toggleObserver: Nullable<Observer<boolean>>;\r\n\r\n // Tooltip\r\n private _tooltipFade: Nullable<FadeInOutBehavior>;\r\n private _tooltipTextBlock: Nullable<TextBlock>;\r\n private _tooltipTexture: Nullable<AdvancedDynamicTexture>;\r\n private _tooltipMesh: Nullable<Mesh>;\r\n private _tooltipHoverObserver: Nullable<Observer<Control3D>>;\r\n private _tooltipOutObserver: Nullable<Observer<Control3D>>;\r\n\r\n private _disposeTooltip() {\r\n this._tooltipFade = null;\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.dispose();\r\n }\r\n if (this._tooltipTexture) {\r\n this._tooltipTexture.dispose();\r\n }\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.dispose();\r\n }\r\n this.onPointerEnterObservable.remove(this._tooltipHoverObserver);\r\n this.onPointerOutObservable.remove(this._tooltipOutObserver);\r\n }\r\n\r\n /**\r\n * Rendering ground id of all the mesh in the button\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._backPlate.renderingGroupId = id;\r\n this._textPlate.renderingGroupId = id;\r\n this._frontPlate.renderingGroupId = id;\r\n this._backGlow.renderingGroupId = id;\r\n this._innerQuad.renderingGroupId = id;\r\n\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.renderingGroupId = id;\r\n }\r\n }\r\n public get renderingGroupId(): number {\r\n return this._backPlate.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n return this._backPlate as AbstractMesh;\r\n }\r\n\r\n /**\r\n * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\r\n * Set this property after adding the button to the GUI3DManager\r\n */\r\n public set tooltipText(text: Nullable<string>) {\r\n if (!text) {\r\n this._disposeTooltip();\r\n return;\r\n }\r\n if (!this._tooltipFade) {\r\n const rightHandedScene = this._backPlate._scene.useRightHandedSystem;\r\n // Create tooltip with mesh and text\r\n this._tooltipMesh = CreatePlane(\"\", { size: 1 }, this._backPlate._scene);\r\n this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._frontPlateCollisionMesh;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n const tooltipBackground = new Rectangle();\r\n tooltipBackground.height = 0.25;\r\n tooltipBackground.width = 0.8;\r\n tooltipBackground.cornerRadius = 25;\r\n tooltipBackground.color = \"#ffffff\";\r\n tooltipBackground.thickness = 20;\r\n tooltipBackground.background = \"#060668\";\r\n this._tooltipTexture.addControl(tooltipBackground);\r\n\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 100;\r\n this._tooltipTexture.addControl(this._tooltipTextBlock);\r\n\r\n // Add hover action to tooltip\r\n this._tooltipFade = new FadeInOutBehavior();\r\n this._tooltipFade.delay = 500;\r\n this._tooltipMesh.addBehavior(this._tooltipFade);\r\n this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(true);\r\n }\r\n });\r\n this._tooltipOutObserver = this.onPointerOutObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(false);\r\n }\r\n });\r\n }\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.text = text;\r\n }\r\n }\r\n\r\n public get tooltipText() {\r\n return this._tooltipTextBlock?.text || null;\r\n }\r\n\r\n /**\r\n * Gets or sets text for the button\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n\r\n this._text = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets subtext for a button with larger width\r\n */\r\n public get subtext(): string {\r\n return this._subtext;\r\n }\r\n\r\n public set subtext(value: string) {\r\n if (this._subtext === value) {\r\n return;\r\n }\r\n\r\n this._subtext = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets the image url for the button\r\n */\r\n public get imageUrl(): string {\r\n return this._imageUrl;\r\n }\r\n\r\n public set imageUrl(value: string) {\r\n if (this._imageUrl === value) {\r\n return;\r\n }\r\n\r\n this._imageUrl = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets the back material used by this button\r\n */\r\n public get backMaterial(): MRDLBackplateMaterial {\r\n return this._backMaterial;\r\n }\r\n\r\n /**\r\n * Gets the front material used by this button\r\n */\r\n public get frontMaterial(): MRDLFrontplateMaterial {\r\n return this._frontMaterial;\r\n }\r\n\r\n /**\r\n * Gets the back glow material used by this button\r\n */\r\n public get backGlowMaterial(): MRDLBackglowMaterial {\r\n return this._backGlowMaterial;\r\n }\r\n\r\n /**\r\n * Gets the inner quad material used by this button\r\n */\r\n public get innerQuadMaterial(): MRDLInnerquadMaterial {\r\n return this._innerQuadMaterial;\r\n }\r\n\r\n /**\r\n * Gets the plate material used by this button\r\n */\r\n public get plateMaterial(): StandardMaterial {\r\n return this._plateMaterial;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this button shares its material with other V3 Buttons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement\r\n */\r\n public set isBackplateVisible(isVisible: boolean) {\r\n if (this.mesh && this._backMaterial) {\r\n if (isVisible && !this._isBackplateVisible) {\r\n this._backPlate.visibility = 1;\r\n } else if (!isVisible && this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n }\r\n\r\n this._isBackplateVisible = isVisible;\r\n }\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param shareMaterials\r\n */\r\n constructor(name?: string, shareMaterials = true) {\r\n super(name);\r\n\r\n this._shareMaterials = shareMaterials;\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(1);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n if (this.isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledHoverColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadHoverColor;\r\n }\r\n }\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(-0.8);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this._pointerClickObserver = this.onPointerClickObservable.add(() => {\r\n if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) {\r\n this._performClickAnimation();\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n });\r\n\r\n this._pointerEnterObserver = this.onPointerEnterObservable.add(() => {\r\n this.pointerEnterAnimation();\r\n });\r\n\r\n this._pointerOutObserver = this.onPointerOutObservable.add(() => {\r\n this.pointerOutAnimation();\r\n });\r\n\r\n this._toggleObserver = this.onToggleObservable.add((isToggled) => {\r\n if (isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n });\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"TouchHolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n let content: Control;\r\n\r\n if (this._getAspectRatio() <= 1) {\r\n // align text and image vertically\r\n content = this._alignContentVertically();\r\n } else {\r\n // align text and image horizontally\r\n content = this._alignContentHorizontally();\r\n }\r\n\r\n this.content = content;\r\n }\r\n\r\n private _getAspectRatio() {\r\n return this.width / this.height;\r\n }\r\n\r\n private _alignContentVertically() {\r\n const panel = new StackPanel();\r\n panel.isVertical = true;\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n image.heightInPixels = 180;\r\n image.widthInPixels = 100;\r\n image.paddingTopInPixels = 40;\r\n image.paddingBottomInPixels = 40;\r\n panel.addControl(image);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock();\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.heightInPixels = 30;\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n return panel;\r\n }\r\n\r\n private _alignContentHorizontally() {\r\n let totalPanelWidthInPixels = 240;\r\n const padding = 15;\r\n\r\n const contentContainer = new Rectangle();\r\n contentContainer.widthInPixels = totalPanelWidthInPixels;\r\n contentContainer.heightInPixels = totalPanelWidthInPixels;\r\n contentContainer.color = \"transparent\";\r\n contentContainer.setPaddingInPixels(padding, padding, padding, padding);\r\n totalPanelWidthInPixels -= padding * 2;\r\n\r\n const panel = new StackPanel();\r\n panel.isVertical = false;\r\n panel.scaleY = this._getAspectRatio();\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const imageContainer = new Rectangle(`${this.name}_image`);\r\n imageContainer.widthInPixels = this.imageSizeInPixels;\r\n imageContainer.heightInPixels = this.imageSizeInPixels;\r\n imageContainer.color = \"transparent\";\r\n totalPanelWidthInPixels -= this.imageSizeInPixels;\r\n\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n\r\n imageContainer.addControl(image);\r\n panel.addControl(imageContainer);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock(`${this.name}_text`);\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.fontSize = this.textSizeInPixels;\r\n text.widthInPixels = totalPanelWidthInPixels;\r\n\r\n if (this._imageUrl) {\r\n text.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n text.paddingLeftInPixels = padding;\r\n }\r\n\r\n if (this._subtext) {\r\n const textContainer = new Grid();\r\n textContainer.addColumnDefinition(1);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.widthInPixels = totalPanelWidthInPixels;\r\n textContainer.heightInPixels = 45;\r\n\r\n const subtext = new TextBlock(`${this.name}_subtext`);\r\n subtext.text = this._subtext;\r\n subtext.color = \"#EEEEEEAB\";\r\n subtext.fontSize = this.textSizeInPixels * 0.75;\r\n subtext.fontWeight = \"600\";\r\n\r\n if (this._imageUrl) {\r\n subtext.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n subtext.paddingLeftInPixels = padding;\r\n }\r\n\r\n textContainer.addControl(text, 0);\r\n textContainer.addControl(subtext, 1);\r\n panel.addControl(textContainer);\r\n } else {\r\n panel.addControl(text);\r\n }\r\n }\r\n\r\n contentContainer.addControl(panel);\r\n return contentContainer;\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n\r\n const backPlateMesh = this._createBackPlate(scene);\r\n const collisionMesh = this._createFrontPlate(scene);\r\n const innerQuadMesh = this._createInnerQuad(scene);\r\n const backGlowMesh = this._createBackGlow(scene);\r\n\r\n this._frontPlateCollisionMesh = collisionMesh;\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.name = `${this.name}_textPlate`;\r\n this._textPlate.isPickable = false;\r\n this._textPlate.scaling.x = this.width;\r\n this._textPlate.parent = collisionMesh;\r\n\r\n this._backPlate = backPlateMesh;\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this.backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(innerQuadMesh);\r\n\r\n if (backGlowMesh) {\r\n this._backPlate.addChild(backGlowMesh);\r\n }\r\n\r\n const tn = new TransformNode(`${this.name}_root`, scene);\r\n this._backPlate.setParent(tn);\r\n\r\n this.collisionMesh = collisionMesh;\r\n this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way\r\n\r\n return tn;\r\n }\r\n\r\n private _createBackPlate(scene: Scene) {\r\n const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene);\r\n backPlateMesh.isPickable = false;\r\n backPlateMesh.visibility = 0;\r\n backPlateMesh.scaling.z = 0.2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const backPlateModel = result.meshes[1];\r\n backPlateModel.visibility = 0;\r\n\r\n if (this._isBackplateVisible) {\r\n backPlateModel.visibility = 1;\r\n backPlateModel.name = `${this.name}_backPlate`;\r\n backPlateModel.isPickable = false;\r\n backPlateModel.scaling.x = this.width;\r\n backPlateModel.scaling.y = this.height;\r\n backPlateModel.parent = backPlateMesh;\r\n }\r\n\r\n if (this._backMaterial) {\r\n backPlateModel.material = this._backMaterial;\r\n }\r\n\r\n this._backPlate = backPlateModel;\r\n });\r\n\r\n return backPlateMesh;\r\n }\r\n\r\n private _createFrontPlate(scene: Scene) {\r\n const collisionMesh = CreateBox(\r\n `${this.name}_frontPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n depth: this.frontPlateDepth,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.isNearPickable = true;\r\n collisionMesh.visibility = 0;\r\n collisionMesh.position = Vector3.Forward(scene.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.FRONTPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const collisionPlate = CreateBox(\r\n `${this.name}_collisionPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n },\r\n scene\r\n );\r\n collisionPlate.isPickable = false;\r\n collisionPlate.scaling.z = this.frontPlateDepth;\r\n collisionPlate.visibility = 0;\r\n collisionPlate.parent = collisionMesh;\r\n this._collisionPlate = collisionPlate;\r\n\r\n const frontPlateModel = result.meshes[1];\r\n frontPlateModel.name = `${this.name}_frontPlate`;\r\n frontPlateModel.isPickable = false;\r\n frontPlateModel.scaling.x = this.width - this.backGlowOffset;\r\n frontPlateModel.scaling.y = this.height - this.backGlowOffset;\r\n frontPlateModel.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.5);\r\n frontPlateModel.parent = collisionPlate;\r\n\r\n if (this.isToggleButton) {\r\n frontPlateModel.visibility = 0;\r\n }\r\n\r\n if (this._frontMaterial) {\r\n frontPlateModel.material = this._frontMaterial;\r\n }\r\n\r\n this._textPlate.scaling.x = 1;\r\n this._textPlate.parent = frontPlateModel;\r\n this._frontPlate = frontPlateModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createInnerQuad(scene: Scene) {\r\n const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene);\r\n innerQuadMesh.isPickable = false;\r\n innerQuadMesh.visibility = 0;\r\n innerQuadMesh.scaling.z = this.flatPlaneDepth;\r\n innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.INNERQUAD_MODEL_FILENAME, scene).then((result) => {\r\n const innerQuadModel = result.meshes[1];\r\n innerQuadModel.name = `${this.name}_innerQuad`;\r\n innerQuadModel.isPickable = false;\r\n innerQuadModel.scaling.x = this.width - this.backGlowOffset;\r\n innerQuadModel.scaling.y = this.height - this.backGlowOffset;\r\n innerQuadModel.parent = innerQuadMesh;\r\n\r\n if (this._innerQuadMaterial) {\r\n innerQuadModel.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._innerQuad = innerQuadModel;\r\n });\r\n\r\n return innerQuadMesh;\r\n }\r\n\r\n private _createBackGlow(scene: Scene) {\r\n if (this.isToggleButton) {\r\n return;\r\n }\r\n\r\n const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene);\r\n backGlowMesh.isPickable = false;\r\n backGlowMesh.visibility = 0;\r\n backGlowMesh.scaling.z = this.flatPlaneDepth;\r\n backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKGLOW_MODEL_FILENAME, scene).then((result) => {\r\n const backGlowModel = result.meshes[1];\r\n backGlowModel.name = `${this.name}_backGlow`;\r\n backGlowModel.isPickable = false;\r\n backGlowModel.scaling.x = this.width - this.backGlowOffset;\r\n backGlowModel.scaling.y = this.height - this.backGlowOffset;\r\n backGlowModel.parent = backGlowMesh;\r\n\r\n if (this._backGlowMaterial) {\r\n backGlowModel.material = this._backGlowMaterial;\r\n }\r\n\r\n this._backGlow = backGlowModel;\r\n });\r\n\r\n return backGlowMesh;\r\n }\r\n\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = this.plateMaterialColor;\r\n }\r\n\r\n private _performClickAnimation() {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Click Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"backGlowMotion\",\r\n mesh: this._backGlow,\r\n property: \"material.motion\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0],\r\n },\r\n {\r\n frame: 20,\r\n values: [1, 0.0144, 0.0144],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0027713229489760476, 0, 0],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0027713229489760476],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZSlide\",\r\n mesh: this._collisionPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0.0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0, 0.005403332496794331],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZScale\",\r\n mesh: this._collisionPlate,\r\n property: \"scaling.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [this.frontPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [this.backPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [this.frontPlateDepth, 0.0054],\r\n },\r\n {\r\n frame: 45,\r\n values: [this.frontPlateDepth],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = 1;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _performEnterExitAnimation(speedRatio: number) {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Enter Exit Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"frontPlateFadeOut\",\r\n mesh: this._frontPlate,\r\n property: \"material.fadeOut\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0.025045314830017686, 0],\r\n },\r\n {\r\n frame: 40,\r\n values: [1.00205599570012, 0.025045314830017686, 0, 0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"textPlateZSlide\",\r\n mesh: this._textPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0.0, 0.0],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = speedRatio;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = this._backMaterial ?? new MRDLBackplateMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.absoluteSizes = true;\r\n this._backMaterial.radius = this.radius;\r\n this._backMaterial.lineWidth = 0.02;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = this._frontMaterial ?? new MRDLFrontplateMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this.frontMaterial.radius = this.innerQuadRadius;\r\n this.frontMaterial.fadeOut = 0.0;\r\n }\r\n\r\n private _createBackGlowMaterial(mesh: Mesh) {\r\n const glowRadius = this.radius + 0.04;\r\n this._backGlowMaterial = this._backGlowMaterial ?? new MRDLBackglowMaterial(this.name + \"Back Glow Material\", mesh.getScene());\r\n this._backGlowMaterial.bevelRadius = glowRadius;\r\n this._backGlowMaterial.lineWidth = glowRadius;\r\n this._backGlowMaterial.motion = 0.0;\r\n }\r\n\r\n private _createInnerQuadMaterial(mesh: Mesh) {\r\n this._innerQuadMaterial = this._innerQuadMaterial ?? new MRDLInnerquadMaterial(\"inner_quad\", mesh.getScene());\r\n this._innerQuadMaterial.radius = this.innerQuadRadius;\r\n\r\n if (this.isToggleButton) {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n this._plateMaterial = this._plateMaterial ?? new StandardMaterial(this.name + \"Plate Material\", mesh.getScene());\r\n this._plateMaterial.specularColor = Color3.Black();\r\n }\r\n\r\n protected _onToggle(newState: boolean) {\r\n super._onToggle(newState);\r\n }\r\n\r\n protected _affectMaterial(mesh: Mesh) {\r\n if (this._shareMaterials) {\r\n // Back\r\n if (!this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] as MRDLBackplateMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] as MRDLFrontplateMaterial;\r\n }\r\n\r\n // Back glow\r\n if (!this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"]) {\r\n this._createBackGlowMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] = this._backGlowMaterial;\r\n } else {\r\n this._backGlowMaterial = this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] as MRDLBackglowMaterial;\r\n }\r\n\r\n // Inner quad\r\n if (!this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"]) {\r\n this._createInnerQuadMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] = this._innerQuadMaterial;\r\n } else {\r\n this._innerQuadMaterial = this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] as MRDLInnerquadMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n this._createBackGlowMaterial(mesh);\r\n this._createInnerQuadMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\r\n }\r\n\r\n if (this._backGlow) {\r\n this._backGlow.material = this._backGlowMaterial;\r\n }\r\n\r\n if (this._innerQuad) {\r\n this._innerQuad.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n this._disposeTooltip();\r\n this.onPointerClickObservable.remove(this._pointerClickObserver);\r\n this.onPointerEnterObservable.remove(this._pointerEnterObserver);\r\n this.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this.onToggleObservable.remove(this._toggleObserver);\r\n\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.dispose();\r\n this._backGlowMaterial.dispose();\r\n this._innerQuadMaterial.dispose();\r\n\r\n if (this._pickedPointObserver) {\r\n this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);\r\n this._pickedPointObserver = null;\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"touchHolographicButton.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/3D/controls/MRTK3/touchHolographicButton.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,gDAAkC;AACtD,OAAO,EAAE,cAAc,EAAE,qDAAuC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,wDAA0C;AAChE,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,8CAAgC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,8DAAgD;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,C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AC,oBAAoB,GAAG,IAAI,CAAC;aACpC;SACJ;IACL,CAAC;;AAv/BD;;GAEG;AACW,0CAAmB,GAAG,2CAA2C,AAA9C,CAA+C;AAEhF;;GAEG;AACW,gDAAyB,GAAG,4BAA4B,AAA/B,CAAgC;AAEvE;;GAEG;AACW,+CAAwB,GAAG,2BAA2B,AAA9B,CAA+B;AAErE;;GAEG;AACW,8CAAuB,GAAG,wBAAwB,AAA3B,CAA4B;AAEjE;;GAEG;AACW,+CAAwB,GAAG,oBAAoB,AAAvB,CAAwB","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Control3D } from \"../control3D\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Vector3WithInfo } from \"../../vector3WithInfo\";\r\n\r\nimport { AdvancedDynamicTexture } from \"../../../2D/advancedDynamicTexture\";\r\nimport { Animation } from \"core/Animations/animation\";\r\nimport { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { Control } from \"../../../2D/controls/control\";\r\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { IsDocumentAvailable } from \"core/Misc/domManagement\";\r\nimport { FadeInOutBehavior } from \"core/Behaviors/Meshes/fadeInOutBehavior\";\r\nimport { Grid } from \"../../../2D/controls/grid\";\r\nimport { Image } from \"../../../2D/controls/image\";\r\nimport { MRDLBackglowMaterial } from \"../../materials/mrdl/mrdlBackglowMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../../materials/mrdl/mrdlBackplateMaterial\";\r\nimport { MRDLFrontplateMaterial } from \"../../materials/mrdl/mrdlFrontplateMaterial\";\r\nimport { MRDLInnerquadMaterial } from \"../../materials/mrdl/mrdlInnerquadMaterial\";\r\nimport { Rectangle } from \"../../../2D/controls/rectangle\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { StackPanel } from \"../../../2D/controls/stackPanel\";\r\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\r\nimport { TextBlock } from \"../../../2D/controls/textBlock\";\r\nimport { TouchButton3D } from \"../touchButton3D\";\r\nimport { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Class used to create the mrtkv3 button\r\n */\r\nexport class TouchHolographicButton extends TouchButton3D {\r\n /**\r\n * Base Url for the frontplate model.\r\n */\r\n public static MRTK_ASSET_BASE_URL = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the frontplate model.\r\n */\r\n public static FRONTPLATE_MODEL_FILENAME = \"mrtk-fluent-frontplate.glb\";\r\n\r\n /**\r\n * File name for the backplate model.\r\n */\r\n public static BACKPLATE_MODEL_FILENAME = \"mrtk-fluent-backplate.glb\";\r\n\r\n /**\r\n * File name for the backglow model.\r\n */\r\n public static BACKGLOW_MODEL_FILENAME = \"mrtk-fluent-button.glb\";\r\n\r\n /**\r\n * File name for the innerquad model.\r\n */\r\n public static INNERQUAD_MODEL_FILENAME = \"SlateProximity.glb\";\r\n\r\n /**\r\n * Gets or sets the horizontal scaling for the button.\r\n */\r\n public width = 1;\r\n\r\n /**\r\n * Gets or sets the vertical scaling for the button.\r\n */\r\n public height = 1;\r\n\r\n /**\r\n * Gets or sets the bevel radius for the button.\r\n */\r\n public radius = 0.14;\r\n\r\n /**\r\n * Gets or sets the font size of the button text in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public textSizeInPixels = 18;\r\n\r\n /**\r\n * Gets or sets the size of the button image in pixels.\r\n * This is only adjustable for a button with width to height ratio greater than 1.\r\n */\r\n public imageSizeInPixels = 40;\r\n\r\n /**\r\n * Gets or sets the color of the button plate.\r\n */\r\n public plateMaterialColor = new Color3(0.4, 0.4, 0.4);\r\n\r\n // Shared variables for meshes\r\n /**\r\n * Gets or sets the depth of the button's front plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public frontPlateDepth = 0.2;\r\n\r\n /**\r\n * Gets or sets the depth of the button's back plate.\r\n * This variable determines the z scaling and z position for some of the button's meshes.\r\n */\r\n public backPlateDepth = 0.04;\r\n\r\n /**\r\n * Gets or sets the offset value for button's back glow.\r\n * This variable determines the x, y scaling of the button's meshes.\r\n */\r\n public backGlowOffset = 0.1;\r\n\r\n /**\r\n * Gets or sets the value that determines the z scaling and z position for the innerQuad and BackGlow meshes.\r\n */\r\n public flatPlaneDepth = 0.001;\r\n\r\n /**\r\n * Gets or sets the radius for FrontMaterial and innerQuadMaterial.\r\n */\r\n public innerQuadRadius = this.radius - 0.04;\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial.\r\n */\r\n public innerQuadColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled.\r\n */\r\n public innerQuadToggledColor = new Color4(0.5197843, 0.6485234, 0.9607843, 0.6);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is hovered.\r\n */\r\n public innerQuadHoverColor = new Color4(1, 1, 1, 0.05);\r\n\r\n /**\r\n * Gets or sets the color for innerQuadMaterial for when it is toggled and hovered.\r\n */\r\n public innerQuadToggledHoverColor = new Color4(0.5197843, 0.6485234, 0.9607843, 1);\r\n\r\n // Meshes\r\n private _backPlate: AbstractMesh;\r\n private _textPlate: Mesh;\r\n private _frontPlate: AbstractMesh;\r\n private _backGlow: AbstractMesh;\r\n private _innerQuad: AbstractMesh;\r\n private _collisionPlate: AbstractMesh;\r\n private _frontPlateCollisionMesh: AbstractMesh;\r\n private _isBackplateVisible = true;\r\n\r\n // Content\r\n private _text: string;\r\n private _subtext: string;\r\n private _imageUrl: string;\r\n\r\n // Materials\r\n private _shareMaterials = true;\r\n private _frontMaterial: MRDLFrontplateMaterial;\r\n private _backMaterial: MRDLBackplateMaterial;\r\n private _backGlowMaterial: MRDLBackglowMaterial;\r\n private _innerQuadMaterial: MRDLInnerquadMaterial;\r\n private _plateMaterial: StandardMaterial;\r\n\r\n // Events\r\n private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;\r\n private _pointerClickObserver: Nullable<Observer<Vector3WithInfo>>;\r\n private _pointerEnterObserver: Nullable<Observer<Control3D>>;\r\n private _pointerOutObserver: Nullable<Observer<Control3D>>;\r\n private _toggleObserver: Nullable<Observer<boolean>>;\r\n\r\n // Tooltip\r\n private _tooltipFade: Nullable<FadeInOutBehavior>;\r\n private _tooltipTextBlock: Nullable<TextBlock>;\r\n private _tooltipTexture: Nullable<AdvancedDynamicTexture>;\r\n private _tooltipMesh: Nullable<Mesh>;\r\n private _tooltipHoverObserver: Nullable<Observer<Control3D>>;\r\n private _tooltipOutObserver: Nullable<Observer<Control3D>>;\r\n\r\n private _disposeTooltip() {\r\n this._tooltipFade = null;\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.dispose();\r\n }\r\n if (this._tooltipTexture) {\r\n this._tooltipTexture.dispose();\r\n }\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.dispose();\r\n }\r\n this.onPointerEnterObservable.remove(this._tooltipHoverObserver);\r\n this.onPointerOutObservable.remove(this._tooltipOutObserver);\r\n }\r\n\r\n /**\r\n * Rendering ground id of all the mesh in the button\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._backPlate.renderingGroupId = id;\r\n this._textPlate.renderingGroupId = id;\r\n this._frontPlate.renderingGroupId = id;\r\n this._backGlow.renderingGroupId = id;\r\n this._innerQuad.renderingGroupId = id;\r\n\r\n if (this._tooltipMesh) {\r\n this._tooltipMesh.renderingGroupId = id;\r\n }\r\n }\r\n public get renderingGroupId(): number {\r\n return this._backPlate.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n return this._backPlate as AbstractMesh;\r\n }\r\n\r\n /**\r\n * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)\r\n * Set this property after adding the button to the GUI3DManager\r\n */\r\n public set tooltipText(text: Nullable<string>) {\r\n if (!text) {\r\n this._disposeTooltip();\r\n return;\r\n }\r\n if (!this._tooltipFade) {\r\n const rightHandedScene = this._backPlate._scene.useRightHandedSystem;\r\n // Create tooltip with mesh and text\r\n this._tooltipMesh = CreatePlane(\"\", { size: 1 }, this._backPlate._scene);\r\n this._tooltipMesh.position = Vector3.Down().scale(0.7).add(Vector3.Forward(rightHandedScene).scale(-0.15));\r\n this._tooltipMesh.isPickable = false;\r\n this._tooltipMesh.parent = this._frontPlateCollisionMesh;\r\n\r\n // Create text texture for the tooltip\r\n this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);\r\n const tooltipBackground = new Rectangle();\r\n tooltipBackground.height = 0.25;\r\n tooltipBackground.width = 0.8;\r\n tooltipBackground.cornerRadius = 25;\r\n tooltipBackground.color = \"#ffffff\";\r\n tooltipBackground.thickness = 20;\r\n tooltipBackground.background = \"#060668\";\r\n this._tooltipTexture.addControl(tooltipBackground);\r\n\r\n this._tooltipTextBlock = new TextBlock();\r\n this._tooltipTextBlock.color = \"white\";\r\n this._tooltipTextBlock.fontSize = 100;\r\n this._tooltipTexture.addControl(this._tooltipTextBlock);\r\n\r\n // Add hover action to tooltip\r\n this._tooltipFade = new FadeInOutBehavior();\r\n this._tooltipFade.delay = 500;\r\n this._tooltipMesh.addBehavior(this._tooltipFade);\r\n this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(true);\r\n }\r\n });\r\n this._tooltipOutObserver = this.onPointerOutObservable.add(() => {\r\n if (this._tooltipFade) {\r\n this._tooltipFade.fadeIn(false);\r\n }\r\n });\r\n }\r\n if (this._tooltipTextBlock) {\r\n this._tooltipTextBlock.text = text;\r\n }\r\n }\r\n\r\n public get tooltipText() {\r\n return this._tooltipTextBlock?.text || null;\r\n }\r\n\r\n /**\r\n * Gets or sets text for the button\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n public set text(value: string) {\r\n if (this._text === value) {\r\n return;\r\n }\r\n\r\n this._text = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets subtext for a button with larger width\r\n */\r\n public get subtext(): string {\r\n return this._subtext;\r\n }\r\n\r\n public set subtext(value: string) {\r\n if (this._subtext === value) {\r\n return;\r\n }\r\n\r\n this._subtext = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets or sets the image url for the button\r\n */\r\n public get imageUrl(): string {\r\n return this._imageUrl;\r\n }\r\n\r\n public set imageUrl(value: string) {\r\n if (this._imageUrl === value) {\r\n return;\r\n }\r\n\r\n this._imageUrl = value;\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Gets the back material used by this button\r\n */\r\n public get backMaterial(): MRDLBackplateMaterial {\r\n return this._backMaterial;\r\n }\r\n\r\n /**\r\n * Gets the front material used by this button\r\n */\r\n public get frontMaterial(): MRDLFrontplateMaterial {\r\n return this._frontMaterial;\r\n }\r\n\r\n /**\r\n * Gets the back glow material used by this button\r\n */\r\n public get backGlowMaterial(): MRDLBackglowMaterial {\r\n return this._backGlowMaterial;\r\n }\r\n\r\n /**\r\n * Gets the inner quad material used by this button\r\n */\r\n public get innerQuadMaterial(): MRDLInnerquadMaterial {\r\n return this._innerQuadMaterial;\r\n }\r\n\r\n /**\r\n * Gets the plate material used by this button\r\n */\r\n public get plateMaterial(): StandardMaterial {\r\n return this._plateMaterial;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this button shares its material with other V3 Buttons\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Sets whether the backplate is visible or hidden. Hiding the backplate is not recommended without some sort of replacement\r\n */\r\n public set isBackplateVisible(isVisible: boolean) {\r\n if (this.mesh && this._backMaterial) {\r\n if (isVisible && !this._isBackplateVisible) {\r\n this._backPlate.visibility = 1;\r\n } else if (!isVisible && this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n }\r\n\r\n this._isBackplateVisible = isVisible;\r\n }\r\n\r\n /**\r\n * Creates a new button\r\n * @param name defines the control name\r\n * @param shareMaterials\r\n */\r\n constructor(name?: string, shareMaterials = true) {\r\n super(name);\r\n\r\n this._shareMaterials = shareMaterials;\r\n\r\n this.pointerEnterAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(1);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n if (this.isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledHoverColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadHoverColor;\r\n }\r\n }\r\n };\r\n\r\n this.pointerOutAnimation = () => {\r\n if (this._frontPlate && this._textPlate && !this.isToggleButton) {\r\n this._performEnterExitAnimation(-0.8);\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n };\r\n\r\n this.pointerDownAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this.pointerUpAnimation = () => {\r\n // Do nothing\r\n };\r\n\r\n this._pointerClickObserver = this.onPointerClickObservable.add(() => {\r\n if (this._frontPlate && this._backGlow && !this.isActiveNearInteraction) {\r\n this._performClickAnimation();\r\n }\r\n\r\n if (this.isToggleButton && this._innerQuadMaterial) {\r\n this._onToggle(this.isToggled);\r\n }\r\n });\r\n\r\n this._pointerEnterObserver = this.onPointerEnterObservable.add(() => {\r\n this.pointerEnterAnimation();\r\n });\r\n\r\n this._pointerOutObserver = this.onPointerOutObservable.add(() => {\r\n this.pointerOutAnimation();\r\n });\r\n\r\n this._toggleObserver = this.onToggleObservable.add((isToggled) => {\r\n if (isToggled) {\r\n this._innerQuadMaterial.color = this.innerQuadToggledColor;\r\n } else {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n });\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"TouchHolographicButton\";\r\n }\r\n\r\n private _rebuildContent(): void {\r\n let content: Control;\r\n\r\n if (this._getAspectRatio() <= 1) {\r\n // align text and image vertically\r\n content = this._alignContentVertically();\r\n } else {\r\n // align text and image horizontally\r\n content = this._alignContentHorizontally();\r\n }\r\n\r\n this.content = content;\r\n }\r\n\r\n private _getAspectRatio() {\r\n return this.width / this.height;\r\n }\r\n\r\n private _alignContentVertically() {\r\n const panel = new StackPanel();\r\n panel.isVertical = true;\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n image.heightInPixels = 180;\r\n image.widthInPixels = 100;\r\n image.paddingTopInPixels = 40;\r\n image.paddingBottomInPixels = 40;\r\n panel.addControl(image);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock();\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.heightInPixels = 30;\r\n text.fontSize = 24;\r\n panel.addControl(text);\r\n }\r\n\r\n return panel;\r\n }\r\n\r\n private _alignContentHorizontally() {\r\n let totalPanelWidthInPixels = 240;\r\n const padding = 15;\r\n\r\n const contentContainer = new Rectangle();\r\n contentContainer.widthInPixels = totalPanelWidthInPixels;\r\n contentContainer.heightInPixels = totalPanelWidthInPixels;\r\n contentContainer.color = \"transparent\";\r\n contentContainer.setPaddingInPixels(padding, padding, padding, padding);\r\n totalPanelWidthInPixels -= padding * 2;\r\n\r\n const panel = new StackPanel();\r\n panel.isVertical = false;\r\n panel.scaleY = this._getAspectRatio();\r\n\r\n if (IsDocumentAvailable() && !!document.createElement) {\r\n if (this._imageUrl) {\r\n const imageContainer = new Rectangle(`${this.name}_image`);\r\n imageContainer.widthInPixels = this.imageSizeInPixels;\r\n imageContainer.heightInPixels = this.imageSizeInPixels;\r\n imageContainer.color = \"transparent\";\r\n totalPanelWidthInPixels -= this.imageSizeInPixels;\r\n\r\n const image = new Image();\r\n image.source = this._imageUrl;\r\n\r\n imageContainer.addControl(image);\r\n panel.addControl(imageContainer);\r\n }\r\n }\r\n\r\n if (this._text) {\r\n const text = new TextBlock(`${this.name}_text`);\r\n text.text = this._text;\r\n text.color = \"white\";\r\n text.fontSize = this.textSizeInPixels;\r\n text.widthInPixels = totalPanelWidthInPixels;\r\n\r\n if (this._imageUrl) {\r\n text.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n text.paddingLeftInPixels = padding;\r\n }\r\n\r\n if (this._subtext) {\r\n const textContainer = new Grid();\r\n textContainer.addColumnDefinition(1);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.addRowDefinition(0.5);\r\n textContainer.widthInPixels = totalPanelWidthInPixels;\r\n textContainer.heightInPixels = 45;\r\n\r\n const subtext = new TextBlock(`${this.name}_subtext`);\r\n subtext.text = this._subtext;\r\n subtext.color = \"#EEEEEEAB\";\r\n subtext.fontSize = this.textSizeInPixels * 0.75;\r\n subtext.fontWeight = \"600\";\r\n\r\n if (this._imageUrl) {\r\n subtext.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n subtext.paddingLeftInPixels = padding;\r\n }\r\n\r\n textContainer.addControl(text, 0);\r\n textContainer.addControl(subtext, 1);\r\n panel.addControl(textContainer);\r\n } else {\r\n panel.addControl(text);\r\n }\r\n }\r\n\r\n contentContainer.addControl(panel);\r\n return contentContainer;\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n this.name = this.name ?? \"TouchHolographicButton\";\r\n\r\n const backPlateMesh = this._createBackPlate(scene);\r\n const collisionMesh = this._createFrontPlate(scene);\r\n const innerQuadMesh = this._createInnerQuad(scene);\r\n const backGlowMesh = this._createBackGlow(scene);\r\n\r\n this._frontPlateCollisionMesh = collisionMesh;\r\n this._textPlate = <Mesh>super._createNode(scene);\r\n this._textPlate.name = `${this.name}_textPlate`;\r\n this._textPlate.isPickable = false;\r\n this._textPlate.scaling.x = this.width;\r\n this._textPlate.parent = collisionMesh;\r\n\r\n this._backPlate = backPlateMesh;\r\n this._backPlate.position = Vector3.Forward(scene.useRightHandedSystem).scale(this.backPlateDepth / 2);\r\n this._backPlate.isPickable = false;\r\n\r\n this._backPlate.addChild(collisionMesh);\r\n this._backPlate.addChild(innerQuadMesh);\r\n\r\n if (backGlowMesh) {\r\n this._backPlate.addChild(backGlowMesh);\r\n }\r\n\r\n const tn = new TransformNode(`${this.name}_root`, scene);\r\n this._backPlate.setParent(tn);\r\n\r\n this.collisionMesh = collisionMesh;\r\n this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way\r\n\r\n return tn;\r\n }\r\n\r\n private _createBackPlate(scene: Scene) {\r\n const backPlateMesh = CreateBox(`${this.name}_backPlate`, {}, scene);\r\n backPlateMesh.isPickable = false;\r\n backPlateMesh.visibility = 0;\r\n backPlateMesh.scaling.z = 0.2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const backPlateModel = result.meshes[1];\r\n backPlateModel.visibility = 0;\r\n\r\n if (this._isBackplateVisible) {\r\n backPlateModel.visibility = 1;\r\n backPlateModel.name = `${this.name}_backPlate`;\r\n backPlateModel.isPickable = false;\r\n backPlateModel.scaling.x = this.width;\r\n backPlateModel.scaling.y = this.height;\r\n backPlateModel.parent = backPlateMesh;\r\n }\r\n\r\n if (this._backMaterial) {\r\n backPlateModel.material = this._backMaterial;\r\n }\r\n\r\n this._backPlate = backPlateModel;\r\n });\r\n\r\n return backPlateMesh;\r\n }\r\n\r\n private _createFrontPlate(scene: Scene) {\r\n const collisionMesh = CreateBox(\r\n `${this.name}_frontPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n depth: this.frontPlateDepth,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.isNearPickable = true;\r\n collisionMesh.visibility = 0;\r\n collisionMesh.position = Vector3.Forward(scene.useRightHandedSystem).scale((this.backPlateDepth - this.frontPlateDepth) / 2);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.FRONTPLATE_MODEL_FILENAME, scene).then((result) => {\r\n const collisionPlate = CreateBox(\r\n `${this.name}_collisionPlate`,\r\n {\r\n width: this.width,\r\n height: this.height,\r\n },\r\n scene\r\n );\r\n collisionPlate.isPickable = false;\r\n collisionPlate.scaling.z = this.frontPlateDepth;\r\n collisionPlate.visibility = 0;\r\n collisionPlate.parent = collisionMesh;\r\n this._collisionPlate = collisionPlate;\r\n\r\n const frontPlateModel = result.meshes[1];\r\n frontPlateModel.name = `${this.name}_frontPlate`;\r\n frontPlateModel.isPickable = false;\r\n frontPlateModel.scaling.x = this.width - this.backGlowOffset;\r\n frontPlateModel.scaling.y = this.height - this.backGlowOffset;\r\n frontPlateModel.position = Vector3.Forward(scene.useRightHandedSystem).scale(-0.5);\r\n frontPlateModel.parent = collisionPlate;\r\n\r\n if (this.isToggleButton) {\r\n frontPlateModel.visibility = 0;\r\n }\r\n\r\n if (this._frontMaterial) {\r\n frontPlateModel.material = this._frontMaterial;\r\n }\r\n\r\n this._textPlate.scaling.x = 1;\r\n this._textPlate.parent = frontPlateModel;\r\n this._frontPlate = frontPlateModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createInnerQuad(scene: Scene) {\r\n const innerQuadMesh = CreateBox(`${this.name}_innerQuad`, {}, scene);\r\n innerQuadMesh.isPickable = false;\r\n innerQuadMesh.visibility = 0;\r\n innerQuadMesh.scaling.z = this.flatPlaneDepth;\r\n innerQuadMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.INNERQUAD_MODEL_FILENAME, scene).then((result) => {\r\n const innerQuadModel = result.meshes[1];\r\n innerQuadModel.name = `${this.name}_innerQuad`;\r\n innerQuadModel.isPickable = false;\r\n innerQuadModel.scaling.x = this.width - this.backGlowOffset;\r\n innerQuadModel.scaling.y = this.height - this.backGlowOffset;\r\n innerQuadModel.parent = innerQuadMesh;\r\n\r\n if (this._innerQuadMaterial) {\r\n innerQuadModel.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._innerQuad = innerQuadModel;\r\n });\r\n\r\n return innerQuadMesh;\r\n }\r\n\r\n private _createBackGlow(scene: Scene) {\r\n if (this.isToggleButton) {\r\n return;\r\n }\r\n\r\n const backGlowMesh = CreateBox(`${this.name}_backGlow`, {}, scene);\r\n backGlowMesh.isPickable = false;\r\n backGlowMesh.visibility = 0;\r\n backGlowMesh.scaling.z = this.flatPlaneDepth;\r\n backGlowMesh.position.z += this.backPlateDepth / 2 - this.flatPlaneDepth * 2;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, TouchHolographicButton.MRTK_ASSET_BASE_URL, TouchHolographicButton.BACKGLOW_MODEL_FILENAME, scene).then((result) => {\r\n const backGlowModel = result.meshes[1];\r\n backGlowModel.name = `${this.name}_backGlow`;\r\n backGlowModel.isPickable = false;\r\n backGlowModel.scaling.x = this.width - this.backGlowOffset;\r\n backGlowModel.scaling.y = this.height - this.backGlowOffset;\r\n backGlowModel.parent = backGlowMesh;\r\n\r\n if (this._backGlowMaterial) {\r\n backGlowModel.material = this._backGlowMaterial;\r\n }\r\n\r\n this._backGlow = backGlowModel;\r\n });\r\n\r\n return backGlowMesh;\r\n }\r\n\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {\r\n this._plateMaterial.emissiveTexture = facadeTexture;\r\n this._plateMaterial.opacityTexture = facadeTexture;\r\n this._plateMaterial.diffuseColor = this.plateMaterialColor;\r\n }\r\n\r\n private _performClickAnimation() {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Click Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"backGlowMotion\",\r\n mesh: this._backGlow,\r\n property: \"material.motion\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0],\r\n },\r\n {\r\n frame: 20,\r\n values: [1, 0.0144, 0.0144],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0027713229489760476, 0, 0],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0027713229489760476],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZSlide\",\r\n mesh: this._collisionPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0.0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [Vector3.Forward(this._collisionPlate._scene.useRightHandedSystem).scale(this.frontPlateDepth / 2).z, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [0.0, 0.005403332496794331],\r\n },\r\n {\r\n frame: 45,\r\n values: [0.0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"_collisionPlateZScale\",\r\n mesh: this._collisionPlate,\r\n property: \"scaling.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [this.frontPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 20,\r\n values: [this.backPlateDepth, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [this.frontPlateDepth, 0.0054],\r\n },\r\n {\r\n frame: 45,\r\n values: [this.frontPlateDepth],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = 1;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _performEnterExitAnimation(speedRatio: number) {\r\n const frameRate = 60;\r\n const animationGroup = new AnimationGroup(\"Enter Exit Animation Group\");\r\n\r\n const animations = [\r\n {\r\n name: \"frontPlateFadeOut\",\r\n mesh: this._frontPlate,\r\n property: \"material.fadeOut\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0, 0.025045314830017686, 0],\r\n },\r\n {\r\n frame: 40,\r\n values: [1.00205599570012, 0.025045314830017686, 0, 0],\r\n },\r\n ],\r\n },\r\n {\r\n name: \"textPlateZSlide\",\r\n mesh: this._textPlate,\r\n property: \"position.z\",\r\n keys: [\r\n {\r\n frame: 0,\r\n values: [0, 0.0, 0.0],\r\n },\r\n {\r\n frame: 40,\r\n values: [Vector3.Forward(this._textPlate._scene.useRightHandedSystem).scale(-0.15).z, 0.0, 0.0],\r\n },\r\n ],\r\n },\r\n ];\r\n\r\n for (const animation of animations) {\r\n const anim = new Animation(animation.name, animation.property, frameRate, Animation.ANIMATIONTYPE_FLOAT, Animation.ANIMATIONLOOPMODE_CYCLE);\r\n const animkeyFrames = [];\r\n\r\n for (const key of animation.keys) {\r\n animkeyFrames.push({\r\n frame: key.frame,\r\n value: key.values[0],\r\n inTangent: key.values[1],\r\n outTangent: key.values[2],\r\n interpolation: key.values[3],\r\n });\r\n }\r\n\r\n anim.setKeys(animkeyFrames);\r\n\r\n if (!animation.mesh) {\r\n continue;\r\n }\r\n\r\n animationGroup.addTargetedAnimation(anim, animation.mesh);\r\n }\r\n\r\n animationGroup.normalize(0, 45);\r\n animationGroup.speedRatio = speedRatio;\r\n\r\n animationGroup.play();\r\n }\r\n\r\n private _createBackMaterial(mesh: Mesh) {\r\n this._backMaterial = this._backMaterial ?? new MRDLBackplateMaterial(this.name + \"backPlateMaterial\", mesh.getScene());\r\n this._backMaterial.absoluteSizes = true;\r\n this._backMaterial.radius = this.radius;\r\n this._backMaterial.lineWidth = 0.02;\r\n }\r\n\r\n private _createFrontMaterial(mesh: Mesh) {\r\n this._frontMaterial = this._frontMaterial ?? new MRDLFrontplateMaterial(this.name + \"Front Material\", mesh.getScene());\r\n this.frontMaterial.radius = this.innerQuadRadius;\r\n this.frontMaterial.fadeOut = 0.0;\r\n }\r\n\r\n private _createBackGlowMaterial(mesh: Mesh) {\r\n const glowRadius = this.radius + 0.04;\r\n this._backGlowMaterial = this._backGlowMaterial ?? new MRDLBackglowMaterial(this.name + \"Back Glow Material\", mesh.getScene());\r\n this._backGlowMaterial.bevelRadius = glowRadius;\r\n this._backGlowMaterial.lineWidth = glowRadius;\r\n this._backGlowMaterial.motion = 0.0;\r\n }\r\n\r\n private _createInnerQuadMaterial(mesh: Mesh) {\r\n this._innerQuadMaterial = this._innerQuadMaterial ?? new MRDLInnerquadMaterial(\"inner_quad\", mesh.getScene());\r\n this._innerQuadMaterial.radius = this.innerQuadRadius;\r\n\r\n if (this.isToggleButton) {\r\n this._innerQuadMaterial.color = this.innerQuadColor;\r\n }\r\n }\r\n\r\n private _createPlateMaterial(mesh: Mesh) {\r\n this._plateMaterial = this._plateMaterial ?? new StandardMaterial(this.name + \"Plate Material\", mesh.getScene());\r\n this._plateMaterial.specularColor = Color3.Black();\r\n }\r\n\r\n protected _onToggle(newState: boolean) {\r\n super._onToggle(newState);\r\n }\r\n\r\n protected _affectMaterial(mesh: Mesh) {\r\n if (this._shareMaterials) {\r\n // Back\r\n if (!this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"]) {\r\n this._createBackMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] = this._backMaterial;\r\n } else {\r\n this._backMaterial = this._host._touchSharedMaterials[\"mrdlBackplateMaterial\"] as MRDLBackplateMaterial;\r\n }\r\n\r\n // Front\r\n if (!this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"]) {\r\n this._createFrontMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] = this._frontMaterial;\r\n } else {\r\n this._frontMaterial = this._host._touchSharedMaterials[\"mrdlFrontplateMaterial\"] as MRDLFrontplateMaterial;\r\n }\r\n\r\n // Back glow\r\n if (!this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"]) {\r\n this._createBackGlowMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] = this._backGlowMaterial;\r\n } else {\r\n this._backGlowMaterial = this._host._touchSharedMaterials[\"mrdlBackglowMaterial\"] as MRDLBackglowMaterial;\r\n }\r\n\r\n // Inner quad\r\n if (!this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"]) {\r\n this._createInnerQuadMaterial(mesh);\r\n this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] = this._innerQuadMaterial;\r\n } else {\r\n this._innerQuadMaterial = this._host._touchSharedMaterials[\"mrdlInnerQuadMaterial\"] as MRDLInnerquadMaterial;\r\n }\r\n } else {\r\n this._createBackMaterial(mesh);\r\n this._createFrontMaterial(mesh);\r\n this._createBackGlowMaterial(mesh);\r\n this._createInnerQuadMaterial(mesh);\r\n }\r\n\r\n this._createPlateMaterial(mesh);\r\n this._backPlate.material = this._backMaterial;\r\n this._textPlate.material = this._plateMaterial;\r\n\r\n if (!this._isBackplateVisible) {\r\n this._backPlate.visibility = 0;\r\n }\r\n\r\n if (this._frontPlate) {\r\n this._frontPlate.material = this._frontMaterial;\r\n }\r\n\r\n if (this._backGlow) {\r\n this._backGlow.material = this._backGlowMaterial;\r\n }\r\n\r\n if (this._innerQuad) {\r\n this._innerQuad.material = this._innerQuadMaterial;\r\n }\r\n\r\n this._rebuildContent();\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n this._disposeTooltip();\r\n this.onPointerClickObservable.remove(this._pointerClickObserver);\r\n this.onPointerEnterObservable.remove(this._pointerEnterObserver);\r\n this.onPointerOutObservable.remove(this._pointerOutObserver);\r\n this.onToggleObservable.remove(this._toggleObserver);\r\n\r\n if (!this.shareMaterials) {\r\n this._backMaterial.dispose();\r\n this._frontMaterial.dispose();\r\n this._plateMaterial.dispose();\r\n this._backGlowMaterial.dispose();\r\n this._innerQuadMaterial.dispose();\r\n\r\n if (this._pickedPointObserver) {\r\n this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);\r\n this._pickedPointObserver = null;\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
@@ -33,10 +33,9 @@ export class ContentDisplay3D extends Control3D {
|
|
33
33
|
this._applyFacade(this._facadeTexture);
|
34
34
|
}
|
35
35
|
_setFacadeTextureScaling() {
|
36
|
-
var _a;
|
37
36
|
if (this._facadeTexture) {
|
38
37
|
this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;
|
39
|
-
this._facadeTexture.rootContainer.scaleY =
|
38
|
+
this._facadeTexture.rootContainer.scaleY = this._contentScaleRatioY ?? this._contentScaleRatio;
|
40
39
|
}
|
41
40
|
}
|
42
41
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"contentDisplay3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/contentDisplay3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAE1D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;IAA/C;;QAGc,uBAAkB,GAAG,GAAG,CAAC;QACzB,uBAAkB,GAAG,CAAC,CAAC;IA+ErC,CAAC;IA5EG;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;I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QAChC,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAES,qBAAqB;QAC3B,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC9B;IACL,CAAC;IAES,aAAa;QACnB,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,6DAA6D;IACnD,YAAY,CAAC,aAAqC,IAAG,CAAC;CACnE","sourcesContent":["import type { Control } from \"../../2D/controls/control\";\r\nimport { AdvancedDynamicTexture } from \"../../2D/advancedDynamicTexture\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\n\r\n/**\r\n * The base class for controls that display content\r\n */\r\nexport class ContentDisplay3D extends Control3D {\r\n private _content: Control;\r\n private _facadeTexture: Nullable<AdvancedDynamicTexture>;\r\n protected _contentResolution = 512;\r\n protected _contentScaleRatio = 2;\r\n protected _contentScaleRatioY?: number;\r\n\r\n /**\r\n * Gets or sets the GUI 2D content used to display the button's facade\r\n */\r\n public get content(): Control {\r\n return this._content;\r\n }\r\n\r\n public set content(value: Control) {\r\n this._content = value;\r\n\r\n if (!value || !this._host || !this._host.utilityLayer) {\r\n return;\r\n }\r\n\r\n if (!this._facadeTexture) {\r\n this._facadeTexture = new AdvancedDynamicTexture(\r\n \"Facade\",\r\n this._contentResolution,\r\n this._contentResolution,\r\n this._host.utilityLayer.utilityLayerScene,\r\n true,\r\n Texture.TRILINEAR_SAMPLINGMODE\r\n );\r\n this._setFacadeTextureScaling();\r\n this._facadeTexture.premulAlpha = true;\r\n } else {\r\n this._facadeTexture.rootContainer.clearControls();\r\n }\r\n\r\n this._facadeTexture.addControl(value);\r\n\r\n this._applyFacade(this._facadeTexture);\r\n }\r\n\r\n protected _setFacadeTextureScaling() {\r\n if (this._facadeTexture) {\r\n this._facadeTexture.rootContainer.scaleX = this._contentScaleRatio;\r\n this._facadeTexture.rootContainer.scaleY = this._contentScaleRatioY ?? this._contentScaleRatio;\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the texture resolution used to render content (512 by default)\r\n */\r\n public get contentResolution(): number {\r\n return this._contentResolution;\r\n }\r\n\r\n public set contentResolution(value: number) {\r\n if (this._contentResolution === value) {\r\n return;\r\n }\r\n\r\n this._contentResolution = value;\r\n this._resetContent();\r\n }\r\n\r\n protected _disposeFacadeTexture() {\r\n if (this._facadeTexture) {\r\n this._facadeTexture.dispose();\r\n this._facadeTexture = null;\r\n }\r\n }\r\n\r\n protected _resetContent() {\r\n this._disposeFacadeTexture();\r\n this.content = this._content;\r\n }\r\n\r\n /**\r\n * Apply the facade texture (created from the content property).\r\n * This function can be overloaded by child classes\r\n * @param facadeTexture defines the AdvancedDynamicTexture to use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _applyFacade(facadeTexture: AdvancedDynamicTexture) {}\r\n}\r\n"]}
|
package/3D/controls/control3D.js
CHANGED
@@ -210,9 +210,8 @@ export class Control3D {
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
_injectGUI3DReservedDataStore(node) {
|
213
|
-
|
214
|
-
node.reservedDataStore =
|
215
|
-
node.reservedDataStore.GUI3D = (_b = node.reservedDataStore.GUI3D) !== null && _b !== void 0 ? _b : {};
|
213
|
+
node.reservedDataStore = node.reservedDataStore ?? {};
|
214
|
+
node.reservedDataStore.GUI3D = node.reservedDataStore.GUI3D ?? {};
|
216
215
|
return node.reservedDataStore.GUI3D;
|
217
216
|
}
|
218
217
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"control3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/control3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;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,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,YAAY;QACZ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;YACpC,QAAQ,CAAC,MAAM,EAAE,CAAC;SACrB;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IBehaviorAware, Behavior } from \"core/Behaviors/behavior\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport type { GUI3DManager } from \"../gui3DManager\";\r\nimport { Vector3WithInfo } from \"../vector3WithInfo\";\r\nimport type { Container3D } from \"./container3D\";\r\n\r\nimport type { TouchButton3D } from \"./touchButton3D\";\r\n\r\n/**\r\n * Class used as base class for controls\r\n */\r\nexport class Control3D implements IDisposable, IBehaviorAware<Control3D> {\r\n private _node: Nullable<TransformNode>;\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _downPointerIds: { [id: number]: number } = {}; // Store number of pointer downs per ID, from near and far interactions\r\n\r\n protected _isVisible = true;\r\n\r\n /** @internal */\r\n public _host: GUI3DManager;\r\n /** @internal */\r\n public _isScaledByManager = false;\r\n\r\n /** Gets or sets the control position in world space */\r\n public get position(): Vector3 {\r\n if (!this._node) {\r\n return Vector3.Zero();\r\n }\r\n\r\n return this._node.position;\r\n }\r\n\r\n public set position(value: Vector3) {\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._node.position = value;\r\n }\r\n\r\n /** Gets or sets the control scaling in world space */\r\n public get scaling(): Vector3 {\r\n if (!this._node) {\r\n return new Vector3(1, 1, 1);\r\n }\r\n\r\n return this._node.scaling;\r\n }\r\n\r\n public set scaling(value: Vector3) {\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._isScaledByManager = false;\r\n this._node.scaling = value;\r\n }\r\n\r\n /** Callback used to start pointer enter animation */\r\n public pointerEnterAnimation: () => void;\r\n /** Callback used to start pointer out animation */\r\n public pointerOutAnimation: () => void;\r\n /** Callback used to start pointer down animation */\r\n public pointerDownAnimation: () => void;\r\n /** Callback used to start pointer up animation */\r\n public pointerUpAnimation: () => void;\r\n\r\n /**\r\n * An event triggered when the pointer moves over the control\r\n */\r\n public onPointerMoveObservable = new Observable<Vector3>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control\r\n */\r\n public onPointerOutObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer is up\r\n */\r\n public onPointerUpObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on (with a mouse)\r\n */\r\n public onPointerClickObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * Gets or sets the parent container\r\n */\r\n public parent: Nullable<Container3D>;\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Control3D>>();\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n */\r\n public get behaviors(): Behavior<Control3D>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Attach a behavior to the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public addBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n const scene = this._host.scene;\r\n if (scene.isLoading) {\r\n // We defer the attach when the scene will be loaded\r\n scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public removeBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Control3D>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.setEnabled(value);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the control name\r\n */\r\n constructor(\r\n /** Defines the control name */\r\n public name?: string\r\n ) {}\r\n\r\n /**\r\n * Gets a string representing the class name\r\n */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Control3D\";\r\n }\r\n\r\n /**\r\n * Gets the transform node used by this control\r\n */\r\n public get node(): Nullable<TransformNode> {\r\n return this._node;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this._node instanceof AbstractMesh) {\r\n return this._node as AbstractMesh;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Link the control as child of the given node\r\n * @param node defines the node to link to. Use null to unlink the control\r\n * @returns the current control\r\n */\r\n public linkToTransformNode(node: Nullable<TransformNode>): Control3D {\r\n if (this._node) {\r\n this._node.parent = node;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal*\r\n */\r\n public _prepareNode(scene: Scene): void {\r\n if (!this._node) {\r\n this._node = this._createNode(scene);\r\n\r\n if (!this.node) {\r\n return;\r\n }\r\n this._injectGUI3DReservedDataStore(this.node).control = this; // Store the control on the reservedDataStore field in order to get it when picking\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.isPickable = true;\r\n\r\n this._affectMaterial(mesh);\r\n }\r\n }\r\n }\r\n\r\n protected _injectGUI3DReservedDataStore(node: TransformNode): any {\r\n node.reservedDataStore = node.reservedDataStore ?? {};\r\n node.reservedDataStore.GUI3D = node.reservedDataStore.GUI3D ?? {};\r\n return node.reservedDataStore.GUI3D;\r\n }\r\n\r\n /**\r\n * Node creation.\r\n * Can be overriden by children\r\n * @param scene defines the scene where the node must be attached\r\n * @returns the attached node or null if none. Must return a Mesh or AbstractMesh if there is an attached visible object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n // Do nothing by default\r\n return null;\r\n }\r\n\r\n /**\r\n * Affect a material to the given mesh\r\n * @param mesh defines the mesh which will represent the control\r\n */\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n mesh.material = null;\r\n }\r\n\r\n private _isTouchButton3D(control: Control3D): control is TouchButton3D {\r\n return (control as TouchButton3D)._generatePointerEventType !== undefined;\r\n }\r\n\r\n // Pointers\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control3D, coordinates: Vector3): void {\r\n this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control3D): boolean {\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n\r\n this._enterCount++;\r\n\r\n if (this._enterCount > 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerEnterObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerEnterAnimation) {\r\n this.pointerEnterAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control3D): void {\r\n this._enterCount--;\r\n\r\n if (this._enterCount > 0) {\r\n return;\r\n }\r\n\r\n this._enterCount = 0;\r\n\r\n this.onPointerOutObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerOutAnimation) {\r\n this.pointerOutAnimation();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number): boolean {\r\n this._downCount++;\r\n this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1;\r\n\r\n if (this._downCount !== 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerDownObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerDownAnimation) {\r\n this.pointerDownAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._downCount--;\r\n this._downPointerIds[pointerId]--;\r\n\r\n if (this._downPointerIds[pointerId] <= 0) {\r\n delete this._downPointerIds[pointerId];\r\n }\r\n\r\n if (this._downCount < 0) {\r\n // Handle if forcePointerUp was called prior to this\r\n this._downCount = 0;\r\n return;\r\n }\r\n\r\n if (this._downCount == 0) {\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n this.onPointerClickObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n }\r\n this.onPointerUpObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerUpAnimation) {\r\n this.pointerUpAnimation();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector3.Zero(), +key as number, 0, true);\r\n }\r\n if (this._downCount > 0) {\r\n this._downCount = 1;\r\n this._onPointerUp(this, Vector3.Zero(), 0, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(type: number, pickedPoint: Vector3, originMeshPosition: Nullable<Vector3>, pointerId: number, buttonIndex: number): boolean {\r\n if (this._isTouchButton3D(this) && originMeshPosition) {\r\n type = this._generatePointerEventType(type, originMeshPosition, this._downCount);\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, pickedPoint);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, pickedPoint, pointerId, buttonIndex);\r\n this._host._lastControlDown[pointerId] = this;\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /** @internal */\r\n public _disposeNode(): void {\r\n if (this._node) {\r\n this._node.dispose();\r\n this._node = null;\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n\r\n this._disposeNode();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"control3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/control3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AACjD,OAAO,EAAE,iBAAiB,EAAE,gDAAkC;AAE9D,OAAO,EAAE,YAAY,EAAE,+CAAiC;AAKxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;GAEG;AACH,MAAM,OAAO,SAAS;IAalB,uDAAuD;IACvD,IAAW,QAAQ;QACf,I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KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QAEtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,YAAY;QACZ,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;YACpC,QAAQ,CAAC,MAAM,EAAE,CAAC;SACrB;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport { PointerEventTypes } from \"core/Events/pointerEvents\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IBehaviorAware, Behavior } from \"core/Behaviors/behavior\";\r\nimport type { IDisposable, Scene } from \"core/scene\";\r\n\r\nimport type { GUI3DManager } from \"../gui3DManager\";\r\nimport { Vector3WithInfo } from \"../vector3WithInfo\";\r\nimport type { Container3D } from \"./container3D\";\r\n\r\nimport type { TouchButton3D } from \"./touchButton3D\";\r\n\r\n/**\r\n * Class used as base class for controls\r\n */\r\nexport class Control3D implements IDisposable, IBehaviorAware<Control3D> {\r\n private _node: Nullable<TransformNode>;\r\n private _downCount = 0;\r\n private _enterCount = -1;\r\n private _downPointerIds: { [id: number]: number } = {}; // Store number of pointer downs per ID, from near and far interactions\r\n\r\n protected _isVisible = true;\r\n\r\n /** @internal */\r\n public _host: GUI3DManager;\r\n /** @internal */\r\n public _isScaledByManager = false;\r\n\r\n /** Gets or sets the control position in world space */\r\n public get position(): Vector3 {\r\n if (!this._node) {\r\n return Vector3.Zero();\r\n }\r\n\r\n return this._node.position;\r\n }\r\n\r\n public set position(value: Vector3) {\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._node.position = value;\r\n }\r\n\r\n /** Gets or sets the control scaling in world space */\r\n public get scaling(): Vector3 {\r\n if (!this._node) {\r\n return new Vector3(1, 1, 1);\r\n }\r\n\r\n return this._node.scaling;\r\n }\r\n\r\n public set scaling(value: Vector3) {\r\n if (!this._node) {\r\n return;\r\n }\r\n\r\n this._isScaledByManager = false;\r\n this._node.scaling = value;\r\n }\r\n\r\n /** Callback used to start pointer enter animation */\r\n public pointerEnterAnimation: () => void;\r\n /** Callback used to start pointer out animation */\r\n public pointerOutAnimation: () => void;\r\n /** Callback used to start pointer down animation */\r\n public pointerDownAnimation: () => void;\r\n /** Callback used to start pointer up animation */\r\n public pointerUpAnimation: () => void;\r\n\r\n /**\r\n * An event triggered when the pointer moves over the control\r\n */\r\n public onPointerMoveObservable = new Observable<Vector3>();\r\n\r\n /**\r\n * An event triggered when the pointer moves out of the control\r\n */\r\n public onPointerOutObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * An event triggered when the pointer taps the control\r\n */\r\n public onPointerDownObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer is up\r\n */\r\n public onPointerUpObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when a control is clicked on (with a mouse)\r\n */\r\n public onPointerClickObservable = new Observable<Vector3WithInfo>();\r\n\r\n /**\r\n * An event triggered when pointer enters the control\r\n */\r\n public onPointerEnterObservable = new Observable<Control3D>();\r\n\r\n /**\r\n * Gets or sets the parent container\r\n */\r\n public parent: Nullable<Container3D>;\r\n\r\n // Behaviors\r\n private _behaviors = new Array<Behavior<Control3D>>();\r\n\r\n /**\r\n * Gets the list of attached behaviors\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n */\r\n public get behaviors(): Behavior<Control3D>[] {\r\n return this._behaviors;\r\n }\r\n\r\n /**\r\n * Attach a behavior to the control\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public addBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index !== -1) {\r\n return this;\r\n }\r\n\r\n behavior.init();\r\n const scene = this._host.scene;\r\n if (scene.isLoading) {\r\n // We defer the attach when the scene will be loaded\r\n scene.onDataLoadedObservable.addOnce(() => {\r\n behavior.attach(this);\r\n });\r\n } else {\r\n behavior.attach(this);\r\n }\r\n this._behaviors.push(behavior);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove an attached behavior\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @param behavior defines the behavior to attach\r\n * @returns the current control\r\n */\r\n public removeBehavior(behavior: Behavior<Control3D>): Control3D {\r\n const index = this._behaviors.indexOf(behavior);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._behaviors[index].detach();\r\n this._behaviors.splice(index, 1);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets an attached behavior by name\r\n * @param name defines the name of the behavior to look for\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/behaviors\r\n * @returns null if behavior was not found else the requested behavior\r\n */\r\n public getBehaviorByName(name: string): Nullable<Behavior<Control3D>> {\r\n for (const behavior of this._behaviors) {\r\n if (behavior.name === name) {\r\n return behavior;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets a boolean indicating if the control is visible */\r\n public get isVisible(): boolean {\r\n return this._isVisible;\r\n }\r\n\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.setEnabled(value);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new control\r\n * @param name defines the control name\r\n */\r\n constructor(\r\n /** Defines the control name */\r\n public name?: string\r\n ) {}\r\n\r\n /**\r\n * Gets a string representing the class name\r\n */\r\n public get typeName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n /**\r\n * Get the current class name of the control.\r\n * @returns current class name\r\n */\r\n public getClassName(): string {\r\n return this._getTypeName();\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Control3D\";\r\n }\r\n\r\n /**\r\n * Gets the transform node used by this control\r\n */\r\n public get node(): Nullable<TransformNode> {\r\n return this._node;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this._node instanceof AbstractMesh) {\r\n return this._node as AbstractMesh;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Link the control as child of the given node\r\n * @param node defines the node to link to. Use null to unlink the control\r\n * @returns the current control\r\n */\r\n public linkToTransformNode(node: Nullable<TransformNode>): Control3D {\r\n if (this._node) {\r\n this._node.parent = node;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal*\r\n */\r\n public _prepareNode(scene: Scene): void {\r\n if (!this._node) {\r\n this._node = this._createNode(scene);\r\n\r\n if (!this.node) {\r\n return;\r\n }\r\n this._injectGUI3DReservedDataStore(this.node).control = this; // Store the control on the reservedDataStore field in order to get it when picking\r\n\r\n const mesh = this.mesh;\r\n if (mesh) {\r\n mesh.isPickable = true;\r\n\r\n this._affectMaterial(mesh);\r\n }\r\n }\r\n }\r\n\r\n protected _injectGUI3DReservedDataStore(node: TransformNode): any {\r\n node.reservedDataStore = node.reservedDataStore ?? {};\r\n node.reservedDataStore.GUI3D = node.reservedDataStore.GUI3D ?? {};\r\n return node.reservedDataStore.GUI3D;\r\n }\r\n\r\n /**\r\n * Node creation.\r\n * Can be overriden by children\r\n * @param scene defines the scene where the node must be attached\r\n * @returns the attached node or null if none. Must return a Mesh or AbstractMesh if there is an attached visible object\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _createNode(scene: Scene): Nullable<TransformNode> {\r\n // Do nothing by default\r\n return null;\r\n }\r\n\r\n /**\r\n * Affect a material to the given mesh\r\n * @param mesh defines the mesh which will represent the control\r\n */\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n mesh.material = null;\r\n }\r\n\r\n private _isTouchButton3D(control: Control3D): control is TouchButton3D {\r\n return (control as TouchButton3D)._generatePointerEventType !== undefined;\r\n }\r\n\r\n // Pointers\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerMove(target: Control3D, coordinates: Vector3): void {\r\n this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerEnter(target: Control3D): boolean {\r\n if (this._enterCount === -1) {\r\n // -1 is for touch input, we are now sure we are with a mouse or pencil\r\n this._enterCount = 0;\r\n }\r\n\r\n this._enterCount++;\r\n\r\n if (this._enterCount > 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerEnterObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerEnterAnimation) {\r\n this.pointerEnterAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerOut(target: Control3D): void {\r\n this._enterCount--;\r\n\r\n if (this._enterCount > 0) {\r\n return;\r\n }\r\n\r\n this._enterCount = 0;\r\n\r\n this.onPointerOutObservable.notifyObservers(this, -1, target, this);\r\n\r\n if (this.pointerOutAnimation) {\r\n this.pointerOutAnimation();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerDown(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number): boolean {\r\n this._downCount++;\r\n this._downPointerIds[pointerId] = this._downPointerIds[pointerId] + 1 || 1;\r\n\r\n if (this._downCount !== 1) {\r\n return false;\r\n }\r\n\r\n this.onPointerDownObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerDownAnimation) {\r\n this.pointerDownAnimation();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _onPointerUp(target: Control3D, coordinates: Vector3, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._downCount--;\r\n this._downPointerIds[pointerId]--;\r\n\r\n if (this._downPointerIds[pointerId] <= 0) {\r\n delete this._downPointerIds[pointerId];\r\n }\r\n\r\n if (this._downCount < 0) {\r\n // Handle if forcePointerUp was called prior to this\r\n this._downCount = 0;\r\n return;\r\n }\r\n\r\n if (this._downCount == 0) {\r\n if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {\r\n this.onPointerClickObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n }\r\n this.onPointerUpObservable.notifyObservers(new Vector3WithInfo(coordinates, buttonIndex), -1, target, this);\r\n\r\n if (this.pointerUpAnimation) {\r\n this.pointerUpAnimation();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public forcePointerUp(pointerId: Nullable<number> = null) {\r\n if (pointerId !== null) {\r\n this._onPointerUp(this, Vector3.Zero(), pointerId, 0, true);\r\n } else {\r\n for (const key in this._downPointerIds) {\r\n this._onPointerUp(this, Vector3.Zero(), +key as number, 0, true);\r\n }\r\n if (this._downCount > 0) {\r\n this._downCount = 1;\r\n this._onPointerUp(this, Vector3.Zero(), 0, 0, true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _processObservables(type: number, pickedPoint: Vector3, originMeshPosition: Nullable<Vector3>, pointerId: number, buttonIndex: number): boolean {\r\n if (this._isTouchButton3D(this) && originMeshPosition) {\r\n type = this._generatePointerEventType(type, originMeshPosition, this._downCount);\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERMOVE) {\r\n this._onPointerMove(this, pickedPoint);\r\n\r\n const previousControlOver = this._host._lastControlOver[pointerId];\r\n if (previousControlOver && previousControlOver !== this) {\r\n previousControlOver._onPointerOut(this);\r\n }\r\n\r\n if (previousControlOver !== this) {\r\n this._onPointerEnter(this);\r\n }\r\n\r\n this._host._lastControlOver[pointerId] = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERDOWN) {\r\n this._onPointerDown(this, pickedPoint, pointerId, buttonIndex);\r\n this._host._lastControlDown[pointerId] = this;\r\n this._host._lastPickedControl = this;\r\n return true;\r\n }\r\n\r\n if (type === PointerEventTypes.POINTERUP || type === PointerEventTypes.POINTERDOUBLETAP) {\r\n if (this._host._lastControlDown[pointerId]) {\r\n this._host._lastControlDown[pointerId]._onPointerUp(this, pickedPoint, pointerId, buttonIndex, true);\r\n }\r\n delete this._host._lastControlDown[pointerId];\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /** @internal */\r\n public _disposeNode(): void {\r\n if (this._node) {\r\n this._node.dispose();\r\n this._node = null;\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n this.onPointerDownObservable.clear();\r\n this.onPointerEnterObservable.clear();\r\n this.onPointerMoveObservable.clear();\r\n this.onPointerOutObservable.clear();\r\n this.onPointerUpObservable.clear();\r\n this.onPointerClickObservable.clear();\r\n\r\n this._disposeNode();\r\n\r\n // Behaviors\r\n for (const behavior of this._behaviors) {\r\n behavior.detach();\r\n }\r\n }\r\n}\r\n"]}
|
@@ -42,8 +42,7 @@ export class HolographicBackplate extends Control3D {
|
|
42
42
|
}
|
43
43
|
// Mesh association
|
44
44
|
_createNode(scene) {
|
45
|
-
|
46
|
-
const collisionMesh = CreateBox(((_a = this.name) !== null && _a !== void 0 ? _a : "HolographicBackplate") + "_CollisionMesh", {
|
45
|
+
const collisionMesh = CreateBox((this.name ?? "HolographicBackplate") + "_CollisionMesh", {
|
47
46
|
width: 1.0,
|
48
47
|
height: 1.0,
|
49
48
|
depth: 1.0,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"holographicBackplate.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicBackplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAGvD;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAa/C;;OAEG;IACH,IAAW,gBAAgB,CAAC,EAAU;QAClC,IAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;IACtC,CAAC;IACD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,YACI,IAAa,EACL,kBAAkB,IAAI;QAE9B,KAAK,CAAC,IAAI,CAAC,CAAC;QAFJ,oBAAe,GAAf,eAAe,CAAO;IAGlC,CAAC;IAES,YAAY;QAClB,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAED,mBAAmB;IACT,WAAW,CAAC,KAAY
|
1
|
+
{"version":3,"file":"holographicBackplate.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/holographicBackplate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAGvD;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAa/C;;OAEG;IACH,IAAW,gBAAgB,CAAC,EAAU;QAClC,IAAI,CAAC,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;IACtC,CAAC;IACD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,cAAc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AI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC3F,CAAC;IAES,eAAe,CAAC,IAAU;QAChC,OAAO;QACP,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,EAAE;gBAC9D,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAC3B,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;aAChF;iBAAM;gBACH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,yBAAyB,CAA4B,CAAC;aAC3G;SACJ;aAAM;YACH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC9B;IACL,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,wCAAwC;QAEzD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;;AA7GD;;GAEG;AACW,mCAAc,GAAW,2CAA2C,CAAC;AACnF;;GAEG;AACW,mCAAc,GAAW,2BAA2B,CAAC","sourcesContent":["import type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { FluentBackplateMaterial } from \"../materials/fluentBackplate/fluentBackplateMaterial\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to create a holographic backplate in 3D\r\n * @since 5.0.0\r\n */\r\nexport class HolographicBackplate extends Control3D {\r\n /**\r\n * Base Url for the button model.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n /**\r\n * File name for the button model.\r\n */\r\n public static MODEL_FILENAME: string = \"mrtk-fluent-backplate.glb\";\r\n\r\n private _model: AbstractMesh;\r\n private _material: FluentBackplateMaterial;\r\n\r\n /**\r\n * Rendering ground id of the backplate mesh.\r\n */\r\n public set renderingGroupId(id: number) {\r\n this._model.renderingGroupId = id;\r\n }\r\n public get renderingGroupId(): number {\r\n return this._model.renderingGroupId;\r\n }\r\n\r\n /**\r\n * Gets the material used by the backplate\r\n */\r\n public get material(): FluentBackplateMaterial {\r\n return this._material;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if this backplate shares its material with other HolographicBackplates\r\n */\r\n public get shareMaterials(): boolean {\r\n return this._shareMaterials;\r\n }\r\n\r\n /**\r\n * Creates a new holographic backplate\r\n * @param name defines the control name\r\n * @param _shareMaterials\r\n */\r\n constructor(\r\n name?: string,\r\n private _shareMaterials = true\r\n ) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"HolographicBackplate\";\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n const collisionMesh = CreateBox(\r\n (this.name ?? \"HolographicBackplate\") + \"_CollisionMesh\",\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 1.0,\r\n },\r\n scene\r\n );\r\n collisionMesh.isPickable = true;\r\n collisionMesh.visibility = 0;\r\n\r\n SceneLoader.ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene).then((result) => {\r\n const importedModel = result.meshes[1];\r\n importedModel.name = `${this.name}_frontPlate`;\r\n importedModel.isPickable = false;\r\n importedModel.parent = collisionMesh;\r\n if (this._material) {\r\n importedModel.material = this._material;\r\n }\r\n this._model = importedModel;\r\n });\r\n\r\n return collisionMesh;\r\n }\r\n\r\n private _createMaterial(mesh: Mesh) {\r\n this._material = new FluentBackplateMaterial(this.name + \" Material\", mesh.getScene());\r\n }\r\n\r\n protected _affectMaterial(mesh: Mesh) {\r\n // Back\r\n if (this._shareMaterials) {\r\n if (!this._host._touchSharedMaterials[\"fluentBackplateMaterial\"]) {\r\n this._createMaterial(mesh);\r\n this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] = this._material;\r\n } else {\r\n this._material = this._host._touchSharedMaterials[\"fluentBackplateMaterial\"] as FluentBackplateMaterial;\r\n }\r\n } else {\r\n this._createMaterial(mesh);\r\n }\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose(); // will dispose main mesh ie. back plate\r\n\r\n if (!this.shareMaterials) {\r\n this._material.dispose();\r\n }\r\n\r\n this._model.dispose();\r\n }\r\n}\r\n"]}
|
@@ -181,8 +181,7 @@ export class HolographicSlate extends ContentDisplay3D {
|
|
181
181
|
}
|
182
182
|
}
|
183
183
|
_applyContentViewport() {
|
184
|
-
|
185
|
-
if (((_a = this._contentPlate) === null || _a === void 0 ? void 0 : _a.material) && this._contentPlate.material.albedoTexture) {
|
184
|
+
if (this._contentPlate?.material && this._contentPlate.material.albedoTexture) {
|
186
185
|
const tex = this._contentPlate.material.albedoTexture;
|
187
186
|
tex.uScale = this._contentScaleRatio;
|
188
187
|
tex.vScale = (this._contentScaleRatio / this._contentViewport.width) * this._contentViewport.height;
|