@combeenation/3d-viewer 7.1.0 → 7.1.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/README.md +111 -111
- package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-cjs/api/classes/animationInterface.js +2 -2
- package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-cjs/api/classes/dottedPath.js +166 -166
- package/dist/lib-cjs/api/classes/element.d.ts +153 -153
- package/dist/lib-cjs/api/classes/element.js +672 -670
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/event.d.ts +401 -396
- package/dist/lib-cjs/api/classes/event.js +424 -419
- package/dist/lib-cjs/api/classes/event.js.map +1 -1
- package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -49
- package/dist/lib-cjs/api/classes/fuzzyMap.d.ts +7 -7
- package/dist/lib-cjs/api/classes/fuzzyMap.js +21 -21
- package/dist/lib-cjs/api/classes/parameter.d.ts +351 -351
- package/dist/lib-cjs/api/classes/parameter.js +524 -517
- package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-cjs/api/classes/parameterObservable.js +72 -72
- package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-cjs/api/classes/parameterizable.js +102 -102
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -45
- package/dist/lib-cjs/api/classes/placementAnimation.js +176 -176
- package/dist/lib-cjs/api/classes/variant.d.ts +253 -253
- package/dist/lib-cjs/api/classes/variant.js +858 -843
- package/dist/lib-cjs/api/classes/variant.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantInstance.d.ts +53 -53
- package/dist/lib-cjs/api/classes/variantInstance.js +125 -125
- package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-cjs/api/classes/variantParameterizable.js +86 -88
- package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewer.d.ts +204 -199
- package/dist/lib-cjs/api/classes/viewer.js +682 -670
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewerError.d.ts +43 -0
- package/dist/lib-cjs/api/classes/viewerError.js +56 -0
- package/dist/lib-cjs/api/classes/viewerError.js.map +1 -0
- package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
- package/dist/lib-cjs/api/classes/viewerLight.js +348 -348
- package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
- package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
- package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
- package/dist/lib-cjs/api/internal/sceneSetup.js +226 -226
- package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
- package/dist/lib-cjs/api/manager/animationManager.js +126 -126
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +79 -78
- package/dist/lib-cjs/api/manager/gltfExportManager.js +242 -241
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -33
- package/dist/lib-cjs/api/manager/sceneManager.js +128 -130
- package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/tagManager.d.ts +116 -108
- package/dist/lib-cjs/api/manager/tagManager.js +444 -419
- package/dist/lib-cjs/api/manager/tagManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -22
- package/dist/lib-cjs/api/manager/textureLoadManager.js +97 -97
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +106 -102
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +292 -284
- package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
- package/dist/lib-cjs/api/store/specStorage.d.ts +32 -32
- package/dist/lib-cjs/api/store/specStorage.js +65 -65
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +235 -235
- package/dist/lib-cjs/api/util/babylonHelper.js +753 -753
- package/dist/lib-cjs/api/util/globalTypes.d.ts +441 -436
- package/dist/lib-cjs/api/util/globalTypes.js +1 -1
- package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
- package/dist/lib-cjs/api/util/resourceHelper.js +203 -203
- package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +44 -44
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js +175 -175
- package/dist/lib-cjs/api/util/stringHelper.d.ts +13 -13
- package/dist/lib-cjs/api/util/stringHelper.js +32 -32
- package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/structureHelper.js +57 -48
- package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
- package/dist/lib-cjs/buildinfo.json +3 -3
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/dist/lib-cjs/index.d.ts +54 -53
- package/dist/lib-cjs/index.js +117 -114
- package/dist/lib-cjs/index.js.map +1 -1
- package/package.json +81 -81
- package/src/api/classes/animationInterface.ts +10 -10
- package/src/api/classes/dottedPath.ts +181 -181
- package/src/api/classes/element.ts +733 -731
- package/src/api/classes/event.ts +457 -452
- package/src/api/classes/eventBroadcaster.ts +52 -52
- package/src/api/classes/fuzzyMap.ts +21 -21
- package/src/api/classes/parameter.ts +561 -554
- package/src/api/classes/parameterObservable.ts +73 -73
- package/src/api/classes/parameterizable.ts +87 -87
- package/src/api/classes/placementAnimation.ts +162 -162
- package/src/api/classes/variant.ts +949 -933
- package/src/api/classes/variantInstance.ts +123 -123
- package/src/api/classes/variantParameterizable.ts +83 -85
- package/src/api/classes/viewer.ts +760 -743
- package/src/api/classes/viewerError.ts +63 -0
- package/src/api/classes/viewerLight.ts +339 -339
- package/src/api/internal/debugViewer.ts +90 -90
- package/src/api/internal/lensRendering.ts +9 -9
- package/src/api/internal/sceneSetup.ts +205 -205
- package/src/api/manager/animationManager.ts +143 -143
- package/src/api/manager/gltfExportManager.ts +237 -236
- package/src/api/manager/sceneManager.ts +134 -136
- package/src/api/manager/tagManager.ts +477 -451
- package/src/api/manager/textureLoadManager.ts +95 -95
- package/src/api/manager/variantInstanceManager.ts +309 -297
- package/src/api/store/specStorage.ts +68 -68
- package/src/api/util/babylonHelper.ts +823 -823
- package/src/api/util/globalTypes.ts +508 -503
- package/src/api/util/resourceHelper.ts +191 -191
- package/src/api/util/sceneLoaderHelper.ts +170 -170
- package/src/api/util/stringHelper.ts +30 -30
- package/src/api/util/structureHelper.ts +58 -49
- package/src/buildinfo.json +3 -3
- package/src/dev.ts +62 -62
- package/src/index.ts +103 -100
- package/src/types.d.ts +38 -38
|
@@ -1,518 +1,525 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Parameter = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
[Parameter.
|
|
24
|
-
[Parameter.
|
|
25
|
-
[Parameter.
|
|
26
|
-
[Parameter.
|
|
27
|
-
[Parameter.
|
|
28
|
-
[Parameter.
|
|
29
|
-
[Parameter.
|
|
30
|
-
[Parameter.
|
|
31
|
-
[Parameter.
|
|
32
|
-
[Parameter.
|
|
33
|
-
[Parameter.
|
|
34
|
-
[Parameter.
|
|
35
|
-
[Parameter.
|
|
36
|
-
[Parameter.
|
|
37
|
-
[Parameter.
|
|
38
|
-
[Parameter.
|
|
39
|
-
[Parameter.
|
|
40
|
-
[Parameter.
|
|
41
|
-
[Parameter.
|
|
42
|
-
[Parameter.
|
|
43
|
-
[Parameter.
|
|
44
|
-
[Parameter.
|
|
45
|
-
[Parameter.
|
|
46
|
-
[Parameter.
|
|
47
|
-
[Parameter.
|
|
48
|
-
[Parameter.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
[Parameter.
|
|
58
|
-
[Parameter.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return math_color_1.Color3
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
*
|
|
250
|
-
* @
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* @
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
*
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Parameter = void 0;
|
|
4
|
+
const viewerError_1 = require("./viewerError");
|
|
5
|
+
const math_color_1 = require("@babylonjs/core/Maths/math.color");
|
|
6
|
+
const math_vector_1 = require("@babylonjs/core/Maths/math.vector");
|
|
7
|
+
const lodash_es_1 = require("lodash-es");
|
|
8
|
+
/**
|
|
9
|
+
* This `Parameter` class defines all parameters that can be consumed and committed by a {@link ParameterObservable}.
|
|
10
|
+
* Use {@link ParameterObservable.addParameterObserver} or {@link ParameterObservable.commitParameters} to either add or
|
|
11
|
+
* commit parameters on your observable objects.
|
|
12
|
+
*/
|
|
13
|
+
class Parameter {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor.
|
|
16
|
+
*/
|
|
17
|
+
constructor() { }
|
|
18
|
+
/**
|
|
19
|
+
* The {@link ParameterDeclarations} for all parameters in this class.
|
|
20
|
+
*/
|
|
21
|
+
static get declarations() {
|
|
22
|
+
return {
|
|
23
|
+
[Parameter.VISIBLE]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
24
|
+
[Parameter.SCALING]: { type: 'number', parser: Parameter.parseNumber },
|
|
25
|
+
[Parameter.POSITION]: { type: 'vector', parser: Parameter.parseVector },
|
|
26
|
+
[Parameter.ROTATION]: { type: 'vector', parser: Parameter.parseVector },
|
|
27
|
+
[Parameter.HIGHLIGHTED]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
28
|
+
[Parameter.MATERIAL]: { type: 'string' },
|
|
29
|
+
[Parameter.MATERIAL_COLOR]: { type: 'color', parser: Parameter.parseColor },
|
|
30
|
+
[Parameter.MATERIAL_METALLNESS]: { type: 'number', parser: Parameter.parseNumber },
|
|
31
|
+
[Parameter.MATERIAL_ROUGHNESS]: { type: 'number', parser: Parameter.parseNumber },
|
|
32
|
+
[Parameter.HIGHLIGHT_ENABLED]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
33
|
+
[Parameter.HIGHLIGHT_COLOR]: { type: 'color', parser: Parameter.parseColor },
|
|
34
|
+
[Parameter.HIGHLIGHTED]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
35
|
+
[Parameter.CAST_SHADOW]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
36
|
+
[Parameter.CAST_SHADOW_FROM_LIGHTS]: { type: 'csl', parser: Parameter.parseCommaSeparatedList },
|
|
37
|
+
[Parameter.RECEIVE_SHADOWS]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
38
|
+
[Parameter.INTENSITY]: { type: 'number', parser: Parameter.parseNumber },
|
|
39
|
+
[Parameter.DIRECTION]: { type: 'vector', parser: Parameter.parseVector },
|
|
40
|
+
[Parameter.ANGLE]: { type: 'number', parser: Parameter.parseNumber },
|
|
41
|
+
[Parameter.EXPONENT]: { type: 'number', parser: Parameter.parseNumber },
|
|
42
|
+
[Parameter.DIFFUSE]: { type: 'color', parser: Parameter.parseColor },
|
|
43
|
+
[Parameter.SPECULAR]: { type: 'color', parser: Parameter.parseColor },
|
|
44
|
+
[Parameter.ENVIRONMENT]: { type: 'string' },
|
|
45
|
+
[Parameter.ENVIRONMENT_COLOR]: { type: 'color', parser: Parameter.parseColor },
|
|
46
|
+
[Parameter.ENVIRONMENT_ROTATION]: { type: 'number', parser: Parameter.parseNumber },
|
|
47
|
+
[Parameter.ENVIRONMENT_INTENSITY]: { type: 'number', parser: Parameter.parseNumber },
|
|
48
|
+
[Parameter.ENVIRONMENT_BACKGROUND]: { type: 'string' },
|
|
49
|
+
[Parameter.ENVIRONMENT_USEDEFAULT]: { type: 'boolean', parser: Parameter.parseBoolean },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The default {@link ParameterValue}s returned as {@link ParameterBag} for a set of parameters in this class.
|
|
54
|
+
*/
|
|
55
|
+
static get defaultValues() {
|
|
56
|
+
return {
|
|
57
|
+
[Parameter.SCALING]: '(1, 1, 1)',
|
|
58
|
+
[Parameter.POSITION]: '(0, 0, 0)',
|
|
59
|
+
[Parameter.ROTATION]: '(0, 0, 0)',
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets the {@link ParameterDeclaration} for a given {@link Parameter} declared in this class.
|
|
64
|
+
*/
|
|
65
|
+
static getDeclaration(parameter) {
|
|
66
|
+
return Parameter.declarations[parameter];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Gets the default {@link ParameterValue} for a given {@link Parameter} declared in this class.
|
|
70
|
+
*/
|
|
71
|
+
static getDefaultValue(parameter) {
|
|
72
|
+
return Parameter.defaultValues[parameter];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* All parameters defined in this class.
|
|
76
|
+
*/
|
|
77
|
+
static get all() {
|
|
78
|
+
const all = [];
|
|
79
|
+
for (const parameter in Parameter) {
|
|
80
|
+
const property = Object.getOwnPropertyDescriptor(Parameter, parameter);
|
|
81
|
+
if (parameter.toUpperCase() === parameter && property && (0, lodash_es_1.isString)(property.value)) {
|
|
82
|
+
all.push(property.value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return all;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Asserts whether given parameter is declared and valid.
|
|
89
|
+
*/
|
|
90
|
+
static assertParameter(parameterDeclaration, parameter, value) {
|
|
91
|
+
if (!(parameter in parameterDeclaration)) {
|
|
92
|
+
// This is a valid case since we are not able to check parameters that are not declared.
|
|
93
|
+
// We just ignore parameters that are not declared.
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const declaration = parameterDeclaration[parameter];
|
|
97
|
+
const genericError = `"${value}" is not a valid value for parameter "${parameter}" of type "${declaration.type}".`;
|
|
98
|
+
if (declaration.parser) {
|
|
99
|
+
try {
|
|
100
|
+
declaration.parser(value);
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
throw new viewerError_1.ViewerError({
|
|
104
|
+
id: viewerError_1.ViewerErrorIds.InvalidParameterValue,
|
|
105
|
+
message: `${genericError} ${e.message}`,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
switch (declaration.type) {
|
|
110
|
+
case 'select':
|
|
111
|
+
if (!declaration.options) {
|
|
112
|
+
throw new viewerError_1.ViewerError({
|
|
113
|
+
id: viewerError_1.ViewerErrorIds.UnknownParameterOption,
|
|
114
|
+
message: `No options defined for parameter declaration "${parameter}" of type "${declaration.type}".`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (declaration.options.indexOf(value) === -1) {
|
|
118
|
+
throw Error(genericError + ` Valid values are: "${declaration.options.join('", "')}".`);
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Parses given {@link ParameterBag} with given {@link ParameterDeclarations}.
|
|
125
|
+
*/
|
|
126
|
+
static parseFromDeclarations(declarations, parameterBag) {
|
|
127
|
+
const parameters = {};
|
|
128
|
+
for (const parameter in parameterBag) {
|
|
129
|
+
const value = (0, lodash_es_1.get)(parameterBag, parameter);
|
|
130
|
+
parameters[parameter] = value;
|
|
131
|
+
const declaration = declarations[parameter];
|
|
132
|
+
if (declaration) {
|
|
133
|
+
if (!(0, lodash_es_1.isEmpty)(value) && declaration.parser) {
|
|
134
|
+
parameters[parameter] = declaration.parser(value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return parameters;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Parses a string of format `'(x,y,z)'` to a `Vector3`.
|
|
142
|
+
*/
|
|
143
|
+
static parseVector(value) {
|
|
144
|
+
if (!(0, lodash_es_1.isString)(value)) {
|
|
145
|
+
throw new Error(`Unable to convert "${value}" into a Vector: not a string.`);
|
|
146
|
+
}
|
|
147
|
+
let cleanedValue = value.split(' ').join('');
|
|
148
|
+
if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
|
|
149
|
+
cleanedValue = cleanedValue.substring(1, cleanedValue.length - 1);
|
|
150
|
+
const [x, y, z] = cleanedValue.split(',').map(value => parseFloat(value));
|
|
151
|
+
return new math_vector_1.Vector3(x, y, z);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
throw new Error(`Unable to parse "${value}" to a Vector: expected "(x,y,z)".`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Stringifies a Vector3 to format `(x,y,z)`.
|
|
159
|
+
*/
|
|
160
|
+
static stringifyVector(value) {
|
|
161
|
+
return `(${value.x},${value.y},${value.z})`;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Parses a string of format `'(x,y,z)'` with angular degrees to a `Vector3` with rotation information in radians.
|
|
165
|
+
*/
|
|
166
|
+
static parseRotation(value) {
|
|
167
|
+
const rotation = Parameter.parseVector(value);
|
|
168
|
+
const deg2rad = function (deg) {
|
|
169
|
+
return (deg * Math.PI) / 180;
|
|
170
|
+
};
|
|
171
|
+
return rotation.set(deg2rad(rotation.x), deg2rad(rotation.y), deg2rad(rotation.z));
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Parses a string of format `'(x,y,z)'` or a simple `number` to a `Vector3` for scaling.
|
|
175
|
+
*/
|
|
176
|
+
static parseScaling(value) {
|
|
177
|
+
let scaling = new math_vector_1.Vector3();
|
|
178
|
+
if ((0, lodash_es_1.isString)(value)) {
|
|
179
|
+
const cleanedFactor = value.split(' ').join('');
|
|
180
|
+
if (cleanedFactor.startsWith('(') && cleanedFactor.endsWith(')')) {
|
|
181
|
+
scaling = Parameter.parseVector(cleanedFactor);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const _factor = parseFloat(value);
|
|
185
|
+
scaling = new math_vector_1.Vector3(_factor, _factor, _factor);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else if ((0, lodash_es_1.isNumber)(value)) {
|
|
189
|
+
scaling = new math_vector_1.Vector3(value, value, value);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
throw new Error(`Unable to convert "${value}" to a Vector: expected "(x,y,z)".`);
|
|
193
|
+
}
|
|
194
|
+
return scaling;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Parses a string of format `'#rrggbb'` or `'(r,g,b)'` to a `Color3`.
|
|
198
|
+
*/
|
|
199
|
+
static parseColor(value) {
|
|
200
|
+
const cleanedValue = value.toString().split(' ').join('');
|
|
201
|
+
if (cleanedValue.startsWith('#')) {
|
|
202
|
+
return math_color_1.Color3.FromHexString(value.toString());
|
|
203
|
+
}
|
|
204
|
+
if (cleanedValue.startsWith('(') && cleanedValue.endsWith(')')) {
|
|
205
|
+
const rgb = cleanedValue.substring(1, cleanedValue.length - 1);
|
|
206
|
+
const [r, g, b] = rgb.split(',').map(value => parseFloat(value));
|
|
207
|
+
return math_color_1.Color3.FromInts(r, g, b);
|
|
208
|
+
}
|
|
209
|
+
const humanReadable = (0, lodash_es_1.capitalize)(cleanedValue);
|
|
210
|
+
// disable lint for this rule as there is no smoother option for checking static class functions (eg Color.Red())
|
|
211
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
212
|
+
if (math_color_1.Color3.hasOwnProperty(humanReadable)) {
|
|
213
|
+
// @ts-ignore same as above
|
|
214
|
+
return math_color_1.Color3[humanReadable]();
|
|
215
|
+
}
|
|
216
|
+
throw new Error(`Unable to parse "${value}" to a Color: expected "#rrggbb", "(r,g,b)" or any human readable property implemented in Color3.`);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Parses a `boolean` string (`'true'`/`'1'` or `'false'`/`'0'`) or `number` (`1` or `0`) to a `boolean` or
|
|
220
|
+
* `undefined`.
|
|
221
|
+
*/
|
|
222
|
+
static parseBoolean(value) {
|
|
223
|
+
if (value.toString() === 'true' || value.toString() === '1') {
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
else if (value.toString() === 'false' || value.toString() === '0') {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
throw new Error(`Unable to parse "${value}" to a boolean.`);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Parses a number `string` to a `number`.
|
|
233
|
+
*/
|
|
234
|
+
static parseNumber(value) {
|
|
235
|
+
return parseFloat(value.toString());
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Parses a string with comma separated values to a list of strings.
|
|
239
|
+
*/
|
|
240
|
+
static parseCommaSeparatedList(value) {
|
|
241
|
+
return value
|
|
242
|
+
.toString()
|
|
243
|
+
.split(',')
|
|
244
|
+
.map(s => s.trim());
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.Parameter = Parameter;
|
|
248
|
+
/**
|
|
249
|
+
* Mutates the visibility. Helper methods are {@link VariantParameterizable.show} and
|
|
250
|
+
* {@link VariantParameterizable.hide}. Getter and setter is {@link VariantParameterizable.visible}.
|
|
251
|
+
*
|
|
252
|
+
* Scopes:
|
|
253
|
+
* * {@link Element}
|
|
254
|
+
* * {@link Variant}
|
|
255
|
+
* * {@link ViewerLight} Available for all light types
|
|
256
|
+
*
|
|
257
|
+
* @parser {@link parseBoolean}
|
|
258
|
+
*/
|
|
259
|
+
Parameter.VISIBLE = 'visible';
|
|
260
|
+
/**
|
|
261
|
+
* Stretches or compresses some meshes. Getter and setter is {@link VariantParameterizable.scaling}.
|
|
262
|
+
*
|
|
263
|
+
* Scopes:
|
|
264
|
+
* * {@link Element}
|
|
265
|
+
* * {@link Variant}
|
|
266
|
+
*
|
|
267
|
+
* @parser {@link parseScaling}
|
|
268
|
+
*/
|
|
269
|
+
Parameter.SCALING = 'scaling';
|
|
270
|
+
/**
|
|
271
|
+
* Mutates the material. Getter and setter is {@link VariantParameterizable.material}. The value of this parameter
|
|
272
|
+
* represents the ID of a baked-in glTF or custom created material in the {@link Variant} tree.
|
|
273
|
+
*
|
|
274
|
+
* Scopes:
|
|
275
|
+
* * {@link Element}
|
|
276
|
+
* * {@link Variant}
|
|
277
|
+
*
|
|
278
|
+
* @parser string
|
|
279
|
+
*/
|
|
280
|
+
Parameter.MATERIAL = 'material';
|
|
281
|
+
/**
|
|
282
|
+
* Mutates the material color.
|
|
283
|
+
*
|
|
284
|
+
* Scopes:
|
|
285
|
+
* * {@link Element}
|
|
286
|
+
* * {@link Variant}
|
|
287
|
+
*
|
|
288
|
+
* @parser {@link parseColor}
|
|
289
|
+
*/
|
|
290
|
+
Parameter.MATERIAL_COLOR = 'material.color';
|
|
291
|
+
/**
|
|
292
|
+
* Mutates the material metallness.
|
|
293
|
+
*
|
|
294
|
+
* Scopes:
|
|
295
|
+
* * {@link Element}
|
|
296
|
+
* * {@link Variant}
|
|
297
|
+
*
|
|
298
|
+
* @parser {@link parseNumber}
|
|
299
|
+
*/
|
|
300
|
+
Parameter.MATERIAL_METALLNESS = 'material.metallness';
|
|
301
|
+
/**
|
|
302
|
+
* Mutates the material roughness.
|
|
303
|
+
*
|
|
304
|
+
* Scopes:
|
|
305
|
+
* * {@link Element}
|
|
306
|
+
* * {@link Variant}
|
|
307
|
+
*
|
|
308
|
+
* @parser {@link parseNumber}
|
|
309
|
+
*/
|
|
310
|
+
Parameter.MATERIAL_ROUGHNESS = 'material.roughness';
|
|
311
|
+
/**
|
|
312
|
+
* Mutates whether a highlight layer should be enabled.
|
|
313
|
+
*
|
|
314
|
+
* Scopes:
|
|
315
|
+
* * {@link Element}
|
|
316
|
+
* * {@link Variant}
|
|
317
|
+
*
|
|
318
|
+
* @parser {@link parseBoolean}
|
|
319
|
+
*/
|
|
320
|
+
Parameter.HIGHLIGHT_ENABLED = 'highlight.enabled';
|
|
321
|
+
/**
|
|
322
|
+
* Changes the highlight color.
|
|
323
|
+
*
|
|
324
|
+
* Scopes:
|
|
325
|
+
* * {@link Element}
|
|
326
|
+
* * {@link Variant}
|
|
327
|
+
*
|
|
328
|
+
* @parser {@link parseColor}
|
|
329
|
+
*/
|
|
330
|
+
Parameter.HIGHLIGHT_COLOR = 'highlight.color';
|
|
331
|
+
/**
|
|
332
|
+
* Mutates the highlighted state. Getter and setter is {@link VariantParameterizable.highlighted}.
|
|
333
|
+
*
|
|
334
|
+
* Scopes:
|
|
335
|
+
* * {@link Element}
|
|
336
|
+
* * {@link Variant}
|
|
337
|
+
*
|
|
338
|
+
* @parser {@link parseBoolean}
|
|
339
|
+
*/
|
|
340
|
+
Parameter.HIGHLIGHTED = 'highlighted';
|
|
341
|
+
/**
|
|
342
|
+
* Mutates the position relative to its origin position. Getter and setter is {@link VariantParameterizable.position}.
|
|
343
|
+
*
|
|
344
|
+
* Scopes:
|
|
345
|
+
* * {@link Element}
|
|
346
|
+
* * {@link Variant}
|
|
347
|
+
* * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#position), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#position), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#position)
|
|
348
|
+
*
|
|
349
|
+
* @parser {@link parseVector}
|
|
350
|
+
*/
|
|
351
|
+
Parameter.POSITION = 'position';
|
|
352
|
+
/**
|
|
353
|
+
* Mutates the rotation relative to its origin rotation. Getter and setter is {@link VariantParameterizable.rotation}.
|
|
354
|
+
*
|
|
355
|
+
* Scopes:
|
|
356
|
+
* * {@link Element}
|
|
357
|
+
* * {@link Variant}
|
|
358
|
+
*
|
|
359
|
+
* @parser {@link parseRotation}
|
|
360
|
+
*/
|
|
361
|
+
Parameter.ROTATION = 'rotation';
|
|
362
|
+
/**
|
|
363
|
+
* Mutates whether a shadow should be casted or not.
|
|
364
|
+
*
|
|
365
|
+
* Scopes:
|
|
366
|
+
* * {@link Element}
|
|
367
|
+
* * {@link Variant}
|
|
368
|
+
*
|
|
369
|
+
* @parser {@link parseBoolean}
|
|
370
|
+
*/
|
|
371
|
+
Parameter.CAST_SHADOW = 'castShadow';
|
|
372
|
+
/**
|
|
373
|
+
* Mutates from which lights a shadow should be casted.
|
|
374
|
+
*
|
|
375
|
+
* Scopes:
|
|
376
|
+
* * {@link Element}
|
|
377
|
+
* * {@link Variant}
|
|
378
|
+
*
|
|
379
|
+
* @parser {@link parseCommaSeparatedList}
|
|
380
|
+
*/
|
|
381
|
+
Parameter.CAST_SHADOW_FROM_LIGHTS = 'castShadow.fromLights';
|
|
382
|
+
/**
|
|
383
|
+
* Mutates whether to receive shadows or not.
|
|
384
|
+
*
|
|
385
|
+
* Scopes:
|
|
386
|
+
* * {@link Element}
|
|
387
|
+
* * {@link Variant}
|
|
388
|
+
*
|
|
389
|
+
* @parser {@link parseBoolean}
|
|
390
|
+
*/
|
|
391
|
+
Parameter.RECEIVE_SHADOWS = 'receiveShadows';
|
|
392
|
+
/**
|
|
393
|
+
* Mutates the intensity of Lights.
|
|
394
|
+
*
|
|
395
|
+
* Scopes:
|
|
396
|
+
* * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#intensity), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#intensity), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#intensity), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#intensity)
|
|
397
|
+
*
|
|
398
|
+
* @parser {@link parseNumber}
|
|
399
|
+
*/
|
|
400
|
+
Parameter.INTENSITY = 'intensity';
|
|
401
|
+
/**
|
|
402
|
+
* Mutates the direction of Lights.
|
|
403
|
+
*
|
|
404
|
+
* Scopes:
|
|
405
|
+
* * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#direction), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#direction), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#direction), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#direction)
|
|
406
|
+
*
|
|
407
|
+
* @parser {@link parseNumber}
|
|
408
|
+
*/
|
|
409
|
+
Parameter.DIRECTION = 'direction';
|
|
410
|
+
/**
|
|
411
|
+
* Mutates the angle of Lights.
|
|
412
|
+
*
|
|
413
|
+
* Scopes:
|
|
414
|
+
* * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#angle)
|
|
415
|
+
*
|
|
416
|
+
* @parser {@link parseNumber}
|
|
417
|
+
*/
|
|
418
|
+
Parameter.ANGLE = 'angle';
|
|
419
|
+
/**
|
|
420
|
+
* Mutates the exponent of Lights.
|
|
421
|
+
*
|
|
422
|
+
* Scopes:
|
|
423
|
+
* * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#exponent)
|
|
424
|
+
*
|
|
425
|
+
* @parser {@link parseNumber}
|
|
426
|
+
*/
|
|
427
|
+
Parameter.EXPONENT = 'exponent';
|
|
428
|
+
/**
|
|
429
|
+
* Mutates the diffuse color of Lights.
|
|
430
|
+
*
|
|
431
|
+
* Scopes:
|
|
432
|
+
* * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#diffuse), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#diffuse), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#diffuse), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#diffuse)
|
|
433
|
+
*
|
|
434
|
+
* @parser {@link parseNumber}
|
|
435
|
+
*/
|
|
436
|
+
Parameter.DIFFUSE = 'diffuse';
|
|
437
|
+
/**
|
|
438
|
+
* Mutates the specular color of Lights.
|
|
439
|
+
*
|
|
440
|
+
* Scopes:
|
|
441
|
+
* * {@link ViewerLight} Available for [PointLight](https://doc.babylonjs.com/typedoc/classes/babylon.pointlight#specular), [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#specular), [DirectionalLight](https://doc.babylonjs.com/typedoc/classes/babylon.directionallight#specular), [HemisphericLight](https://doc.babylonjs.com/typedoc/classes/babylon.hemisphericlight#specular)
|
|
442
|
+
*
|
|
443
|
+
* @parser {@link parseNumber}
|
|
444
|
+
*/
|
|
445
|
+
Parameter.SPECULAR = 'specular';
|
|
446
|
+
/**
|
|
447
|
+
* Sets the environment. See [BABYLON.Scene.environmentTexture](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#environmentTexture).
|
|
448
|
+
*
|
|
449
|
+
* Usually the URL to an `*.env` file.
|
|
450
|
+
*
|
|
451
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
452
|
+
*
|
|
453
|
+
* Scopes:
|
|
454
|
+
* * {@link SceneManager}
|
|
455
|
+
*
|
|
456
|
+
* @parser string
|
|
457
|
+
*/
|
|
458
|
+
Parameter.ENVIRONMENT = 'environment';
|
|
459
|
+
/**
|
|
460
|
+
* Sets [BABYLON.Scene.clearColor](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#clearColor)
|
|
461
|
+
*
|
|
462
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
463
|
+
*
|
|
464
|
+
* Scopes:
|
|
465
|
+
* * {@link SceneManager}
|
|
466
|
+
*
|
|
467
|
+
* @parser {@link parseColor}
|
|
468
|
+
*/
|
|
469
|
+
Parameter.ENVIRONMENT_COLOR = 'environment.color';
|
|
470
|
+
/**
|
|
471
|
+
* Rotates connected textures, i.e. IBL, reflection, background, ...
|
|
472
|
+
* Rotation angle in degree.
|
|
473
|
+
*
|
|
474
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
475
|
+
*
|
|
476
|
+
* Scopes:
|
|
477
|
+
* * {@link SceneManager}
|
|
478
|
+
*
|
|
479
|
+
* @parser {@link parseNumber}
|
|
480
|
+
*/
|
|
481
|
+
Parameter.ENVIRONMENT_ROTATION = 'environment.rotation';
|
|
482
|
+
/**
|
|
483
|
+
* Intensity of IBL. Defaults to 1, usually between 0 & 2.
|
|
484
|
+
*
|
|
485
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
486
|
+
*
|
|
487
|
+
* Scopes:
|
|
488
|
+
* * {@link SceneManager}
|
|
489
|
+
*
|
|
490
|
+
* @parser {@link parseNumber}
|
|
491
|
+
*/
|
|
492
|
+
Parameter.ENVIRONMENT_INTENSITY = 'environment.intensity';
|
|
493
|
+
/**
|
|
494
|
+
* Background texture on a [PhotoDome](https://doc.babylonjs.com/divingDeeper/environment/360PhotoDome).
|
|
495
|
+
* Just background, no IBL or reflection.
|
|
496
|
+
*
|
|
497
|
+
* Recommended format is `*.jpg`. HDR files are not supported as background but can be converted to `*.jpg` using
|
|
498
|
+
* tools like Photoshop, Gimp or various free online converters.
|
|
499
|
+
*
|
|
500
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
501
|
+
*
|
|
502
|
+
* Scopes:
|
|
503
|
+
* * {@link SceneManager}
|
|
504
|
+
*
|
|
505
|
+
* @parser string
|
|
506
|
+
*/
|
|
507
|
+
Parameter.ENVIRONMENT_BACKGROUND = 'environment.background';
|
|
508
|
+
/**
|
|
509
|
+
* If `true`, sets a `scene.environmentTexture` and creates a *BackgroundHelper* Node (via
|
|
510
|
+
* [scene.createDefaultEnvironment](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#createDefaultEnvironment))
|
|
511
|
+
* with two subnodes/meshes:
|
|
512
|
+
* - BackgroundPlane
|
|
513
|
+
* - BackgroundSkybox
|
|
514
|
+
*
|
|
515
|
+
* The value of this parameter is ignored if {@link ENVIRONMENT_BACKGROUND} is also set.
|
|
516
|
+
*
|
|
517
|
+
* See [environment page](./../pages/Documentation/Environment.html) for details on how to use this.
|
|
518
|
+
*
|
|
519
|
+
* Scopes:
|
|
520
|
+
* * {@link SceneManager}
|
|
521
|
+
*
|
|
522
|
+
* @parser {@link parseBoolean}
|
|
523
|
+
*/
|
|
524
|
+
Parameter.ENVIRONMENT_USEDEFAULT = 'environment.usedefault';
|
|
518
525
|
//# sourceMappingURL=parameter.js.map
|