@combeenation/3d-viewer 6.1.0 → 6.2.0

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