babylonjs-gui 5.0.0-beta.1 → 5.0.0-beta.12
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 +557 -358
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +2 -2
- package/babylon.gui.module.d.ts +380 -308
- package/package.json +2 -2
package/babylon.gui.js
CHANGED
|
@@ -97,9 +97,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
99
|
/***/ "../../node_modules/tslib/tslib.es6.js":
|
|
100
|
-
|
|
101
|
-
!***
|
|
102
|
-
|
|
100
|
+
/*!************************************************************************************!*\
|
|
101
|
+
!*** C:/Users/raweber/Documents/GitHub/Babylon.js/node_modules/tslib/tslib.es6.js ***!
|
|
102
|
+
\************************************************************************************/
|
|
103
103
|
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
|
|
104
104
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
105
105
|
|
|
@@ -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
|
|
@@ -1610,6 +1611,10 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1610
1611
|
if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) {
|
|
1611
1612
|
this.scaleTo(width, height);
|
|
1612
1613
|
}
|
|
1614
|
+
else {
|
|
1615
|
+
// scales the GUI to a default size if none was available in the serialized content
|
|
1616
|
+
this.scaleTo(1920, 1080);
|
|
1617
|
+
}
|
|
1613
1618
|
}
|
|
1614
1619
|
};
|
|
1615
1620
|
/**
|
|
@@ -1701,8 +1706,10 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1701
1706
|
if (height === void 0) { height = 1024; }
|
|
1702
1707
|
if (supportPointerMove === void 0) { supportPointerMove = true; }
|
|
1703
1708
|
if (onlyAlphaTesting === void 0) { onlyAlphaTesting = false; }
|
|
1704
|
-
|
|
1705
|
-
var
|
|
1709
|
+
// use a unique ID in name so serialization will work even if you create two ADTs for a single mesh
|
|
1710
|
+
var uniqueId = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["RandomGUID"])();
|
|
1711
|
+
var result = new AdvancedDynamicTexture("AdvancedDynamicTexture for ".concat(mesh.name, " [").concat(uniqueId, "]"), width, height, mesh.getScene(), true, babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Texture"].TRILINEAR_SAMPLINGMODE, invertY);
|
|
1712
|
+
var material = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("AdvancedDynamicTextureMaterial for ".concat(mesh.name, " [").concat(uniqueId, "]"), mesh.getScene());
|
|
1706
1713
|
material.backFaceCulling = false;
|
|
1707
1714
|
material.diffuseColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
1708
1715
|
material.specularColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
@@ -1770,6 +1777,23 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1770
1777
|
result.attach();
|
|
1771
1778
|
return result;
|
|
1772
1779
|
};
|
|
1780
|
+
/**
|
|
1781
|
+
* Scales the texture
|
|
1782
|
+
* @param ratio the scale factor to apply to both width and height
|
|
1783
|
+
*/
|
|
1784
|
+
AdvancedDynamicTexture.prototype.scale = function (ratio) {
|
|
1785
|
+
_super.prototype.scale.call(this, ratio);
|
|
1786
|
+
this.markAsDirty();
|
|
1787
|
+
};
|
|
1788
|
+
/**
|
|
1789
|
+
* Resizes the texture
|
|
1790
|
+
* @param width the new width
|
|
1791
|
+
* @param height the new height
|
|
1792
|
+
*/
|
|
1793
|
+
AdvancedDynamicTexture.prototype.scaleTo = function (width, height) {
|
|
1794
|
+
_super.prototype.scaleTo.call(this, width, height);
|
|
1795
|
+
this.markAsDirty();
|
|
1796
|
+
};
|
|
1773
1797
|
/** Define the Uurl to load snippets */
|
|
1774
1798
|
AdvancedDynamicTexture.SnippetUrl = "https://snippet.babylonjs.com";
|
|
1775
1799
|
/** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
|
|
@@ -2447,7 +2471,7 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
2447
2471
|
};
|
|
2448
2472
|
ColorPicker.prototype._createColorWheelCanvas = function (radius, thickness) {
|
|
2449
2473
|
// Shoudl abstract platform instead of using LastCreatedEngine
|
|
2450
|
-
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
2474
|
+
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
2451
2475
|
if (!engine) {
|
|
2452
2476
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
2453
2477
|
}
|
|
@@ -4045,7 +4069,7 @@ var Container = /** @class */ (function (_super) {
|
|
|
4045
4069
|
rebuildCount++;
|
|
4046
4070
|
} while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle);
|
|
4047
4071
|
if (rebuildCount >= 3 && this.logLayoutCycleErrors) {
|
|
4048
|
-
babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__["Logger"].Error("Layout cycle detected in GUI (Container name="
|
|
4072
|
+
babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__["Logger"].Error("Layout cycle detected in GUI (Container name=".concat(this.name, ", uniqueId=").concat(this.uniqueId, ")"));
|
|
4049
4073
|
}
|
|
4050
4074
|
context.restore();
|
|
4051
4075
|
if (this._isDirty) {
|
|
@@ -4115,7 +4139,10 @@ var Container = /** @class */ (function (_super) {
|
|
|
4115
4139
|
if (!this._isEnabled || !this.isVisible || this.notRenderable) {
|
|
4116
4140
|
return false;
|
|
4117
4141
|
}
|
|
4118
|
-
if
|
|
4142
|
+
// checks if the picking position is within the container
|
|
4143
|
+
var contains = _super.prototype.contains.call(this, x, y);
|
|
4144
|
+
// if clipChildren is off, we should still pass picking events to children even if we don't contain the pointer
|
|
4145
|
+
if (!contains && this.clipChildren) {
|
|
4119
4146
|
return false;
|
|
4120
4147
|
}
|
|
4121
4148
|
// Checking backwards to pick closest first
|
|
@@ -4128,6 +4155,9 @@ var Container = /** @class */ (function (_super) {
|
|
|
4128
4155
|
return true;
|
|
4129
4156
|
}
|
|
4130
4157
|
}
|
|
4158
|
+
if (!contains) {
|
|
4159
|
+
return false;
|
|
4160
|
+
}
|
|
4131
4161
|
if (!this.isHitTestVisible) {
|
|
4132
4162
|
return false;
|
|
4133
4163
|
}
|
|
@@ -5340,17 +5370,34 @@ var Control = /** @class */ (function () {
|
|
|
5340
5370
|
return this._isEnabled;
|
|
5341
5371
|
},
|
|
5342
5372
|
set: function (value) {
|
|
5373
|
+
var _this = this;
|
|
5343
5374
|
if (this._isEnabled === value) {
|
|
5344
5375
|
return;
|
|
5345
5376
|
}
|
|
5346
5377
|
this._isEnabled = value;
|
|
5347
5378
|
this._markAsDirty();
|
|
5379
|
+
// if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event
|
|
5380
|
+
var recursivelyFirePointerOut = function (control) {
|
|
5381
|
+
if (!control.host) {
|
|
5382
|
+
return;
|
|
5383
|
+
}
|
|
5384
|
+
for (var pointer in control.host._lastControlOver) {
|
|
5385
|
+
if (control === _this.host._lastControlOver[pointer]) {
|
|
5386
|
+
control._onPointerOut(control, null, true);
|
|
5387
|
+
delete control.host._lastControlOver[pointer];
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
if (control.children !== undefined) {
|
|
5391
|
+
control.children.forEach(recursivelyFirePointerOut);
|
|
5392
|
+
}
|
|
5393
|
+
};
|
|
5394
|
+
recursivelyFirePointerOut(this);
|
|
5348
5395
|
},
|
|
5349
5396
|
enumerable: false,
|
|
5350
5397
|
configurable: true
|
|
5351
5398
|
});
|
|
5352
5399
|
Object.defineProperty(Control.prototype, "disabledColor", {
|
|
5353
|
-
/** Gets or sets background color of control if it's disabled */
|
|
5400
|
+
/** Gets or sets background color of control if it's disabled. Only applies to Button class. */
|
|
5354
5401
|
get: function () {
|
|
5355
5402
|
return this._disabledColor;
|
|
5356
5403
|
},
|
|
@@ -5365,7 +5412,7 @@ var Control = /** @class */ (function () {
|
|
|
5365
5412
|
configurable: true
|
|
5366
5413
|
});
|
|
5367
5414
|
Object.defineProperty(Control.prototype, "disabledColorItem", {
|
|
5368
|
-
/** Gets or sets front color of control if it's disabled */
|
|
5415
|
+
/** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
|
|
5369
5416
|
get: function () {
|
|
5370
5417
|
return this._disabledColorItem;
|
|
5371
5418
|
},
|
|
@@ -5397,6 +5444,19 @@ var Control = /** @class */ (function () {
|
|
|
5397
5444
|
}
|
|
5398
5445
|
return this.parent.getAscendantOfClass(className);
|
|
5399
5446
|
};
|
|
5447
|
+
/**
|
|
5448
|
+
* Mark control element as dirty
|
|
5449
|
+
* @param force force non visible elements to be marked too
|
|
5450
|
+
*/
|
|
5451
|
+
Control.prototype.markAsDirty = function (force) {
|
|
5452
|
+
this._markAsDirty(force);
|
|
5453
|
+
};
|
|
5454
|
+
/**
|
|
5455
|
+
* Mark the element and its children as dirty
|
|
5456
|
+
*/
|
|
5457
|
+
Control.prototype.markAllAsDirty = function () {
|
|
5458
|
+
this._markAllAsDirty();
|
|
5459
|
+
};
|
|
5400
5460
|
/** @hidden */
|
|
5401
5461
|
Control.prototype._resetFontCache = function () {
|
|
5402
5462
|
this._fontSet = true;
|
|
@@ -5559,11 +5619,9 @@ var Control = /** @class */ (function () {
|
|
|
5559
5619
|
var _a;
|
|
5560
5620
|
var oldLeft = this._left.getValue(this._host);
|
|
5561
5621
|
var oldTop = this._top.getValue(this._host);
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
this._processMeasures(parentMeasure, this._host.getContext());
|
|
5566
|
-
}
|
|
5622
|
+
var parentMeasure = (_a = this.parent) === null || _a === void 0 ? void 0 : _a._currentMeasure;
|
|
5623
|
+
if (parentMeasure) {
|
|
5624
|
+
this._processMeasures(parentMeasure, this._host.getContext());
|
|
5567
5625
|
}
|
|
5568
5626
|
var newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;
|
|
5569
5627
|
var newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
|
|
@@ -5601,19 +5659,19 @@ var Control = /** @class */ (function () {
|
|
|
5601
5659
|
// No child
|
|
5602
5660
|
};
|
|
5603
5661
|
/** @hidden */
|
|
5604
|
-
Control.prototype._intersectsRect = function (rect) {
|
|
5605
|
-
//
|
|
5606
|
-
this.
|
|
5607
|
-
if (this.
|
|
5662
|
+
Control.prototype._intersectsRect = function (rect, context) {
|
|
5663
|
+
// make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.
|
|
5664
|
+
this._transform(context);
|
|
5665
|
+
if (this._evaluatedMeasure.left >= rect.left + rect.width) {
|
|
5608
5666
|
return false;
|
|
5609
5667
|
}
|
|
5610
|
-
if (this.
|
|
5668
|
+
if (this._evaluatedMeasure.top >= rect.top + rect.height) {
|
|
5611
5669
|
return false;
|
|
5612
5670
|
}
|
|
5613
|
-
if (this.
|
|
5671
|
+
if (this._evaluatedMeasure.left + this._evaluatedMeasure.width <= rect.left) {
|
|
5614
5672
|
return false;
|
|
5615
5673
|
}
|
|
5616
|
-
if (this.
|
|
5674
|
+
if (this._evaluatedMeasure.top + this._evaluatedMeasure.height <= rect.top) {
|
|
5617
5675
|
return false;
|
|
5618
5676
|
}
|
|
5619
5677
|
return true;
|
|
@@ -5655,6 +5713,7 @@ var Control = /** @class */ (function () {
|
|
|
5655
5713
|
return;
|
|
5656
5714
|
}
|
|
5657
5715
|
this._isDirty = true;
|
|
5716
|
+
this._markMatrixAsDirty();
|
|
5658
5717
|
// Redraw only this rectangle
|
|
5659
5718
|
if (this._host) {
|
|
5660
5719
|
this._host.markAsDirty();
|
|
@@ -5699,6 +5758,7 @@ var Control = /** @class */ (function () {
|
|
|
5699
5758
|
this._flagDescendantsAsMatrixDirty();
|
|
5700
5759
|
_math2D__WEBPACK_IMPORTED_MODULE_4__["Matrix2D"].ComposeToRef(-offsetX, -offsetY, this._rotation, this._scaleX, this._scaleY, this.parent ? this.parent._transformMatrix : null, this._transformMatrix);
|
|
5701
5760
|
this._transformMatrix.invertToRef(this._invertTransformMatrix);
|
|
5761
|
+
this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
|
|
5702
5762
|
}
|
|
5703
5763
|
};
|
|
5704
5764
|
/** @hidden */
|
|
@@ -5758,7 +5818,7 @@ var Control = /** @class */ (function () {
|
|
|
5758
5818
|
rebuildCount++;
|
|
5759
5819
|
} while (this._rebuildLayout && rebuildCount < 3);
|
|
5760
5820
|
if (rebuildCount >= 3) {
|
|
5761
|
-
babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Logger"].Error("Layout cycle detected in GUI (Control name="
|
|
5821
|
+
babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Logger"].Error("Layout cycle detected in GUI (Control name=".concat(this.name, ", uniqueId=").concat(this.uniqueId, ")"));
|
|
5762
5822
|
}
|
|
5763
5823
|
context.restore();
|
|
5764
5824
|
this.invalidateRect();
|
|
@@ -6305,7 +6365,7 @@ var Control = /** @class */ (function () {
|
|
|
6305
6365
|
if (Control._FontHeightSizes[font]) {
|
|
6306
6366
|
return Control._FontHeightSizes[font];
|
|
6307
6367
|
}
|
|
6308
|
-
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
6368
|
+
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
6309
6369
|
if (!engine) {
|
|
6310
6370
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
6311
6371
|
}
|
|
@@ -7155,7 +7215,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7155
7215
|
* @returns the list of controls
|
|
7156
7216
|
*/
|
|
7157
7217
|
Grid.prototype.getChildrenAt = function (row, column) {
|
|
7158
|
-
var cell = this._cells[row
|
|
7218
|
+
var cell = this._cells["".concat(row, ":").concat(column)];
|
|
7159
7219
|
if (!cell) {
|
|
7160
7220
|
return null;
|
|
7161
7221
|
}
|
|
@@ -7204,14 +7264,14 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7204
7264
|
return this;
|
|
7205
7265
|
}
|
|
7206
7266
|
for (var x = 0; x < this._rowDefinitions.length; x++) {
|
|
7207
|
-
var key = x
|
|
7267
|
+
var key = "".concat(x, ":").concat(index);
|
|
7208
7268
|
var cell = this._cells[key];
|
|
7209
7269
|
this._removeCell(cell, key);
|
|
7210
7270
|
}
|
|
7211
7271
|
for (var x = 0; x < this._rowDefinitions.length; x++) {
|
|
7212
7272
|
for (var y = index + 1; y < this._columnDefinitions.length; y++) {
|
|
7213
|
-
var previousKey = x
|
|
7214
|
-
var key = x
|
|
7273
|
+
var previousKey = "".concat(x, ":").concat(y - 1);
|
|
7274
|
+
var key = "".concat(x, ":").concat(y);
|
|
7215
7275
|
this._offsetCell(previousKey, key);
|
|
7216
7276
|
}
|
|
7217
7277
|
}
|
|
@@ -7231,14 +7291,14 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7231
7291
|
return this;
|
|
7232
7292
|
}
|
|
7233
7293
|
for (var y = 0; y < this._columnDefinitions.length; y++) {
|
|
7234
|
-
var key = index
|
|
7294
|
+
var key = "".concat(index, ":").concat(y);
|
|
7235
7295
|
var cell = this._cells[key];
|
|
7236
7296
|
this._removeCell(cell, key);
|
|
7237
7297
|
}
|
|
7238
7298
|
for (var y = 0; y < this._columnDefinitions.length; y++) {
|
|
7239
7299
|
for (var x = index + 1; x < this._rowDefinitions.length; x++) {
|
|
7240
|
-
var previousKey = x - 1
|
|
7241
|
-
var key = x
|
|
7300
|
+
var previousKey = "".concat(x - 1, ":").concat(y);
|
|
7301
|
+
var key = "".concat(x, ":").concat(y);
|
|
7242
7302
|
this._offsetCell(previousKey, key);
|
|
7243
7303
|
}
|
|
7244
7304
|
}
|
|
@@ -7267,12 +7327,12 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7267
7327
|
this.addColumnDefinition(1, false);
|
|
7268
7328
|
}
|
|
7269
7329
|
if (this._childControls.indexOf(control) !== -1) {
|
|
7270
|
-
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_4__["Tools"].Warn("Control (Name:"
|
|
7330
|
+
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_4__["Tools"].Warn("Control (Name:".concat(control.name, ", UniqueId:").concat(control.uniqueId, ") is already associated with this grid. You must remove it before reattaching it"));
|
|
7271
7331
|
return this;
|
|
7272
7332
|
}
|
|
7273
7333
|
var x = Math.min(row, this._rowDefinitions.length - 1);
|
|
7274
7334
|
var y = Math.min(column, this._columnDefinitions.length - 1);
|
|
7275
|
-
var key = x
|
|
7335
|
+
var key = "".concat(x, ":").concat(y);
|
|
7276
7336
|
var goodContainer = this._cells[key];
|
|
7277
7337
|
if (!goodContainer) {
|
|
7278
7338
|
goodContainer = new _container__WEBPACK_IMPORTED_MODULE_1__["Container"](key);
|
|
@@ -7840,7 +7900,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
7840
7900
|
var width = this._domImage.width;
|
|
7841
7901
|
var height = this._domImage.height;
|
|
7842
7902
|
// Should abstract platform instead of using LastCreatedEngine
|
|
7843
|
-
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
7903
|
+
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
7844
7904
|
if (!engine) {
|
|
7845
7905
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
7846
7906
|
}
|
|
@@ -7910,7 +7970,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
7910
7970
|
var width = this._domImage.width;
|
|
7911
7971
|
var height = this._domImage.height;
|
|
7912
7972
|
if (!this._workingCanvas) {
|
|
7913
|
-
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
7973
|
+
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
7914
7974
|
if (!engine) {
|
|
7915
7975
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
7916
7976
|
}
|
|
@@ -8010,7 +8070,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
8010
8070
|
value = this._svgCheck(value);
|
|
8011
8071
|
}
|
|
8012
8072
|
// Should abstract platform instead of using LastCreatedEngine
|
|
8013
|
-
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
8073
|
+
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
8014
8074
|
if (!engine) {
|
|
8015
8075
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
8016
8076
|
}
|
|
@@ -8241,7 +8301,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
8241
8301
|
var width = this._currentMeasure.width;
|
|
8242
8302
|
var height = this._currentMeasure.height;
|
|
8243
8303
|
if (!this._workingCanvas) {
|
|
8244
|
-
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
8304
|
+
var engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
8245
8305
|
if (!engine) {
|
|
8246
8306
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
8247
8307
|
}
|
|
@@ -9005,7 +9065,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9005
9065
|
this._cursorOffset = 0;
|
|
9006
9066
|
this._markAsDirty();
|
|
9007
9067
|
this.onFocusObservable.notifyObservers(this);
|
|
9008
|
-
if (
|
|
9068
|
+
if (this._focusedBy === "touch" && !this.disableMobilePrompt) {
|
|
9009
9069
|
var value = prompt(this.promptMessage);
|
|
9010
9070
|
if (value !== null) {
|
|
9011
9071
|
this.text = value;
|
|
@@ -9618,6 +9678,7 @@ var InputText = /** @class */ (function (_super) {
|
|
|
9618
9678
|
this._cursorIndex = -1;
|
|
9619
9679
|
this._isPointerDown = true;
|
|
9620
9680
|
this._host._capturingControl[pointerId] = this;
|
|
9681
|
+
this._focusedBy = pi.event.pointerType;
|
|
9621
9682
|
if (this._host.focusedControl === this) {
|
|
9622
9683
|
// Move cursor
|
|
9623
9684
|
clearTimeout(this._blinkTimeout);
|
|
@@ -12611,7 +12672,7 @@ var BaseSlider = /** @class */ (function (_super) {
|
|
|
12611
12672
|
else {
|
|
12612
12673
|
value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum);
|
|
12613
12674
|
}
|
|
12614
|
-
this.value = this._step ? (
|
|
12675
|
+
this.value = this._step ? Math.round(value / this._step) * this._step : value;
|
|
12615
12676
|
};
|
|
12616
12677
|
BaseSlider.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
|
|
12617
12678
|
if (!_super.prototype._onPointerDown.call(this, target, coordinates, pointerId, buttonIndex, pi)) {
|
|
@@ -13771,7 +13832,7 @@ var StackPanel = /** @class */ (function (_super) {
|
|
|
13771
13832
|
}
|
|
13772
13833
|
if (child._height.isPercentage && !child._automaticSize) {
|
|
13773
13834
|
if (!this.ignoreLayoutWarnings) {
|
|
13774
|
-
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:"
|
|
13835
|
+
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:".concat(child.name, ", UniqueId:").concat(child.uniqueId, ") is using height in percentage mode inside a vertical StackPanel"));
|
|
13775
13836
|
}
|
|
13776
13837
|
}
|
|
13777
13838
|
else {
|
|
@@ -13786,7 +13847,7 @@ var StackPanel = /** @class */ (function (_super) {
|
|
|
13786
13847
|
}
|
|
13787
13848
|
if (child._width.isPercentage && !child._automaticSize) {
|
|
13788
13849
|
if (!this.ignoreLayoutWarnings) {
|
|
13789
|
-
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:"
|
|
13850
|
+
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:".concat(child.name, ", UniqueId:").concat(child.uniqueId, ") is using width in percentage mode inside a horizontal StackPanel"));
|
|
13790
13851
|
}
|
|
13791
13852
|
}
|
|
13792
13853
|
else {
|
|
@@ -14358,30 +14419,40 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14358
14419
|
var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
14359
14420
|
return { text: line, width: lineWidth };
|
|
14360
14421
|
};
|
|
14422
|
+
//Calculate how many characters approximately we need to remove
|
|
14423
|
+
TextBlock.prototype._getCharsToRemove = function (lineWidth, width, lineLength) {
|
|
14424
|
+
var diff = lineWidth > width ? lineWidth - width : 0;
|
|
14425
|
+
// This isn't exact unless the font is monospaced
|
|
14426
|
+
var charWidth = lineWidth / lineLength;
|
|
14427
|
+
var removeChars = Math.max(Math.floor(diff / charWidth), 1);
|
|
14428
|
+
return removeChars;
|
|
14429
|
+
};
|
|
14361
14430
|
TextBlock.prototype._parseLineEllipsis = function (line, width, context) {
|
|
14362
14431
|
if (line === void 0) { line = ""; }
|
|
14363
14432
|
var textMetrics = context.measureText(line);
|
|
14364
14433
|
var lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
14365
|
-
|
|
14366
|
-
line += "…";
|
|
14367
|
-
}
|
|
14434
|
+
var removeChars = this._getCharsToRemove(lineWidth, width, line.length);
|
|
14368
14435
|
// unicode support. split('') does not work with unicode!
|
|
14369
14436
|
// make sure Array.from is available
|
|
14370
14437
|
var characters = Array.from && Array.from(line);
|
|
14371
14438
|
if (!characters) {
|
|
14372
14439
|
// no array.from, use the old method
|
|
14373
14440
|
while (line.length > 2 && lineWidth > width) {
|
|
14374
|
-
line = line.slice(0, -
|
|
14375
|
-
textMetrics = context.measureText(line);
|
|
14441
|
+
line = line.slice(0, -removeChars);
|
|
14442
|
+
textMetrics = context.measureText(line + "…");
|
|
14376
14443
|
lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
14444
|
+
removeChars = this._getCharsToRemove(lineWidth, width, line.length);
|
|
14377
14445
|
}
|
|
14446
|
+
// Add on the end
|
|
14447
|
+
line += "…";
|
|
14378
14448
|
}
|
|
14379
14449
|
else {
|
|
14380
14450
|
while (characters.length && lineWidth > width) {
|
|
14381
|
-
characters.
|
|
14382
|
-
line = characters.join("")
|
|
14451
|
+
characters.splice(characters.length - removeChars, removeChars);
|
|
14452
|
+
line = "".concat(characters.join(""), "\u2026");
|
|
14383
14453
|
textMetrics = context.measureText(line);
|
|
14384
14454
|
lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
14455
|
+
removeChars = this._getCharsToRemove(lineWidth, width, line.length);
|
|
14385
14456
|
}
|
|
14386
14457
|
}
|
|
14387
14458
|
return { text: line, width: lineWidth };
|
|
@@ -14418,7 +14489,7 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14418
14489
|
if (currentHeight > height && n > 1) {
|
|
14419
14490
|
var lastLine = lines[n - 2];
|
|
14420
14491
|
var currentLine = lines[n - 1];
|
|
14421
|
-
lines[n - 2] = this._parseLineEllipsis(""
|
|
14492
|
+
lines[n - 2] = this._parseLineEllipsis("".concat(lastLine.text + currentLine.text), width, context);
|
|
14422
14493
|
var linesToRemove = lines.length - n + 1;
|
|
14423
14494
|
for (var i = 0; i < linesToRemove; i++) {
|
|
14424
14495
|
lines.pop();
|
|
@@ -14479,7 +14550,7 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14479
14550
|
var _a;
|
|
14480
14551
|
if (this.text && this.widthInPixels) {
|
|
14481
14552
|
// Should abstract platform instead of using LastCreatedEngine
|
|
14482
|
-
var context_1 = (_a = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
14553
|
+
var context_1 = (_a = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine) === null || _a === void 0 ? void 0 : _a.createCanvas(0, 0).getContext("2d");
|
|
14483
14554
|
if (context_1) {
|
|
14484
14555
|
this._applyStates(context_1);
|
|
14485
14556
|
if (!this._fontOffset) {
|
|
@@ -16211,6 +16282,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16211
16282
|
/* harmony import */ var babylonjs_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_typeStore__WEBPACK_IMPORTED_MODULE_1__);
|
|
16212
16283
|
|
|
16213
16284
|
|
|
16285
|
+
var XmlLoaderError = "XmlLoader Exception : XML file is malformed or corrupted.";
|
|
16214
16286
|
/**
|
|
16215
16287
|
* Class used to load GUI via XML.
|
|
16216
16288
|
*/
|
|
@@ -16513,7 +16585,13 @@ var XmlLoader = /** @class */ (function () {
|
|
|
16513
16585
|
xhttp.onload = function () {
|
|
16514
16586
|
if (xhttp.readyState === 4 && xhttp.status === 200) {
|
|
16515
16587
|
if (!xhttp.responseXML) {
|
|
16516
|
-
|
|
16588
|
+
if (onError) {
|
|
16589
|
+
onError(XmlLoaderError);
|
|
16590
|
+
return;
|
|
16591
|
+
}
|
|
16592
|
+
else {
|
|
16593
|
+
throw XmlLoaderError;
|
|
16594
|
+
}
|
|
16517
16595
|
}
|
|
16518
16596
|
var xmlDoc = xhttp.responseXML.documentElement;
|
|
16519
16597
|
_this._parseXml(xmlDoc.firstChild, rootNode);
|
|
@@ -17042,7 +17120,7 @@ var ContentDisplay3D = /** @class */ (function (_super) {
|
|
|
17042
17120
|
},
|
|
17043
17121
|
set: function (value) {
|
|
17044
17122
|
this._content = value;
|
|
17045
|
-
if (!this._host || !this._host.utilityLayer) {
|
|
17123
|
+
if (!value || !this._host || !this._host.utilityLayer) {
|
|
17046
17124
|
return;
|
|
17047
17125
|
}
|
|
17048
17126
|
if (!this._facadeTexture) {
|
|
@@ -17761,7 +17839,7 @@ var HolographicBackplate = /** @class */ (function (_super) {
|
|
|
17761
17839
|
babylonjs_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene)
|
|
17762
17840
|
.then(function (result) {
|
|
17763
17841
|
var importedModel = result.meshes[1];
|
|
17764
|
-
importedModel.name = _this.name
|
|
17842
|
+
importedModel.name = "".concat(_this.name, "_frontPlate");
|
|
17765
17843
|
importedModel.isPickable = false;
|
|
17766
17844
|
importedModel.parent = collisionMesh;
|
|
17767
17845
|
if (!!_this._material) {
|
|
@@ -18186,15 +18264,21 @@ var HolographicButton = /** @class */ (function (_super) {
|
|
|
18186
18264
|
__webpack_require__.r(__webpack_exports__);
|
|
18187
18265
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HolographicSlate", function() { return HolographicSlate; });
|
|
18188
18266
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
18189
|
-
/* harmony import */ var
|
|
18190
|
-
/* harmony import */ var
|
|
18191
|
-
/* harmony import */ var
|
|
18192
|
-
/* harmony import */ var
|
|
18193
|
-
/* harmony import */ var
|
|
18194
|
-
/* harmony import */ var
|
|
18195
|
-
/* harmony import */ var
|
|
18196
|
-
/* harmony import */ var
|
|
18197
|
-
/* harmony import */ var
|
|
18267
|
+
/* harmony import */ var _contentDisplay3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contentDisplay3D */ "./3D/controls/contentDisplay3D.ts");
|
|
18268
|
+
/* harmony import */ var _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./touchHolographicButton */ "./3D/controls/touchHolographicButton.ts");
|
|
18269
|
+
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "./2D/advancedDynamicTexture.ts");
|
|
18270
|
+
/* harmony import */ var _2D_controls_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/control */ "./2D/controls/control.ts");
|
|
18271
|
+
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "./2D/controls/textBlock.ts");
|
|
18272
|
+
/* harmony import */ var _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../behaviors/defaultBehavior */ "./3D/behaviors/defaultBehavior.ts");
|
|
18273
|
+
/* harmony import */ var _gizmos_slateGizmo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../gizmos/slateGizmo */ "./3D/gizmos/slateGizmo.ts");
|
|
18274
|
+
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "./3D/materials/fluent/fluentMaterial.ts");
|
|
18275
|
+
/* harmony import */ var _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../materials/fluentBackplate/fluentBackplateMaterial */ "./3D/materials/fluentBackplate/fluentBackplateMaterial.ts");
|
|
18276
|
+
/* harmony import */ var babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! babylonjs/Behaviors/Meshes/pointerDragBehavior */ "babylonjs/Misc/observable");
|
|
18277
|
+
/* harmony import */ var babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__);
|
|
18278
|
+
|
|
18279
|
+
|
|
18280
|
+
|
|
18281
|
+
|
|
18198
18282
|
|
|
18199
18283
|
|
|
18200
18284
|
|
|
@@ -18224,35 +18308,31 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18224
18308
|
function HolographicSlate(name) {
|
|
18225
18309
|
var _this = _super.call(this, name) || this;
|
|
18226
18310
|
/**
|
|
18227
|
-
*
|
|
18311
|
+
* Margin between title bar and contentplate
|
|
18228
18312
|
*/
|
|
18229
|
-
_this.
|
|
18313
|
+
_this.titleBarMargin = 0.005;
|
|
18230
18314
|
/**
|
|
18231
|
-
*
|
|
18232
|
-
*/
|
|
18233
|
-
_this.minDimensions = new babylonjs_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__["Vector3"](15.625, 6.25, 0.001);
|
|
18234
|
-
/**
|
|
18235
|
-
* Default dimensions of the slate
|
|
18236
|
-
*/
|
|
18237
|
-
_this.defaultDimensions = _this.dimensions.clone();
|
|
18238
|
-
/**
|
|
18239
|
-
* Dimensions of the backplate
|
|
18315
|
+
* Origin in local coordinates (top left corner)
|
|
18240
18316
|
*/
|
|
18241
|
-
_this.
|
|
18317
|
+
_this.origin = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](0, 0, 0);
|
|
18318
|
+
_this._dimensions = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector2"](21.875, 12.5);
|
|
18319
|
+
_this._titleBarHeight = 0.625;
|
|
18320
|
+
_this._titleText = "";
|
|
18321
|
+
_this._contentScaleRatio = 1;
|
|
18242
18322
|
/**
|
|
18243
|
-
*
|
|
18323
|
+
* Minimum dimensions of the slate
|
|
18244
18324
|
*/
|
|
18245
|
-
_this.
|
|
18325
|
+
_this.minDimensions = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector2"](15.625, 6.25);
|
|
18246
18326
|
/**
|
|
18247
|
-
*
|
|
18327
|
+
* Default dimensions of the slate
|
|
18248
18328
|
*/
|
|
18249
|
-
_this.
|
|
18250
|
-
_this.
|
|
18251
|
-
_this._followButton =
|
|
18252
|
-
_this._closeButton = new
|
|
18253
|
-
_this._contentViewport = new
|
|
18254
|
-
_this._contentDragBehavior = new
|
|
18255
|
-
dragPlaneNormal: new
|
|
18329
|
+
_this.defaultDimensions = _this._dimensions.clone();
|
|
18330
|
+
_this._followButton = new _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__["TouchHolographicButton"]("followButton" + _this.name);
|
|
18331
|
+
_this._followButton.isToggleButton = true;
|
|
18332
|
+
_this._closeButton = new _touchHolographicButton__WEBPACK_IMPORTED_MODULE_2__["TouchHolographicButton"]("closeButton" + _this.name);
|
|
18333
|
+
_this._contentViewport = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Viewport"](0, 0, 1, 1);
|
|
18334
|
+
_this._contentDragBehavior = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["PointerDragBehavior"]({
|
|
18335
|
+
dragPlaneNormal: new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](0, 0, -1),
|
|
18256
18336
|
});
|
|
18257
18337
|
return _this;
|
|
18258
18338
|
}
|
|
@@ -18266,35 +18346,76 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18266
18346
|
enumerable: false,
|
|
18267
18347
|
configurable: true
|
|
18268
18348
|
});
|
|
18349
|
+
Object.defineProperty(HolographicSlate.prototype, "dimensions", {
|
|
18350
|
+
/**
|
|
18351
|
+
* 2D dimensions of the slate
|
|
18352
|
+
*/
|
|
18353
|
+
get: function () {
|
|
18354
|
+
return this._dimensions;
|
|
18355
|
+
},
|
|
18356
|
+
set: function (value) {
|
|
18357
|
+
//clamp, respecting ratios
|
|
18358
|
+
var scale = 1.0;
|
|
18359
|
+
if (value.x < this.minDimensions.x || value.y < this.minDimensions.y) {
|
|
18360
|
+
var newRatio = value.x / value.y;
|
|
18361
|
+
var minRatio = this.minDimensions.x / this.minDimensions.y;
|
|
18362
|
+
if (minRatio > newRatio) {
|
|
18363
|
+
// We just need to make sure the x-val is greater than the min
|
|
18364
|
+
scale = this.minDimensions.x / value.x;
|
|
18365
|
+
}
|
|
18366
|
+
else {
|
|
18367
|
+
// We just need to make sure the y-val is greater than the min
|
|
18368
|
+
scale = this.minDimensions.y / value.y;
|
|
18369
|
+
}
|
|
18370
|
+
}
|
|
18371
|
+
this._dimensions.copyFrom(value).scaleInPlace(scale);
|
|
18372
|
+
this._updatePivot();
|
|
18373
|
+
this._positionElements();
|
|
18374
|
+
},
|
|
18375
|
+
enumerable: false,
|
|
18376
|
+
configurable: true
|
|
18377
|
+
});
|
|
18378
|
+
Object.defineProperty(HolographicSlate.prototype, "titleBarHeight", {
|
|
18379
|
+
/**
|
|
18380
|
+
* Height of the title bar component
|
|
18381
|
+
*/
|
|
18382
|
+
get: function () {
|
|
18383
|
+
return this._titleBarHeight;
|
|
18384
|
+
},
|
|
18385
|
+
set: function (value) {
|
|
18386
|
+
this._titleBarHeight = value;
|
|
18387
|
+
},
|
|
18388
|
+
enumerable: false,
|
|
18389
|
+
configurable: true
|
|
18390
|
+
});
|
|
18269
18391
|
Object.defineProperty(HolographicSlate.prototype, "renderingGroupId", {
|
|
18270
18392
|
get: function () {
|
|
18271
|
-
return this.
|
|
18393
|
+
return this._titleBar.renderingGroupId;
|
|
18272
18394
|
},
|
|
18273
18395
|
/**
|
|
18274
|
-
* Rendering ground id of all the
|
|
18396
|
+
* Rendering ground id of all the meshes
|
|
18275
18397
|
*/
|
|
18276
18398
|
set: function (id) {
|
|
18277
|
-
this.
|
|
18399
|
+
this._titleBar.renderingGroupId = id;
|
|
18400
|
+
this._titleBarTitle.renderingGroupId = id;
|
|
18278
18401
|
this._contentPlate.renderingGroupId = id;
|
|
18402
|
+
this._backPlate.renderingGroupId = id;
|
|
18279
18403
|
},
|
|
18280
18404
|
enumerable: false,
|
|
18281
18405
|
configurable: true
|
|
18282
18406
|
});
|
|
18283
|
-
Object.defineProperty(HolographicSlate.prototype, "
|
|
18284
|
-
/**
|
|
18285
|
-
* Gets or sets the image url for the button
|
|
18286
|
-
*/
|
|
18407
|
+
Object.defineProperty(HolographicSlate.prototype, "title", {
|
|
18287
18408
|
get: function () {
|
|
18288
|
-
return this.
|
|
18409
|
+
return this._titleText;
|
|
18289
18410
|
},
|
|
18290
|
-
|
|
18291
|
-
|
|
18292
|
-
|
|
18411
|
+
/**
|
|
18412
|
+
* The title text displayed at the top of the slate
|
|
18413
|
+
*/
|
|
18414
|
+
set: function (title) {
|
|
18415
|
+
this._titleText = title;
|
|
18416
|
+
if (this._titleTextComponent) {
|
|
18417
|
+
this._titleTextComponent.text = title;
|
|
18293
18418
|
}
|
|
18294
|
-
this._imageUrl = value;
|
|
18295
|
-
this._rebuildContent();
|
|
18296
|
-
this._resetContentPositionAndZoom();
|
|
18297
|
-
this._applyContentViewport();
|
|
18298
18419
|
},
|
|
18299
18420
|
enumerable: false,
|
|
18300
18421
|
configurable: true
|
|
@@ -18306,18 +18427,9 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18306
18427
|
*/
|
|
18307
18428
|
HolographicSlate.prototype._applyFacade = function (facadeTexture) {
|
|
18308
18429
|
this._contentMaterial.albedoTexture = facadeTexture;
|
|
18309
|
-
|
|
18310
|
-
|
|
18311
|
-
this.
|
|
18312
|
-
if (babylonjs_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__["DomManagement"].IsDocumentAvailable() && !!document.createElement) {
|
|
18313
|
-
if (this._imageUrl) {
|
|
18314
|
-
var image = new _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__["Image"]();
|
|
18315
|
-
image.source = this._imageUrl;
|
|
18316
|
-
if (this._contentPlate) {
|
|
18317
|
-
this.content = image;
|
|
18318
|
-
}
|
|
18319
|
-
}
|
|
18320
|
-
}
|
|
18430
|
+
this._resetContentPositionAndZoom();
|
|
18431
|
+
this._applyContentViewport();
|
|
18432
|
+
facadeTexture.attachToMesh(this._contentPlate, true);
|
|
18321
18433
|
};
|
|
18322
18434
|
HolographicSlate.prototype._addControl = function (control) {
|
|
18323
18435
|
control._host = this._host;
|
|
@@ -18332,36 +18444,45 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18332
18444
|
* @hidden
|
|
18333
18445
|
*/
|
|
18334
18446
|
HolographicSlate.prototype._positionElements = function () {
|
|
18335
|
-
var
|
|
18336
|
-
var
|
|
18337
|
-
var
|
|
18447
|
+
var followButton = this._followButton;
|
|
18448
|
+
var closeButton = this._closeButton;
|
|
18449
|
+
var titleBar = this._titleBar;
|
|
18450
|
+
var titleBarTitle = this._titleBarTitle;
|
|
18338
18451
|
var contentPlate = this._contentPlate;
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
followButtonMesh.scaling.setAll(backPlateYScale);
|
|
18346
|
-
closeButtonMesh.position
|
|
18347
|
-
.copyFromFloats(this.backplateDimensions.x - backPlateYScale / 2, -this.backplateDimensions.y / 2, (-this.backplateDimensions.z / 2) * (this._host.scene.useRightHandedSystem ? -1 : 1))
|
|
18452
|
+
var backPlate = this._backPlate;
|
|
18453
|
+
if (followButton && closeButton && titleBar) {
|
|
18454
|
+
closeButton.scaling.setAll(this.titleBarHeight);
|
|
18455
|
+
followButton.scaling.setAll(this.titleBarHeight);
|
|
18456
|
+
closeButton.position
|
|
18457
|
+
.copyFromFloats(this.dimensions.x - this.titleBarHeight / 2, -this.titleBarHeight / 2, 0)
|
|
18348
18458
|
.addInPlace(this.origin);
|
|
18349
|
-
|
|
18350
|
-
.copyFromFloats(this.
|
|
18459
|
+
followButton.position
|
|
18460
|
+
.copyFromFloats(this.dimensions.x - (3 * this.titleBarHeight) / 2, -this.titleBarHeight / 2, 0)
|
|
18351
18461
|
.addInPlace(this.origin);
|
|
18352
|
-
var contentPlateHeight = this.dimensions.y - this.
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
contentPlate.
|
|
18462
|
+
var contentPlateHeight = this.dimensions.y - this.titleBarHeight - this.titleBarMargin;
|
|
18463
|
+
var rightHandScene = contentPlate.getScene().useRightHandedSystem;
|
|
18464
|
+
titleBar.scaling.set(this.dimensions.x, this.titleBarHeight, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18465
|
+
titleBarTitle.scaling.set(this.dimensions.x - (2 * this.titleBarHeight), this.titleBarHeight, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18466
|
+
contentPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18467
|
+
backPlate.scaling.copyFromFloats(this.dimensions.x, contentPlateHeight, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18468
|
+
titleBar.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight / 2), 0).addInPlace(this.origin);
|
|
18469
|
+
titleBarTitle.position.copyFromFloats((this.dimensions.x / 2) - this.titleBarHeight, -(this.titleBarHeight / 2), rightHandScene ? babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"] : -babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]).addInPlace(this.origin);
|
|
18470
|
+
contentPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), 0).addInPlace(this.origin);
|
|
18471
|
+
backPlate.position.copyFromFloats(this.dimensions.x / 2, -(this.titleBarHeight + this.titleBarMargin + contentPlateHeight / 2), rightHandScene ? -babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"] : babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]).addInPlace(this.origin);
|
|
18472
|
+
// Update the title's AdvancedDynamicTexture scale to avoid visual stretching
|
|
18473
|
+
this._titleTextComponent.host.scaleTo(HolographicSlate.DEFAULT_TEXT_RESOLUTION_Y * titleBarTitle.scaling.x / titleBarTitle.scaling.y, HolographicSlate.DEFAULT_TEXT_RESOLUTION_Y);
|
|
18357
18474
|
var aspectRatio = this.dimensions.x / contentPlateHeight;
|
|
18358
18475
|
this._contentViewport.width = this._contentScaleRatio;
|
|
18359
18476
|
this._contentViewport.height = this._contentScaleRatio / aspectRatio;
|
|
18360
18477
|
this._applyContentViewport();
|
|
18478
|
+
if (this._gizmo) {
|
|
18479
|
+
this._gizmo.updateBoundingBox();
|
|
18480
|
+
}
|
|
18361
18481
|
}
|
|
18362
18482
|
};
|
|
18363
18483
|
HolographicSlate.prototype._applyContentViewport = function () {
|
|
18364
|
-
|
|
18484
|
+
var _a;
|
|
18485
|
+
if (((_a = this._contentPlate) === null || _a === void 0 ? void 0 : _a.material) && this._contentPlate.material.albedoTexture) {
|
|
18365
18486
|
var tex = this._contentPlate.material.albedoTexture;
|
|
18366
18487
|
tex.uScale = this._contentScaleRatio;
|
|
18367
18488
|
tex.vScale = (this._contentScaleRatio / this._contentViewport.width) * this._contentViewport.height;
|
|
@@ -18382,45 +18503,61 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18382
18503
|
return;
|
|
18383
18504
|
}
|
|
18384
18505
|
// Update pivot point so it is at the center of geometry
|
|
18385
|
-
var center = this.dimensions.scale(0.5);
|
|
18386
18506
|
// As origin is topleft corner in 2D, dimensions are calculated towards bottom right corner, thus y axis is downwards
|
|
18387
|
-
center.y
|
|
18507
|
+
var center = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](this.dimensions.x * 0.5, -this.dimensions.y * 0.5, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18388
18508
|
center.addInPlace(this.origin);
|
|
18389
18509
|
center.z = 0;
|
|
18390
|
-
var origin = new
|
|
18391
|
-
|
|
18510
|
+
var origin = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](0, 0, 0);
|
|
18511
|
+
babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformCoordinatesToRef(origin, this.mesh.computeWorldMatrix(true), origin);
|
|
18392
18512
|
this.mesh.setPivotPoint(center);
|
|
18393
|
-
var origin2 = new
|
|
18394
|
-
|
|
18513
|
+
var origin2 = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](0, 0, 0);
|
|
18514
|
+
babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformCoordinatesToRef(origin2, this.mesh.computeWorldMatrix(true), origin2);
|
|
18395
18515
|
this.mesh.position.addInPlace(origin).subtractInPlace(origin2);
|
|
18396
18516
|
};
|
|
18397
18517
|
// Mesh association
|
|
18398
18518
|
HolographicSlate.prototype._createNode = function (scene) {
|
|
18399
18519
|
var _this = this;
|
|
18400
|
-
var node = new
|
|
18401
|
-
this.
|
|
18402
|
-
|
|
18520
|
+
var node = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Mesh"]("slate_" + this.name, scene);
|
|
18521
|
+
this._titleBar = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreateBox"])("titleBar_" + this.name, { size: 1 }, scene);
|
|
18522
|
+
this._titleBarTitle = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreatePlane"])("titleText_" + this.name, { size: 1 }, scene);
|
|
18523
|
+
this._titleBarTitle.parent = node;
|
|
18524
|
+
this._titleBarTitle.isPickable = false;
|
|
18525
|
+
var adt = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__["AdvancedDynamicTexture"].CreateForMesh(this._titleBarTitle);
|
|
18526
|
+
this._titleTextComponent = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__["TextBlock"]("titleText_" + this.name, this._titleText);
|
|
18527
|
+
this._titleTextComponent.textWrapping = _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_5__["TextWrapping"].Ellipsis;
|
|
18528
|
+
this._titleTextComponent.textHorizontalAlignment = _2D_controls_control__WEBPACK_IMPORTED_MODULE_4__["Control"].HORIZONTAL_ALIGNMENT_LEFT;
|
|
18529
|
+
this._titleTextComponent.color = "white";
|
|
18530
|
+
this._titleTextComponent.fontSize = HolographicSlate.DEFAULT_TEXT_RESOLUTION_Y / 2;
|
|
18531
|
+
this._titleTextComponent.paddingLeft = HolographicSlate.DEFAULT_TEXT_RESOLUTION_Y / 4;
|
|
18532
|
+
adt.addControl(this._titleTextComponent);
|
|
18403
18533
|
if (scene.useRightHandedSystem) {
|
|
18404
|
-
faceUV[
|
|
18534
|
+
var faceUV = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector4"](0, 0, 1, 1);
|
|
18535
|
+
this._contentPlate = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreatePlane"])("contentPlate_" + this.name, { size: 1, sideOrientation: babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["VertexData"].BACKSIDE, frontUVs: faceUV }, scene);
|
|
18536
|
+
this._backPlate = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreatePlane"])("backPlate_" + this.name, { size: 1, sideOrientation: babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["VertexData"].FRONTSIDE }, scene);
|
|
18405
18537
|
}
|
|
18406
|
-
|
|
18407
|
-
|
|
18408
|
-
|
|
18538
|
+
else {
|
|
18539
|
+
var faceUV = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector4"](0, 0, 1, 1);
|
|
18540
|
+
this._contentPlate = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreatePlane"])("contentPlate_" + this.name, { size: 1, sideOrientation: babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["VertexData"].FRONTSIDE, frontUVs: faceUV }, scene);
|
|
18541
|
+
this._backPlate = Object(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["CreatePlane"])("backPlate_" + this.name, { size: 1, sideOrientation: babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["VertexData"].BACKSIDE }, scene);
|
|
18542
|
+
}
|
|
18543
|
+
this._titleBar.parent = node;
|
|
18544
|
+
this._titleBar.isNearGrabbable = true;
|
|
18409
18545
|
this._contentPlate.parent = node;
|
|
18546
|
+
this._backPlate.parent = node;
|
|
18410
18547
|
this._attachContentPlateBehavior();
|
|
18411
18548
|
this._addControl(this._followButton);
|
|
18412
18549
|
this._addControl(this._closeButton);
|
|
18413
|
-
var
|
|
18414
|
-
var
|
|
18415
|
-
|
|
18416
|
-
|
|
18550
|
+
var followButton = this._followButton;
|
|
18551
|
+
var closeButton = this._closeButton;
|
|
18552
|
+
followButton.node.parent = node;
|
|
18553
|
+
closeButton.node.parent = node;
|
|
18417
18554
|
this._positionElements();
|
|
18418
18555
|
this._followButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.FOLLOW_ICON_FILENAME;
|
|
18419
18556
|
this._closeButton.imageUrl = HolographicSlate.ASSETS_BASE_URL + HolographicSlate.CLOSE_ICON_FILENAME;
|
|
18420
18557
|
this._followButton.isBackplateVisible = false;
|
|
18421
18558
|
this._closeButton.isBackplateVisible = false;
|
|
18422
|
-
this._followButton.
|
|
18423
|
-
_this._defaultBehavior.followBehaviorEnabled =
|
|
18559
|
+
this._followButton.onToggleObservable.add(function (isToggled) {
|
|
18560
|
+
_this._defaultBehavior.followBehaviorEnabled = isToggled;
|
|
18424
18561
|
if (_this._defaultBehavior.followBehaviorEnabled) {
|
|
18425
18562
|
_this._defaultBehavior.followBehavior.recenter();
|
|
18426
18563
|
}
|
|
@@ -18428,7 +18565,7 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18428
18565
|
this._closeButton.onPointerClickObservable.add(function () {
|
|
18429
18566
|
_this.dispose();
|
|
18430
18567
|
});
|
|
18431
|
-
node.rotationQuaternion =
|
|
18568
|
+
node.rotationQuaternion = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Quaternion"].Identity();
|
|
18432
18569
|
node.isVisible = false;
|
|
18433
18570
|
return node;
|
|
18434
18571
|
};
|
|
@@ -18438,11 +18575,11 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18438
18575
|
this._contentDragBehavior.moveAttached = false;
|
|
18439
18576
|
this._contentDragBehavior.useObjectOrientationForDragging = true;
|
|
18440
18577
|
this._contentDragBehavior.updateDragPlane = false;
|
|
18441
|
-
var origin = new
|
|
18442
|
-
var worldDimensions = new
|
|
18443
|
-
var upWorld = new
|
|
18444
|
-
var rightWorld = new
|
|
18445
|
-
var projectedOffset = new
|
|
18578
|
+
var origin = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"]();
|
|
18579
|
+
var worldDimensions = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"]();
|
|
18580
|
+
var upWorld = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"]();
|
|
18581
|
+
var rightWorld = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"]();
|
|
18582
|
+
var projectedOffset = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector2"]();
|
|
18446
18583
|
var startViewport;
|
|
18447
18584
|
var worldMatrix;
|
|
18448
18585
|
this._contentDragBehavior.onDragStartObservable.add(function (event) {
|
|
@@ -18452,65 +18589,67 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18452
18589
|
startViewport = _this._contentViewport.clone();
|
|
18453
18590
|
worldMatrix = _this.node.computeWorldMatrix(true);
|
|
18454
18591
|
origin.copyFrom(event.dragPlanePoint);
|
|
18455
|
-
worldDimensions.
|
|
18456
|
-
worldDimensions.y -= _this.
|
|
18457
|
-
|
|
18592
|
+
worldDimensions.set(_this.dimensions.x, _this.dimensions.y, babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"]);
|
|
18593
|
+
worldDimensions.y -= _this.titleBarHeight + _this.titleBarMargin;
|
|
18594
|
+
babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformNormalToRef(worldDimensions, worldMatrix, worldDimensions);
|
|
18458
18595
|
upWorld.copyFromFloats(0, 1, 0);
|
|
18459
|
-
|
|
18596
|
+
babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformNormalToRef(upWorld, worldMatrix, upWorld);
|
|
18460
18597
|
rightWorld.copyFromFloats(1, 0, 0);
|
|
18461
|
-
|
|
18598
|
+
babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformNormalToRef(rightWorld, worldMatrix, rightWorld);
|
|
18462
18599
|
upWorld.normalize();
|
|
18463
|
-
upWorld.scaleInPlace(1 /
|
|
18600
|
+
upWorld.scaleInPlace(1 / babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].Dot(upWorld, worldDimensions));
|
|
18464
18601
|
rightWorld.normalize();
|
|
18465
|
-
rightWorld.scaleInPlace(1 /
|
|
18602
|
+
rightWorld.scaleInPlace(1 / babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].Dot(rightWorld, worldDimensions));
|
|
18466
18603
|
});
|
|
18467
|
-
var offset = new
|
|
18604
|
+
var offset = new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"]();
|
|
18468
18605
|
this._contentDragBehavior.onDragObservable.add(function (event) {
|
|
18469
18606
|
offset.copyFrom(event.dragPlanePoint);
|
|
18470
18607
|
offset.subtractInPlace(origin);
|
|
18471
|
-
projectedOffset.copyFromFloats(
|
|
18608
|
+
projectedOffset.copyFromFloats(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].Dot(offset, rightWorld), babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].Dot(offset, upWorld));
|
|
18472
18609
|
// By default, content takes full width available and height is cropped to keep aspect ratio
|
|
18473
|
-
_this._contentViewport.x =
|
|
18474
|
-
_this._contentViewport.y =
|
|
18610
|
+
_this._contentViewport.x = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Scalar"].Clamp(startViewport.x - offset.x, 0, 1 - _this._contentViewport.width * _this._contentScaleRatio);
|
|
18611
|
+
_this._contentViewport.y = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Scalar"].Clamp(startViewport.y - offset.y, 0, 1 - _this._contentViewport.height * _this._contentScaleRatio);
|
|
18475
18612
|
_this._applyContentViewport();
|
|
18476
18613
|
});
|
|
18477
18614
|
};
|
|
18478
18615
|
HolographicSlate.prototype._affectMaterial = function (mesh) {
|
|
18479
18616
|
// TODO share materials
|
|
18480
|
-
this.
|
|
18481
|
-
this.
|
|
18482
|
-
// if (pickedPoint) {
|
|
18483
|
-
// this._backPlateMaterial. = pickedPoint;
|
|
18484
|
-
// this._backPlateMaterial.hoverColor.a = 1.0;
|
|
18485
|
-
// } else {
|
|
18486
|
-
// this._backPlateMaterial.hoverColor.a = 0;
|
|
18487
|
-
// }
|
|
18488
|
-
});
|
|
18489
|
-
this._contentMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__["FluentMaterial"](this.name + "contentMaterial", mesh.getScene());
|
|
18617
|
+
this._titleBarMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__["FluentBackplateMaterial"]("".concat(this.name, " plateMaterial"), mesh.getScene());
|
|
18618
|
+
this._contentMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_8__["FluentMaterial"]("".concat(this.name, " contentMaterial"), mesh.getScene());
|
|
18490
18619
|
this._contentMaterial.renderBorders = true;
|
|
18491
|
-
this.
|
|
18620
|
+
this._backMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_9__["FluentBackplateMaterial"]("".concat(this.name, " backPlate"), mesh.getScene());
|
|
18621
|
+
this._backMaterial.lineWidth = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Epsilon"];
|
|
18622
|
+
this._backMaterial.radius = 0.005;
|
|
18623
|
+
this._backMaterial.backFaceCulling = true;
|
|
18624
|
+
this._titleBar.material = this._titleBarMaterial;
|
|
18492
18625
|
this._contentPlate.material = this._contentMaterial;
|
|
18493
|
-
this.
|
|
18626
|
+
this._backPlate.material = this._backMaterial;
|
|
18627
|
+
this._resetContent();
|
|
18494
18628
|
this._applyContentViewport();
|
|
18495
18629
|
};
|
|
18496
18630
|
/** @hidden **/
|
|
18497
18631
|
HolographicSlate.prototype._prepareNode = function (scene) {
|
|
18498
18632
|
var _this = this;
|
|
18499
18633
|
_super.prototype._prepareNode.call(this, scene);
|
|
18500
|
-
this._gizmo = new
|
|
18634
|
+
this._gizmo = new _gizmos_slateGizmo__WEBPACK_IMPORTED_MODULE_7__["SlateGizmo"](this._host.utilityLayer);
|
|
18501
18635
|
this._gizmo.attachedSlate = this;
|
|
18502
|
-
this._defaultBehavior = new
|
|
18503
|
-
this._defaultBehavior.attach(this.node, [this.
|
|
18636
|
+
this._defaultBehavior = new _behaviors_defaultBehavior__WEBPACK_IMPORTED_MODULE_6__["DefaultBehavior"]();
|
|
18637
|
+
this._defaultBehavior.attach(this.node, [this._titleBar]);
|
|
18638
|
+
this._defaultBehavior.sixDofDragBehavior.onDragStartObservable.add(function () {
|
|
18639
|
+
_this._followButton.isToggled = false;
|
|
18640
|
+
});
|
|
18504
18641
|
this._positionChangedObserver = this._defaultBehavior.sixDofDragBehavior.onPositionChangedObservable.add(function () {
|
|
18505
18642
|
_this._gizmo.updateBoundingBox();
|
|
18506
18643
|
});
|
|
18507
18644
|
this._updatePivot();
|
|
18508
|
-
this.resetDefaultAspectAndPose();
|
|
18645
|
+
this.resetDefaultAspectAndPose(false);
|
|
18509
18646
|
};
|
|
18510
18647
|
/**
|
|
18511
18648
|
* Resets the aspect and pose of the slate so it is right in front of the active camera, facing towards it.
|
|
18649
|
+
* @param resetAspect Should the slate's dimensions/aspect ratio be reset as well
|
|
18512
18650
|
*/
|
|
18513
|
-
HolographicSlate.prototype.resetDefaultAspectAndPose = function () {
|
|
18651
|
+
HolographicSlate.prototype.resetDefaultAspectAndPose = function (resetAspect) {
|
|
18652
|
+
if (resetAspect === void 0) { resetAspect = true; }
|
|
18514
18653
|
if (!this._host || !this._host.utilityLayer || !this.node) {
|
|
18515
18654
|
return;
|
|
18516
18655
|
}
|
|
@@ -18518,13 +18657,15 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18518
18657
|
var camera = scene.activeCamera;
|
|
18519
18658
|
if (camera) {
|
|
18520
18659
|
var worldMatrix = camera.getWorldMatrix();
|
|
18521
|
-
var backward =
|
|
18522
|
-
this.dimensions.copyFrom(this.defaultDimensions);
|
|
18660
|
+
var backward = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].TransformNormal(babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"].Backward(scene.useRightHandedSystem), worldMatrix);
|
|
18523
18661
|
this.origin.setAll(0);
|
|
18524
18662
|
this._gizmo.updateBoundingBox();
|
|
18525
18663
|
var pivot = this.node.getAbsolutePivotPoint();
|
|
18526
18664
|
this.node.position.copyFrom(camera.position).subtractInPlace(backward).subtractInPlace(pivot);
|
|
18527
|
-
this.node.rotationQuaternion =
|
|
18665
|
+
this.node.rotationQuaternion = babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Quaternion"].FromLookDirectionLH(backward, new babylonjs_Behaviors_Meshes_pointerDragBehavior__WEBPACK_IMPORTED_MODULE_10__["Vector3"](0, 1, 0));
|
|
18666
|
+
if (resetAspect) {
|
|
18667
|
+
this.dimensions = this.defaultDimensions;
|
|
18668
|
+
}
|
|
18528
18669
|
}
|
|
18529
18670
|
};
|
|
18530
18671
|
/**
|
|
@@ -18532,10 +18673,12 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18532
18673
|
*/
|
|
18533
18674
|
HolographicSlate.prototype.dispose = function () {
|
|
18534
18675
|
_super.prototype.dispose.call(this);
|
|
18535
|
-
this.
|
|
18676
|
+
this._titleBarMaterial.dispose();
|
|
18536
18677
|
this._contentMaterial.dispose();
|
|
18537
|
-
this.
|
|
18678
|
+
this._titleBar.dispose();
|
|
18679
|
+
this._titleBarTitle.dispose();
|
|
18538
18680
|
this._contentPlate.dispose();
|
|
18681
|
+
this._backPlate.dispose();
|
|
18539
18682
|
this._followButton.dispose();
|
|
18540
18683
|
this._closeButton.dispose();
|
|
18541
18684
|
this._host.onPickedPointChangedObservable.remove(this._pickedPointObserver);
|
|
@@ -18556,8 +18699,9 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18556
18699
|
* File name for the close icon.
|
|
18557
18700
|
*/
|
|
18558
18701
|
HolographicSlate.FOLLOW_ICON_FILENAME = "IconFollowMe.png";
|
|
18702
|
+
HolographicSlate.DEFAULT_TEXT_RESOLUTION_Y = 102.4;
|
|
18559
18703
|
return HolographicSlate;
|
|
18560
|
-
}(
|
|
18704
|
+
}(_contentDisplay3D__WEBPACK_IMPORTED_MODULE_1__["ContentDisplay3D"]));
|
|
18561
18705
|
|
|
18562
18706
|
|
|
18563
18707
|
|
|
@@ -18567,7 +18711,7 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18567
18711
|
/*!******************************!*\
|
|
18568
18712
|
!*** ./3D/controls/index.ts ***!
|
|
18569
18713
|
\******************************/
|
|
18570
|
-
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
18714
|
+
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu, VolumeBasedPanel, HolographicBackplate */
|
|
18571
18715
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
18572
18716
|
|
|
18573
18717
|
"use strict";
|
|
@@ -18629,14 +18773,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18629
18773
|
/* harmony import */ var _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./touchHolographicMenu */ "./3D/controls/touchHolographicMenu.ts");
|
|
18630
18774
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _touchHolographicMenu__WEBPACK_IMPORTED_MODULE_18__["TouchHolographicMenu"]; });
|
|
18631
18775
|
|
|
18632
|
-
/* harmony import */ var
|
|
18633
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
18634
|
-
|
|
18635
|
-
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
|
|
18636
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_20__["VolumeBasedPanel"]; });
|
|
18776
|
+
/* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
|
|
18777
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_19__["VolumeBasedPanel"]; });
|
|
18637
18778
|
|
|
18638
|
-
/* harmony import */ var
|
|
18639
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return
|
|
18779
|
+
/* harmony import */ var _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./holographicBackplate */ "./3D/controls/holographicBackplate.ts");
|
|
18780
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _holographicBackplate__WEBPACK_IMPORTED_MODULE_20__["HolographicBackplate"]; });
|
|
18640
18781
|
|
|
18641
18782
|
|
|
18642
18783
|
|
|
@@ -18657,7 +18798,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18657
18798
|
|
|
18658
18799
|
|
|
18659
18800
|
|
|
18660
|
-
|
|
18661
18801
|
|
|
18662
18802
|
|
|
18663
18803
|
|
|
@@ -18797,13 +18937,16 @@ var NearMenu = /** @class */ (function (_super) {
|
|
|
18797
18937
|
return this._isPinned;
|
|
18798
18938
|
},
|
|
18799
18939
|
set: function (value) {
|
|
18940
|
+
// Tell the pin button to toggle if this was called manually, for clean state control
|
|
18941
|
+
if (this._pinButton.isToggled !== value) {
|
|
18942
|
+
this._pinButton.isToggled = value;
|
|
18943
|
+
return;
|
|
18944
|
+
}
|
|
18800
18945
|
this._isPinned = value;
|
|
18801
|
-
if (
|
|
18802
|
-
this._pinMaterial.emissiveColor.copyFromFloats(0.25, 0.4, 0.95);
|
|
18946
|
+
if (value) {
|
|
18803
18947
|
this._defaultBehavior.followBehaviorEnabled = false;
|
|
18804
18948
|
}
|
|
18805
18949
|
else {
|
|
18806
|
-
this._pinMaterial.emissiveColor.copyFromFloats(0.08, 0.15, 0.55);
|
|
18807
18950
|
this._defaultBehavior.followBehaviorEnabled = true;
|
|
18808
18951
|
}
|
|
18809
18952
|
},
|
|
@@ -18816,12 +18959,11 @@ var NearMenu = /** @class */ (function (_super) {
|
|
|
18816
18959
|
control.imageUrl = NearMenu.ASSETS_BASE_URL + NearMenu.PIN_ICON_FILENAME;
|
|
18817
18960
|
control.parent = this;
|
|
18818
18961
|
control._host = this._host;
|
|
18819
|
-
control.
|
|
18962
|
+
control.isToggleButton = true;
|
|
18963
|
+
control.onToggleObservable.add(function (newState) { _this.isPinned = newState; });
|
|
18820
18964
|
if (this._host.utilityLayer) {
|
|
18821
18965
|
control._prepareNode(this._host.utilityLayer.utilityLayerScene);
|
|
18822
18966
|
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
18967
|
if (control.node) {
|
|
18826
18968
|
control.node.parent = parent;
|
|
18827
18969
|
}
|
|
@@ -19230,7 +19372,7 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19230
19372
|
// Mesh association
|
|
19231
19373
|
Slider3D.prototype._createNode = function (scene) {
|
|
19232
19374
|
var _this = this;
|
|
19233
|
-
var sliderBackplate = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
19375
|
+
var sliderBackplate = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_sliderbackplate"), {
|
|
19234
19376
|
width: 1.0,
|
|
19235
19377
|
height: 1.0,
|
|
19236
19378
|
depth: 1.0,
|
|
@@ -19241,12 +19383,12 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19241
19383
|
babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene)
|
|
19242
19384
|
.then(function (result) {
|
|
19243
19385
|
var sliderBackplateModel = result.meshes[1];
|
|
19244
|
-
var sliderBarModel = result.meshes[1].clone(_this.name
|
|
19245
|
-
var sliderThumbModel = result.meshes[1].clone(_this.name
|
|
19386
|
+
var sliderBarModel = result.meshes[1].clone("".concat(_this.name, "_sliderbar"), sliderBackplate);
|
|
19387
|
+
var sliderThumbModel = result.meshes[1].clone("".concat(_this.name, "_sliderthumb"), sliderBackplate);
|
|
19246
19388
|
sliderBackplateModel.visibility = 0;
|
|
19247
19389
|
if (_this._sliderBackplateVisible) {
|
|
19248
19390
|
sliderBackplateModel.visibility = 1;
|
|
19249
|
-
sliderBackplateModel.name = _this.name
|
|
19391
|
+
sliderBackplateModel.name = "".concat(_this.name, "_sliderbackplate");
|
|
19250
19392
|
sliderBackplateModel.isPickable = false;
|
|
19251
19393
|
sliderBackplateModel.scaling.x = 1;
|
|
19252
19394
|
sliderBackplateModel.scaling.z = 0.2;
|
|
@@ -19284,9 +19426,9 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19284
19426
|
};
|
|
19285
19427
|
Slider3D.prototype._affectMaterial = function (mesh) {
|
|
19286
19428
|
var _a, _b, _c;
|
|
19287
|
-
this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== void 0 ? _a : new _materials_mrdl_mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_5__["MRDLBackplateMaterial"](this.name
|
|
19288
|
-
this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== void 0 ? _b : new _materials_mrdl_mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_3__["MRDLSliderBarMaterial"](this.name
|
|
19289
|
-
this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== void 0 ? _c : new _materials_mrdl_mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_4__["MRDLSliderThumbMaterial"](this.name
|
|
19429
|
+
this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== void 0 ? _a : new _materials_mrdl_mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_5__["MRDLBackplateMaterial"]("".concat(this.name, "_sliderbackplate_material"), mesh.getScene());
|
|
19430
|
+
this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== void 0 ? _b : new _materials_mrdl_mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_3__["MRDLSliderBarMaterial"]("".concat(this.name, "_sliderbar_material"), mesh.getScene());
|
|
19431
|
+
this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== void 0 ? _c : new _materials_mrdl_mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_4__["MRDLSliderThumbMaterial"]("".concat(this.name, "_sliderthumb_material"), mesh.getScene());
|
|
19290
19432
|
};
|
|
19291
19433
|
Slider3D.prototype._createBehavior = function () {
|
|
19292
19434
|
var _this = this;
|
|
@@ -19570,6 +19712,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19570
19712
|
|
|
19571
19713
|
|
|
19572
19714
|
|
|
19715
|
+
|
|
19573
19716
|
/**
|
|
19574
19717
|
* Class used to create a touchable button in 3D
|
|
19575
19718
|
*/
|
|
@@ -19583,12 +19726,30 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19583
19726
|
function TouchButton3D(name, collisionMesh) {
|
|
19584
19727
|
var _this = _super.call(this, name) || this;
|
|
19585
19728
|
_this._isNearPressed = false;
|
|
19729
|
+
_this._interactionSurfaceHeight = 0;
|
|
19730
|
+
_this._isToggleButton = false;
|
|
19731
|
+
_this._toggleState = false;
|
|
19732
|
+
_this._toggleButtonCallback = function () { _this._onToggle(!_this._toggleState); };
|
|
19733
|
+
/**
|
|
19734
|
+
* An event triggered when the button is toggled. Only fired if 'isToggleButton' is true
|
|
19735
|
+
*/
|
|
19736
|
+
_this.onToggleObservable = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Observable"]();
|
|
19586
19737
|
_this.collidableFrontDirection = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
19587
19738
|
if (collisionMesh) {
|
|
19588
19739
|
_this.collisionMesh = collisionMesh;
|
|
19589
19740
|
}
|
|
19590
19741
|
return _this;
|
|
19591
19742
|
}
|
|
19743
|
+
Object.defineProperty(TouchButton3D.prototype, "isActiveNearInteraction", {
|
|
19744
|
+
/**
|
|
19745
|
+
* Whether the current interaction is caused by near interaction or not
|
|
19746
|
+
*/
|
|
19747
|
+
get: function () {
|
|
19748
|
+
return this._isNearPressed;
|
|
19749
|
+
},
|
|
19750
|
+
enumerable: false,
|
|
19751
|
+
configurable: true
|
|
19752
|
+
});
|
|
19592
19753
|
Object.defineProperty(TouchButton3D.prototype, "collidableFrontDirection", {
|
|
19593
19754
|
/**
|
|
19594
19755
|
* Returns the front-facing direction of the button, or Vector3.Zero if there is no 'front'
|
|
@@ -19625,25 +19786,97 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19625
19786
|
* @param collisionMesh the new collision mesh for the button
|
|
19626
19787
|
*/
|
|
19627
19788
|
set: function (collisionMesh) {
|
|
19789
|
+
var _this = this;
|
|
19790
|
+
var _a;
|
|
19791
|
+
// Remove the GUI3DManager's data from the previous collision mesh's reserved data store, and reset interactability
|
|
19628
19792
|
if (this._collisionMesh) {
|
|
19629
|
-
this._collisionMesh.
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
|
|
19793
|
+
this._collisionMesh.isNearPickable = false;
|
|
19794
|
+
if ((_a = this._collisionMesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) {
|
|
19795
|
+
this._collisionMesh.reservedDataStore.GUI3D = {};
|
|
19796
|
+
}
|
|
19797
|
+
this._collisionMesh.getChildMeshes().forEach(function (mesh) {
|
|
19798
|
+
var _a;
|
|
19799
|
+
mesh.isNearPickable = false;
|
|
19800
|
+
if ((_a = mesh.reservedDataStore) === null || _a === void 0 ? void 0 : _a.GUI3D) {
|
|
19801
|
+
mesh.reservedDataStore.GUI3D = {};
|
|
19802
|
+
}
|
|
19803
|
+
});
|
|
19634
19804
|
}
|
|
19635
19805
|
this._collisionMesh = collisionMesh;
|
|
19636
19806
|
this._injectGUI3DReservedDataStore(this._collisionMesh).control = this;
|
|
19637
19807
|
this._collisionMesh.isNearPickable = true;
|
|
19808
|
+
this._collisionMesh.getChildMeshes().forEach(function (mesh) {
|
|
19809
|
+
_this._injectGUI3DReservedDataStore(mesh).control = _this;
|
|
19810
|
+
mesh.isNearPickable = true;
|
|
19811
|
+
});
|
|
19638
19812
|
this.collidableFrontDirection = collisionMesh.forward;
|
|
19639
19813
|
},
|
|
19640
19814
|
enumerable: false,
|
|
19641
19815
|
configurable: true
|
|
19642
19816
|
});
|
|
19817
|
+
Object.defineProperty(TouchButton3D.prototype, "isToggleButton", {
|
|
19818
|
+
get: function () {
|
|
19819
|
+
return this._isToggleButton;
|
|
19820
|
+
},
|
|
19821
|
+
/**
|
|
19822
|
+
* Setter for if this TouchButton3D should be treated as a toggle button
|
|
19823
|
+
* @param value If this TouchHolographicButton should act like a toggle button
|
|
19824
|
+
*/
|
|
19825
|
+
set: function (value) {
|
|
19826
|
+
if (value === this._isToggleButton) {
|
|
19827
|
+
return;
|
|
19828
|
+
}
|
|
19829
|
+
this._isToggleButton = value;
|
|
19830
|
+
if (value) {
|
|
19831
|
+
this.onPointerUpObservable.add(this._toggleButtonCallback);
|
|
19832
|
+
}
|
|
19833
|
+
else {
|
|
19834
|
+
this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
|
|
19835
|
+
// Safety check, reset the button if it's toggled on but no longer a toggle button
|
|
19836
|
+
if (this._toggleState) {
|
|
19837
|
+
this._onToggle(false);
|
|
19838
|
+
}
|
|
19839
|
+
}
|
|
19840
|
+
},
|
|
19841
|
+
enumerable: false,
|
|
19842
|
+
configurable: true
|
|
19843
|
+
});
|
|
19844
|
+
Object.defineProperty(TouchButton3D.prototype, "isToggled", {
|
|
19845
|
+
get: function () {
|
|
19846
|
+
return this._toggleState;
|
|
19847
|
+
},
|
|
19848
|
+
/**
|
|
19849
|
+
* A public entrypoint to set the toggle state of the TouchHolographicButton. Only works if 'isToggleButton' is true
|
|
19850
|
+
* @param newState The new state to set the TouchHolographicButton's toggle state to
|
|
19851
|
+
*/
|
|
19852
|
+
set: function (newState) {
|
|
19853
|
+
if (this._isToggleButton && this._toggleState !== newState) {
|
|
19854
|
+
this._onToggle(newState);
|
|
19855
|
+
}
|
|
19856
|
+
},
|
|
19857
|
+
enumerable: false,
|
|
19858
|
+
configurable: true
|
|
19859
|
+
});
|
|
19860
|
+
TouchButton3D.prototype._onToggle = function (newState) {
|
|
19861
|
+
this._toggleState = newState;
|
|
19862
|
+
this.onToggleObservable.notifyObservers(newState);
|
|
19863
|
+
};
|
|
19643
19864
|
// Returns true if the collidable is in front of the button, or if the button has no front direction
|
|
19644
19865
|
TouchButton3D.prototype._isInteractionInFrontOfButton = function (collidablePos) {
|
|
19645
19866
|
return this._getInteractionHeight(collidablePos, this._collisionMesh.getAbsolutePosition()) > 0;
|
|
19646
19867
|
};
|
|
19868
|
+
/**
|
|
19869
|
+
* Get the height of the touchPoint from the collidable part of the button
|
|
19870
|
+
* @param touchPoint the point to compare to the button, in absolute position
|
|
19871
|
+
* @returns the depth of the touch point into the front of the button
|
|
19872
|
+
*/
|
|
19873
|
+
TouchButton3D.prototype.getPressDepth = function (touchPoint) {
|
|
19874
|
+
if (!this._isNearPressed) {
|
|
19875
|
+
return 0;
|
|
19876
|
+
}
|
|
19877
|
+
var interactionHeight = this._getInteractionHeight(touchPoint, this._collisionMesh.getAbsolutePosition());
|
|
19878
|
+
return this._interactionSurfaceHeight - interactionHeight;
|
|
19879
|
+
};
|
|
19647
19880
|
// Returns true if the collidable is in front of the button, or if the button has no front direction
|
|
19648
19881
|
TouchButton3D.prototype._getInteractionHeight = function (interactionPos, basePos) {
|
|
19649
19882
|
var frontDir = this.collidableFrontDirection;
|
|
@@ -19664,6 +19897,7 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19664
19897
|
}
|
|
19665
19898
|
else {
|
|
19666
19899
|
this._isNearPressed = true;
|
|
19900
|
+
this._interactionSurfaceHeight = this._getInteractionHeight(nearMeshPosition, this._collisionMesh.getAbsolutePosition());
|
|
19667
19901
|
}
|
|
19668
19902
|
}
|
|
19669
19903
|
if (providedType === babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["PointerEventTypes"].POINTERUP) {
|
|
@@ -19689,6 +19923,9 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19689
19923
|
*/
|
|
19690
19924
|
TouchButton3D.prototype.dispose = function () {
|
|
19691
19925
|
_super.prototype.dispose.call(this);
|
|
19926
|
+
// Clean up toggle observables
|
|
19927
|
+
this.onPointerUpObservable.removeCallback(this._toggleButtonCallback);
|
|
19928
|
+
this.onToggleObservable.clear();
|
|
19692
19929
|
if (this._collisionMesh) {
|
|
19693
19930
|
this._collisionMesh.dispose();
|
|
19694
19931
|
}
|
|
@@ -19713,12 +19950,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19713
19950
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
19714
19951
|
/* harmony import */ var babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math.vector */ "babylonjs/Misc/observable");
|
|
19715
19952
|
/* 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
|
|
19953
|
+
/* harmony import */ var _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../materials/fluent/fluentMaterial */ "./3D/materials/fluent/fluentMaterial.ts");
|
|
19954
|
+
/* harmony import */ var _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluentButton/fluentButtonMaterial */ "./3D/materials/fluentButton/fluentButtonMaterial.ts");
|
|
19955
|
+
/* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "./2D/controls/stackPanel.ts");
|
|
19956
|
+
/* harmony import */ var _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../2D/controls/image */ "./2D/controls/image.ts");
|
|
19957
|
+
/* harmony import */ var _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../2D/controls/textBlock */ "./2D/controls/textBlock.ts");
|
|
19958
|
+
/* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "./2D/advancedDynamicTexture.ts");
|
|
19959
|
+
/* harmony import */ var _touchButton3D__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./touchButton3D */ "./3D/controls/touchButton3D.ts");
|
|
19960
|
+
|
|
19961
|
+
|
|
19722
19962
|
|
|
19723
19963
|
|
|
19724
19964
|
|
|
@@ -19753,6 +19993,8 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19753
19993
|
_this._isBackplateVisible = true;
|
|
19754
19994
|
_this._frontPlateDepth = 0.5;
|
|
19755
19995
|
_this._backPlateDepth = 0.04;
|
|
19996
|
+
_this._backplateColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.08, 0.15, 0.55);
|
|
19997
|
+
_this._backplateToggledColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.25, 0.4, 0.95);
|
|
19756
19998
|
_this._shareMaterials = shareMaterials;
|
|
19757
19999
|
_this.pointerEnterAnimation = function () {
|
|
19758
20000
|
_this._frontMaterial.leftBlobEnable = true;
|
|
@@ -19763,7 +20005,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19763
20005
|
_this._frontMaterial.rightBlobEnable = false;
|
|
19764
20006
|
};
|
|
19765
20007
|
_this.pointerDownAnimation = function () {
|
|
19766
|
-
if (_this._frontPlate && !_this.
|
|
20008
|
+
if (_this._frontPlate && !_this.isActiveNearInteraction) {
|
|
19767
20009
|
_this._frontPlate.scaling.z = _this._frontPlateDepth * 0.2;
|
|
19768
20010
|
_this._frontPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(_this._frontPlate._scene.useRightHandedSystem).scale((_this._frontPlateDepth - (0.2 * _this._frontPlateDepth)) / 2);
|
|
19769
20011
|
_this._textPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(_this._textPlate._scene.useRightHandedSystem).scale(-(_this._backPlateDepth + (0.2 * _this._frontPlateDepth)) / 2);
|
|
@@ -19777,10 +20019,10 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19777
20019
|
}
|
|
19778
20020
|
};
|
|
19779
20021
|
_this.onPointerMoveObservable.add(function (position) {
|
|
19780
|
-
if (_this._frontPlate && _this.
|
|
20022
|
+
if (_this._frontPlate && _this.isActiveNearInteraction) {
|
|
19781
20023
|
var scale = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Zero();
|
|
19782
20024
|
if (_this._backPlate.getWorldMatrix().decompose(scale, undefined, undefined)) {
|
|
19783
|
-
var interactionHeight = _this._getInteractionHeight(position, _this._backPlate.
|
|
20025
|
+
var interactionHeight = _this._getInteractionHeight(position, _this._backPlate.getAbsolutePosition()) / scale.z;
|
|
19784
20026
|
interactionHeight = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Scalar"].Clamp(interactionHeight - (_this._backPlateDepth / 2), 0.2 * _this._frontPlateDepth, _this._frontPlateDepth);
|
|
19785
20027
|
_this._frontPlate.scaling.z = interactionHeight;
|
|
19786
20028
|
_this._frontPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(_this._frontPlate._scene.useRightHandedSystem).scale((_this._frontPlateDepth - interactionHeight) / 2);
|
|
@@ -19825,6 +20067,16 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19825
20067
|
enumerable: false,
|
|
19826
20068
|
configurable: true
|
|
19827
20069
|
});
|
|
20070
|
+
Object.defineProperty(TouchHolographicButton.prototype, "mesh", {
|
|
20071
|
+
/**
|
|
20072
|
+
* Gets the mesh used to render this control
|
|
20073
|
+
*/
|
|
20074
|
+
get: function () {
|
|
20075
|
+
return this._backPlate;
|
|
20076
|
+
},
|
|
20077
|
+
enumerable: false,
|
|
20078
|
+
configurable: true
|
|
20079
|
+
});
|
|
19828
20080
|
Object.defineProperty(TouchHolographicButton.prototype, "tooltipText", {
|
|
19829
20081
|
get: function () {
|
|
19830
20082
|
if (this._tooltipTextBlock) {
|
|
@@ -19857,8 +20109,8 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19857
20109
|
this._tooltipMesh.isPickable = false;
|
|
19858
20110
|
this._tooltipMesh.parent = this._backPlate;
|
|
19859
20111
|
// Create text texture for the tooltip
|
|
19860
|
-
this._tooltipTexture =
|
|
19861
|
-
this._tooltipTextBlock = new
|
|
20112
|
+
this._tooltipTexture = _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_7__["AdvancedDynamicTexture"].CreateForMesh(this._tooltipMesh);
|
|
20113
|
+
this._tooltipTextBlock = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__["TextBlock"]();
|
|
19862
20114
|
this._tooltipTextBlock.scaleY = 3;
|
|
19863
20115
|
this._tooltipTextBlock.color = "white";
|
|
19864
20116
|
this._tooltipTextBlock.fontSize = 130;
|
|
@@ -19982,11 +20234,11 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19982
20234
|
};
|
|
19983
20235
|
TouchHolographicButton.prototype._rebuildContent = function () {
|
|
19984
20236
|
this._disposeFacadeTexture();
|
|
19985
|
-
var panel = new
|
|
20237
|
+
var panel = new _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__["StackPanel"]();
|
|
19986
20238
|
panel.isVertical = true;
|
|
19987
20239
|
if (babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["DomManagement"].IsDocumentAvailable() && !!document.createElement) {
|
|
19988
20240
|
if (this._imageUrl) {
|
|
19989
|
-
var image = new
|
|
20241
|
+
var image = new _2D_controls_image__WEBPACK_IMPORTED_MODULE_5__["Image"]();
|
|
19990
20242
|
image.source = this._imageUrl;
|
|
19991
20243
|
image.paddingTop = "40px";
|
|
19992
20244
|
image.height = "180px";
|
|
@@ -19996,7 +20248,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
19996
20248
|
}
|
|
19997
20249
|
}
|
|
19998
20250
|
if (this._text) {
|
|
19999
|
-
var text = new
|
|
20251
|
+
var text = new _2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_6__["TextBlock"]();
|
|
20000
20252
|
text.text = this._text;
|
|
20001
20253
|
text.color = "white";
|
|
20002
20254
|
text.height = "30px";
|
|
@@ -20010,7 +20262,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20010
20262
|
var _this = this;
|
|
20011
20263
|
var _a;
|
|
20012
20264
|
this.name = (_a = this.name) !== null && _a !== void 0 ? _a : "TouchHolographicButton";
|
|
20013
|
-
var collisionMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
20265
|
+
var collisionMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_collisionMesh"), {
|
|
20014
20266
|
width: 1.0,
|
|
20015
20267
|
height: 1.0,
|
|
20016
20268
|
depth: this._frontPlateDepth,
|
|
@@ -20021,32 +20273,43 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20021
20273
|
collisionMesh.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
|
|
20022
20274
|
babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, TouchHolographicButton.MODEL_BASE_URL, TouchHolographicButton.MODEL_FILENAME, scene)
|
|
20023
20275
|
.then(function (result) {
|
|
20276
|
+
var alphaMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("${this.name}_alphaMesh", {
|
|
20277
|
+
width: 1.0,
|
|
20278
|
+
height: 1.0,
|
|
20279
|
+
depth: 1.0,
|
|
20280
|
+
}, scene);
|
|
20281
|
+
alphaMesh.isPickable = false;
|
|
20282
|
+
alphaMesh.material = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("${this.name}_alphaMesh_material", scene);
|
|
20283
|
+
alphaMesh.material.alpha = 0.15;
|
|
20024
20284
|
var importedFrontPlate = result.meshes[1];
|
|
20025
|
-
importedFrontPlate.name = _this.name
|
|
20285
|
+
importedFrontPlate.name = "".concat(_this.name, "_frontPlate");
|
|
20026
20286
|
importedFrontPlate.isPickable = false;
|
|
20027
20287
|
importedFrontPlate.scaling.z = _this._frontPlateDepth;
|
|
20288
|
+
alphaMesh.parent = importedFrontPlate;
|
|
20028
20289
|
importedFrontPlate.parent = collisionMesh;
|
|
20029
20290
|
if (!!_this._frontMaterial) {
|
|
20030
20291
|
importedFrontPlate.material = _this._frontMaterial;
|
|
20031
20292
|
}
|
|
20032
20293
|
_this._frontPlate = importedFrontPlate;
|
|
20033
20294
|
});
|
|
20034
|
-
this._backPlate = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
20295
|
+
this._backPlate = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_backPlate"), {
|
|
20035
20296
|
width: 1.0,
|
|
20036
20297
|
height: 1.0,
|
|
20037
20298
|
depth: this._backPlateDepth,
|
|
20038
20299
|
}, scene);
|
|
20039
|
-
this._backPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(
|
|
20300
|
+
this._backPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(this._backPlateDepth / 2);
|
|
20040
20301
|
this._backPlate.isPickable = false;
|
|
20041
20302
|
this._textPlate = _super.prototype._createNode.call(this, scene);
|
|
20042
|
-
this._textPlate.name = this.name
|
|
20303
|
+
this._textPlate.name = "".concat(this.name, "_textPlate");
|
|
20043
20304
|
this._textPlate.isPickable = false;
|
|
20044
20305
|
this._textPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
|
|
20045
20306
|
this._backPlate.addChild(collisionMesh);
|
|
20046
20307
|
this._backPlate.addChild(this._textPlate);
|
|
20308
|
+
var tn = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["TransformNode"]("{this.name}_root", scene);
|
|
20309
|
+
this._backPlate.setParent(tn);
|
|
20047
20310
|
this.collisionMesh = collisionMesh;
|
|
20048
20311
|
this.collidableFrontDirection = this._backPlate.forward.negate(); // Mesh is facing the wrong way
|
|
20049
|
-
return
|
|
20312
|
+
return tn;
|
|
20050
20313
|
};
|
|
20051
20314
|
TouchHolographicButton.prototype._applyFacade = function (facadeTexture) {
|
|
20052
20315
|
this._plateMaterial.emissiveTexture = facadeTexture;
|
|
@@ -20054,16 +20317,29 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20054
20317
|
this._plateMaterial.diffuseColor = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"](0.4, 0.4, 0.4);
|
|
20055
20318
|
};
|
|
20056
20319
|
TouchHolographicButton.prototype._createBackMaterial = function (mesh) {
|
|
20057
|
-
this._backMaterial = new
|
|
20058
|
-
this._backMaterial.
|
|
20320
|
+
this._backMaterial = new _materials_fluent_fluentMaterial__WEBPACK_IMPORTED_MODULE_2__["FluentMaterial"](this.name + "backPlateMaterial", mesh.getScene());
|
|
20321
|
+
this._backMaterial.albedoColor = this._backplateColor;
|
|
20322
|
+
this._backMaterial.renderBorders = true;
|
|
20323
|
+
this._backMaterial.renderHoverLight = false;
|
|
20059
20324
|
};
|
|
20060
20325
|
TouchHolographicButton.prototype._createFrontMaterial = function (mesh) {
|
|
20061
|
-
this._frontMaterial = new
|
|
20326
|
+
this._frontMaterial = new _materials_fluentButton_fluentButtonMaterial__WEBPACK_IMPORTED_MODULE_3__["FluentButtonMaterial"](this.name + "Front Material", mesh.getScene());
|
|
20062
20327
|
};
|
|
20063
20328
|
TouchHolographicButton.prototype._createPlateMaterial = function (mesh) {
|
|
20064
20329
|
this._plateMaterial = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"](this.name + "Plate Material", mesh.getScene());
|
|
20065
20330
|
this._plateMaterial.specularColor = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
20066
20331
|
};
|
|
20332
|
+
TouchHolographicButton.prototype._onToggle = function (newState) {
|
|
20333
|
+
if (this._backMaterial) {
|
|
20334
|
+
if (newState) {
|
|
20335
|
+
this._backMaterial.albedoColor = this._backplateToggledColor;
|
|
20336
|
+
}
|
|
20337
|
+
else {
|
|
20338
|
+
this._backMaterial.albedoColor = this._backplateColor;
|
|
20339
|
+
}
|
|
20340
|
+
}
|
|
20341
|
+
_super.prototype._onToggle.call(this, newState);
|
|
20342
|
+
};
|
|
20067
20343
|
TouchHolographicButton.prototype._affectMaterial = function (mesh) {
|
|
20068
20344
|
if (this._shareMaterials) {
|
|
20069
20345
|
// Back
|
|
@@ -20124,7 +20400,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20124
20400
|
*/
|
|
20125
20401
|
TouchHolographicButton.MODEL_FILENAME = "mrtk-fluent-button.glb";
|
|
20126
20402
|
return TouchHolographicButton;
|
|
20127
|
-
}(
|
|
20403
|
+
}(_touchButton3D__WEBPACK_IMPORTED_MODULE_8__["TouchButton3D"]));
|
|
20128
20404
|
|
|
20129
20405
|
|
|
20130
20406
|
|
|
@@ -20188,7 +20464,7 @@ var TouchHolographicMenu = /** @class */ (function (_super) {
|
|
|
20188
20464
|
configurable: true
|
|
20189
20465
|
});
|
|
20190
20466
|
TouchHolographicMenu.prototype._createNode = function (scene) {
|
|
20191
|
-
var node = new babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["Mesh"]("menu_"
|
|
20467
|
+
var node = new babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["Mesh"]("menu_".concat(this.name), scene);
|
|
20192
20468
|
this._backPlate = Object(babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["CreateBox"])("backPlate" + this.name, { size: 1 }, scene);
|
|
20193
20469
|
this._backPlate.parent = node;
|
|
20194
20470
|
return node;
|
|
@@ -20373,83 +20649,6 @@ var TouchMeshButton3D = /** @class */ (function (_super) {
|
|
|
20373
20649
|
|
|
20374
20650
|
|
|
20375
20651
|
|
|
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/observable");
|
|
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
20652
|
/***/ }),
|
|
20454
20653
|
|
|
20455
20654
|
/***/ "./3D/controls/volumeBasedPanel.ts":
|
|
@@ -20921,6 +21120,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20921
21120
|
|
|
20922
21121
|
|
|
20923
21122
|
|
|
21123
|
+
|
|
20924
21124
|
/**
|
|
20925
21125
|
* Gizmo to resize 2D slates
|
|
20926
21126
|
*/
|
|
@@ -20944,6 +21144,7 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
20944
21144
|
* Value we use to offset handles from mesh
|
|
20945
21145
|
*/
|
|
20946
21146
|
_this._margin = 0.35;
|
|
21147
|
+
_this._handleSize = 0.075;
|
|
20947
21148
|
_this._attachedSlate = null;
|
|
20948
21149
|
_this._existingSlateScale = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
20949
21150
|
/**
|
|
@@ -20954,10 +21155,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
20954
21155
|
* The distance away from the object which the draggable meshes should appear world sized when fixedScreenSize is set to true (default: 10)
|
|
20955
21156
|
*/
|
|
20956
21157
|
_this.fixedScreenSizeDistanceFactor = 10;
|
|
20957
|
-
/**
|
|
20958
|
-
* Size of the handles (meters in XR)
|
|
20959
|
-
*/
|
|
20960
|
-
_this.handleSize = 0.01;
|
|
20961
21158
|
_this._createNode();
|
|
20962
21159
|
_this.updateScale = false;
|
|
20963
21160
|
_this._renderObserver = _this.gizmoLayer.originalScene.onBeforeRenderObservable.add(function () {
|
|
@@ -21028,7 +21225,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21028
21225
|
var corner = new _gizmoHandle__WEBPACK_IMPORTED_MODULE_2__["CornerHandle"](this, this.gizmoLayer.utilityLayerScene);
|
|
21029
21226
|
this._corners.push(corner);
|
|
21030
21227
|
corner.node.rotation.z = (Math.PI / 2) * i;
|
|
21031
|
-
corner.node.scaling.setAll(this.handleSize);
|
|
21032
21228
|
corner.node.parent = this._handlesParent;
|
|
21033
21229
|
this._assignDragBehaviorCorners(corner, function (originStart, dimensionsStart, offset, masks) { return _this._moveHandle(originStart, dimensionsStart, offset, masks, true); }, masksCorners[i]);
|
|
21034
21230
|
}
|
|
@@ -21036,7 +21232,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21036
21232
|
var side = new _gizmoHandle__WEBPACK_IMPORTED_MODULE_2__["SideHandle"](this, this.gizmoLayer.utilityLayerScene);
|
|
21037
21233
|
this._sides.push(side);
|
|
21038
21234
|
side.node.rotation.z = (Math.PI / 2) * i;
|
|
21039
|
-
side.node.scaling.copyFromFloats(this.handleSize, this.handleSize, this.handleSize);
|
|
21040
21235
|
side.node.parent = this._handlesParent;
|
|
21041
21236
|
this._assignDragBehaviorSides(side, i % 2 === 0 ? new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"](0, 1, 0) : new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"](1, 0, 0));
|
|
21042
21237
|
}
|
|
@@ -21083,8 +21278,7 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21083
21278
|
offsetOriginMasked.copyFrom(offset).multiplyInPlace(masks.origin);
|
|
21084
21279
|
offsetDimensionsMasked.copyFrom(offset).multiplyInPlace(masks.dimensions);
|
|
21085
21280
|
this._attachedSlate.origin.copyFrom(originStart).addInPlace(offsetOriginMasked);
|
|
21086
|
-
this._attachedSlate.dimensions.
|
|
21087
|
-
this._attachedSlate.backplateDimensions.x = this._attachedSlate.dimensions.x;
|
|
21281
|
+
this._attachedSlate.dimensions.set(dimensionsStart.x + offsetDimensionsMasked.x, dimensionsStart.y + offsetDimensionsMasked.y);
|
|
21088
21282
|
};
|
|
21089
21283
|
SlateGizmo.prototype._assignDragBehaviorCorners = function (handle, moveFn, masks) {
|
|
21090
21284
|
var _this = this;
|
|
@@ -21093,7 +21287,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21093
21287
|
var dragOrigin = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21094
21288
|
var toObjectFrame = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Matrix"]();
|
|
21095
21289
|
var dragPlaneNormal = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21096
|
-
var previousFollowState = false;
|
|
21097
21290
|
var projectToRef = function (position, normal, origin, ref) {
|
|
21098
21291
|
// Projects on the plane with its normal and origin
|
|
21099
21292
|
position.subtractToRef(origin, babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["TmpVectors"].Vector3[0]);
|
|
@@ -21104,13 +21297,12 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21104
21297
|
};
|
|
21105
21298
|
var dragStart = function (event) {
|
|
21106
21299
|
if (_this.attachedSlate && _this.attachedMesh) {
|
|
21107
|
-
dimensionsStart.
|
|
21300
|
+
dimensionsStart.set(_this.attachedSlate.dimensions.x, _this.attachedSlate.dimensions.y, babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Epsilon"]);
|
|
21108
21301
|
originStart.copyFrom(_this.attachedSlate.origin);
|
|
21109
21302
|
dragOrigin.copyFrom(event.position);
|
|
21110
21303
|
toObjectFrame.copyFrom(_this.attachedMesh.computeWorldMatrix(true));
|
|
21111
21304
|
toObjectFrame.invert();
|
|
21112
|
-
|
|
21113
|
-
_this.attachedSlate.defaultBehavior.followBehaviorEnabled = false;
|
|
21305
|
+
_this.attachedSlate._followButton.isToggled = false;
|
|
21114
21306
|
babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"].TransformNormalToRef(babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(), _this.attachedMesh.getWorldMatrix(), dragPlaneNormal);
|
|
21115
21307
|
dragPlaneNormal.normalize();
|
|
21116
21308
|
if (_this._handleHovered) {
|
|
@@ -21132,7 +21324,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21132
21324
|
var dragEnd = function () {
|
|
21133
21325
|
if (_this.attachedSlate && _this.attachedNode) {
|
|
21134
21326
|
_this.attachedSlate._updatePivot();
|
|
21135
|
-
_this.attachedSlate.defaultBehavior.followBehaviorEnabled = previousFollowState;
|
|
21136
21327
|
if (_this._handleDragged) {
|
|
21137
21328
|
_this._handleDragged.drag = false;
|
|
21138
21329
|
_this._handleDragged = null;
|
|
@@ -21147,16 +21338,14 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21147
21338
|
var dragOrigin = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21148
21339
|
var directionOrigin = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21149
21340
|
var worldPivot = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21150
|
-
var previousFollowState;
|
|
21151
21341
|
var worldPlaneNormal = new babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"]();
|
|
21152
21342
|
var dragStart = function (event) {
|
|
21153
21343
|
if (_this.attachedSlate && _this.attachedMesh) {
|
|
21154
21344
|
quaternionOrigin.copyFrom(_this.attachedMesh.rotationQuaternion);
|
|
21155
21345
|
dragOrigin.copyFrom(event.position);
|
|
21156
|
-
previousFollowState = _this.attachedSlate.defaultBehavior.followBehaviorEnabled;
|
|
21157
|
-
_this.attachedSlate.defaultBehavior.followBehaviorEnabled = false;
|
|
21158
21346
|
worldPivot.copyFrom(_this.attachedMesh.getAbsolutePivotPoint());
|
|
21159
21347
|
directionOrigin.copyFrom(dragOrigin).subtractInPlace(worldPivot).normalize();
|
|
21348
|
+
_this.attachedSlate._followButton.isToggled = false;
|
|
21160
21349
|
babylonjs_Gizmos_gizmo__WEBPACK_IMPORTED_MODULE_1__["Vector3"].TransformNormalToRef(dragPlaneNormal, _this.attachedMesh.getWorldMatrix(), worldPlaneNormal);
|
|
21161
21350
|
worldPlaneNormal.normalize();
|
|
21162
21351
|
if (_this._handleHovered) {
|
|
@@ -21178,7 +21367,6 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21178
21367
|
var dragEnd = function () {
|
|
21179
21368
|
if (_this.attachedSlate && _this.attachedNode) {
|
|
21180
21369
|
_this.attachedSlate._updatePivot();
|
|
21181
|
-
_this.attachedSlate.defaultBehavior.followBehaviorEnabled = previousFollowState;
|
|
21182
21370
|
if (_this._handleDragged) {
|
|
21183
21371
|
_this._handleDragged.drag = false;
|
|
21184
21372
|
_this._handleDragged = null;
|
|
@@ -21218,6 +21406,7 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21218
21406
|
this._boundingBoxGizmo.max = boundingMinMax.max;
|
|
21219
21407
|
// Update handles of the gizmo
|
|
21220
21408
|
this._updateHandlesPosition();
|
|
21409
|
+
this._updateHandlesScaling();
|
|
21221
21410
|
// Restore position/rotation values
|
|
21222
21411
|
this.attachedMesh.rotationQuaternion.copyFrom(this._tmpQuaternion);
|
|
21223
21412
|
this.attachedMesh.position.copyFrom(this._tmpVector);
|
|
@@ -21246,6 +21435,19 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21246
21435
|
this._sides[2].node.position.copyFromFloats(max.x, center.y, 0);
|
|
21247
21436
|
this._sides[3].node.position.copyFromFloats(center.x, max.y, 0);
|
|
21248
21437
|
};
|
|
21438
|
+
SlateGizmo.prototype._updateHandlesScaling = function () {
|
|
21439
|
+
if (this._attachedSlate && this._attachedSlate.mesh) {
|
|
21440
|
+
var scaledWidth = this._attachedSlate.mesh.scaling.x * this._attachedSlate.dimensions.x;
|
|
21441
|
+
var scaledHeight = this._attachedSlate.mesh.scaling.y * this._attachedSlate.dimensions.y;
|
|
21442
|
+
var scale = Math.min(scaledWidth, scaledHeight) * this._handleSize;
|
|
21443
|
+
for (var index = 0; index < this._corners.length; index++) {
|
|
21444
|
+
this._corners[index].node.scaling.setAll(scale);
|
|
21445
|
+
}
|
|
21446
|
+
for (var index = 0; index < this._sides.length; index++) {
|
|
21447
|
+
this._sides[index].node.scaling.setAll(scale);
|
|
21448
|
+
}
|
|
21449
|
+
}
|
|
21450
|
+
};
|
|
21249
21451
|
SlateGizmo.prototype._update = function () {
|
|
21250
21452
|
_super.prototype._update.call(this);
|
|
21251
21453
|
if (!this.gizmoLayer.utilityLayerScene.activeCamera) {
|
|
@@ -21254,10 +21456,13 @@ var SlateGizmo = /** @class */ (function (_super) {
|
|
|
21254
21456
|
if (this._attachedSlate && this._attachedSlate.mesh) {
|
|
21255
21457
|
if (this.fixedScreenSize) {
|
|
21256
21458
|
this._attachedSlate.mesh.absolutePosition.subtractToRef(this.gizmoLayer.utilityLayerScene.activeCamera.position, this._tmpVector);
|
|
21257
|
-
var distanceFromCamera = (this.
|
|
21459
|
+
var distanceFromCamera = (this._handleSize * this._tmpVector.length()) / this.fixedScreenSizeDistanceFactor;
|
|
21258
21460
|
for (var i = 0; i < this._corners.length; i++) {
|
|
21259
21461
|
this._corners[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
|
|
21260
21462
|
}
|
|
21463
|
+
for (var i = 0; i < this._sides.length; i++) {
|
|
21464
|
+
this._sides[i].node.scaling.set(distanceFromCamera, distanceFromCamera, distanceFromCamera);
|
|
21465
|
+
}
|
|
21261
21466
|
}
|
|
21262
21467
|
this._updateHandlesPosition();
|
|
21263
21468
|
}
|
|
@@ -21560,7 +21765,7 @@ var GUI3DManager = /** @class */ (function () {
|
|
|
21560
21765
|
/*!*********************!*\
|
|
21561
21766
|
!*** ./3D/index.ts ***!
|
|
21562
21767
|
\*********************/
|
|
21563
|
-
/*! exports provided: AbstractButton3D, Button3D, Container3D, Control3D, CylinderPanel, HolographicButton, HolographicSlate, HandMenu, MeshButton3D, NearMenu, PlanePanel, ScatterPanel, Slider3D, SpherePanel, StackPanel3D, TouchButton3D, TouchMeshButton3D, TouchHolographicButton, TouchHolographicMenu,
|
|
21768
|
+
/*! 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
21769
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
21565
21770
|
|
|
21566
21771
|
"use strict";
|
|
@@ -21604,8 +21809,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
21604
21809
|
|
|
21605
21810
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["TouchHolographicMenu"]; });
|
|
21606
21811
|
|
|
21607
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["TouchToggleButton3D"]; });
|
|
21608
|
-
|
|
21609
21812
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["VolumeBasedPanel"]; });
|
|
21610
21813
|
|
|
21611
21814
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _controls_index__WEBPACK_IMPORTED_MODULE_0__["HolographicBackplate"]; });
|
|
@@ -21742,7 +21945,7 @@ var FluentMaterial = /** @class */ (function (_super) {
|
|
|
21742
21945
|
/**
|
|
21743
21946
|
* Gets or sets the radius used to render the hover light (default is 1.0)
|
|
21744
21947
|
*/
|
|
21745
|
-
_this.hoverRadius =
|
|
21948
|
+
_this.hoverRadius = 0.01;
|
|
21746
21949
|
/**
|
|
21747
21950
|
* Gets or sets the color used to render the hover light (default is Color4(0.3, 0.3, 0.3, 1.0))
|
|
21748
21951
|
*/
|
|
@@ -21893,7 +22096,7 @@ var FluentMaterial = /** @class */ (function (_super) {
|
|
|
21893
22096
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentMaterial(name, _this.getScene()); }, this);
|
|
21894
22097
|
};
|
|
21895
22098
|
FluentMaterial.prototype.serialize = function () {
|
|
21896
|
-
var serializationObject =
|
|
22099
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
21897
22100
|
serializationObject.customType = "BABYLON.GUI.FluentMaterial";
|
|
21898
22101
|
return serializationObject;
|
|
21899
22102
|
};
|
|
@@ -22181,8 +22384,8 @@ var FluentBackplateMaterial = /** @class */ (function (_super) {
|
|
|
22181
22384
|
_this._globalRightIndexTipPosition4 = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"].Zero();
|
|
22182
22385
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
22183
22386
|
_this.backFaceCulling = false;
|
|
22184
|
-
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.BLOB_TEXTURE_URL,
|
|
22185
|
-
_this._iridescentMap = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.IM_TEXTURE_URL,
|
|
22387
|
+
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE);
|
|
22388
|
+
_this._iridescentMap = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.IM_TEXTURE_URL, _this.getScene(), true, false, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE);
|
|
22186
22389
|
return _this;
|
|
22187
22390
|
}
|
|
22188
22391
|
FluentBackplateMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -22374,7 +22577,7 @@ var FluentBackplateMaterial = /** @class */ (function (_super) {
|
|
|
22374
22577
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
|
|
22375
22578
|
};
|
|
22376
22579
|
FluentBackplateMaterial.prototype.serialize = function () {
|
|
22377
|
-
var serializationObject =
|
|
22580
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
22378
22581
|
serializationObject.customType = "BABYLON.FluentBackplateMaterial";
|
|
22379
22582
|
return serializationObject;
|
|
22380
22583
|
};
|
|
@@ -22735,7 +22938,7 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
22735
22938
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ADD;
|
|
22736
22939
|
_this.disableDepthWrite = true;
|
|
22737
22940
|
_this.backFaceCulling = false;
|
|
22738
|
-
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentButtonMaterial.BLOB_TEXTURE_URL,
|
|
22941
|
+
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentButtonMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE);
|
|
22739
22942
|
return _this;
|
|
22740
22943
|
}
|
|
22741
22944
|
FluentButtonMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -22956,7 +23159,7 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
22956
23159
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentButtonMaterial(name, _this.getScene()); }, this);
|
|
22957
23160
|
};
|
|
22958
23161
|
FluentButtonMaterial.prototype.serialize = function () {
|
|
22959
|
-
var serializationObject =
|
|
23162
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
22960
23163
|
serializationObject.customType = "BABYLON.FluentButtonMaterial";
|
|
22961
23164
|
return serializationObject;
|
|
22962
23165
|
};
|
|
@@ -23581,7 +23784,7 @@ var MRDLBackplateMaterial = /** @class */ (function (_super) {
|
|
|
23581
23784
|
_this.edgeLineGradientBlend = 0.5;
|
|
23582
23785
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
23583
23786
|
_this.backFaceCulling = false;
|
|
23584
|
-
_this._iridescentMapTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL,
|
|
23787
|
+
_this._iridescentMapTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL, _this.getScene(), true, false, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE);
|
|
23585
23788
|
return _this;
|
|
23586
23789
|
}
|
|
23587
23790
|
MRDLBackplateMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -23754,7 +23957,7 @@ var MRDLBackplateMaterial = /** @class */ (function (_super) {
|
|
|
23754
23957
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLBackplateMaterial(name, _this.getScene()); }, this);
|
|
23755
23958
|
};
|
|
23756
23959
|
MRDLBackplateMaterial.prototype.serialize = function () {
|
|
23757
|
-
var serializationObject =
|
|
23960
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
23758
23961
|
serializationObject.customType = "BABYLON.MRDLBackplateMaterial";
|
|
23759
23962
|
return serializationObject;
|
|
23760
23963
|
};
|
|
@@ -24196,7 +24399,7 @@ var MRDLSliderBarMaterial = /** @class */ (function (_super) {
|
|
|
24196
24399
|
_this.globalRightIndexMiddlePosition = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"](0.0, 0.0, 0.0, 1.0);
|
|
24197
24400
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
24198
24401
|
_this.backFaceCulling = false;
|
|
24199
|
-
_this._blueGradientTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL,
|
|
24402
|
+
_this._blueGradientTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL, _this.getScene(), true, false, babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"].NEAREST_SAMPLINGMODE);
|
|
24200
24403
|
return _this;
|
|
24201
24404
|
}
|
|
24202
24405
|
MRDLSliderBarMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -24439,7 +24642,7 @@ var MRDLSliderBarMaterial = /** @class */ (function (_super) {
|
|
|
24439
24642
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLSliderBarMaterial(name, _this.getScene()); }, this);
|
|
24440
24643
|
};
|
|
24441
24644
|
MRDLSliderBarMaterial.prototype.serialize = function () {
|
|
24442
|
-
var serializationObject =
|
|
24645
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
24443
24646
|
serializationObject.customType = "BABYLON.MRDLSliderBarMaterial";
|
|
24444
24647
|
return serializationObject;
|
|
24445
24648
|
};
|
|
@@ -25244,7 +25447,7 @@ var MRDLSliderThumbMaterial = /** @class */ (function (_super) {
|
|
|
25244
25447
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLSliderThumbMaterial(name, _this.getScene()); }, this);
|
|
25245
25448
|
};
|
|
25246
25449
|
MRDLSliderThumbMaterial.prototype.serialize = function () {
|
|
25247
|
-
var serializationObject =
|
|
25450
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
25248
25451
|
serializationObject.customType = "BABYLON.MRDLSliderThumbMaterial";
|
|
25249
25452
|
return serializationObject;
|
|
25250
25453
|
};
|
|
@@ -25632,7 +25835,7 @@ var Vector3WithInfo = /** @class */ (function (_super) {
|
|
|
25632
25835
|
/*!******************!*\
|
|
25633
25836
|
!*** ./index.ts ***!
|
|
25634
25837
|
\******************/
|
|
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,
|
|
25838
|
+
/*! 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
25839
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
25637
25840
|
|
|
25638
25841
|
"use strict";
|
|
@@ -25765,8 +25968,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25765
25968
|
|
|
25766
25969
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["TouchHolographicMenu"]; });
|
|
25767
25970
|
|
|
25768
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["TouchToggleButton3D"]; });
|
|
25769
|
-
|
|
25770
25971
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["VolumeBasedPanel"]; });
|
|
25771
25972
|
|
|
25772
25973
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _3D_index__WEBPACK_IMPORTED_MODULE_1__["HolographicBackplate"]; });
|
|
@@ -25811,7 +26012,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25811
26012
|
/*!**************************!*\
|
|
25812
26013
|
!*** ./legacy/legacy.ts ***!
|
|
25813
26014
|
\**************************/
|
|
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,
|
|
26015
|
+
/*! 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
26016
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
25816
26017
|
|
|
25817
26018
|
"use strict";
|
|
@@ -25943,8 +26144,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25943
26144
|
|
|
25944
26145
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchHolographicMenu", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TouchHolographicMenu"]; });
|
|
25945
26146
|
|
|
25946
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TouchToggleButton3D", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["TouchToggleButton3D"]; });
|
|
25947
|
-
|
|
25948
26147
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["VolumeBasedPanel"]; });
|
|
25949
26148
|
|
|
25950
26149
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HolographicBackplate", function() { return _index__WEBPACK_IMPORTED_MODULE_0__["HolographicBackplate"]; });
|