babylonjs-gui 5.0.0-beta.3 → 5.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.gui.js +135 -119
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +2 -2
- package/babylon.gui.module.d.ts +68 -72
- package/package.json +2 -2
package/babylon.gui.js
CHANGED
|
@@ -581,6 +581,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
581
581
|
|
|
582
582
|
|
|
583
583
|
|
|
584
|
+
|
|
584
585
|
/**
|
|
585
586
|
* Class used to create texture to support 2D GUI elements
|
|
586
587
|
* @see https://doc.babylonjs.com/how_to/gui
|
|
@@ -1701,8 +1702,10 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1701
1702
|
if (height === void 0) { height = 1024; }
|
|
1702
1703
|
if (supportPointerMove === void 0) { supportPointerMove = true; }
|
|
1703
1704
|
if (onlyAlphaTesting === void 0) { onlyAlphaTesting = false; }
|
|
1704
|
-
|
|
1705
|
-
var
|
|
1705
|
+
// use a unique ID in name so serialization will work even if you create two ADTs for a single mesh
|
|
1706
|
+
var uniqueId = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["RandomGUID"])();
|
|
1707
|
+
var result = new AdvancedDynamicTexture("AdvancedDynamicTexture for " + mesh.name + " [" + uniqueId + "]", width, height, mesh.getScene(), true, babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Texture"].TRILINEAR_SAMPLINGMODE, invertY);
|
|
1708
|
+
var material = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("AdvancedDynamicTextureMaterial for " + mesh.name + " [" + uniqueId + "]", mesh.getScene());
|
|
1706
1709
|
material.backFaceCulling = false;
|
|
1707
1710
|
material.diffuseColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
1708
1711
|
material.specularColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
@@ -5397,6 +5400,19 @@ var Control = /** @class */ (function () {
|
|
|
5397
5400
|
}
|
|
5398
5401
|
return this.parent.getAscendantOfClass(className);
|
|
5399
5402
|
};
|
|
5403
|
+
/**
|
|
5404
|
+
* Mark control element as dirty
|
|
5405
|
+
* @param force force non visible elements to be marked too
|
|
5406
|
+
*/
|
|
5407
|
+
Control.prototype.markAsDirty = function (force) {
|
|
5408
|
+
this._markAsDirty(force);
|
|
5409
|
+
};
|
|
5410
|
+
/**
|
|
5411
|
+
* Mark the element and its children as dirty
|
|
5412
|
+
*/
|
|
5413
|
+
Control.prototype.markAllAsDirty = function () {
|
|
5414
|
+
this._markAllAsDirty();
|
|
5415
|
+
};
|
|
5400
5416
|
/** @hidden */
|
|
5401
5417
|
Control.prototype._resetFontCache = function () {
|
|
5402
5418
|
this._fontSet = true;
|
|
@@ -18361,7 +18377,8 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18361
18377
|
}
|
|
18362
18378
|
};
|
|
18363
18379
|
HolographicSlate.prototype._applyContentViewport = function () {
|
|
18364
|
-
|
|
18380
|
+
var _a;
|
|
18381
|
+
if (((_a = this._contentPlate) === null || _a === void 0 ? void 0 : _a.material) && this._contentPlate.material.albedoTexture) {
|
|
18365
18382
|
var tex = this._contentPlate.material.albedoTexture;
|
|
18366
18383
|
tex.uScale = this._contentScaleRatio;
|
|
18367
18384
|
tex.vScale = (this._contentScaleRatio / this._contentViewport.width) * this._contentViewport.height;
|
|
@@ -18567,7 +18584,7 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18567
18584
|
/*!******************************!*\
|
|
18568
18585
|
!*** ./3D/controls/index.ts ***!
|
|
18569
18586
|
\******************************/
|
|
18570
|
-
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
18587
|
+
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu, VolumeBasedPanel, HolographicBackplate */
|
|
18571
18588
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
18572
18589
|
|
|
18573
18590
|
"use strict";
|
|
@@ -18629,16 +18646,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18629
18646
|
/* harmony import */ var _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./touchHolographicMenu */ "./3D/controls/touchHolographicMenu.ts");
|
|
18630
18647
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__["TouchHolographicMenu"]; });
|
|
18631
18648
|
|
|
18632
|
-
/* harmony import */ var
|
|
18633
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
18649
|
+
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
|
|
18650
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__["VolumeBasedPanel"]; });
|
|
18634
18651
|
|
|
18635
|
-
/* harmony import */ var
|
|
18636
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
18652
|
+
/* harmony import */ var _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./holographicBackplate */ "./3D/controls/holographicBackplate.ts");
|
|
18653
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__["HolographicBackplate"]; });
|
|
18637
18654
|
|
|
18638
|
-
/* harmony import */ var _holographicBackplate__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./holographicBackplate */ "./3D/controls/holographicBackplate.ts");
|
|
18639
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _holographicBackplate__WEBPACK_IMPORTED_MODULE_21__["HolographicBackplate"]; });
|
|
18640
|
-
|
|
18641
|
-
|
|
18642
18655
|
|
|
18643
18656
|
|
|
18644
18657
|
|
|
@@ -18797,13 +18810,16 @@ var NearMenu = /** @class */ (function (_super) {
|
|
|
18797
18810
|
return this._isPinned;
|
|
18798
18811
|
},
|
|
18799
18812
|
set: function (value) {
|
|
18813
|
+
// Tell the pin button to toggle if this was called manually, for clean state control
|
|
18814
|
+
if (this._pinButton.isToggled !== value) {
|
|
18815
|
+
this._pinButton.isToggled = value;
|
|
18816
|
+
return;
|
|
18817
|
+
}
|
|
18800
18818
|
this._isPinned = value;
|
|
18801
|
-
if (
|
|
18802
|
-
this._pinMaterial.emissiveColor.copyFromFloats(0.25, 0.4, 0.95);
|
|
18819
|
+
if (value) {
|
|
18803
18820
|
this._defaultBehavior.followBehaviorEnabled = false;
|
|
18804
18821
|
}
|
|
18805
18822
|
else {
|
|
18806
|
-
this._pinMaterial.emissiveColor.copyFromFloats(0.08, 0.15, 0.55);
|
|
18807
18823
|
this._defaultBehavior.followBehaviorEnabled = true;
|
|
18808
18824
|
}
|
|
18809
18825
|
},
|
|
@@ -18816,12 +18832,11 @@ var NearMenu = /** @class */ (function (_super) {
|
|
|
18816
18832
|
control.imageUrl = NearMenu.ASSETS_BASE_URL + NearMenu.PIN_ICON_FILENAME;
|
|
18817
18833
|
control.parent = this;
|
|
18818
18834
|
control._host = this._host;
|
|
18819
|
-
control.
|
|
18835
|
+
control.isToggleButton = true;
|
|
18836
|
+
control.onToggleObservable.add(function (newState) { _this.isPinned = newState; });
|
|
18820
18837
|
if (this._host.utilityLayer) {
|
|
18821
18838
|
control._prepareNode(this._host.utilityLayer.utilityLayerScene);
|
|
18822
18839
|
control.scaling.scaleInPlace(_touchHolographicMenu__WEBPACK_IMPORTED_MODULE_3__["TouchHolographicMenu"].MENU_BUTTON_SCALE);
|
|
18823
|
-
this._pinMaterial = control.backMaterial;
|
|
18824
|
-
this._pinMaterial.diffuseColor.copyFromFloats(0, 0, 0);
|
|
18825
18840
|
if (control.node) {
|
|
18826
18841
|
control.node.parent = parent;
|
|
18827
18842
|
}
|
|
@@ -19570,6 +19585,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19570
19585
|
|
|
19571
19586
|
|
|
19572
19587
|
|
|
19588
|
+
|
|
19573
19589
|
/**
|
|
19574
19590
|
* Class used to create a touchable button in 3D
|
|
19575
19591
|
*/
|
|
@@ -19583,6 +19599,13 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19583
19599
|
function TouchButton3D(name, collisionMesh) {
|
|
19584
19600
|
var _this = _super.call(this, name) || this;
|
|
19585
19601
|
_this._isNearPressed = false;
|
|
19602
|
+
_this._isToggleButton = false;
|
|
19603
|
+
_this._toggleState = false;
|
|
19604
|
+
_this._toggleButtonCallback = function () { _this._onToggle(!_this._toggleState); };
|
|
19605
|
+
/**
|
|
19606
|
+
* An event triggered when the button is toggled. Only fired if 'isToggleButton' is true
|
|
19607
|
+
*/
|
|
19608
|
+
_this.onToggleObservable = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
|
19586
19609
|
_this.collidableFrontDirection = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
19587
19610
|
if (collisionMesh) {
|
|
19588
19611
|
_this.collisionMesh = collisionMesh;
|
|
@@ -19640,6 +19663,53 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19640
19663
|
enumerable: false,
|
|
19641
19664
|
configurable: true
|
|
19642
19665
|
});
|
|
19666
|
+
Object.defineProperty(TouchButton3D.prototype, "isToggleButton", {
|
|
19667
|
+
get: function () {
|
|
19668
|
+
return this._isToggleButton;
|
|
19669
|
+
},
|
|
19670
|
+
/**
|
|
19671
|
+
* Setter for if this TouchButton3D should be treated as a toggle button
|
|
19672
|
+
* @param value If this TouchHolographicButton should act like a toggle button
|
|
19673
|
+
*/
|
|
19674
|
+
set: function (value) {
|
|
19675
|
+
if (value === this._isToggleButton) {
|
|
19676
|
+
return;
|
|
19677
|
+
}
|
|
19678
|
+
this._isToggleButton = value;
|
|
19679
|
+
if (value) {
|
|
19680
|
+
this.onPointerUpObservable.add(this._toggleButtonCallback);
|
|
19681
|
+
}
|
|
19682
|
+
else {
|
|
19683
|
+
this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
|
|
19684
|
+
// Safety check, reset the button if it's toggled on but no longer a toggle button
|
|
19685
|
+
if (this._toggleState) {
|
|
19686
|
+
this._onToggle(false);
|
|
19687
|
+
}
|
|
19688
|
+
}
|
|
19689
|
+
},
|
|
19690
|
+
enumerable: false,
|
|
19691
|
+
configurable: true
|
|
19692
|
+
});
|
|
19693
|
+
Object.defineProperty(TouchButton3D.prototype, "isToggled", {
|
|
19694
|
+
get: function () {
|
|
19695
|
+
return this._toggleState;
|
|
19696
|
+
},
|
|
19697
|
+
/**
|
|
19698
|
+
* A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true
|
|
19699
|
+
* @param newState The new state to set the TouchHolographicButton's toggle state to
|
|
19700
|
+
*/
|
|
19701
|
+
set: function (newState) {
|
|
19702
|
+
if (this._isToggleButton && this._toggleState !== newState) {
|
|
19703
|
+
this._onToggle(newState);
|
|
19704
|
+
}
|
|
19705
|
+
},
|
|
19706
|
+
enumerable: false,
|
|
19707
|
+
configurable: true
|
|
19708
|
+
});
|
|
19709
|
+
TouchButton3D.prototype._onToggle = function (newState) {
|
|
19710
|
+
this._toggleState = newState;
|
|
19711
|
+
this.onToggleObservable.notifyObservers(newState);
|
|
19712
|
+
};
|
|
19643
19713
|
// Returns true if the collidable is in front of the button, or if the button has no front direction
|
|
19644
19714
|
TouchButton3D.prototype._isInteractionInFrontOfButton = function (collidablePos) {
|
|
19645
19715
|
return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0;
|
|
@@ -19689,6 +19759,9 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19689
19759
|
*/
|
|
19690
19760
|
TouchButton3D.prototype.dispose = function () {
|
|
19691
19761
|
_super.prototype.dispose.call(this);
|
|
19762
|
+
// Clean up toggle observables
|
|
19763
|
+
this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
|
|
19764
|
+
this.onToggleObservable.clear();
|
|
19692
19765
|
if (this._collisionMesh) {
|
|
19693
19766
|
this._collisionMesh.dispose();
|
|
19694
19767
|
}
|
|
@@ -19713,12 +19786,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19713
19786
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
19714
19787
|
/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/perfCounter");
|
|
19715
19788
|
/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__);
|
|
19716
|
-
/* harmony import */ var
|
|
19717
|
-
/* harmony import */ var
|
|
19718
|
-
/* harmony import */ var
|
|
19719
|
-
/* harmony import */ var
|
|
19720
|
-
/* harmony import */ var
|
|
19721
|
-
/* harmony import */ var
|
|
19789
|
+
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "./3D/materials/fluent/fluentMaterial.ts");
|
|
19790
|
+
/* harmony import */ var _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluentButton/fluentButtonMaterial */ "./3D/materials/fluentButton/fluentButtonMaterial.ts");
|
|
19791
|
+
/* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "./2D/controls/stackPanel.ts");
|
|
19792
|
+
/* harmony import */ var _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/image */ "./2D/controls/image.ts");
|
|
19793
|
+
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "./2D/controls/textBlock.ts");
|
|
19794
|
+
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "./2D/advancedDynamicTexture.ts");
|
|
19795
|
+
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./touchButton3D */ "./3D/controls/touchButton3D.ts");
|
|
19796
|
+
|
|
19722
19797
|
|
|
19723
19798
|
|
|
19724
19799
|
|
|
@@ -19753,6 +19828,8 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19753
19828
|
_this._isBackplateVisible = true;
|
|
19754
19829
|
_this._frontPlateDepth = 0.5;
|
|
19755
19830
|
_this._backPlateDepth = 0.04;
|
|
19831
|
+
_this._backplateColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.08, 0.15, 0.55);
|
|
19832
|
+
_this._backplateToggledColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.25, 0.4, 0.95);
|
|
19756
19833
|
_this._shareMaterials = shareMaterials;
|
|
19757
19834
|
_this.pointerEnterAnimation = function () {
|
|
19758
19835
|
_this._frontMaterial.leftBlobEnable = true;
|
|
@@ -19857,8 +19934,8 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19857
19934
|
this._tooltipMesh.isPickable = false;
|
|
19858
19935
|
this._tooltipMesh.parent = this._backPlate;
|
|
19859
19936
|
// Create text texture for the tooltip
|
|
19860
|
-
this._tooltipTexture =
|
|
19861
|
-
this._tooltipTextBlock = new
|
|
19937
|
+
this._tooltipTexture = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__["AdvancedDynamicTexture"].CreateForMesh(this._tooltipMesh);
|
|
19938
|
+
this._tooltipTextBlock = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__["TextBlock"]();
|
|
19862
19939
|
this._tooltipTextBlock.scaleY = 3;
|
|
19863
19940
|
this._tooltipTextBlock.color = "white";
|
|
19864
19941
|
this._tooltipTextBlock.fontSize = 130;
|
|
@@ -19982,11 +20059,11 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19982
20059
|
};
|
|
19983
20060
|
TouchHolographicButton.prototype._rebuildContent = function () {
|
|
19984
20061
|
this._disposeFacadeTexture();
|
|
19985
|
-
var panel = new
|
|
20062
|
+
var panel = new _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__["StackPanel"]();
|
|
19986
20063
|
panel.isVertical = true;
|
|
19987
20064
|
if (babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["DomManagement"].IsDocumentAvailable() && !!document.createElement) {
|
|
19988
20065
|
if (this._imageUrl) {
|
|
19989
|
-
var image = new
|
|
20066
|
+
var image = new _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__["Image"]();
|
|
19990
20067
|
image.source = this._imageUrl;
|
|
19991
20068
|
image.paddingTop = "40px";
|
|
19992
20069
|
image.height = "180px";
|
|
@@ -19996,7 +20073,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19996
20073
|
}
|
|
19997
20074
|
}
|
|
19998
20075
|
if (this._text) {
|
|
19999
|
-
var text = new
|
|
20076
|
+
var text = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__["TextBlock"]();
|
|
20000
20077
|
text.text = this._text;
|
|
20001
20078
|
text.color = "white";
|
|
20002
20079
|
text.height = "30px";
|
|
@@ -20021,10 +20098,19 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20021
20098
|
collisionMesh.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
|
|
20022
20099
|
babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene)
|
|
20023
20100
|
.then(function (result) {
|
|
20101
|
+
var alphaMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("${this.name}_alphaMesh", {
|
|
20102
|
+
width: 1.0,
|
|
20103
|
+
height: 1.0,
|
|
20104
|
+
depth: 1.0,
|
|
20105
|
+
}, scene);
|
|
20106
|
+
alphaMesh.isPickable = false;
|
|
20107
|
+
alphaMesh.material = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("${this.name}_alphaMesh_material", scene);
|
|
20108
|
+
alphaMesh.material.alpha = 0.15;
|
|
20024
20109
|
var importedFrontPlate = result.meshes[1];
|
|
20025
20110
|
importedFrontPlate.name = _this.name + "_frontPlate";
|
|
20026
20111
|
importedFrontPlate.isPickable = false;
|
|
20027
20112
|
importedFrontPlate.scaling.z = _this._frontPlateDepth;
|
|
20113
|
+
alphaMesh.parent = importedFrontPlate;
|
|
20028
20114
|
importedFrontPlate.parent = collisionMesh;
|
|
20029
20115
|
if (!!_this._frontMaterial) {
|
|
20030
20116
|
importedFrontPlate.material = _this._frontMaterial;
|
|
@@ -20054,16 +20140,29 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20054
20140
|
this._plateMaterial.diffuseColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.4, 0.4, 0.4);
|
|
20055
20141
|
};
|
|
20056
20142
|
TouchHolographicButton.prototype._createBackMaterial = function (mesh) {
|
|
20057
|
-
this._backMaterial = new
|
|
20058
|
-
this._backMaterial.
|
|
20143
|
+
this._backMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__["FluentMaterial"](this.name + "backPlateMaterial", mesh.getScene());
|
|
20144
|
+
this._backMaterial.albedoColor = this._backplateColor;
|
|
20145
|
+
this._backMaterial.renderBorders = true;
|
|
20146
|
+
this._backMaterial.renderHoverLight = false;
|
|
20059
20147
|
};
|
|
20060
20148
|
TouchHolographicButton.prototype._createFrontMaterial = function (mesh) {
|
|
20061
|
-
this._frontMaterial = new
|
|
20149
|
+
this._frontMaterial = new _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__["FluentButtonMaterial"](this.name + "Front Material", mesh.getScene());
|
|
20062
20150
|
};
|
|
20063
20151
|
TouchHolographicButton.prototype._createPlateMaterial = function (mesh) {
|
|
20064
20152
|
this._plateMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"](this.name + "Plate Material", mesh.getScene());
|
|
20065
20153
|
this._plateMaterial.specularColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
20066
20154
|
};
|
|
20155
|
+
TouchHolographicButton.prototype._onToggle = function (newState) {
|
|
20156
|
+
if (this._backMaterial) {
|
|
20157
|
+
if (newState) {
|
|
20158
|
+
this._backMaterial.albedoColor = this._backplateToggledColor;
|
|
20159
|
+
}
|
|
20160
|
+
else {
|
|
20161
|
+
this._backMaterial.albedoColor = this._backplateColor;
|
|
20162
|
+
}
|
|
20163
|
+
}
|
|
20164
|
+
_super.prototype._onToggle.call(this, newState);
|
|
20165
|
+
};
|
|
20067
20166
|
TouchHolographicButton.prototype._affectMaterial = function (mesh) {
|
|
20068
20167
|
if (this._shareMaterials) {
|
|
20069
20168
|
// Back
|
|
@@ -20124,7 +20223,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20124
20223
|
*/
|
|
20125
20224
|
TouchHolographicButton.MODEL_FILENAME = "mrtk-fluent-button.glb";
|
|
20126
20225
|
return TouchHolographicButton;
|
|
20127
|
-
}(
|
|
20226
|
+
}(_touchButton3D__WEBPACK_IMPORTED_MODULE_8__["TouchButton3D"]));
|
|
20128
20227
|
|
|
20129
20228
|
|
|
20130
20229
|
|
|
@@ -20373,83 +20472,6 @@ var TouchMeshButton3D = /** @class */ (function (_super) {
|
|
|
20373
20472
|
|
|
20374
20473
|
|
|
20375
20474
|
|
|
20376
|
-
/***/ }),
|
|
20377
|
-
|
|
20378
|
-
/***/ "./3D/controls/touchToggleButton3D.ts":
|
|
20379
|
-
/*!********************************************!*\
|
|
20380
|
-
!*** ./3D/controls/touchToggleButton3D.ts ***!
|
|
20381
|
-
\********************************************/
|
|
20382
|
-
/*! exports provided: TouchToggleButton3D */
|
|
20383
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
20384
|
-
|
|
20385
|
-
"use strict";
|
|
20386
|
-
__webpack_require__.r(__webpack_exports__);
|
|
20387
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return TouchToggleButton3D; });
|
|
20388
|
-
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
20389
|
-
/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/perfCounter");
|
|
20390
|
-
/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
|
|
20391
|
-
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./touchButton3D */ "./3D/controls/touchButton3D.ts");
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
/**
|
|
20396
|
-
* Class used as base class for touch-enabled toggleable buttons
|
|
20397
|
-
*/
|
|
20398
|
-
var TouchToggleButton3D = /** @class */ (function (_super) {
|
|
20399
|
-
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(TouchToggleButton3D, _super);
|
|
20400
|
-
/**
|
|
20401
|
-
* Creates a new button
|
|
20402
|
-
* @param name defines the control name
|
|
20403
|
-
* @param collisionMesh defines the mesh to track near interactions with
|
|
20404
|
-
*/
|
|
20405
|
-
function TouchToggleButton3D(name, collisionMesh) {
|
|
20406
|
-
var _this = _super.call(this, name, collisionMesh) || this;
|
|
20407
|
-
_this._isPressed = false;
|
|
20408
|
-
/**
|
|
20409
|
-
* An event triggered when the button is toggled on
|
|
20410
|
-
*/
|
|
20411
|
-
_this.onToggleOnObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
|
20412
|
-
/**
|
|
20413
|
-
* An event triggered when the button is toggled off
|
|
20414
|
-
*/
|
|
20415
|
-
_this.onToggleOffObservable = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
|
20416
|
-
_this.onPointerUpObservable.add(function (posVecWithInfo) {
|
|
20417
|
-
_this._onToggle(posVecWithInfo);
|
|
20418
|
-
});
|
|
20419
|
-
return _this;
|
|
20420
|
-
}
|
|
20421
|
-
TouchToggleButton3D.prototype._onToggle = function (position) {
|
|
20422
|
-
this._isPressed = !this._isPressed;
|
|
20423
|
-
if (this._isPressed) {
|
|
20424
|
-
this.onToggleOnObservable.notifyObservers(position);
|
|
20425
|
-
}
|
|
20426
|
-
else {
|
|
20427
|
-
this.onToggleOffObservable.notifyObservers(position);
|
|
20428
|
-
}
|
|
20429
|
-
};
|
|
20430
|
-
TouchToggleButton3D.prototype._getTypeName = function () {
|
|
20431
|
-
return "TouchToggleButton3D";
|
|
20432
|
-
};
|
|
20433
|
-
// Mesh association
|
|
20434
|
-
TouchToggleButton3D.prototype._createNode = function (scene) {
|
|
20435
|
-
return _super.prototype._createNode.call(this, scene);
|
|
20436
|
-
};
|
|
20437
|
-
TouchToggleButton3D.prototype._affectMaterial = function (mesh) {
|
|
20438
|
-
_super.prototype._affectMaterial.call(this, mesh);
|
|
20439
|
-
};
|
|
20440
|
-
/**
|
|
20441
|
-
* Releases all associated resources
|
|
20442
|
-
*/
|
|
20443
|
-
TouchToggleButton3D.prototype.dispose = function () {
|
|
20444
|
-
this.onToggleOnObservable.clear();
|
|
20445
|
-
this.onToggleOffObservable.clear();
|
|
20446
|
-
_super.prototype.dispose.call(this);
|
|
20447
|
-
};
|
|
20448
|
-
return TouchToggleButton3D;
|
|
20449
|
-
}(_touchButton3D__WEBPACK_IMPORTED_MODULE_2__["TouchButton3D"]));
|
|
20450
|
-
|
|
20451
|
-
|
|
20452
|
-
|
|
20453
20475
|
/***/ }),
|
|
20454
20476
|
|
|
20455
20477
|
/***/ "./3D/controls/volumeBasedPanel.ts":
|
|
@@ -21560,7 +21582,7 @@ var GUI3DManager = /** @class */ (function () {
|
|
|
21560
21582
|
/*!*********************!*\
|
|
21561
21583
|
!*** ./3D/index.ts ***!
|
|
21562
21584
|
\*********************/
|
|
21563
|
-
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
21585
|
+
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu, VolumeBasedPanel, HolographicBackplate, FluentMaterialDefines, FluentMaterial, FluentButtonMaterial, FluentBackplateMaterial, HandleMaterial, MRDLSliderBarMaterial, MRDLSliderThumbMaterial, MRDLBackplateMaterial, SlateGizmo, HandleState, GizmoHandle, SideHandle, CornerHandle, GUI3DManager, Vector3WithInfo */
|
|
21564
21586
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
21565
21587
|
|
|
21566
21588
|
"use strict";
|
|
@@ -21604,8 +21626,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21604
21626
|
|
|
21605
21627
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["TouchHolographicMenu"]; });
|
|
21606
21628
|
|
|
21607
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["TouchToggleButton3D"]; });
|
|
21608
|
-
|
|
21609
21629
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["VolumeBasedPanel"]; });
|
|
21610
21630
|
|
|
21611
21631
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["HolographicBackplate"]; });
|
|
@@ -25632,7 +25652,7 @@ var Vector3WithInfo = /** @class */ (function (_super) {
|
|
|
25632
25652
|
/*!******************!*\
|
|
25633
25653
|
!*** ./index.ts ***!
|
|
25634
25654
|
\******************/
|
|
25635
|
-
/*! exports provided: Button, Checkbox, ColorPicker, Container, Control, Ellipse, FocusableButton, Grid, Image, InputText, InputPassword, Line, MultiLine, RadioButton, StackPanel, SelectorGroup, CheckboxGroup, RadioGroup, SliderGroup, SelectionPanel, ScrollViewer, TextWrapping, TextBlock, TextWrapper, ToggleButton, KeyPropertySet, VirtualKeyboard, Rectangle, DisplayGrid, BaseSlider, Slider, ImageBasedSlider, ScrollBar, ImageScrollBar, name, AdvancedDynamicTexture, AdvancedDynamicTextureInstrumentation, Vector2WithInfo, Matrix2D, Measure, MultiLinePoint, Style, ValueAndUnit, XmlLoader, AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
25655
|
+
/*! exports provided: Button, Checkbox, ColorPicker, Container, Control, Ellipse, FocusableButton, Grid, Image, InputText, InputPassword, Line, MultiLine, RadioButton, StackPanel, SelectorGroup, CheckboxGroup, RadioGroup, SliderGroup, SelectionPanel, ScrollViewer, TextWrapping, TextBlock, TextWrapper, ToggleButton, KeyPropertySet, VirtualKeyboard, Rectangle, DisplayGrid, BaseSlider, Slider, ImageBasedSlider, ScrollBar, ImageScrollBar, name, AdvancedDynamicTexture, AdvancedDynamicTextureInstrumentation, Vector2WithInfo, Matrix2D, Measure, MultiLinePoint, Style, ValueAndUnit, XmlLoader, AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu, VolumeBasedPanel, HolographicBackplate, FluentMaterialDefines, FluentMaterial, FluentButtonMaterial, FluentBackplateMaterial, HandleMaterial, MRDLSliderBarMaterial, MRDLSliderThumbMaterial, MRDLBackplateMaterial, SlateGizmo, HandleState, GizmoHandle, SideHandle, CornerHandle, GUI3DManager, Vector3WithInfo */
|
|
25636
25656
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
25637
25657
|
|
|
25638
25658
|
"use strict";
|
|
@@ -25765,8 +25785,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25765
25785
|
|
|
25766
25786
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["TouchHolographicMenu"]; });
|
|
25767
25787
|
|
|
25768
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["TouchToggleButton3D"]; });
|
|
25769
|
-
|
|
25770
25788
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["VolumeBasedPanel"]; });
|
|
25771
25789
|
|
|
25772
25790
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["HolographicBackplate"]; });
|
|
@@ -25811,7 +25829,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25811
25829
|
/*!**************************!*\
|
|
25812
25830
|
!*** ./legacy/legacy.ts ***!
|
|
25813
25831
|
\**************************/
|
|
25814
|
-
/*! exports provided: Button, Checkbox, ColorPicker, Container, Control, Ellipse, FocusableButton, Grid, Image, InputText, InputPassword, Line, MultiLine, RadioButton, StackPanel, SelectorGroup, CheckboxGroup, RadioGroup, SliderGroup, SelectionPanel, ScrollViewer, TextWrapping, TextBlock, TextWrapper, ToggleButton, KeyPropertySet, VirtualKeyboard, Rectangle, DisplayGrid, BaseSlider, Slider, ImageBasedSlider, ScrollBar, ImageScrollBar, name, AdvancedDynamicTexture, AdvancedDynamicTextureInstrumentation, Vector2WithInfo, Matrix2D, Measure, MultiLinePoint, Style, ValueAndUnit, XmlLoader, AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
25832
|
+
/*! exports provided: Button, Checkbox, ColorPicker, Container, Control, Ellipse, FocusableButton, Grid, Image, InputText, InputPassword, Line, MultiLine, RadioButton, StackPanel, SelectorGroup, CheckboxGroup, RadioGroup, SliderGroup, SelectionPanel, ScrollViewer, TextWrapping, TextBlock, TextWrapper, ToggleButton, KeyPropertySet, VirtualKeyboard, Rectangle, DisplayGrid, BaseSlider, Slider, ImageBasedSlider, ScrollBar, ImageScrollBar, name, AdvancedDynamicTexture, AdvancedDynamicTextureInstrumentation, Vector2WithInfo, Matrix2D, Measure, MultiLinePoint, Style, ValueAndUnit, XmlLoader, AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu, VolumeBasedPanel, HolographicBackplate, FluentMaterialDefines, FluentMaterial, FluentButtonMaterial, FluentBackplateMaterial, HandleMaterial, MRDLSliderBarMaterial, MRDLSliderThumbMaterial, MRDLBackplateMaterial, SlateGizmo, HandleState, GizmoHandle, SideHandle, CornerHandle, GUI3DManager, Vector3WithInfo */
|
|
25815
25833
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
25816
25834
|
|
|
25817
25835
|
"use strict";
|
|
@@ -25943,8 +25961,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25943
25961
|
|
|
25944
25962
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TouchHolographicMenu"]; });
|
|
25945
25963
|
|
|
25946
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TouchToggleButton3D"]; });
|
|
25947
|
-
|
|
25948
25964
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["VolumeBasedPanel"]; });
|
|
25949
25965
|
|
|
25950
25966
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["HolographicBackplate"]; });
|