@combeenation/3d-viewer 12.4.1 → 12.4.3

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 (114) hide show
  1. package/README.md +9 -9
  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 +702 -702
  8. package/dist/lib-cjs/api/classes/event.d.ts +401 -401
  9. package/dist/lib-cjs/api/classes/event.js +424 -424
  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 +410 -410
  15. package/dist/lib-cjs/api/classes/parameter.js +642 -642
  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 +261 -261
  23. package/dist/lib-cjs/api/classes/variant.js +872 -872
  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 +86 -86
  28. package/dist/lib-cjs/api/classes/viewer.d.ts +215 -215
  29. package/dist/lib-cjs/api/classes/viewer.js +708 -708
  30. package/dist/lib-cjs/api/classes/viewerError.d.ts +43 -43
  31. package/dist/lib-cjs/api/classes/viewerError.js +55 -55
  32. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  33. package/dist/lib-cjs/api/classes/viewerLight.js +344 -344
  34. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  35. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  36. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  37. package/dist/lib-cjs/api/internal/sceneSetup.js +227 -227
  38. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
  39. package/dist/lib-cjs/api/manager/animationManager.js +126 -126
  40. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +80 -80
  41. package/dist/lib-cjs/api/manager/gltfExportManager.js +300 -299
  42. package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
  43. package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -33
  44. package/dist/lib-cjs/api/manager/sceneManager.js +128 -128
  45. package/dist/lib-cjs/api/manager/tagManager.d.ts +118 -118
  46. package/dist/lib-cjs/api/manager/tagManager.js +530 -530
  47. package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -22
  48. package/dist/lib-cjs/api/manager/textureLoadManager.js +107 -107
  49. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +106 -106
  50. package/dist/lib-cjs/api/manager/variantInstanceManager.js +290 -290
  51. package/dist/lib-cjs/api/store/specStorage.d.ts +32 -32
  52. package/dist/lib-cjs/api/store/specStorage.js +65 -65
  53. package/dist/lib-cjs/api/util/babylonHelper.d.ts +238 -238
  54. package/dist/lib-cjs/api/util/babylonHelper.js +825 -825
  55. package/dist/lib-cjs/api/util/debugHelper.d.ts +9 -9
  56. package/dist/lib-cjs/api/util/debugHelper.js +93 -93
  57. package/dist/lib-cjs/api/util/deviceHelper.d.ts +9 -9
  58. package/dist/lib-cjs/api/util/deviceHelper.js +28 -28
  59. package/dist/lib-cjs/api/util/geometryHelper.d.ts +17 -17
  60. package/dist/lib-cjs/api/util/geometryHelper.js +112 -112
  61. package/dist/lib-cjs/api/util/globalTypes.d.ts +490 -490
  62. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  63. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  64. package/dist/lib-cjs/api/util/resourceHelper.js +214 -214
  65. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +58 -58
  66. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +228 -228
  67. package/dist/lib-cjs/api/util/stringHelper.d.ts +13 -13
  68. package/dist/lib-cjs/api/util/stringHelper.js +32 -32
  69. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  70. package/dist/lib-cjs/api/util/structureHelper.js +57 -57
  71. package/dist/lib-cjs/buildinfo.json +3 -3
  72. package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
  73. package/dist/lib-cjs/index.d.ts +63 -63
  74. package/dist/lib-cjs/index.js +128 -128
  75. package/package.json +93 -92
  76. package/src/api/classes/animationInterface.ts +10 -10
  77. package/src/api/classes/dottedPath.ts +181 -181
  78. package/src/api/classes/element.ts +766 -766
  79. package/src/api/classes/event.ts +457 -457
  80. package/src/api/classes/eventBroadcaster.ts +52 -52
  81. package/src/api/classes/fuzzyMap.ts +21 -21
  82. package/src/api/classes/parameter.ts +686 -686
  83. package/src/api/classes/parameterObservable.ts +73 -73
  84. package/src/api/classes/parameterizable.ts +87 -87
  85. package/src/api/classes/placementAnimation.ts +162 -162
  86. package/src/api/classes/variant.ts +965 -965
  87. package/src/api/classes/variantInstance.ts +123 -123
  88. package/src/api/classes/variantParameterizable.ts +83 -83
  89. package/src/api/classes/viewer.ts +751 -751
  90. package/src/api/classes/viewerError.ts +63 -63
  91. package/src/api/classes/viewerLight.ts +335 -335
  92. package/src/api/internal/debugViewer.ts +90 -90
  93. package/src/api/internal/lensRendering.ts +9 -9
  94. package/src/api/internal/sceneSetup.ts +208 -208
  95. package/src/api/manager/animationManager.ts +143 -143
  96. package/src/api/manager/gltfExportManager.ts +337 -334
  97. package/src/api/manager/sceneManager.ts +134 -134
  98. package/src/api/manager/tagManager.ts +572 -572
  99. package/src/api/manager/textureLoadManager.ts +107 -107
  100. package/src/api/manager/variantInstanceManager.ts +306 -306
  101. package/src/api/store/specStorage.ts +68 -68
  102. package/src/api/util/babylonHelper.ts +915 -915
  103. package/src/api/util/debugHelper.ts +121 -121
  104. package/src/api/util/deviceHelper.ts +31 -31
  105. package/src/api/util/geometryHelper.ts +142 -142
  106. package/src/api/util/globalTypes.ts +566 -566
  107. package/src/api/util/resourceHelper.ts +201 -201
  108. package/src/api/util/sceneLoaderHelper.ts +247 -247
  109. package/src/api/util/stringHelper.ts +30 -30
  110. package/src/api/util/structureHelper.ts +62 -62
  111. package/src/buildinfo.json +3 -3
  112. package/src/dev.ts +70 -70
  113. package/src/index.ts +116 -116
  114. package/src/types.d.ts +49 -49
