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