@babylonjs/gui 5.20.0 → 5.22.1
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/adtInstrumentation.js +70 -90
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +14 -0
- package/2D/advancedDynamicTexture.js +574 -620
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js +76 -90
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js +86 -106
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js +395 -415
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.js +187 -230
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js +1073 -1353
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js +152 -196
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js +32 -40
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js +30 -35
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/grid.js +172 -212
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js +489 -592
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js +9 -16
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js +380 -467
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js +234 -273
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js +147 -198
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js +87 -113
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js +106 -127
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js +60 -72
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js +439 -543
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js +241 -329
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +182 -230
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js +86 -109
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +148 -178
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js +64 -80
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js +91 -115
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js +114 -135
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.js +5 -5
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.js +322 -384
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.js +27 -41
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.js +105 -121
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js +101 -123
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/math2D.js +62 -70
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js +30 -32
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.js +71 -89
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.js +55 -73
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.js +71 -104
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.js +70 -84
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.js +40 -59
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/abstractButton3D.js +8 -12
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.js +30 -35
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js +57 -71
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +47 -60
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js +123 -158
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.js +28 -38
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/handMenu.js +20 -29
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.js +52 -72
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js +160 -200
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js +176 -206
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js +24 -30
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js +57 -71
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.js +6 -13
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.js +43 -54
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js +168 -222
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.js +29 -39
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.js +36 -49
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js +126 -154
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +223 -272
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js +55 -66
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js +24 -30
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js +85 -107
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.js +68 -103
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/slateGizmo.js +165 -182
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js +76 -101
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js +110 -119
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
- package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
- package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js +56 -69
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/shaders/handle.fragment.js +3 -3
- package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
- package/3D/materials/handle/shaders/handle.vertex.js +3 -3
- package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
- package/3D/vector3WithInfo.js +6 -12
- package/3D/vector3WithInfo.js.map +1 -1
- package/legacy/legacy.js +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +3 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "@babylonjs/core/tslib.es6.js";
|
|
2
2
|
import { serializeAsColor4, serializeAsVector3, serialize, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
|
|
3
3
|
import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
|
|
4
4
|
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
|
@@ -13,194 +13,189 @@ import { Constants } from "@babylonjs/core/Engines/constants.js";
|
|
|
13
13
|
import "./shaders/fluentButton.fragment.js";
|
|
14
14
|
import "./shaders/fluentButton.vertex.js";
|
|
15
15
|
/** @hidden */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_this.rebuild();
|
|
25
|
-
return _this;
|
|
16
|
+
class FluentButtonMaterialDefines extends MaterialDefines {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.RELATIVE_WIDTH = true;
|
|
20
|
+
this.ENABLE_FADE = true;
|
|
21
|
+
this._needNormals = true;
|
|
22
|
+
this._needUVs = true;
|
|
23
|
+
this.rebuild();
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
}(MaterialDefines));
|
|
25
|
+
}
|
|
29
26
|
/**
|
|
30
27
|
* Class used to render square buttons with fluent design
|
|
31
28
|
* @since 5.0.0
|
|
32
29
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var _this = _super.call(this, name, scene) || this;
|
|
30
|
+
export class FluentButtonMaterial extends PushMaterial {
|
|
31
|
+
constructor(name, scene) {
|
|
32
|
+
super(name, scene);
|
|
37
33
|
/**
|
|
38
34
|
* Gets or sets the width of the glowing edge, relative to the scale of the button.
|
|
39
35
|
* (Default is 4% of the height).
|
|
40
36
|
*/
|
|
41
|
-
|
|
37
|
+
this.edgeWidth = 0.04;
|
|
42
38
|
/**
|
|
43
39
|
* Gets or sets the color of the glowing edge.
|
|
44
40
|
*/
|
|
45
|
-
|
|
41
|
+
this.edgeColor = new Color4(0.592157, 0.592157, 0.592157, 1.0);
|
|
46
42
|
/**
|
|
47
43
|
* Gets or sets the maximum intensity of the proximity light.
|
|
48
44
|
*/
|
|
49
|
-
|
|
45
|
+
this.proximityMaxIntensity = 0.45;
|
|
50
46
|
/**
|
|
51
47
|
* Gets or sets the maximum distance for the proximity light (Default is 16mm).
|
|
52
48
|
*/
|
|
53
|
-
|
|
49
|
+
this.proximityFarDistance = 0.16;
|
|
54
50
|
/**
|
|
55
51
|
* Gets or sets the radius of the proximity light when near to the surface.
|
|
56
52
|
*/
|
|
57
|
-
|
|
53
|
+
this.proximityNearRadius = 1.5;
|
|
58
54
|
/**
|
|
59
55
|
* Gets or sets the anisotropy of the proximity light.
|
|
60
56
|
*/
|
|
61
|
-
|
|
57
|
+
this.proximityAnisotropy = 1;
|
|
62
58
|
/**
|
|
63
59
|
* Gets or sets the amount of fuzzing in the selection focus.
|
|
64
60
|
*/
|
|
65
|
-
|
|
61
|
+
this.selectionFuzz = 0.5;
|
|
66
62
|
/**
|
|
67
63
|
* Gets or sets an override value to display the button as selected.
|
|
68
64
|
*/
|
|
69
|
-
|
|
65
|
+
this.selected = 0;
|
|
70
66
|
/**
|
|
71
67
|
* Gets or sets a value to manually fade the blob size.
|
|
72
68
|
*/
|
|
73
|
-
|
|
69
|
+
this.selectionFade = 0;
|
|
74
70
|
/**
|
|
75
71
|
* Gets or sets a value to manually shrink the blob size as it fades (see selectionFade).
|
|
76
72
|
*/
|
|
77
|
-
|
|
73
|
+
this.selectionFadeSize = 0.3;
|
|
78
74
|
/**
|
|
79
75
|
* Gets or sets the distance from the button the cursor should be for the button
|
|
80
76
|
* to appear selected (Default is 8cm).
|
|
81
77
|
*/
|
|
82
|
-
|
|
78
|
+
this.selectedDistance = 0.08;
|
|
83
79
|
/**
|
|
84
80
|
* Gets or sets the fall-off distance for the selection fade (Default is 8cm).
|
|
85
81
|
*/
|
|
86
|
-
|
|
82
|
+
this.selectedFadeLength = 0.08;
|
|
87
83
|
/**
|
|
88
84
|
* Gets or sets the intensity of the luminous blob (Ranges 0-1, default is 0.5).
|
|
89
85
|
*/
|
|
90
|
-
|
|
86
|
+
this.blobIntensity = 0.5;
|
|
91
87
|
/**
|
|
92
88
|
* The size of the blob when the pointer is at the blobFarDistance (Default is 5cm).
|
|
93
89
|
*/
|
|
94
|
-
|
|
90
|
+
this.blobFarSize = 0.05;
|
|
95
91
|
/**
|
|
96
92
|
* The distance at which the pointer is considered near. See [left|right]BlobNearSize. (Default is 0cm).
|
|
97
93
|
*/
|
|
98
|
-
|
|
94
|
+
this.blobNearDistance = 0;
|
|
99
95
|
/**
|
|
100
96
|
* The distance at which the pointer is considered far. See [left|right]BlobFarSize. (Default is 8cm).
|
|
101
97
|
*/
|
|
102
|
-
|
|
98
|
+
this.blobFarDistance = 0.08;
|
|
103
99
|
/**
|
|
104
100
|
* The distance over which the blob intensity fades from full to none (Default is 8cm).
|
|
105
101
|
*/
|
|
106
|
-
|
|
102
|
+
this.blobFadeLength = 0.08;
|
|
107
103
|
/**
|
|
108
104
|
* Gets or sets whether the blob corresponding to the left index finger is enabled.
|
|
109
105
|
*/
|
|
110
|
-
|
|
106
|
+
this.leftBlobEnable = true;
|
|
111
107
|
/**
|
|
112
108
|
* Gets or sets the size of the left blob when the left pointer is considered near. See blobNearDistance. (Default is 2.5cm).
|
|
113
109
|
*/
|
|
114
|
-
|
|
110
|
+
this.leftBlobNearSize = 0.025;
|
|
115
111
|
/**
|
|
116
112
|
* Gets or sets the progress of the pulse animation on the left blob (Ranges 0-1).
|
|
117
113
|
*/
|
|
118
|
-
|
|
114
|
+
this.leftBlobPulse = 0;
|
|
119
115
|
/**
|
|
120
116
|
* Gets or sets the fade factor on the left blob.
|
|
121
117
|
*/
|
|
122
|
-
|
|
118
|
+
this.leftBlobFade = 1;
|
|
123
119
|
/**
|
|
124
120
|
* Gets or sets the inner fade on the left blob;
|
|
125
121
|
*/
|
|
126
|
-
|
|
122
|
+
this.leftBlobInnerFade = 0.01;
|
|
127
123
|
/**
|
|
128
124
|
* Gets or sets whether the blob corresponding to the right index finger is enabled.
|
|
129
125
|
*/
|
|
130
|
-
|
|
126
|
+
this.rightBlobEnable = true;
|
|
131
127
|
/**
|
|
132
128
|
* Gets or sets the size of the right blob when the right pointer is considered near. See blobNearDistance. (Default is 2.5cm).
|
|
133
129
|
*/
|
|
134
|
-
|
|
130
|
+
this.rightBlobNearSize = 0.025;
|
|
135
131
|
/**
|
|
136
132
|
* Gets or sets the progress of the pulse animation on the right blob (Ranges 0-1).
|
|
137
133
|
*/
|
|
138
|
-
|
|
134
|
+
this.rightBlobPulse = 0;
|
|
139
135
|
/**
|
|
140
136
|
* Gets or sets the fade factor on the right blob.
|
|
141
137
|
*/
|
|
142
|
-
|
|
138
|
+
this.rightBlobFade = 1;
|
|
143
139
|
/**
|
|
144
140
|
* Gets or sets the inner fade on the right blob;
|
|
145
141
|
*/
|
|
146
|
-
|
|
142
|
+
this.rightBlobInnerFade = 0.01;
|
|
147
143
|
/**
|
|
148
144
|
* Gets or sets the direction of the active face before the world transform is applied.
|
|
149
145
|
* This should almost always be set to -z.
|
|
150
146
|
*/
|
|
151
|
-
|
|
147
|
+
this.activeFaceDir = new Vector3(0, 0, -1);
|
|
152
148
|
/**
|
|
153
149
|
* Gets or sets the button's up direction before the world transform is applied.
|
|
154
150
|
* This should almost always be set to +y.
|
|
155
151
|
*/
|
|
156
|
-
|
|
152
|
+
this.activeFaceUp = new Vector3(0, 1, 0);
|
|
157
153
|
/**
|
|
158
154
|
* Gets or sets whether the edge fade effect is enabled.
|
|
159
155
|
*/
|
|
160
|
-
|
|
156
|
+
this.enableFade = true;
|
|
161
157
|
/**
|
|
162
158
|
* Gets or sets a value corresponding to the width of the edge fade effect (Default 1.5).
|
|
163
159
|
*/
|
|
164
|
-
|
|
160
|
+
this.fadeWidth = 1.5;
|
|
165
161
|
/**
|
|
166
162
|
* Gets or sets whether the active face is smoothly interpolated.
|
|
167
163
|
*/
|
|
168
|
-
|
|
164
|
+
this.smoothActiveFace = true;
|
|
169
165
|
/**
|
|
170
166
|
* Gets or sets whether the frame of the fluent button model is visible.
|
|
171
167
|
* This is usually only enabled for debugging purposes.
|
|
172
168
|
*/
|
|
173
|
-
|
|
169
|
+
this.showFrame = false;
|
|
174
170
|
/**
|
|
175
171
|
* Gets or sets whether the blob color texture is used for the proximity
|
|
176
172
|
* light effect. This is usually only disabled for debugging purposes.
|
|
177
173
|
*/
|
|
178
|
-
|
|
174
|
+
this.useBlobTexture = true;
|
|
179
175
|
/**
|
|
180
176
|
* Gets or sets the world-space position of the tip of the left index finger.
|
|
181
177
|
*/
|
|
182
|
-
|
|
178
|
+
this.globalLeftIndexTipPosition = Vector3.Zero();
|
|
183
179
|
/**
|
|
184
180
|
* Gets or sets the world-space position of the tip of the right index finger.
|
|
185
181
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return _this;
|
|
182
|
+
this.globalRightIndexTipPosition = Vector3.Zero();
|
|
183
|
+
this.alphaMode = Constants.ALPHA_ADD;
|
|
184
|
+
this.disableDepthWrite = true;
|
|
185
|
+
this.backFaceCulling = false;
|
|
186
|
+
this._blobTexture = new Texture(FluentButtonMaterial.BLOB_TEXTURE_URL, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
|
|
192
187
|
}
|
|
193
|
-
|
|
188
|
+
needAlphaBlending() {
|
|
194
189
|
return true;
|
|
195
|
-
}
|
|
196
|
-
|
|
190
|
+
}
|
|
191
|
+
needAlphaTesting() {
|
|
197
192
|
return true;
|
|
198
|
-
}
|
|
199
|
-
|
|
193
|
+
}
|
|
194
|
+
getAlphaTestTexture() {
|
|
200
195
|
return null;
|
|
201
|
-
}
|
|
196
|
+
}
|
|
202
197
|
// Methods
|
|
203
|
-
|
|
198
|
+
isReadyForSubMesh(mesh, subMesh) {
|
|
204
199
|
if (this.isFrozen) {
|
|
205
200
|
if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
|
|
206
201
|
return true;
|
|
@@ -209,12 +204,12 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
209
204
|
if (!subMesh.materialDefines) {
|
|
210
205
|
subMesh.materialDefines = new FluentButtonMaterialDefines();
|
|
211
206
|
}
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
const defines = subMesh.materialDefines;
|
|
208
|
+
const scene = this.getScene();
|
|
214
209
|
if (this._isReadyForSubMesh(subMesh)) {
|
|
215
210
|
return true;
|
|
216
211
|
}
|
|
217
|
-
|
|
212
|
+
const engine = scene.getEngine();
|
|
218
213
|
// Attribs
|
|
219
214
|
MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
|
|
220
215
|
// Get correct effect
|
|
@@ -222,14 +217,14 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
222
217
|
defines.markAsProcessed();
|
|
223
218
|
scene.resetCachedMaterial();
|
|
224
219
|
// Fallbacks
|
|
225
|
-
|
|
220
|
+
const fallbacks = new EffectFallbacks();
|
|
226
221
|
if (defines.FOG) {
|
|
227
222
|
fallbacks.addFallback(1, "FOG");
|
|
228
223
|
}
|
|
229
224
|
MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
|
|
230
225
|
defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
|
|
231
226
|
//Attributes
|
|
232
|
-
|
|
227
|
+
const attribs = [VertexBuffer.PositionKind];
|
|
233
228
|
if (defines.NORMAL) {
|
|
234
229
|
attribs.push(VertexBuffer.NormalKind);
|
|
235
230
|
}
|
|
@@ -247,9 +242,9 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
247
242
|
}
|
|
248
243
|
MaterialHelper.PrepareAttributesForInstances(attribs, defines);
|
|
249
244
|
// Legacy browser patch
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
245
|
+
const shaderName = "fluentButton";
|
|
246
|
+
const join = defines.toString();
|
|
247
|
+
const uniforms = [
|
|
253
248
|
"world",
|
|
254
249
|
"viewProjection",
|
|
255
250
|
"cameraPosition",
|
|
@@ -300,8 +295,8 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
300
295
|
"Global_Left_Index_Tip_Proximity",
|
|
301
296
|
"Global_Right_Index_Tip_Proximity",
|
|
302
297
|
];
|
|
303
|
-
|
|
304
|
-
|
|
298
|
+
const samplers = ["_Blob_Texture_"];
|
|
299
|
+
const uniformBuffers = new Array();
|
|
305
300
|
MaterialHelper.PrepareUniformsAndSamplersList({
|
|
306
301
|
uniformsNames: uniforms,
|
|
307
302
|
uniformBuffersNames: uniformBuffers,
|
|
@@ -327,14 +322,14 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
327
322
|
defines._renderId = scene.getRenderId();
|
|
328
323
|
subMesh.effect._wasPreviouslyReady = true;
|
|
329
324
|
return true;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
325
|
+
}
|
|
326
|
+
bindForSubMesh(world, mesh, subMesh) {
|
|
327
|
+
const scene = this.getScene();
|
|
328
|
+
const defines = subMesh.materialDefines;
|
|
334
329
|
if (!defines) {
|
|
335
330
|
return;
|
|
336
331
|
}
|
|
337
|
-
|
|
332
|
+
const effect = subMesh.effect;
|
|
338
333
|
if (!effect) {
|
|
339
334
|
return;
|
|
340
335
|
}
|
|
@@ -394,147 +389,144 @@ var FluentButtonMaterial = /** @class */ (function (_super) {
|
|
|
394
389
|
this._activeEffect.setVector4("Global_Left_Index_Tip_Position", new Vector4(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0));
|
|
395
390
|
this._activeEffect.setVector4("Global_Right_Index_Tip_Position", new Vector4(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0));
|
|
396
391
|
this._afterBind(mesh, this._activeEffect);
|
|
397
|
-
}
|
|
392
|
+
}
|
|
398
393
|
/**
|
|
399
394
|
* Get the list of animatables in the material.
|
|
400
395
|
* @returns the list of animatables object used in the material
|
|
401
396
|
*/
|
|
402
|
-
|
|
397
|
+
getAnimatables() {
|
|
403
398
|
return [];
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
var serializationObject = _super.prototype.serialize.call(this);
|
|
399
|
+
}
|
|
400
|
+
dispose(forceDisposeEffect) {
|
|
401
|
+
super.dispose(forceDisposeEffect);
|
|
402
|
+
}
|
|
403
|
+
clone(name) {
|
|
404
|
+
return SerializationHelper.Clone(() => new FluentButtonMaterial(name, this.getScene()), this);
|
|
405
|
+
}
|
|
406
|
+
serialize() {
|
|
407
|
+
const serializationObject = super.serialize();
|
|
414
408
|
serializationObject.customType = "BABYLON.FluentButtonMaterial";
|
|
415
409
|
return serializationObject;
|
|
416
|
-
}
|
|
417
|
-
|
|
410
|
+
}
|
|
411
|
+
getClassName() {
|
|
418
412
|
return "FluentButtonMaterial";
|
|
419
|
-
}
|
|
413
|
+
}
|
|
420
414
|
// Statics
|
|
421
|
-
|
|
422
|
-
return SerializationHelper.Parse(
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
}(PushMaterial));
|
|
538
|
-
export { FluentButtonMaterial };
|
|
415
|
+
static Parse(source, scene, rootUrl) {
|
|
416
|
+
return SerializationHelper.Parse(() => new FluentButtonMaterial(source.name, scene), source, scene, rootUrl);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* URL pointing to the texture used to define the coloring for the fluent blob effect.
|
|
421
|
+
*/
|
|
422
|
+
FluentButtonMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-button-blob.png";
|
|
423
|
+
__decorate([
|
|
424
|
+
serialize()
|
|
425
|
+
], FluentButtonMaterial.prototype, "edgeWidth", void 0);
|
|
426
|
+
__decorate([
|
|
427
|
+
serializeAsColor4()
|
|
428
|
+
], FluentButtonMaterial.prototype, "edgeColor", void 0);
|
|
429
|
+
__decorate([
|
|
430
|
+
serialize()
|
|
431
|
+
], FluentButtonMaterial.prototype, "proximityMaxIntensity", void 0);
|
|
432
|
+
__decorate([
|
|
433
|
+
serialize()
|
|
434
|
+
], FluentButtonMaterial.prototype, "proximityFarDistance", void 0);
|
|
435
|
+
__decorate([
|
|
436
|
+
serialize()
|
|
437
|
+
], FluentButtonMaterial.prototype, "proximityNearRadius", void 0);
|
|
438
|
+
__decorate([
|
|
439
|
+
serialize()
|
|
440
|
+
], FluentButtonMaterial.prototype, "proximityAnisotropy", void 0);
|
|
441
|
+
__decorate([
|
|
442
|
+
serialize()
|
|
443
|
+
], FluentButtonMaterial.prototype, "selectionFuzz", void 0);
|
|
444
|
+
__decorate([
|
|
445
|
+
serialize()
|
|
446
|
+
], FluentButtonMaterial.prototype, "selected", void 0);
|
|
447
|
+
__decorate([
|
|
448
|
+
serialize()
|
|
449
|
+
], FluentButtonMaterial.prototype, "selectionFade", void 0);
|
|
450
|
+
__decorate([
|
|
451
|
+
serialize()
|
|
452
|
+
], FluentButtonMaterial.prototype, "selectionFadeSize", void 0);
|
|
453
|
+
__decorate([
|
|
454
|
+
serialize()
|
|
455
|
+
], FluentButtonMaterial.prototype, "selectedDistance", void 0);
|
|
456
|
+
__decorate([
|
|
457
|
+
serialize()
|
|
458
|
+
], FluentButtonMaterial.prototype, "selectedFadeLength", void 0);
|
|
459
|
+
__decorate([
|
|
460
|
+
serialize()
|
|
461
|
+
], FluentButtonMaterial.prototype, "blobIntensity", void 0);
|
|
462
|
+
__decorate([
|
|
463
|
+
serialize()
|
|
464
|
+
], FluentButtonMaterial.prototype, "blobFarSize", void 0);
|
|
465
|
+
__decorate([
|
|
466
|
+
serialize()
|
|
467
|
+
], FluentButtonMaterial.prototype, "blobNearDistance", void 0);
|
|
468
|
+
__decorate([
|
|
469
|
+
serialize()
|
|
470
|
+
], FluentButtonMaterial.prototype, "blobFarDistance", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
serialize()
|
|
473
|
+
], FluentButtonMaterial.prototype, "blobFadeLength", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
serialize()
|
|
476
|
+
], FluentButtonMaterial.prototype, "leftBlobEnable", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
serialize()
|
|
479
|
+
], FluentButtonMaterial.prototype, "leftBlobNearSize", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
serialize()
|
|
482
|
+
], FluentButtonMaterial.prototype, "leftBlobPulse", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
serialize()
|
|
485
|
+
], FluentButtonMaterial.prototype, "leftBlobFade", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
serialize()
|
|
488
|
+
], FluentButtonMaterial.prototype, "leftBlobInnerFade", void 0);
|
|
489
|
+
__decorate([
|
|
490
|
+
serialize()
|
|
491
|
+
], FluentButtonMaterial.prototype, "rightBlobEnable", void 0);
|
|
492
|
+
__decorate([
|
|
493
|
+
serialize()
|
|
494
|
+
], FluentButtonMaterial.prototype, "rightBlobNearSize", void 0);
|
|
495
|
+
__decorate([
|
|
496
|
+
serialize()
|
|
497
|
+
], FluentButtonMaterial.prototype, "rightBlobPulse", void 0);
|
|
498
|
+
__decorate([
|
|
499
|
+
serialize()
|
|
500
|
+
], FluentButtonMaterial.prototype, "rightBlobFade", void 0);
|
|
501
|
+
__decorate([
|
|
502
|
+
serialize()
|
|
503
|
+
], FluentButtonMaterial.prototype, "rightBlobInnerFade", void 0);
|
|
504
|
+
__decorate([
|
|
505
|
+
serializeAsVector3()
|
|
506
|
+
], FluentButtonMaterial.prototype, "activeFaceDir", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
serializeAsVector3()
|
|
509
|
+
], FluentButtonMaterial.prototype, "activeFaceUp", void 0);
|
|
510
|
+
__decorate([
|
|
511
|
+
serialize()
|
|
512
|
+
], FluentButtonMaterial.prototype, "enableFade", void 0);
|
|
513
|
+
__decorate([
|
|
514
|
+
serialize()
|
|
515
|
+
], FluentButtonMaterial.prototype, "fadeWidth", void 0);
|
|
516
|
+
__decorate([
|
|
517
|
+
serialize()
|
|
518
|
+
], FluentButtonMaterial.prototype, "smoothActiveFace", void 0);
|
|
519
|
+
__decorate([
|
|
520
|
+
serialize()
|
|
521
|
+
], FluentButtonMaterial.prototype, "showFrame", void 0);
|
|
522
|
+
__decorate([
|
|
523
|
+
serialize()
|
|
524
|
+
], FluentButtonMaterial.prototype, "useBlobTexture", void 0);
|
|
525
|
+
__decorate([
|
|
526
|
+
serializeAsVector3()
|
|
527
|
+
], FluentButtonMaterial.prototype, "globalLeftIndexTipPosition", void 0);
|
|
528
|
+
__decorate([
|
|
529
|
+
serializeAsVector3()
|
|
530
|
+
], FluentButtonMaterial.prototype, "globalRightIndexTipPosition", void 0);
|
|
539
531
|
RegisterClass("BABYLON.GUI.FluentButtonMaterial", FluentButtonMaterial);
|
|
540
532
|
//# sourceMappingURL=fluentButtonMaterial.js.map
|