@@ -1,410 +1,410 @@
1
- import { Color3 } from '@babylonjs/core/Maths/math.color';
2
- import { Vector3 } from '@babylonjs/core/Maths/math.vector';
3
- /**
4
- * This `Parameter` class defines all parameters that can be consumed and committed by a {@link ParameterObservable}.
5
- * Use {@link ParameterObservable.addParameterObserver} or {@link ParameterObservable.commitParameters} to either add or
6
- * commit parameters on your observable objects.
7
- */
8
- export declare class Parameter {
9
- /**
10
- * Constructor.
11
- */
12
- private constructor();
13
- /**
14
- * Mutates the visibility. Helper methods are {@link VariantParameterizable.show} and
15
- * {@link VariantParameterizable.hide}. Getter and setter is {@link VariantParameterizable.visible}.
16
- *
17
- * Scopes:
18
- * * {@link Element}
19
- * * {@link Variant}
20
- * * {@link ViewerLight} Available for all light types
21
- *
22
- * @parser {@link parseBoolean}
23
- */
24
- static readonly VISIBLE = "visible";
25
- /**
26
- * Stretches or compresses some meshes. Getter and setter is {@link VariantParameterizable.scaling}.
27
- *
28
- * Scopes:
29
- * * {@link Element}
30
- * * {@link Variant}
31
- *
32
- * @parser {@link parseScaling}
33
- */
34
- static readonly SCALING = "scaling";
35
- /**
36
- * Mutates the material. Getter and setter is {@link VariantParameterizable.material}. The value of this parameter
37
- * represents the ID of a baked-in glTF or custom created material in the {@link Variant} tree.
38
- *
39
- * Scopes:
40
- * * {@link Element}
41
- * * {@link Variant}
42
- *
43
- * @parser string
44
- */
45
- static readonly MATERIAL = "material";
46
- /**
47
- * Mutates the material color.
48
- *
49
- * Scopes:
50
- * * {@link Element}
51
- * * {@link Variant}
52
- *
53
- * @parser {@link parseColor}
54
- */
55
- static readonly MATERIAL_COLOR = "material.color";
56
- /**
57
- * Mutates the material metallness.
58
- *
59
- * Scopes:
60
- * * {@link Element}
61
- * * {@link Variant}
62
- *
63
- * @parser {@link parseNumber}
64
- */
65
- static readonly MATERIAL_METALLNESS = "material.metallness";
66
- /**
67
- * Mutates the material roughness.
68
- *
69
- * Scopes:
70
- * * {@link Element}
71
- * * {@link Variant}
72
- *
73
- * @parser {@link parseNumber}
74
- */
75
- static readonly MATERIAL_ROUGHNESS = "material.roughness";
76
- /**
77
- * Mutates whether a highlight layer should be enabled.
78
- *
79
- * Scopes:
80
- * * {@link Element}
81
- * * {@link Variant}
82
- *
83
- * @parser {@link parseBoolean}
84
- */
85
- static readonly HIGHLIGHT_ENABLED = "highlight.enabled";
86
- /**
87
- * Changes the highlight color.
88
- *
89
- * Scopes:
90
- * * {@link Element}
91
- * * {@link Variant}
92
- *
93
- * @parser {@link parseColor}
94
- */
95
- static readonly HIGHLIGHT_COLOR = "highlight.color";
96
- /**
97
- * Mutates the highlighted state. Getter and setter is {@link VariantParameterizable.highlighted}.
98
- *
99
- * Scopes:
100
- * * {@link Element}
101
- * * {@link Variant}
102
- *
103
- * @parser {@link parseBoolean}
104
- */
105
- static readonly HIGHLIGHTED = "highlighted";
106
- /**
107
- * Mutates the position relative to its origin position. Getter and setter is {@link VariantParameterizable.position}.
108
- *
109
- * Scopes:
110
- * * {@link Element}
111
- * * {@link Variant}
112
- * * {@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)
113
- *
114
- * @parser {@link parseVector}
115
- */
116
- static readonly POSITION = "position";
117
- /**
118
- * Mutates the rotation relative to its origin rotation. Getter and setter is {@link VariantParameterizable.rotation}.
119
- *
120
- * Scopes:
121
- * * {@link Element}
122
- * * {@link Variant}
123
- *
124
- * @parser {@link parseRotation}
125
- */
126
- static readonly ROTATION = "rotation";
127
- /**
128
- * Mutates the color.
129
- *
130
- * Scopes:
131
- * * {@link Material} via {@link TagManager}
132
- *
133
- * @parser {@link parseColor}
134
- */
135
- static readonly COLOR = "color";
136
- /**
137
- * Mutates the metallic.
138
- *
139
- * Scopes:
140
- * * {@link Material} via {@link TagManager}
141
- *
142
- * @parser {@link parseNumber}
143
- */
144
- static readonly METALLIC = "metallic";
145
- /**
146
- * Paintables can be used to let the client/browser draw graphics on a 3d model by mutating the texture of a
147
- * material.\
148
- * For detailed information have a look at the [paintables](./../pages/documentation/Paintables.html) page.
149
- *
150
- * Also see {@link parsePaintable} for detailed information on which values you can pass to the `paintable`
151
- * parameter.
152
- *
153
- * Scopes:
154
- * * {@link Material} via {@link TagManager}
155
- *
156
- * @parser {@link parsePaintable}
157
- *
158
- */
159
- static readonly PAINTABLE = "paintable";
160
- /**
161
- * Mutates the roughness.
162
- *
163
- * Scopes:
164
- * * {@link Material} via {@link TagManager}
165
- *
166
- * @parser {@link parseNumber}
167
- */
168
- static readonly ROUGHNESS = "roughness";
169
- /**
170
- * Mutates whether a shadow should be casted or not.
171
- *
172
- * Scopes:
173
- * * {@link Element}
174
- * * {@link Variant}
175
- *
176
- * @parser {@link parseBoolean}
177
- */
178
- static readonly CAST_SHADOW = "castShadow";
179
- /**
180
- * Mutates from which lights a shadow should be casted.
181
- *
182
- * Scopes:
183
- * * {@link Element}
184
- * * {@link Variant}
185
- *
186
- * @parser {@link parseCommaSeparatedList}
187
- */
188
- static readonly CAST_SHADOW_FROM_LIGHTS = "castShadow.fromLights";
189
- /**
190
- * Mutates whether to receive shadows or not.
191
- *
192
- * Scopes:
193
- * * {@link Element}
194
- * * {@link Variant}
195
- *
196
- * @parser {@link parseBoolean}
197
- */
198
- static readonly RECEIVE_SHADOWS = "receiveShadows";
199
- /**
200
- * Mutates the intensity of Lights.
201
- *
202
- * Scopes:
203
- * * {@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)
204
- *
205
- * @parser {@link parseNumber}
206
- */
207
- static readonly INTENSITY = "intensity";
208
- /**
209
- * Mutates the direction of Lights.
210
- *
211
- * Scopes:
212
- * * {@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)
213
- *
214
- * @parser {@link parseNumber}
215
- */
216
- static readonly DIRECTION = "direction";
217
- /**
218
- * Mutates the angle of Lights.
219
- *
220
- * Scopes:
221
- * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#angle)
222
- *
223
- * @parser {@link parseNumber}
224
- */
225
- static readonly ANGLE = "angle";
226
- /**
227
- * Mutates the exponent of Lights.
228
- *
229
- * Scopes:
230
- * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#exponent)
231
- *
232
- * @parser {@link parseNumber}
233
- */
234
- static readonly EXPONENT = "exponent";
235
- /**
236
- * Mutates the diffuse color of Lights.
237
- *
238
- * Scopes:
239
- * * {@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)
240
- *
241
- * @parser {@link parseNumber}
242
- */
243
- static readonly DIFFUSE = "diffuse";
244
- /**
245
- * Mutates the specular color of Lights.
246
- *
247
- * Scopes:
248
- * * {@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)
249
- *
250
- * @parser {@link parseNumber}
251
- */
252
- static readonly SPECULAR = "specular";
253
- /**
254
- * Sets the environment. See [BABYLON.Scene.environmentTexture](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#environmentTexture).
255
- *
256
- * Usually the URL to an `*.env` file.
257
- *
258
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
259
- *
260
- * Scopes:
261
- * * {@link SceneManager}
262
- *
263
- * @parser string
264
- */
265
- static readonly ENVIRONMENT = "environment";
266
- /**
267
- * Sets [BABYLON.Scene.clearColor](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#clearColor)
268
- *
269
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
270
- *
271
- * Scopes:
272
- * * {@link SceneManager}
273
- *
274
- * @parser {@link parseColor}
275
- */
276
- static readonly ENVIRONMENT_COLOR = "environment.color";
277
- /**
278
- * Rotates connected textures, i.e. IBL, reflection, background, ...
279
- * Rotation angle in degree.
280
- *
281
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
282
- *
283
- * Scopes:
284
- * * {@link SceneManager}
285
- *
286
- * @parser {@link parseNumber}
287
- */
288
- static readonly ENVIRONMENT_ROTATION = "environment.rotation";
289
- /**
290
- * Intensity of IBL. Defaults to 1, usually between 0 & 2.
291
- *
292
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
293
- *
294
- * Scopes:
295
- * * {@link SceneManager}
296
- *
297
- * @parser {@link parseNumber}
298
- */
299
- static readonly ENVIRONMENT_INTENSITY = "environment.intensity";
300
- /**
301
- * Background texture on a [PhotoDome](https://doc.babylonjs.com/divingDeeper/environment/360PhotoDome).
302
- * Just background, no IBL or reflection.
303
- *
304
- * Recommended format is `*.jpg`. HDR files are not supported as background but can be converted to `*.jpg` using
305
- * tools like Photoshop, Gimp or various free online converters.
306
- *
307
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
308
- *
309
- * Scopes:
310
- * * {@link SceneManager}
311
- *
312
- * @parser string
313
- */
314
- static readonly ENVIRONMENT_BACKGROUND = "environment.background";
315
- /**
316
- * If `true`, sets a `scene.environmentTexture` and creates a *BackgroundHelper* Node (via
317
- * [scene.createDefaultEnvironment](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#createDefaultEnvironment))
318
- * with two subnodes/meshes:
319
- * - BackgroundPlane
320
- * - BackgroundSkybox
321
- *
322
- * The value of this parameter is ignored if {@link ENVIRONMENT_BACKGROUND} is also set.
323
- *
324
- * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
325
- *
326
- * Scopes:
327
- * * {@link SceneManager}
328
- *
329
- * @parser {@link parseBoolean}
330
- */
331
- static readonly ENVIRONMENT_USEDEFAULT = "environment.usedefault";
332
- /**
333
- * The {@link ParameterDeclarations} for all parameters in this class.
334
- */
335
- static get declarations(): ParameterDeclarations;
336
- /**
337
- * The default {@link ParameterValue}s returned as {@link ParameterBag} for a set of parameters in this class.
338
- */
339
- static get defaultValues(): ParameterBag;
340
- /**
341
- * Gets the default {@link ParameterValue} for a given {@link Parameter} declared in this class.
342
- */
343
- static getDefaultValue(parameter: string): ParameterValue;
344
- /**
345
- * All parameters defined in this class.
346
- */
347
- static get all(): string[];
348
- /**
349
- * Asserts whether given parameter is declared and valid.
350
- */
351
- static assertParameter(parameterDeclaration: ParameterDeclarations, parameter: string, value: ParameterValue): void;
352
- /**
353
- * Parses given {@link ParameterBag} with given {@link ParameterDeclarations}.
354
- */
355
- static parseFromDeclarations(declarations: ParameterDeclarations, parameterBag: ParameterBag): ParsedParameterBag;
356
- /**
357
- * Parses a string of format `'(x,y,z)'` to a `Vector3`.
358
- */
359
- static parseVector(value: ParameterValue): Vector3;
360
- /**
361
- * Stringifies a Vector3 to format `(x,y,z)`.
362
- */
363
- static stringifyVector(value: Vector3): string;
364
- /**
365
- * Parses a string of format `'(x,y,z)'` with angular degrees to a `Vector3` with rotation information in radians.
366
- */
367
- static parseRotation(value: ParameterValue): Vector3;
368
- /**
369
- * Parses a string of format `'(x,y,z)'` or a simple `number` to a `Vector3` for scaling.
370
- */
371
- static parseScaling(value: ParameterValue): Vector3;
372
- /**
373
- * Parses a string of format `'#rrggbb'` or `'(r,g,b)'` to a `Color3`.
374
- */
375
- static parseColor(value: ParameterValue): Color3;
376
- /**
377
- * Parses a `boolean` string (`'true'`/`'1'` or `'false'`/`'0'`) or `number` (`1` or `0`) to a `boolean` or
378
- * `undefined`.
379
- */
380
- static parseBoolean(value: ParameterValue): boolean;
381
- /**
382
- * Parses a number `string` to a `number`.
383
- */
384
- static parseNumber(value: ParameterValue): number;
385
- /**
386
- * Parses string defintion of a paintable into a paintable object.\
387
- * Here are some examples:
388
- * ```ts
389
- * // Default definition as JSON object:
390
- * '{ "src": "https://path.to/image.jpg", "uScale": 0.5 }'
391
- *
392
- * // Short hand definition, only contains source string:
393
- * 'https://path.to/image.jpg'
394
- *
395
- * // Full content, paintable texture is flipped in both directions
396
- * '{ "src": "https://path.to/image.jpg", "uScale": -1, "vScale": -1, "uOffset": 0, "vOffset": 0 }'
397
- *
398
- * // SVG content can be used directly:
399
- * '<svg>...</svg>'
400
- *
401
- * // SVG in src property works as well:
402
- * '{ "src": "<svg>...</svg>", "uScale": 0.5 }'
403
- * ```
404
- */
405
- static parsePaintable(value: ParameterValue): PaintableValue;
406
- /**
407
- * Parses a string with comma separated values to a list of strings.
408
- */
409
- static parseCommaSeparatedList(value: ParameterValue): string[];
410
- }
1
+ import { Color3 } from '@babylonjs/core/Maths/math.color';
2
+ import { Vector3 } from '@babylonjs/core/Maths/math.vector';
3
+ /**
4
+ * This `Parameter` class defines all parameters that can be consumed and committed by a {@link ParameterObservable}.
5
+ * Use {@link ParameterObservable.addParameterObserver} or {@link ParameterObservable.commitParameters} to either add or
6
+ * commit parameters on your observable objects.
7
+ */
8
+ export declare class Parameter {
9
+ /**
10
+ * Constructor.
11
+ */
12
+ private constructor();
13
+ /**
14
+ * Mutates the visibility. Helper methods are {@link VariantParameterizable.show} and
15
+ * {@link VariantParameterizable.hide}. Getter and setter is {@link VariantParameterizable.visible}.
16
+ *
17
+ * Scopes:
18
+ * * {@link Element}
19
+ * * {@link Variant}
20
+ * * {@link ViewerLight} Available for all light types
21
+ *
22
+ * @parser {@link parseBoolean}
23
+ */
24
+ static readonly VISIBLE = "visible";
25
+ /**
26
+ * Stretches or compresses some meshes. Getter and setter is {@link VariantParameterizable.scaling}.
27
+ *
28
+ * Scopes:
29
+ * * {@link Element}
30
+ * * {@link Variant}
31
+ *
32
+ * @parser {@link parseScaling}
33
+ */
34
+ static readonly SCALING = "scaling";
35
+ /**
36
+ * Mutates the material. Getter and setter is {@link VariantParameterizable.material}. The value of this parameter
37
+ * represents the ID of a baked-in glTF or custom created material in the {@link Variant} tree.
38
+ *
39
+ * Scopes:
40
+ * * {@link Element}
41
+ * * {@link Variant}
42
+ *
43
+ * @parser string
44
+ */
45
+ static readonly MATERIAL = "material";
46
+ /**
47
+ * Mutates the material color.
48
+ *
49
+ * Scopes:
50
+ * * {@link Element}
51
+ * * {@link Variant}
52
+ *
53
+ * @parser {@link parseColor}
54
+ */
55
+ static readonly MATERIAL_COLOR = "material.color";
56
+ /**
57
+ * Mutates the material metallness.
58
+ *
59
+ * Scopes:
60
+ * * {@link Element}
61
+ * * {@link Variant}
62
+ *
63
+ * @parser {@link parseNumber}
64
+ */
65
+ static readonly MATERIAL_METALLNESS = "material.metallness";
66
+ /**
67
+ * Mutates the material roughness.
68
+ *
69
+ * Scopes:
70
+ * * {@link Element}
71
+ * * {@link Variant}
72
+ *
73
+ * @parser {@link parseNumber}
74
+ */
75
+ static readonly MATERIAL_ROUGHNESS = "material.roughness";
76
+ /**
77
+ * Mutates whether a highlight layer should be enabled.
78
+ *
79
+ * Scopes:
80
+ * * {@link Element}
81
+ * * {@link Variant}
82
+ *
83
+ * @parser {@link parseBoolean}
84
+ */
85
+ static readonly HIGHLIGHT_ENABLED = "highlight.enabled";
86
+ /**
87
+ * Changes the highlight color.
88
+ *
89
+ * Scopes:
90
+ * * {@link Element}
91
+ * * {@link Variant}
92
+ *
93
+ * @parser {@link parseColor}
94
+ */
95
+ static readonly HIGHLIGHT_COLOR = "highlight.color";
96
+ /**
97
+ * Mutates the highlighted state. Getter and setter is {@link VariantParameterizable.highlighted}.
98
+ *
99
+ * Scopes:
100
+ * * {@link Element}
101
+ * * {@link Variant}
102
+ *
103
+ * @parser {@link parseBoolean}
104
+ */
105
+ static readonly HIGHLIGHTED = "highlighted";
106
+ /**
107
+ * Mutates the position relative to its origin position. Getter and setter is {@link VariantParameterizable.position}.
108
+ *
109
+ * Scopes:
110
+ * * {@link Element}
111
+ * * {@link Variant}
112
+ * * {@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)
113
+ *
114
+ * @parser {@link parseVector}
115
+ */
116
+ static readonly POSITION = "position";
117
+ /**
118
+ * Mutates the rotation relative to its origin rotation. Getter and setter is {@link VariantParameterizable.rotation}.
119
+ *
120
+ * Scopes:
121
+ * * {@link Element}
122
+ * * {@link Variant}
123
+ *
124
+ * @parser {@link parseRotation}
125
+ */
126
+ static readonly ROTATION = "rotation";
127
+ /**
128
+ * Mutates the color.
129
+ *
130
+ * Scopes:
131
+ * * {@link Material} via {@link TagManager}
132
+ *
133
+ * @parser {@link parseColor}
134
+ */
135
+ static readonly COLOR = "color";
136
+ /**
137
+ * Mutates the metallic.
138
+ *
139
+ * Scopes:
140
+ * * {@link Material} via {@link TagManager}
141
+ *
142
+ * @parser {@link parseNumber}
143
+ */
144
+ static readonly METALLIC = "metallic";
145
+ /**
146
+ * Paintables can be used to let the client/browser draw graphics on a 3d model by mutating the texture of a
147
+ * material.\
148
+ * For detailed information have a look at the [paintables](./../pages/documentation/Paintables.html) page.
149
+ *
150
+ * Also see {@link parsePaintable} for detailed information on which values you can pass to the `paintable`
151
+ * parameter.
152
+ *
153
+ * Scopes:
154
+ * * {@link Material} via {@link TagManager}
155
+ *
156
+ * @parser {@link parsePaintable}
157
+ *
158
+ */
159
+ static readonly PAINTABLE = "paintable";
160
+ /**
161
+ * Mutates the roughness.
162
+ *
163
+ * Scopes:
164
+ * * {@link Material} via {@link TagManager}
165
+ *
166
+ * @parser {@link parseNumber}
167
+ */
168
+ static readonly ROUGHNESS = "roughness";
169
+ /**
170
+ * Mutates whether a shadow should be casted or not.
171
+ *
172
+ * Scopes:
173
+ * * {@link Element}
174
+ * * {@link Variant}
175
+ *
176
+ * @parser {@link parseBoolean}
177
+ */
178
+ static readonly CAST_SHADOW = "castShadow";
179
+ /**
180
+ * Mutates from which lights a shadow should be casted.
181
+ *
182
+ * Scopes:
183
+ * * {@link Element}
184
+ * * {@link Variant}
185
+ *
186
+ * @parser {@link parseCommaSeparatedList}
187
+ */
188
+ static readonly CAST_SHADOW_FROM_LIGHTS = "castShadow.fromLights";
189
+ /**
190
+ * Mutates whether to receive shadows or not.
191
+ *
192
+ * Scopes:
193
+ * * {@link Element}
194
+ * * {@link Variant}
195
+ *
196
+ * @parser {@link parseBoolean}
197
+ */
198
+ static readonly RECEIVE_SHADOWS = "receiveShadows";
199
+ /**
200
+ * Mutates the intensity of Lights.
201
+ *
202
+ * Scopes:
203
+ * * {@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)
204
+ *
205
+ * @parser {@link parseNumber}
206
+ */
207
+ static readonly INTENSITY = "intensity";
208
+ /**
209
+ * Mutates the direction of Lights.
210
+ *
211
+ * Scopes:
212
+ * * {@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)
213
+ *
214
+ * @parser {@link parseNumber}
215
+ */
216
+ static readonly DIRECTION = "direction";
217
+ /**
218
+ * Mutates the angle of Lights.
219
+ *
220
+ * Scopes:
221
+ * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#angle)
222
+ *
223
+ * @parser {@link parseNumber}
224
+ */
225
+ static readonly ANGLE = "angle";
226
+ /**
227
+ * Mutates the exponent of Lights.
228
+ *
229
+ * Scopes:
230
+ * * {@link ViewerLight} Available for [SpotLight](https://doc.babylonjs.com/typedoc/classes/babylon.spotlight#exponent)
231
+ *
232
+ * @parser {@link parseNumber}
233
+ */
234
+ static readonly EXPONENT = "exponent";
235
+ /**
236
+ * Mutates the diffuse color of Lights.
237
+ *
238
+ * Scopes:
239
+ * * {@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)
240
+ *
241
+ * @parser {@link parseNumber}
242
+ */
243
+ static readonly DIFFUSE = "diffuse";
244
+ /**
245
+ * Mutates the specular color of Lights.
246
+ *
247
+ * Scopes:
248
+ * * {@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)
249
+ *
250
+ * @parser {@link parseNumber}
251
+ */
252
+ static readonly SPECULAR = "specular";
253
+ /**
254
+ * Sets the environment. See [BABYLON.Scene.environmentTexture](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#environmentTexture).
255
+ *
256
+ * Usually the URL to an `*.env` file.
257
+ *
258
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
259
+ *
260
+ * Scopes:
261
+ * * {@link SceneManager}
262
+ *
263
+ * @parser string
264
+ */
265
+ static readonly ENVIRONMENT = "environment";
266
+ /**
267
+ * Sets [BABYLON.Scene.clearColor](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#clearColor)
268
+ *
269
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
270
+ *
271
+ * Scopes:
272
+ * * {@link SceneManager}
273
+ *
274
+ * @parser {@link parseColor}
275
+ */
276
+ static readonly ENVIRONMENT_COLOR = "environment.color";
277
+ /**
278
+ * Rotates connected textures, i.e. IBL, reflection, background, ...
279
+ * Rotation angle in degree.
280
+ *
281
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
282
+ *
283
+ * Scopes:
284
+ * * {@link SceneManager}
285
+ *
286
+ * @parser {@link parseNumber}
287
+ */
288
+ static readonly ENVIRONMENT_ROTATION = "environment.rotation";
289
+ /**
290
+ * Intensity of IBL. Defaults to 1, usually between 0 & 2.
291
+ *
292
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
293
+ *
294
+ * Scopes:
295
+ * * {@link SceneManager}
296
+ *
297
+ * @parser {@link parseNumber}
298
+ */
299
+ static readonly ENVIRONMENT_INTENSITY = "environment.intensity";
300
+ /**
301
+ * Background texture on a [PhotoDome](https://doc.babylonjs.com/divingDeeper/environment/360PhotoDome).
302
+ * Just background, no IBL or reflection.
303
+ *
304
+ * Recommended format is `*.jpg`. HDR files are not supported as background but can be converted to `*.jpg` using
305
+ * tools like Photoshop, Gimp or various free online converters.
306
+ *
307
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
308
+ *
309
+ * Scopes:
310
+ * * {@link SceneManager}
311
+ *
312
+ * @parser string
313
+ */
314
+ static readonly ENVIRONMENT_BACKGROUND = "environment.background";
315
+ /**
316
+ * If `true`, sets a `scene.environmentTexture` and creates a *BackgroundHelper* Node (via
317
+ * [scene.createDefaultEnvironment](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#createDefaultEnvironment))
318
+ * with two subnodes/meshes:
319
+ * - BackgroundPlane
320
+ * - BackgroundSkybox
321
+ *
322
+ * The value of this parameter is ignored if {@link ENVIRONMENT_BACKGROUND} is also set.
323
+ *
324
+ * See [environment page](./../pages/documentation/Environment.html) for details on how to use this.
325
+ *
326
+ * Scopes:
327
+ * * {@link SceneManager}
328
+ *
329
+ * @parser {@link parseBoolean}
330
+ */
331
+ static readonly ENVIRONMENT_USEDEFAULT = "environment.usedefault";
332
+ /**
333
+ * The {@link ParameterDeclarations} for all parameters in this class.
334
+ */
335
+ static get declarations(): ParameterDeclarations;
336
+ /**
337
+ * The default {@link ParameterValue}s returned as {@link ParameterBag} for a set of parameters in this class.
338
+ */
339
+ static get defaultValues(): ParameterBag;
340
+ /**
341
+ * Gets the default {@link ParameterValue} for a given {@link Parameter} declared in this class.
342
+ */
343
+ static getDefaultValue(parameter: string): ParameterValue;
344
+ /**
345
+ * All parameters defined in this class.
346
+ */
347
+ static get all(): string[];
348
+ /**
349
+ * Asserts whether given parameter is declared and valid.
350
+ */
351
+ static assertParameter(parameterDeclaration: ParameterDeclarations, parameter: string, value: ParameterValue): void;
352
+ /**
353
+ * Parses given {@link ParameterBag} with given {@link ParameterDeclarations}.
354
+ */
355
+ static parseFromDeclarations(declarations: ParameterDeclarations, parameterBag: ParameterBag): ParsedParameterBag;
356
+ /**
357
+ * Parses a string of format `'(x,y,z)'` to a `Vector3`.
358
+ */
359
+ static parseVector(value: ParameterValue): Vector3;
360
+ /**
361
+ * Stringifies a Vector3 to format `(x,y,z)`.
362
+ */
363
+ static stringifyVector(value: Vector3): string;
364
+ /**
365
+ * Parses a string of format `'(x,y,z)'` with angular degrees to a `Vector3` with rotation information in radians.
366
+ */
367
+ static parseRotation(value: ParameterValue): Vector3;
368
+ /**
369
+ * Parses a string of format `'(x,y,z)'` or a simple `number` to a `Vector3` for scaling.
370
+ */
371
+ static parseScaling(value: ParameterValue): Vector3;
372
+ /**
373
+ * Parses a string of format `'#rrggbb'` or `'(r,g,b)'` to a `Color3`.
374
+ */
375
+ static parseColor(value: ParameterValue): Color3;
376
+ /**
377
+ * Parses a `boolean` string (`'true'`/`'1'` or `'false'`/`'0'`) or `number` (`1` or `0`) to a `boolean` or
378
+ * `undefined`.
379
+ */
380
+ static parseBoolean(value: ParameterValue): boolean;
381
+ /**
382
+ * Parses a number `string` to a `number`.
383
+ */
384
+ static parseNumber(value: ParameterValue): number;
385
+ /**
386
+ * Parses string defintion of a paintable into a paintable object.\
387
+ * Here are some examples:
388
+ * ```ts
389
+ * // Default definition as JSON object:
390
+ * '{ "src": "https://path.to/image.jpg", "uScale": 0.5 }'
391
+ *
392
+ * // Short hand definition, only contains source string:
393
+ * 'https://path.to/image.jpg'
394
+ *
395
+ * // Full content, paintable texture is flipped in both directions
396
+ * '{ "src": "https://path.to/image.jpg", "uScale": -1, "vScale": -1, "uOffset": 0, "vOffset": 0 }'
397
+ *
398
+ * // SVG content can be used directly:
399
+ * '<svg>...</svg>'
400
+ *
401
+ * // SVG in src property works as well:
402
+ * '{ "src": "<svg>...</svg>", "uScale": 0.5 }'
403
+ * ```
404
+ */
405
+ static parsePaintable(value: ParameterValue): PaintableValue;
406
+ /**
407
+ * Parses a string with comma separated values to a list of strings.
408
+ */
409
+ static parseCommaSeparatedList(value: ParameterValue): string[];
410
+ }