babylonjs-gui 5.0.0-beta.4 → 5.0.0-beta.8
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 +105 -59
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +1 -1
- package/babylon.gui.module.d.ts +40 -18
- package/package.json +2 -2
package/babylon.gui.js
CHANGED
|
@@ -1611,6 +1611,10 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1611
1611
|
if (typeof width === "number" && typeof height === "number" && width >= 0 && height >= 0) {
|
|
1612
1612
|
this.scaleTo(width, height);
|
|
1613
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
|
+
}
|
|
1614
1618
|
}
|
|
1615
1619
|
};
|
|
1616
1620
|
/**
|
|
@@ -1704,8 +1708,8 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1704
1708
|
if (onlyAlphaTesting === void 0) { onlyAlphaTesting = false; }
|
|
1705
1709
|
// use a unique ID in name so serialization will work even if you create two ADTs for a single mesh
|
|
1706
1710
|
var uniqueId = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["RandomGUID"])();
|
|
1707
|
-
var result = new AdvancedDynamicTexture("AdvancedDynamicTexture for "
|
|
1708
|
-
var material = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("AdvancedDynamicTextureMaterial for "
|
|
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());
|
|
1709
1713
|
material.backFaceCulling = false;
|
|
1710
1714
|
material.diffuseColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
1711
1715
|
material.specularColor = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Color3"].Black();
|
|
@@ -1773,6 +1777,23 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1773
1777
|
result.attach();
|
|
1774
1778
|
return result;
|
|
1775
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
|
+
};
|
|
1776
1797
|
/** Define the Uurl to load snippets */
|
|
1777
1798
|
AdvancedDynamicTexture.SnippetUrl = "https://snippet.babylonjs.com";
|
|
1778
1799
|
/** Indicates if some optimizations can be performed in GUI GPU management (the downside is additional memory/GPU texture memory used) */
|
|
@@ -2450,7 +2471,7 @@ var ColorPicker = /** @class */ (function (_super) {
|
|
|
2450
2471
|
};
|
|
2451
2472
|
ColorPicker.prototype._createColorWheelCanvas = function (radius, thickness) {
|
|
2452
2473
|
// Shoudl abstract platform instead of using LastCreatedEngine
|
|
2453
|
-
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
2474
|
+
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
2454
2475
|
if (!engine) {
|
|
2455
2476
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
2456
2477
|
}
|
|
@@ -4048,7 +4069,7 @@ var Container = /** @class */ (function (_super) {
|
|
|
4048
4069
|
rebuildCount++;
|
|
4049
4070
|
} while (this._rebuildLayout && rebuildCount < this.maxLayoutCycle);
|
|
4050
4071
|
if (rebuildCount >= 3 && this.logLayoutCycleErrors) {
|
|
4051
|
-
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, ")"));
|
|
4052
4073
|
}
|
|
4053
4074
|
context.restore();
|
|
4054
4075
|
if (this._isDirty) {
|
|
@@ -4118,7 +4139,10 @@ var Container = /** @class */ (function (_super) {
|
|
|
4118
4139
|
if (!this._isEnabled || !this.isVisible || this.notRenderable) {
|
|
4119
4140
|
return false;
|
|
4120
4141
|
}
|
|
4121
|
-
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) {
|
|
4122
4146
|
return false;
|
|
4123
4147
|
}
|
|
4124
4148
|
// Checking backwards to pick closest first
|
|
@@ -4131,6 +4155,9 @@ var Container = /** @class */ (function (_super) {
|
|
|
4131
4155
|
return true;
|
|
4132
4156
|
}
|
|
4133
4157
|
}
|
|
4158
|
+
if (!contains) {
|
|
4159
|
+
return false;
|
|
4160
|
+
}
|
|
4134
4161
|
if (!this.isHitTestVisible) {
|
|
4135
4162
|
return false;
|
|
4136
4163
|
}
|
|
@@ -5343,17 +5370,34 @@ var Control = /** @class */ (function () {
|
|
|
5343
5370
|
return this._isEnabled;
|
|
5344
5371
|
},
|
|
5345
5372
|
set: function (value) {
|
|
5373
|
+
var _this = this;
|
|
5346
5374
|
if (this._isEnabled === value) {
|
|
5347
5375
|
return;
|
|
5348
5376
|
}
|
|
5349
5377
|
this._isEnabled = value;
|
|
5350
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);
|
|
5351
5395
|
},
|
|
5352
5396
|
enumerable: false,
|
|
5353
5397
|
configurable: true
|
|
5354
5398
|
});
|
|
5355
5399
|
Object.defineProperty(Control.prototype, "disabledColor", {
|
|
5356
|
-
/** 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. */
|
|
5357
5401
|
get: function () {
|
|
5358
5402
|
return this._disabledColor;
|
|
5359
5403
|
},
|
|
@@ -5368,7 +5412,7 @@ var Control = /** @class */ (function () {
|
|
|
5368
5412
|
configurable: true
|
|
5369
5413
|
});
|
|
5370
5414
|
Object.defineProperty(Control.prototype, "disabledColorItem", {
|
|
5371
|
-
/** 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. */
|
|
5372
5416
|
get: function () {
|
|
5373
5417
|
return this._disabledColorItem;
|
|
5374
5418
|
},
|
|
@@ -5774,7 +5818,7 @@ var Control = /** @class */ (function () {
|
|
|
5774
5818
|
rebuildCount++;
|
|
5775
5819
|
} while (this._rebuildLayout && rebuildCount < 3);
|
|
5776
5820
|
if (rebuildCount >= 3) {
|
|
5777
|
-
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, ")"));
|
|
5778
5822
|
}
|
|
5779
5823
|
context.restore();
|
|
5780
5824
|
this.invalidateRect();
|
|
@@ -6321,7 +6365,7 @@ var Control = /** @class */ (function () {
|
|
|
6321
6365
|
if (Control._FontHeightSizes[font]) {
|
|
6322
6366
|
return Control._FontHeightSizes[font];
|
|
6323
6367
|
}
|
|
6324
|
-
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
6368
|
+
var engine = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["EngineStore"].LastCreatedEngine;
|
|
6325
6369
|
if (!engine) {
|
|
6326
6370
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
6327
6371
|
}
|
|
@@ -7171,7 +7215,7 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7171
7215
|
* @returns the list of controls
|
|
7172
7216
|
*/
|
|
7173
7217
|
Grid.prototype.getChildrenAt = function (row, column) {
|
|
7174
|
-
var cell = this._cells[row
|
|
7218
|
+
var cell = this._cells["".concat(row, ":").concat(column)];
|
|
7175
7219
|
if (!cell) {
|
|
7176
7220
|
return null;
|
|
7177
7221
|
}
|
|
@@ -7220,14 +7264,14 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7220
7264
|
return this;
|
|
7221
7265
|
}
|
|
7222
7266
|
for (var x = 0; x < this._rowDefinitions.length; x++) {
|
|
7223
|
-
var key = x
|
|
7267
|
+
var key = "".concat(x, ":").concat(index);
|
|
7224
7268
|
var cell = this._cells[key];
|
|
7225
7269
|
this._removeCell(cell, key);
|
|
7226
7270
|
}
|
|
7227
7271
|
for (var x = 0; x < this._rowDefinitions.length; x++) {
|
|
7228
7272
|
for (var y = index + 1; y < this._columnDefinitions.length; y++) {
|
|
7229
|
-
var previousKey = x
|
|
7230
|
-
var key = x
|
|
7273
|
+
var previousKey = "".concat(x, ":").concat(y - 1);
|
|
7274
|
+
var key = "".concat(x, ":").concat(y);
|
|
7231
7275
|
this._offsetCell(previousKey, key);
|
|
7232
7276
|
}
|
|
7233
7277
|
}
|
|
@@ -7247,14 +7291,14 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7247
7291
|
return this;
|
|
7248
7292
|
}
|
|
7249
7293
|
for (var y = 0; y < this._columnDefinitions.length; y++) {
|
|
7250
|
-
var key = index
|
|
7294
|
+
var key = "".concat(index, ":").concat(y);
|
|
7251
7295
|
var cell = this._cells[key];
|
|
7252
7296
|
this._removeCell(cell, key);
|
|
7253
7297
|
}
|
|
7254
7298
|
for (var y = 0; y < this._columnDefinitions.length; y++) {
|
|
7255
7299
|
for (var x = index + 1; x < this._rowDefinitions.length; x++) {
|
|
7256
|
-
var previousKey = x - 1
|
|
7257
|
-
var key = x
|
|
7300
|
+
var previousKey = "".concat(x - 1, ":").concat(y);
|
|
7301
|
+
var key = "".concat(x, ":").concat(y);
|
|
7258
7302
|
this._offsetCell(previousKey, key);
|
|
7259
7303
|
}
|
|
7260
7304
|
}
|
|
@@ -7283,12 +7327,12 @@ var Grid = /** @class */ (function (_super) {
|
|
|
7283
7327
|
this.addColumnDefinition(1, false);
|
|
7284
7328
|
}
|
|
7285
7329
|
if (this._childControls.indexOf(control) !== -1) {
|
|
7286
|
-
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"));
|
|
7287
7331
|
return this;
|
|
7288
7332
|
}
|
|
7289
7333
|
var x = Math.min(row, this._rowDefinitions.length - 1);
|
|
7290
7334
|
var y = Math.min(column, this._columnDefinitions.length - 1);
|
|
7291
|
-
var key = x
|
|
7335
|
+
var key = "".concat(x, ":").concat(y);
|
|
7292
7336
|
var goodContainer = this._cells[key];
|
|
7293
7337
|
if (!goodContainer) {
|
|
7294
7338
|
goodContainer = new _container__WEBPACK_IMPORTED_MODULE_1__["Container"](key);
|
|
@@ -7856,7 +7900,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
7856
7900
|
var width = this._domImage.width;
|
|
7857
7901
|
var height = this._domImage.height;
|
|
7858
7902
|
// Should abstract platform instead of using LastCreatedEngine
|
|
7859
|
-
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;
|
|
7860
7904
|
if (!engine) {
|
|
7861
7905
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
7862
7906
|
}
|
|
@@ -7926,7 +7970,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
7926
7970
|
var width = this._domImage.width;
|
|
7927
7971
|
var height = this._domImage.height;
|
|
7928
7972
|
if (!this._workingCanvas) {
|
|
7929
|
-
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;
|
|
7930
7974
|
if (!engine) {
|
|
7931
7975
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
7932
7976
|
}
|
|
@@ -8026,7 +8070,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
8026
8070
|
value = this._svgCheck(value);
|
|
8027
8071
|
}
|
|
8028
8072
|
// Should abstract platform instead of using LastCreatedEngine
|
|
8029
|
-
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;
|
|
8030
8074
|
if (!engine) {
|
|
8031
8075
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
8032
8076
|
}
|
|
@@ -8257,7 +8301,7 @@ var Image = /** @class */ (function (_super) {
|
|
|
8257
8301
|
var width = this._currentMeasure.width;
|
|
8258
8302
|
var height = this._currentMeasure.height;
|
|
8259
8303
|
if (!this._workingCanvas) {
|
|
8260
|
-
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;
|
|
8261
8305
|
if (!engine) {
|
|
8262
8306
|
throw new Error("Invalid engine. Unable to create a canvas.");
|
|
8263
8307
|
}
|
|
@@ -13787,7 +13831,7 @@ var StackPanel = /** @class */ (function (_super) {
|
|
|
13787
13831
|
}
|
|
13788
13832
|
if (child._height.isPercentage && !child._automaticSize) {
|
|
13789
13833
|
if (!this.ignoreLayoutWarnings) {
|
|
13790
|
-
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:"
|
|
13834
|
+
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"));
|
|
13791
13835
|
}
|
|
13792
13836
|
}
|
|
13793
13837
|
else {
|
|
@@ -13802,7 +13846,7 @@ var StackPanel = /** @class */ (function (_super) {
|
|
|
13802
13846
|
}
|
|
13803
13847
|
if (child._width.isPercentage && !child._automaticSize) {
|
|
13804
13848
|
if (!this.ignoreLayoutWarnings) {
|
|
13805
|
-
babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__["Tools"].Warn("Control (Name:"
|
|
13849
|
+
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"));
|
|
13806
13850
|
}
|
|
13807
13851
|
}
|
|
13808
13852
|
else {
|
|
@@ -14395,7 +14439,7 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14395
14439
|
else {
|
|
14396
14440
|
while (characters.length && lineWidth > width) {
|
|
14397
14441
|
characters.pop();
|
|
14398
|
-
line = characters.join("")
|
|
14442
|
+
line = "".concat(characters.join(""), "...");
|
|
14399
14443
|
textMetrics = context.measureText(line);
|
|
14400
14444
|
lineWidth = Math.abs(textMetrics.actualBoundingBoxLeft) + Math.abs(textMetrics.actualBoundingBoxRight);
|
|
14401
14445
|
}
|
|
@@ -14434,7 +14478,7 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14434
14478
|
if (currentHeight > height && n > 1) {
|
|
14435
14479
|
var lastLine = lines[n - 2];
|
|
14436
14480
|
var currentLine = lines[n - 1];
|
|
14437
|
-
lines[n - 2] = this._parseLineEllipsis(""
|
|
14481
|
+
lines[n - 2] = this._parseLineEllipsis("".concat(lastLine.text + currentLine.text), width, context);
|
|
14438
14482
|
var linesToRemove = lines.length - n + 1;
|
|
14439
14483
|
for (var i = 0; i < linesToRemove; i++) {
|
|
14440
14484
|
lines.pop();
|
|
@@ -14495,7 +14539,7 @@ var TextBlock = /** @class */ (function (_super) {
|
|
|
14495
14539
|
var _a;
|
|
14496
14540
|
if (this.text && this.widthInPixels) {
|
|
14497
14541
|
// Should abstract platform instead of using LastCreatedEngine
|
|
14498
|
-
var context_1 = (_a = babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["
|
|
14542
|
+
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");
|
|
14499
14543
|
if (context_1) {
|
|
14500
14544
|
this._applyStates(context_1);
|
|
14501
14545
|
if (!this._fontOffset) {
|
|
@@ -17777,7 +17821,7 @@ var HolographicBackplate = /** @class */ (function (_super) {
|
|
|
17777
17821
|
babylonjs_Meshes_Builders_boxBuilder__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, HolographicBackplate.MODEL_BASE_URL, HolographicBackplate.MODEL_FILENAME, scene)
|
|
17778
17822
|
.then(function (result) {
|
|
17779
17823
|
var importedModel = result.meshes[1];
|
|
17780
|
-
importedModel.name = _this.name
|
|
17824
|
+
importedModel.name = "".concat(_this.name, "_frontPlate");
|
|
17781
17825
|
importedModel.isPickable = false;
|
|
17782
17826
|
importedModel.parent = collisionMesh;
|
|
17783
17827
|
if (!!_this._material) {
|
|
@@ -18322,6 +18366,10 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18322
18366
|
*/
|
|
18323
18367
|
HolographicSlate.prototype._applyFacade = function (facadeTexture) {
|
|
18324
18368
|
this._contentMaterial.albedoTexture = facadeTexture;
|
|
18369
|
+
// We should have a content plate by this point, but check for safety
|
|
18370
|
+
if (this._contentPlate) {
|
|
18371
|
+
facadeTexture.attachToMesh(this._contentPlate, true);
|
|
18372
|
+
}
|
|
18325
18373
|
};
|
|
18326
18374
|
HolographicSlate.prototype._rebuildContent = function () {
|
|
18327
18375
|
this._disposeFacadeTexture();
|
|
@@ -18494,7 +18542,7 @@ var HolographicSlate = /** @class */ (function (_super) {
|
|
|
18494
18542
|
};
|
|
18495
18543
|
HolographicSlate.prototype._affectMaterial = function (mesh) {
|
|
18496
18544
|
// TODO share materials
|
|
18497
|
-
this._backPlateMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_8__["FluentBackplateMaterial"](this.name
|
|
18545
|
+
this._backPlateMaterial = new _materials_fluentBackplate_fluentBackplateMaterial__WEBPACK_IMPORTED_MODULE_8__["FluentBackplateMaterial"]("".concat(this.name, " plateMaterial"), mesh.getScene());
|
|
18498
18546
|
this._pickedPointObserver = this._host.onPickedPointChangedObservable.add(function (pickedPoint) {
|
|
18499
18547
|
// if (pickedPoint) {
|
|
18500
18548
|
// this._backPlateMaterial. = pickedPoint;
|
|
@@ -19245,7 +19293,7 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19245
19293
|
// Mesh association
|
|
19246
19294
|
Slider3D.prototype._createNode = function (scene) {
|
|
19247
19295
|
var _this = this;
|
|
19248
|
-
var sliderBackplate = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
19296
|
+
var sliderBackplate = Object(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_sliderbackplate"), {
|
|
19249
19297
|
width: 1.0,
|
|
19250
19298
|
height: 1.0,
|
|
19251
19299
|
depth: 1.0,
|
|
@@ -19256,12 +19304,12 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19256
19304
|
babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["SceneLoader"].ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene)
|
|
19257
19305
|
.then(function (result) {
|
|
19258
19306
|
var sliderBackplateModel = result.meshes[1];
|
|
19259
|
-
var sliderBarModel = result.meshes[1].clone(_this.name
|
|
19260
|
-
var sliderThumbModel = result.meshes[1].clone(_this.name
|
|
19307
|
+
var sliderBarModel = result.meshes[1].clone("".concat(_this.name, "_sliderbar"), sliderBackplate);
|
|
19308
|
+
var sliderThumbModel = result.meshes[1].clone("".concat(_this.name, "_sliderthumb"), sliderBackplate);
|
|
19261
19309
|
sliderBackplateModel.visibility = 0;
|
|
19262
19310
|
if (_this._sliderBackplateVisible) {
|
|
19263
19311
|
sliderBackplateModel.visibility = 1;
|
|
19264
|
-
sliderBackplateModel.name = _this.name
|
|
19312
|
+
sliderBackplateModel.name = "".concat(_this.name, "_sliderbackplate");
|
|
19265
19313
|
sliderBackplateModel.isPickable = false;
|
|
19266
19314
|
sliderBackplateModel.scaling.x = 1;
|
|
19267
19315
|
sliderBackplateModel.scaling.z = 0.2;
|
|
@@ -19299,9 +19347,9 @@ var Slider3D = /** @class */ (function (_super) {
|
|
|
19299
19347
|
};
|
|
19300
19348
|
Slider3D.prototype._affectMaterial = function (mesh) {
|
|
19301
19349
|
var _a, _b, _c;
|
|
19302
|
-
this._sliderBackplateMaterial = (_a = this._sliderBackplateMaterial) !== null && _a !== void 0 ? _a : new _materials_mrdl_mrdlBackplateMaterial__WEBPACK_IMPORTED_MODULE_5__["MRDLBackplateMaterial"](this.name
|
|
19303
|
-
this._sliderBarMaterial = (_b = this._sliderBarMaterial) !== null && _b !== void 0 ? _b : new _materials_mrdl_mrdlSliderBarMaterial__WEBPACK_IMPORTED_MODULE_3__["MRDLSliderBarMaterial"](this.name
|
|
19304
|
-
this._sliderThumbMaterial = (_c = this._sliderThumbMaterial) !== null && _c !== void 0 ? _c : new _materials_mrdl_mrdlSliderThumbMaterial__WEBPACK_IMPORTED_MODULE_4__["MRDLSliderThumbMaterial"](this.name
|
|
19350
|
+
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());
|
|
19351
|
+
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());
|
|
19352
|
+
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());
|
|
19305
19353
|
};
|
|
19306
19354
|
Slider3D.prototype._createBehavior = function () {
|
|
19307
19355
|
var _this = this;
|
|
@@ -19648,12 +19696,10 @@ var TouchButton3D = /** @class */ (function (_super) {
|
|
|
19648
19696
|
* @param collisionMesh the new collision mesh for the button
|
|
19649
19697
|
*/
|
|
19650
19698
|
set: function (collisionMesh) {
|
|
19651
|
-
|
|
19652
|
-
|
|
19653
|
-
|
|
19654
|
-
|
|
19655
|
-
if (!collisionMesh.parent && this.mesh) {
|
|
19656
|
-
collisionMesh.setParent(this.mesh);
|
|
19699
|
+
var _a, _b;
|
|
19700
|
+
// Remove the GUI3DManager's data from the previous collision mesh's reserved data store
|
|
19701
|
+
if ((_b = (_a = this._collisionMesh) === null || _a === void 0 ? void 0 : _a.reservedDataStore) === null || _b === void 0 ? void 0 : _b.GUI3D) {
|
|
19702
|
+
this._collisionMesh.reservedDataStore.GUI3D = {};
|
|
19657
19703
|
}
|
|
19658
19704
|
this._collisionMesh = collisionMesh;
|
|
19659
19705
|
this._injectGUI3DReservedDataStore(this._collisionMesh).control = this;
|
|
@@ -20087,7 +20133,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20087
20133
|
var _this = this;
|
|
20088
20134
|
var _a;
|
|
20089
20135
|
this.name = (_a = this.name) !== null && _a !== void 0 ? _a : "TouchHolographicButton";
|
|
20090
|
-
var collisionMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
20136
|
+
var collisionMesh = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_collisionMesh"), {
|
|
20091
20137
|
width: 1.0,
|
|
20092
20138
|
height: 1.0,
|
|
20093
20139
|
depth: this._frontPlateDepth,
|
|
@@ -20107,7 +20153,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20107
20153
|
alphaMesh.material = new babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["StandardMaterial"]("${this.name}_alphaMesh_material", scene);
|
|
20108
20154
|
alphaMesh.material.alpha = 0.15;
|
|
20109
20155
|
var importedFrontPlate = result.meshes[1];
|
|
20110
|
-
importedFrontPlate.name = _this.name
|
|
20156
|
+
importedFrontPlate.name = "".concat(_this.name, "_frontPlate");
|
|
20111
20157
|
importedFrontPlate.isPickable = false;
|
|
20112
20158
|
importedFrontPlate.scaling.z = _this._frontPlateDepth;
|
|
20113
20159
|
alphaMesh.parent = importedFrontPlate;
|
|
@@ -20117,7 +20163,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20117
20163
|
}
|
|
20118
20164
|
_this._frontPlate = importedFrontPlate;
|
|
20119
20165
|
});
|
|
20120
|
-
this._backPlate = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])(this.name
|
|
20166
|
+
this._backPlate = Object(babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["CreateBox"])("".concat(this.name, "_backPlate"), {
|
|
20121
20167
|
width: 1.0,
|
|
20122
20168
|
height: 1.0,
|
|
20123
20169
|
depth: this._backPlateDepth,
|
|
@@ -20125,7 +20171,7 @@ var TouchHolographicButton = /** @class */ (function (_super) {
|
|
|
20125
20171
|
this._backPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(-this._backPlateDepth / 2);
|
|
20126
20172
|
this._backPlate.isPickable = false;
|
|
20127
20173
|
this._textPlate = _super.prototype._createNode.call(this, scene);
|
|
20128
|
-
this._textPlate.name = this.name
|
|
20174
|
+
this._textPlate.name = "".concat(this.name, "_textPlate");
|
|
20129
20175
|
this._textPlate.isPickable = false;
|
|
20130
20176
|
this._textPlate.position = babylonjs_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Forward(scene.useRightHandedSystem).scale(-this._frontPlateDepth / 2);
|
|
20131
20177
|
this._backPlate.addChild(collisionMesh);
|
|
@@ -20287,7 +20333,7 @@ var TouchHolographicMenu = /** @class */ (function (_super) {
|
|
|
20287
20333
|
configurable: true
|
|
20288
20334
|
});
|
|
20289
20335
|
TouchHolographicMenu.prototype._createNode = function (scene) {
|
|
20290
|
-
var node = new babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["Mesh"]("menu_"
|
|
20336
|
+
var node = new babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["Mesh"]("menu_".concat(this.name), scene);
|
|
20291
20337
|
this._backPlate = Object(babylonjs_Meshes_mesh__WEBPACK_IMPORTED_MODULE_2__["CreateBox"])("backPlate" + this.name, { size: 1 }, scene);
|
|
20292
20338
|
this._backPlate.parent = node;
|
|
20293
20339
|
return node;
|
|
@@ -21762,7 +21808,7 @@ var FluentMaterial = /** @class */ (function (_super) {
|
|
|
21762
21808
|
/**
|
|
21763
21809
|
* Gets or sets the radius used to render the hover light (default is 1.0)
|
|
21764
21810
|
*/
|
|
21765
|
-
_this.hoverRadius =
|
|
21811
|
+
_this.hoverRadius = 0.01;
|
|
21766
21812
|
/**
|
|
21767
21813
|
* Gets or sets the color used to render the hover light (default is Color4(0.3, 0.3, 0.3, 1.0))
|
|
21768
21814
|
*/
|
|
@@ -21913,7 +21959,7 @@ var FluentMaterial = /** @class */ (function (_super) {
|
|
|
21913
21959
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentMaterial(name, _this.getScene()); }, this);
|
|
21914
21960
|
};
|
|
21915
21961
|
FluentMaterial.prototype.serialize = function () {
|
|
21916
|
-
var serializationObject =
|
|
21962
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
21917
21963
|
serializationObject.customType = "BABYLON.GUI.FluentMaterial";
|
|
21918
21964
|
return serializationObject;
|
|
21919
21965
|
};
|
|
@@ -22201,8 +22247,8 @@ var FluentBackplateMaterial = /** @class */ (function (_super) {
|
|
|
22201
22247
|
_this._globalRightIndexTipPosition4 = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"].Zero();
|
|
22202
22248
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
22203
22249
|
_this.backFaceCulling = false;
|
|
22204
|
-
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.BLOB_TEXTURE_URL,
|
|
22205
|
-
_this._iridescentMap = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentBackplateMaterial.IM_TEXTURE_URL,
|
|
22250
|
+
_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);
|
|
22251
|
+
_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);
|
|
22206
22252
|
return _this;
|
|
22207
22253
|
}
|
|
22208
22254
|
FluentBackplateMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -22394,7 +22440,7 @@ var FluentBackplateMaterial = /** @class */ (function (_super) {
|
|
|
22394
22440
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
|
|
22395
22441
|
};
|
|
22396
22442
|
FluentBackplateMaterial.prototype.serialize = function () {
|
|
22397
|
-
var serializationObject =
|
|
22443
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
22398
22444
|
serializationObject.customType = "BABYLON.FluentBackplateMaterial";
|
|
22399
22445
|
return serializationObject;
|
|
22400
22446
|
};
|
|
@@ -22755,7 +22801,7 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
22755
22801
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_ADD;
|
|
22756
22802
|
_this.disableDepthWrite = true;
|
|
22757
22803
|
_this.backFaceCulling = false;
|
|
22758
|
-
_this._blobTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](FluentButtonMaterial.BLOB_TEXTURE_URL,
|
|
22804
|
+
_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);
|
|
22759
22805
|
return _this;
|
|
22760
22806
|
}
|
|
22761
22807
|
FluentButtonMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -22976,7 +23022,7 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
22976
23022
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new FluentButtonMaterial(name, _this.getScene()); }, this);
|
|
22977
23023
|
};
|
|
22978
23024
|
FluentButtonMaterial.prototype.serialize = function () {
|
|
22979
|
-
var serializationObject =
|
|
23025
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
22980
23026
|
serializationObject.customType = "BABYLON.FluentButtonMaterial";
|
|
22981
23027
|
return serializationObject;
|
|
22982
23028
|
};
|
|
@@ -23601,7 +23647,7 @@ var MRDLBackplateMaterial = /** @class */ (function (_super) {
|
|
|
23601
23647
|
_this.edgeLineGradientBlend = 0.5;
|
|
23602
23648
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
23603
23649
|
_this.backFaceCulling = false;
|
|
23604
|
-
_this._iridescentMapTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLBackplateMaterial.IRIDESCENT_MAP_TEXTURE_URL,
|
|
23650
|
+
_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);
|
|
23605
23651
|
return _this;
|
|
23606
23652
|
}
|
|
23607
23653
|
MRDLBackplateMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -23774,7 +23820,7 @@ var MRDLBackplateMaterial = /** @class */ (function (_super) {
|
|
|
23774
23820
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLBackplateMaterial(name, _this.getScene()); }, this);
|
|
23775
23821
|
};
|
|
23776
23822
|
MRDLBackplateMaterial.prototype.serialize = function () {
|
|
23777
|
-
var serializationObject =
|
|
23823
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
23778
23824
|
serializationObject.customType = "BABYLON.MRDLBackplateMaterial";
|
|
23779
23825
|
return serializationObject;
|
|
23780
23826
|
};
|
|
@@ -24216,7 +24262,7 @@ var MRDLSliderBarMaterial = /** @class */ (function (_super) {
|
|
|
24216
24262
|
_this.globalRightIndexMiddlePosition = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Vector4"](0.0, 0.0, 0.0, 1.0);
|
|
24217
24263
|
_this.alphaMode = babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Constants"].ALPHA_DISABLE;
|
|
24218
24264
|
_this.backFaceCulling = false;
|
|
24219
|
-
_this._blueGradientTexture = new babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["Texture"](MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL,
|
|
24265
|
+
_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);
|
|
24220
24266
|
return _this;
|
|
24221
24267
|
}
|
|
24222
24268
|
MRDLSliderBarMaterial.prototype.needAlphaBlending = function () {
|
|
@@ -24459,7 +24505,7 @@ var MRDLSliderBarMaterial = /** @class */ (function (_super) {
|
|
|
24459
24505
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLSliderBarMaterial(name, _this.getScene()); }, this);
|
|
24460
24506
|
};
|
|
24461
24507
|
MRDLSliderBarMaterial.prototype.serialize = function () {
|
|
24462
|
-
var serializationObject =
|
|
24508
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
24463
24509
|
serializationObject.customType = "BABYLON.MRDLSliderBarMaterial";
|
|
24464
24510
|
return serializationObject;
|
|
24465
24511
|
};
|
|
@@ -25264,7 +25310,7 @@ var MRDLSliderThumbMaterial = /** @class */ (function (_super) {
|
|
|
25264
25310
|
return babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new MRDLSliderThumbMaterial(name, _this.getScene()); }, this);
|
|
25265
25311
|
};
|
|
25266
25312
|
MRDLSliderThumbMaterial.prototype.serialize = function () {
|
|
25267
|
-
var serializationObject =
|
|
25313
|
+
var serializationObject = _super.prototype.serialize.call(this);
|
|
25268
25314
|
serializationObject.customType = "BABYLON.MRDLSliderThumbMaterial";
|
|
25269
25315
|
return serializationObject;
|
|
25270
25316
|
};
|