@babylonjs/gui 5.0.0-beta.9 → 5.0.0-rc.2
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/2D/advancedDynamicTexture.d.ts +14 -1
- package/2D/advancedDynamicTexture.js +114 -58
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/container.d.ts +1 -1
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.d.ts +7 -7
- package/2D/controls/control.js +12 -12
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/inputText.d.ts +2 -0
- package/2D/controls/inputText.js +2 -1
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +1 -1
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/textBlock.d.ts +1 -0
- package/2D/controls/textBlock.js +17 -7
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/xmlLoader.js +8 -1
- package/2D/xmlLoader.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +1 -1
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/holographicSlate.d.ts +45 -35
- package/3D/controls/holographicSlate.js +172 -113
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/slider3D.d.ts +1 -0
- package/3D/controls/slider3D.js +8 -6
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/touchButton3D.d.ts +12 -1
- package/3D/controls/touchButton3D.js +43 -4
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.d.ts +5 -0
- package/3D/controls/touchHolographicButton.js +17 -4
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/gizmos/slateGizmo.d.ts +2 -4
- package/3D/gizmos/slateGizmo.js +24 -18
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js.map +1 -1
- package/package.json +2 -2
|
@@ -27,6 +27,7 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
27
27
|
private _resizeObserver;
|
|
28
28
|
private _preKeyboardObserver;
|
|
29
29
|
private _pointerMoveObserver;
|
|
30
|
+
private _sceneRenderObserver;
|
|
30
31
|
private _pointerObserver;
|
|
31
32
|
private _canvasPointerOutObserver;
|
|
32
33
|
private _canvasBlurObserver;
|
|
@@ -199,6 +200,13 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
199
200
|
*/
|
|
200
201
|
get clipboardData(): string;
|
|
201
202
|
set clipboardData(value: string);
|
|
203
|
+
/**
|
|
204
|
+
* If set to true, every scene render will trigger a pointer event for the GUI
|
|
205
|
+
* if it is linked to a mesh or has controls linked to a mesh. This will allow
|
|
206
|
+
* you to catch the pointer moving around the GUI due to camera or mesh movements,
|
|
207
|
+
* but it has a performance cost.
|
|
208
|
+
*/
|
|
209
|
+
checkPointerEveryFrame: boolean;
|
|
202
210
|
/**
|
|
203
211
|
* Creates a new AdvancedDynamicTexture
|
|
204
212
|
* @param name defines the name of the texture
|
|
@@ -301,6 +309,7 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
301
309
|
}, control: Control): void;
|
|
302
310
|
/** @hidden */
|
|
303
311
|
_cleanControlAfterRemoval(control: Control): void;
|
|
312
|
+
private _translateToPicking;
|
|
304
313
|
/** Attach to all scene events required to support pointer events */
|
|
305
314
|
attach(): void;
|
|
306
315
|
/** @hidden */
|
|
@@ -329,6 +338,7 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
329
338
|
*/
|
|
330
339
|
moveFocusToControl(control: IFocusableControl): void;
|
|
331
340
|
private _manageFocus;
|
|
341
|
+
private _attachPickingToSceneRender;
|
|
332
342
|
private _attachToOnPointerOut;
|
|
333
343
|
private _attachToOnBlur;
|
|
334
344
|
/**
|
|
@@ -371,9 +381,11 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
371
381
|
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
372
382
|
* @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
|
|
373
383
|
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
384
|
+
* @param materialSetupCallback defines a custom way of creating and seting up the material on the mesh
|
|
374
385
|
* @returns a new AdvancedDynamicTexture
|
|
375
386
|
*/
|
|
376
|
-
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean): AdvancedDynamicTexture;
|
|
387
|
+
static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean, materialSetupCallback?: (mesh: AbstractMesh, uniqueId: string, texture: AdvancedDynamicTexture, onlyAlphaTesting: boolean) => void): AdvancedDynamicTexture;
|
|
388
|
+
private static _CreateMaterial;
|
|
377
389
|
/**
|
|
378
390
|
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
|
|
379
391
|
* @param mesh defines the mesh which will receive the texture
|
|
@@ -410,3 +422,4 @@ export declare class AdvancedDynamicTexture extends DynamicTexture {
|
|
|
410
422
|
*/
|
|
411
423
|
scaleTo(width: number, height: number): void;
|
|
412
424
|
}
|
|
425
|
+
export { IFocusableControl };
|
|
@@ -5,7 +5,6 @@ import { Tools } from "@babylonjs/core/Misc/tools.js";
|
|
|
5
5
|
import { PointerEventTypes } from "@babylonjs/core/Events/pointerEvents.js";
|
|
6
6
|
import { ClipboardEventTypes, ClipboardInfo } from "@babylonjs/core/Events/clipboardEvents.js";
|
|
7
7
|
import { KeyboardEventTypes } from "@babylonjs/core/Events/keyboardEvents.js";
|
|
8
|
-
import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial.js";
|
|
9
8
|
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
10
9
|
import { DynamicTexture } from "@babylonjs/core/Materials/Textures/dynamicTexture.js";
|
|
11
10
|
import { Layer } from "@babylonjs/core/Layers/layer.js";
|
|
@@ -18,6 +17,7 @@ import { Viewport } from "@babylonjs/core/Maths/math.viewport.js";
|
|
|
18
17
|
import { Color3 } from "@babylonjs/core/Maths/math.color.js";
|
|
19
18
|
import { WebRequest } from "@babylonjs/core/Misc/webRequest.js";
|
|
20
19
|
import { RandomGUID } from "@babylonjs/core/Misc/guid.js";
|
|
20
|
+
import { GetClass } from "@babylonjs/core/Misc/typeStore.js";
|
|
21
21
|
/**
|
|
22
22
|
* Class used to create texture to support 2D GUI elements
|
|
23
23
|
* @see https://doc.babylonjs.com/how_to/gui
|
|
@@ -103,6 +103,13 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
103
103
|
* Gets or sets a boolean indicating that the canvas must be reverted on Y when updating the texture
|
|
104
104
|
*/
|
|
105
105
|
_this.applyYInversionOnUpdate = true;
|
|
106
|
+
/**
|
|
107
|
+
* If set to true, every scene render will trigger a pointer event for the GUI
|
|
108
|
+
* if it is linked to a mesh or has controls linked to a mesh. This will allow
|
|
109
|
+
* you to catch the pointer moving around the GUI due to camera or mesh movements,
|
|
110
|
+
* but it has a performance cost.
|
|
111
|
+
*/
|
|
112
|
+
_this.checkPointerEveryFrame = false;
|
|
106
113
|
_this._useInvalidateRectOptimization = true;
|
|
107
114
|
// Invalidated rectangle which is the combination of all invalidated controls after they have been rotated into absolute position
|
|
108
115
|
_this._invalidatedRectangle = null;
|
|
@@ -576,6 +583,9 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
576
583
|
if (this._pointerMoveObserver) {
|
|
577
584
|
scene.onPrePointerObservable.remove(this._pointerMoveObserver);
|
|
578
585
|
}
|
|
586
|
+
if (this._sceneRenderObserver) {
|
|
587
|
+
scene.onBeforeRenderObservable.remove(this._sceneRenderObserver);
|
|
588
|
+
}
|
|
579
589
|
if (this._pointerObserver) {
|
|
580
590
|
scene.onPointerObservable.remove(this._pointerObserver);
|
|
581
591
|
}
|
|
@@ -813,6 +823,61 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
813
823
|
this._cleanControlAfterRemovalFromList(this._lastControlDown, control);
|
|
814
824
|
this._cleanControlAfterRemovalFromList(this._lastControlOver, control);
|
|
815
825
|
};
|
|
826
|
+
AdvancedDynamicTexture.prototype._translateToPicking = function (scene, tempViewport, pi) {
|
|
827
|
+
var camera = scene.cameraToUseForPointers || scene.activeCamera;
|
|
828
|
+
var engine = scene.getEngine();
|
|
829
|
+
var originalCameraToUseForPointers = scene.cameraToUseForPointers;
|
|
830
|
+
if (!camera) {
|
|
831
|
+
tempViewport.x = 0;
|
|
832
|
+
tempViewport.y = 0;
|
|
833
|
+
tempViewport.width = engine.getRenderWidth();
|
|
834
|
+
tempViewport.height = engine.getRenderHeight();
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
if (camera.rigCameras.length) {
|
|
838
|
+
// rig camera - we need to find the camera to use for this event
|
|
839
|
+
var rigViewport_1 = new Viewport(0, 0, 1, 1);
|
|
840
|
+
camera.rigCameras.forEach(function (rigCamera) {
|
|
841
|
+
// generate the viewport of this camera
|
|
842
|
+
rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport_1);
|
|
843
|
+
var x = scene.pointerX / engine.getHardwareScalingLevel() - rigViewport_1.x;
|
|
844
|
+
var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport_1.y - rigViewport_1.height);
|
|
845
|
+
// check if the pointer is in the camera's viewport
|
|
846
|
+
if (x < 0 || y < 0 || x > rigViewport_1.width || y > rigViewport_1.height) {
|
|
847
|
+
// out of viewport - don't use this camera
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
// set the camera to use for pointers until this pointer loop is over
|
|
851
|
+
scene.cameraToUseForPointers = rigCamera;
|
|
852
|
+
// set the viewport
|
|
853
|
+
tempViewport.x = rigViewport_1.x;
|
|
854
|
+
tempViewport.y = rigViewport_1.y;
|
|
855
|
+
tempViewport.width = rigViewport_1.width;
|
|
856
|
+
tempViewport.height = rigViewport_1.height;
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
var x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;
|
|
864
|
+
var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);
|
|
865
|
+
this._shouldBlockPointer = false;
|
|
866
|
+
// Do picking modifies _shouldBlockPointer
|
|
867
|
+
if (pi) {
|
|
868
|
+
var pointerId = pi.event.pointerId || this._defaultMousePointerId;
|
|
869
|
+
this._doPicking(x, y, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY);
|
|
870
|
+
// Avoid overwriting a true skipOnPointerObservable to false
|
|
871
|
+
if (this._shouldBlockPointer) {
|
|
872
|
+
pi.skipOnPointerObservable = this._shouldBlockPointer;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
else {
|
|
876
|
+
this._doPicking(x, y, null, PointerEventTypes.POINTERMOVE, this._defaultMousePointerId, 0);
|
|
877
|
+
}
|
|
878
|
+
// if overridden by a rig camera - reset back to the original value
|
|
879
|
+
scene.cameraToUseForPointers = originalCameraToUseForPointers;
|
|
880
|
+
};
|
|
816
881
|
/** Attach to all scene events required to support pointer events */
|
|
817
882
|
AdvancedDynamicTexture.prototype.attach = function () {
|
|
818
883
|
var _this = this;
|
|
@@ -834,55 +899,9 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
834
899
|
if (pi.type === PointerEventTypes.POINTERMOVE && pi.event.pointerId) {
|
|
835
900
|
_this._defaultMousePointerId = pi.event.pointerId; // This is required to make sure we have the correct pointer ID for wheel
|
|
836
901
|
}
|
|
837
|
-
|
|
838
|
-
var engine = scene.getEngine();
|
|
839
|
-
var originalCameraToUseForPointers = scene.cameraToUseForPointers;
|
|
840
|
-
if (!camera) {
|
|
841
|
-
tempViewport.x = 0;
|
|
842
|
-
tempViewport.y = 0;
|
|
843
|
-
tempViewport.width = engine.getRenderWidth();
|
|
844
|
-
tempViewport.height = engine.getRenderHeight();
|
|
845
|
-
}
|
|
846
|
-
else {
|
|
847
|
-
if (camera.rigCameras.length) {
|
|
848
|
-
// rig camera - we need to find the camera to use for this event
|
|
849
|
-
var rigViewport_1 = new Viewport(0, 0, 1, 1);
|
|
850
|
-
camera.rigCameras.forEach(function (rigCamera) {
|
|
851
|
-
// generate the viewport of this camera
|
|
852
|
-
rigCamera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), rigViewport_1);
|
|
853
|
-
var x = scene.pointerX / engine.getHardwareScalingLevel() - rigViewport_1.x;
|
|
854
|
-
var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - rigViewport_1.y - rigViewport_1.height);
|
|
855
|
-
// check if the pointer is in the camera's viewport
|
|
856
|
-
if (x < 0 || y < 0 || x > rigViewport_1.width || y > rigViewport_1.height) {
|
|
857
|
-
// out of viewport - don't use this camera
|
|
858
|
-
return;
|
|
859
|
-
}
|
|
860
|
-
// set the camera to use for pointers until this pointer loop is over
|
|
861
|
-
scene.cameraToUseForPointers = rigCamera;
|
|
862
|
-
// set the viewport
|
|
863
|
-
tempViewport.x = rigViewport_1.x;
|
|
864
|
-
tempViewport.y = rigViewport_1.y;
|
|
865
|
-
tempViewport.width = rigViewport_1.width;
|
|
866
|
-
tempViewport.height = rigViewport_1.height;
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
else {
|
|
870
|
-
camera.viewport.toGlobalToRef(engine.getRenderWidth(), engine.getRenderHeight(), tempViewport);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
var x = scene.pointerX / engine.getHardwareScalingLevel() - tempViewport.x;
|
|
874
|
-
var y = scene.pointerY / engine.getHardwareScalingLevel() - (engine.getRenderHeight() - tempViewport.y - tempViewport.height);
|
|
875
|
-
_this._shouldBlockPointer = false;
|
|
876
|
-
// Do picking modifies _shouldBlockPointer
|
|
877
|
-
var pointerId = pi.event.pointerId || _this._defaultMousePointerId;
|
|
878
|
-
_this._doPicking(x, y, pi, pi.type, pointerId, pi.event.button, pi.event.deltaX, pi.event.deltaY);
|
|
879
|
-
// Avoid overwriting a true skipOnPointerObservable to false
|
|
880
|
-
if (_this._shouldBlockPointer) {
|
|
881
|
-
pi.skipOnPointerObservable = _this._shouldBlockPointer;
|
|
882
|
-
}
|
|
883
|
-
// if overridden by a rig camera - reset back to the original value
|
|
884
|
-
scene.cameraToUseForPointers = originalCameraToUseForPointers;
|
|
902
|
+
_this._translateToPicking(scene, tempViewport, pi);
|
|
885
903
|
});
|
|
904
|
+
this._attachPickingToSceneRender(scene, function () { return _this._translateToPicking(scene, tempViewport, null); }, false);
|
|
886
905
|
this._attachToOnPointerOut(scene);
|
|
887
906
|
this._attachToOnBlur(scene);
|
|
888
907
|
};
|
|
@@ -968,6 +987,23 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
968
987
|
}
|
|
969
988
|
});
|
|
970
989
|
mesh.enablePointerMoveEvents = supportPointerMove;
|
|
990
|
+
this._attachPickingToSceneRender(scene, function () {
|
|
991
|
+
var pointerId = _this._defaultMousePointerId;
|
|
992
|
+
var pick = scene === null || scene === void 0 ? void 0 : scene.pick(scene.pointerX, scene.pointerY);
|
|
993
|
+
if (pick && pick.hit && pick.pickedMesh === mesh) {
|
|
994
|
+
var uv = pick.getTextureCoordinates();
|
|
995
|
+
if (uv) {
|
|
996
|
+
var size = _this.getSize();
|
|
997
|
+
_this._doPicking(uv.x * size.width, (_this.applyYInversionOnUpdate ? 1.0 - uv.y : uv.y) * size.height, null, PointerEventTypes.POINTERMOVE, pointerId, 0);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
else {
|
|
1001
|
+
if (_this._lastControlOver[pointerId]) {
|
|
1002
|
+
_this._lastControlOver[pointerId]._onPointerOut(_this._lastControlOver[pointerId], null, true);
|
|
1003
|
+
}
|
|
1004
|
+
delete _this._lastControlOver[pointerId];
|
|
1005
|
+
}
|
|
1006
|
+
}, true);
|
|
971
1007
|
this._attachToOnPointerOut(scene);
|
|
972
1008
|
this._attachToOnBlur(scene);
|
|
973
1009
|
};
|
|
@@ -996,6 +1032,17 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
996
1032
|
}
|
|
997
1033
|
}
|
|
998
1034
|
};
|
|
1035
|
+
AdvancedDynamicTexture.prototype._attachPickingToSceneRender = function (scene, pickFunction, forcePicking) {
|
|
1036
|
+
var _this = this;
|
|
1037
|
+
this._sceneRenderObserver = scene.onBeforeRenderObservable.add(function () {
|
|
1038
|
+
if (!_this.checkPointerEveryFrame) {
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
if (_this._linkedControls.length > 0 || forcePicking) {
|
|
1042
|
+
pickFunction();
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
999
1046
|
AdvancedDynamicTexture.prototype._attachToOnPointerOut = function (scene) {
|
|
1000
1047
|
var _this = this;
|
|
1001
1048
|
this._canvasPointerOutObserver = scene.getEngine().onCanvasPointerOutObservable.add(function (pointerEvent) {
|
|
@@ -1135,32 +1182,41 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
|
|
|
1135
1182
|
* @param supportPointerMove defines a boolean indicating if the texture must capture move events (true by default)
|
|
1136
1183
|
* @param onlyAlphaTesting defines a boolean indicating that alpha blending will not be used (only alpha testing) (false by default)
|
|
1137
1184
|
* @param invertY defines if the texture needs to be inverted on the y axis during loading (true by default)
|
|
1185
|
+
* @param materialSetupCallback defines a custom way of creating and seting up the material on the mesh
|
|
1138
1186
|
* @returns a new AdvancedDynamicTexture
|
|
1139
1187
|
*/
|
|
1140
|
-
AdvancedDynamicTexture.CreateForMesh = function (mesh, width, height, supportPointerMove, onlyAlphaTesting, invertY) {
|
|
1188
|
+
AdvancedDynamicTexture.CreateForMesh = function (mesh, width, height, supportPointerMove, onlyAlphaTesting, invertY, materialSetupCallback) {
|
|
1141
1189
|
if (width === void 0) { width = 1024; }
|
|
1142
1190
|
if (height === void 0) { height = 1024; }
|
|
1143
1191
|
if (supportPointerMove === void 0) { supportPointerMove = true; }
|
|
1144
1192
|
if (onlyAlphaTesting === void 0) { onlyAlphaTesting = false; }
|
|
1193
|
+
if (materialSetupCallback === void 0) { materialSetupCallback = this._CreateMaterial; }
|
|
1145
1194
|
// use a unique ID in name so serialization will work even if you create two ADTs for a single mesh
|
|
1146
1195
|
var uniqueId = RandomGUID();
|
|
1147
1196
|
var result = new AdvancedDynamicTexture("AdvancedDynamicTexture for ".concat(mesh.name, " [").concat(uniqueId, "]"), width, height, mesh.getScene(), true, Texture.TRILINEAR_SAMPLINGMODE, invertY);
|
|
1148
|
-
|
|
1197
|
+
materialSetupCallback(mesh, uniqueId, result, onlyAlphaTesting);
|
|
1198
|
+
result.attachToMesh(mesh, supportPointerMove);
|
|
1199
|
+
return result;
|
|
1200
|
+
};
|
|
1201
|
+
AdvancedDynamicTexture._CreateMaterial = function (mesh, uniqueId, texture, onlyAlphaTesting) {
|
|
1202
|
+
var internalClassType = GetClass("BABYLON.StandardMaterial");
|
|
1203
|
+
if (!internalClassType) {
|
|
1204
|
+
throw "StandardMaterial needs to be imported before as it contains a side-effect required by your code.";
|
|
1205
|
+
}
|
|
1206
|
+
var material = new internalClassType("AdvancedDynamicTextureMaterial for ".concat(mesh.name, " [").concat(uniqueId, "]"), mesh.getScene());
|
|
1149
1207
|
material.backFaceCulling = false;
|
|
1150
1208
|
material.diffuseColor = Color3.Black();
|
|
1151
1209
|
material.specularColor = Color3.Black();
|
|
1152
1210
|
if (onlyAlphaTesting) {
|
|
1153
|
-
material.diffuseTexture =
|
|
1154
|
-
material.emissiveTexture =
|
|
1155
|
-
|
|
1211
|
+
material.diffuseTexture = texture;
|
|
1212
|
+
material.emissiveTexture = texture;
|
|
1213
|
+
texture.hasAlpha = true;
|
|
1156
1214
|
}
|
|
1157
1215
|
else {
|
|
1158
|
-
material.emissiveTexture =
|
|
1159
|
-
material.opacityTexture =
|
|
1216
|
+
material.emissiveTexture = texture;
|
|
1217
|
+
material.opacityTexture = texture;
|
|
1160
1218
|
}
|
|
1161
1219
|
mesh.material = material;
|
|
1162
|
-
result.attachToMesh(mesh, supportPointerMove);
|
|
1163
|
-
return result;
|
|
1164
1220
|
};
|
|
1165
1221
|
/**
|
|
1166
1222
|
* Creates a new AdvancedDynamicTexture in projected mode (ie. attached to a mesh) BUT do not create a new material for the mesh. You will be responsible for connecting the texture
|