@combeenation/3d-viewer 4.0.0-beta3 → 4.0.0-beta4

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 (92) hide show
  1. package/README.md +112 -112
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +190 -190
  6. package/dist/lib-cjs/api/classes/element.d.ts +125 -125
  7. package/dist/lib-cjs/api/classes/element.js +682 -682
  8. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -14
  9. package/dist/lib-cjs/api/classes/elementParameterizable.js +134 -134
  10. package/dist/lib-cjs/api/classes/event.d.ts +312 -312
  11. package/dist/lib-cjs/api/classes/event.js +357 -357
  12. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  13. package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
  14. package/dist/lib-cjs/api/classes/parameter.d.ts +165 -165
  15. package/dist/lib-cjs/api/classes/parameter.js +267 -267
  16. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  17. package/dist/lib-cjs/api/classes/parameterObservable.js +126 -126
  18. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  19. package/dist/lib-cjs/api/classes/parameterizable.js +149 -149
  20. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +38 -38
  21. package/dist/lib-cjs/api/classes/placementAnimation.js +138 -138
  22. package/dist/lib-cjs/api/classes/variant.d.ts +190 -190
  23. package/dist/lib-cjs/api/classes/variant.js +873 -873
  24. package/dist/lib-cjs/api/classes/variantInstance.d.ts +41 -41
  25. package/dist/lib-cjs/api/classes/variantInstance.js +98 -98
  26. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  27. package/dist/lib-cjs/api/classes/variantParameterizable.js +92 -92
  28. package/dist/lib-cjs/api/classes/viewer.d.ts +128 -128
  29. package/dist/lib-cjs/api/classes/viewer.js +486 -486
  30. package/dist/lib-cjs/api/classes/viewerLight.d.ts +65 -66
  31. package/dist/lib-cjs/api/classes/viewerLight.js +322 -389
  32. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  33. package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
  34. package/dist/lib-cjs/api/internal/debugViewer.js +87 -87
  35. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  36. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  37. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +6 -6
  38. package/dist/lib-cjs/api/internal/sceneSetup.js +227 -227
  39. package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
  40. package/dist/lib-cjs/api/manager/animationManager.js +121 -121
  41. package/dist/lib-cjs/api/manager/sceneManager.d.ts +32 -32
  42. package/dist/lib-cjs/api/manager/sceneManager.js +132 -132
  43. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +90 -90
  44. package/dist/lib-cjs/api/manager/variantInstanceManager.js +321 -321
  45. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  46. package/dist/lib-cjs/api/store/specStorage.js +51 -51
  47. package/dist/lib-cjs/api/util/babylonHelper.d.ts +125 -125
  48. package/dist/lib-cjs/api/util/babylonHelper.js +368 -368
  49. package/dist/lib-cjs/api/util/globalTypes.d.ts +279 -279
  50. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  51. package/dist/lib-cjs/api/util/resourceHelper.d.ts +51 -48
  52. package/dist/lib-cjs/api/util/resourceHelper.js +243 -240
  53. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  54. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  55. package/dist/lib-cjs/api/util/stringHelper.js +25 -25
  56. package/dist/lib-cjs/buildinfo.json +3 -3
  57. package/dist/lib-cjs/index.d.ts +46 -46
  58. package/dist/lib-cjs/index.js +82 -82
  59. package/dist/webpack-stats.json +0 -0
  60. package/package.json +83 -83
  61. package/src/api/classes/animationInterface.ts +11 -11
  62. package/src/api/classes/dottedPath.ts +189 -189
  63. package/src/api/classes/element.ts +617 -617
  64. package/src/api/classes/elementParameterizable.ts +78 -78
  65. package/src/api/classes/event.ts +355 -355
  66. package/src/api/classes/eventBroadcaster.ts +54 -54
  67. package/src/api/classes/parameter.ts +277 -277
  68. package/src/api/classes/parameterObservable.ts +121 -121
  69. package/src/api/classes/placementAnimation.ts +133 -133
  70. package/src/api/classes/variant.ts +670 -670
  71. package/src/api/classes/variantInstance.ts +81 -81
  72. package/src/api/classes/viewer.ts +421 -421
  73. package/src/api/internal/debugViewer.ts +81 -81
  74. package/src/api/internal/lensRendering.ts +10 -10
  75. package/src/api/internal/sceneSetup.ts +203 -203
  76. package/src/api/manager/animationManager.ts +116 -116
  77. package/src/api/manager/sceneManager.ts +105 -105
  78. package/src/api/manager/variantInstanceManager.ts +236 -236
  79. package/src/api/store/specStorage.ts +53 -53
  80. package/src/api/util/babylonHelper.ts +392 -392
  81. package/src/api/util/globalTypes.ts +318 -318
  82. package/src/api/util/resourceHelper.ts +187 -184
  83. package/src/buildinfo.json +2 -2
  84. package/src/commonjs.tsconfig.json +13 -13
  85. package/src/declaration.tsconfig.json +10 -10
  86. package/src/dev.ts +46 -46
  87. package/src/es6.tsconfig.json +13 -13
  88. package/src/index.ts +87 -87
  89. package/src/pagesconfig.json +57 -57
  90. package/src/tsconfig.json +43 -43
  91. package/src/tsconfig.types.json +9 -9
  92. package/src/types.d.ts +4 -4
@@ -1,319 +1,319 @@
1
- // global accessible types imported from 3d-viewer
2
- type Viewer = import("../classes/viewer").Viewer;
3
- type Variant = import("../classes/variant").Variant;
4
- type VariantInstance = import("../classes/variantInstance").VariantInstance;
5
- /**
6
- * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
7
- * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
8
- */
9
- type VariantElement = import("../classes/element").Element;
10
- type DottedPath = import("../classes/dottedPath").DottedPath;
11
-
12
- // global accessible types imported from BabylonJS
13
- type Scene = import("@babylonjs/core/scene").Scene;
14
- type Vector3 = import("@babylonjs/core/Maths/math.vector").Vector3;
15
- type Color3 = import("@babylonjs/core/Maths/math.color").Color3;
16
- type Color4 = import("@babylonjs/core/Maths/math.color").Color4;
17
- type Material = import("@babylonjs/core/Materials/material").Material;
18
- type PBRMaterial = import("@babylonjs/core/Materials/PBR/pbrMaterial").PBRMaterial;
19
- type StandardMaterial = import("@babylonjs/core/Materials/standardMaterial").StandardMaterial;
20
- type DynamicTexture = import("@babylonjs/core/Materials/Textures/dynamicTexture").DynamicTexture;
21
- type Mesh = import("@babylonjs/core/Meshes/mesh").Mesh;
22
- type AbstractMesh = import("@babylonjs/core/Meshes/abstractMesh").AbstractMesh;
23
- type InstancedMesh = import("@babylonjs/core/Meshes/instancedMesh").InstancedMesh;
24
- type TransformNode = import("@babylonjs/core/Meshes/transformNode").TransformNode;
25
- type Engine = import("@babylonjs/core/Engines/engine").Engine;
26
- type EngineOptions = import("@babylonjs/core/Engines/thinEngine").EngineOptions;
27
- type ArcRotateCamera = import("@babylonjs/core/Cameras/arcRotateCamera").ArcRotateCamera;
28
- type IScreenshotSize = import("@babylonjs/core/Misc/interfaces/screenshotSize").IScreenshotSize;
29
- type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
30
- type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
31
- type MeshBuilder = import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
32
- type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
33
- type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
34
- type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
35
- // Node is already defined in lib.dom.d.ts, so it can't be declared that way
36
- // type Node = import("@babylonjs/core/node").Node;
37
-
38
- type EventEmitter = import('eventemitter3');
39
-
40
- // some more global accessible types
41
- type PathDefinitions = {
42
- include: string[],
43
- exclude?: string[]
44
- };
45
-
46
- type TraceableDefinition = {
47
- path: string
48
- };
49
-
50
- type TraceableDefinitions = {
51
- [name: string]: TraceableDefinition
52
- };
53
-
54
- type PaintableDefinition = {
55
- path: string,
56
- textureOptions: {
57
- width: number,
58
- height: number,
59
- } | number
60
- };
61
-
62
- type PaintableDefinitions = {
63
- [name: string]: PaintableDefinition
64
- };
65
-
66
- type Asset = {
67
- rootUrl: string,
68
- fileName: string | undefined
69
- };
70
-
71
- type ElementDefinition = {
72
- paths: PathDefinitions,
73
- traceables?: TraceableDefinitions,
74
- paintables?: PaintableDefinitions
75
- };
76
-
77
- type StructureJson = {
78
- /**
79
- * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
80
- * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
81
- */
82
- scene?: string | SceneJson,
83
- /**
84
- * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
85
- * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
86
- * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
87
- * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
88
- * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
89
- */
90
- setup?: string | SetupJson,
91
- file?: string
92
- glTF?: Asset | string,
93
- parameterDeclaration?: ParameterDeclarations,
94
- parameters?: ParameterBag,
95
- elements?: {
96
- [name: string]: ElementDefinition | string[]
97
- },
98
- /**
99
- * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
100
- * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
101
- * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
102
- * `paths`.
103
- *
104
- * Example Code
105
- * ```js
106
- * variants: {
107
- * 'My Pretty Variant' {
108
- * glTF: {
109
- * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
110
- * fileName: 'my_3d_model_file.glb',
111
- * },
112
- * elements: {
113
- * 'My Little Element': {
114
- * paths: {
115
- * includes: ['__root__.MeshName']
116
- * }
117
- * }
118
- * }
119
- * }
120
- * }
121
- * ```
122
- * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
123
- */
124
- variants?: {
125
- [id: string]: StructureJson,
126
- }
127
- };
128
-
129
- type SceneJson = {
130
- parameterDeclaration?: ParameterDeclarations,
131
- parameters?: ParameterBag,
132
- meshPicking?: boolean,
133
- /**
134
- * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
135
- */
136
- engine?: {
137
- antialiasing?: boolean
138
- options?: EngineOptions
139
- }
140
- scene: SceneDefinition,
141
- animations?: AnimationDefinitions,
142
- placements?: PlacementDefinitions
143
- };
144
-
145
- type SceneDefinition = {
146
- globals: SceneGlobals,
147
- lights?: LightDefinitions,
148
- cameras?: CameraDefinitions
149
- };
150
-
151
- type SceneGlobals = {
152
- shadows?: {
153
- enabled: boolean,
154
- type: 'contact',
155
- settings: [],
156
- generator: [],
157
- receiver: []
158
- },
159
- /**
160
- * `aa` or anti aliasing is not needed if hard edges are desired.\
161
- * FYI: aa smooths edges and avoids stairs-effects.
162
- */
163
- aa?: 'fxaa',
164
- 'tone-mapping'?: boolean,
165
- /**
166
- * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel, relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to bloom).
167
- * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
168
- *
169
- * @dof short for "depth-of-field" defines the focus in the view. Parameters in settings are listed in [Depth of Field and Other Lens Effects link](https://doc.babylonjs.com/divingDeeper/postProcesses/dofLenseEffects).
170
- * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
171
- * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
172
- */
173
- 'camera-settings'?: {
174
- contrast: number,
175
- exposure: number,
176
- bloom?: {
177
- enabled: boolean,
178
- size?: number,
179
- threshold?: number
180
- },
181
- dof?: {
182
- enabled: boolean,
183
- settings: {}
184
- },
185
- sharpen?: {
186
- enabled: boolean,
187
- settings: {}
188
- }
189
- }
190
- };
191
-
192
- type ScreenshotSettings = {
193
- size?: IScreenshotSize,
194
- mimeType?: string,
195
- samples?: number,
196
- antialiasing?: boolean,
197
- fileName?: string,
198
- renderSprites?: boolean
199
- };
200
-
201
- type AutofocusSettings = {
202
- /**
203
- * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
204
- * Defaults to 1.5 when not set explicitly.
205
- */
206
- radiusFactor?: number,
207
- adjustWheelPrecision?: boolean,
208
- adjustPanningSensibility?: boolean,
209
- adjustPinchPrecision?: boolean
210
- };
211
-
212
- type LightDefinitions = {
213
- [light: string]: LightDefinition
214
- };
215
-
216
- type LightDefinition = {
217
- type: 'hemispheric' | 'point'
218
- };
219
-
220
- type CameraDefinitions = {
221
- [camera: string]: CameraDefinition
222
- };
223
-
224
- type CameraDefinition = {
225
- /**
226
- * `fov` or "Field Of View" defines as it says the view of the scene. Further information about its [theory](https://en.wikipedia.org/wiki/Field_of_view) and [implementation](https://doc.babylonjs.com/typedoc/classes/babylon.camera#fov).
227
- */
228
- fov?: number,
229
- active?: boolean
230
- /**
231
- * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
232
- * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
233
- *
234
- * NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the `Specification`, it's still possible to use them in the viewer.\
235
- * For the moment all camera definitions inside these files are automatically added to the scene and can be actived using the {@link switchCamera} function.\
236
- * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
237
- */
238
- type: 'arc'
239
- /**
240
- * `target` overrides `arc`´s position and repositions the camera. The string has the syntax (x?: number, y?: number, z?: number) like [Vector3](https://doc.babylonjs.com/typedoc/classes/babylon.vector3).
241
- */
242
- target?: string
243
- };
244
-
245
- type VariantInstanceDefinition = {
246
- name?: string,
247
- variant: DottedPathArgument,
248
- parameters?: ParameterBag,
249
- lazy?: boolean
250
- };
251
-
252
- type SetupJson = {
253
- instances: VariantInstanceDefinition[]
254
- };
255
-
256
- type ParameterDeclarations = {
257
- [name: string]: ParameterDeclaration
258
- };
259
-
260
- type ParameterDeclaration = {
261
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector',
262
- options?: ParameterValue[]
263
- };
264
-
265
- type ParameterValue = string | number | boolean;
266
-
267
- type ParameterBag = {
268
- [name: string]: ParameterValue
269
- };
270
-
271
- type DottedPathArgument = string | string[] | DottedPath;
272
-
273
- type ParameterObserver = (
274
- object: any,
275
- oldValue: ParameterValue,
276
- newValue: ParameterValue
277
- ) => void;
278
-
279
- type PlacementDefinitions = {
280
- [name: string]: PlacementDefinition
281
- };
282
-
283
- type PlacementDefinition = {
284
- position?: string | Vector3,
285
- alpha?: number,
286
- beta?: number,
287
- radius?: number,
288
- target?: string | Vector3
289
- };
290
-
291
- type AnimationDefinitions = {
292
- [name: string]: AnimationDefinition
293
- };
294
-
295
- /**
296
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
297
- *
298
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
299
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
300
- * {@link AnimationDefinition}.
301
- *
302
- * Example usage in {@link SceneJson | SceneJson.animations}:
303
- *
304
- * ```js
305
- * // ...
306
- * scene: {
307
- * // ...
308
- * animations: {
309
- * DefaultCameraAnimation: {
310
- * ease: 'Power3.easeInOut',
311
- * duration: 0.8,
312
- * },
313
- * },
314
- * // ...
315
- * }
316
- * // ...
317
- * ```
318
- */
1
+ // global accessible types imported from 3d-viewer
2
+ type Viewer = import("../classes/viewer").Viewer;
3
+ type Variant = import("../classes/variant").Variant;
4
+ type VariantInstance = import("../classes/variantInstance").VariantInstance;
5
+ /**
6
+ * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
7
+ * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
8
+ */
9
+ type VariantElement = import("../classes/element").Element;
10
+ type DottedPath = import("../classes/dottedPath").DottedPath;
11
+
12
+ // global accessible types imported from BabylonJS
13
+ type Scene = import("@babylonjs/core/scene").Scene;
14
+ type Vector3 = import("@babylonjs/core/Maths/math.vector").Vector3;
15
+ type Color3 = import("@babylonjs/core/Maths/math.color").Color3;
16
+ type Color4 = import("@babylonjs/core/Maths/math.color").Color4;
17
+ type Material = import("@babylonjs/core/Materials/material").Material;
18
+ type PBRMaterial = import("@babylonjs/core/Materials/PBR/pbrMaterial").PBRMaterial;
19
+ type StandardMaterial = import("@babylonjs/core/Materials/standardMaterial").StandardMaterial;
20
+ type DynamicTexture = import("@babylonjs/core/Materials/Textures/dynamicTexture").DynamicTexture;
21
+ type Mesh = import("@babylonjs/core/Meshes/mesh").Mesh;
22
+ type AbstractMesh = import("@babylonjs/core/Meshes/abstractMesh").AbstractMesh;
23
+ type InstancedMesh = import("@babylonjs/core/Meshes/instancedMesh").InstancedMesh;
24
+ type TransformNode = import("@babylonjs/core/Meshes/transformNode").TransformNode;
25
+ type Engine = import("@babylonjs/core/Engines/engine").Engine;
26
+ type EngineOptions = import("@babylonjs/core/Engines/thinEngine").EngineOptions;
27
+ type ArcRotateCamera = import("@babylonjs/core/Cameras/arcRotateCamera").ArcRotateCamera;
28
+ type IScreenshotSize = import("@babylonjs/core/Misc/interfaces/screenshotSize").IScreenshotSize;
29
+ type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
30
+ type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
31
+ type MeshBuilder = import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
32
+ type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
33
+ type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
34
+ type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
35
+ // Node is already defined in lib.dom.d.ts, so it can't be declared that way
36
+ // type Node = import("@babylonjs/core/node").Node;
37
+
38
+ type EventEmitter = import('eventemitter3');
39
+
40
+ // some more global accessible types
41
+ type PathDefinitions = {
42
+ include: string[],
43
+ exclude?: string[]
44
+ };
45
+
46
+ type TraceableDefinition = {
47
+ path: string
48
+ };
49
+
50
+ type TraceableDefinitions = {
51
+ [name: string]: TraceableDefinition
52
+ };
53
+
54
+ type PaintableDefinition = {
55
+ path: string,
56
+ textureOptions: {
57
+ width: number,
58
+ height: number,
59
+ } | number
60
+ };
61
+
62
+ type PaintableDefinitions = {
63
+ [name: string]: PaintableDefinition
64
+ };
65
+
66
+ type Asset = {
67
+ rootUrl: string,
68
+ fileName: string | undefined
69
+ };
70
+
71
+ type ElementDefinition = {
72
+ paths: PathDefinitions,
73
+ traceables?: TraceableDefinitions,
74
+ paintables?: PaintableDefinitions
75
+ };
76
+
77
+ type StructureJson = {
78
+ /**
79
+ * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
80
+ * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
81
+ */
82
+ scene?: string | SceneJson,
83
+ /**
84
+ * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
85
+ * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
86
+ * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
87
+ * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
88
+ * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
89
+ */
90
+ setup?: string | SetupJson,
91
+ file?: string
92
+ glTF?: Asset | string,
93
+ parameterDeclaration?: ParameterDeclarations,
94
+ parameters?: ParameterBag,
95
+ elements?: {
96
+ [name: string]: ElementDefinition | string[]
97
+ },
98
+ /**
99
+ * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
100
+ * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
101
+ * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
102
+ * `paths`.
103
+ *
104
+ * Example Code
105
+ * ```js
106
+ * variants: {
107
+ * 'My Pretty Variant' {
108
+ * glTF: {
109
+ * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
110
+ * fileName: 'my_3d_model_file.glb',
111
+ * },
112
+ * elements: {
113
+ * 'My Little Element': {
114
+ * paths: {
115
+ * includes: ['__root__.MeshName']
116
+ * }
117
+ * }
118
+ * }
119
+ * }
120
+ * }
121
+ * ```
122
+ * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
123
+ */
124
+ variants?: {
125
+ [id: string]: StructureJson,
126
+ }
127
+ };
128
+
129
+ type SceneJson = {
130
+ parameterDeclaration?: ParameterDeclarations,
131
+ parameters?: ParameterBag,
132
+ meshPicking?: boolean,
133
+ /**
134
+ * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
135
+ */
136
+ engine?: {
137
+ antialiasing?: boolean
138
+ options?: EngineOptions
139
+ }
140
+ scene: SceneDefinition,
141
+ animations?: AnimationDefinitions,
142
+ placements?: PlacementDefinitions
143
+ };
144
+
145
+ type SceneDefinition = {
146
+ globals: SceneGlobals,
147
+ lights?: LightDefinitions,
148
+ cameras?: CameraDefinitions
149
+ };
150
+
151
+ type SceneGlobals = {
152
+ shadows?: {
153
+ enabled: boolean,
154
+ type: 'contact',
155
+ settings: [],
156
+ generator: [],
157
+ receiver: []
158
+ },
159
+ /**
160
+ * `aa` or anti aliasing is not needed if hard edges are desired.\
161
+ * FYI: aa smooths edges and avoids stairs-effects.
162
+ */
163
+ aa?: 'fxaa',
164
+ 'tone-mapping'?: boolean,
165
+ /**
166
+ * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel, relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to bloom).
167
+ * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
168
+ *
169
+ * @dof short for "depth-of-field" defines the focus in the view. Parameters in settings are listed in [Depth of Field and Other Lens Effects link](https://doc.babylonjs.com/divingDeeper/postProcesses/dofLenseEffects).
170
+ * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
171
+ * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
172
+ */
173
+ 'camera-settings'?: {
174
+ contrast: number,
175
+ exposure: number,
176
+ bloom?: {
177
+ enabled: boolean,
178
+ size?: number,
179
+ threshold?: number
180
+ },
181
+ dof?: {
182
+ enabled: boolean,
183
+ settings: {}
184
+ },
185
+ sharpen?: {
186
+ enabled: boolean,
187
+ settings: {}
188
+ }
189
+ }
190
+ };
191
+
192
+ type ScreenshotSettings = {
193
+ size?: IScreenshotSize,
194
+ mimeType?: string,
195
+ samples?: number,
196
+ antialiasing?: boolean,
197
+ fileName?: string,
198
+ renderSprites?: boolean
199
+ };
200
+
201
+ type AutofocusSettings = {
202
+ /**
203
+ * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
204
+ * Defaults to 1.5 when not set explicitly.
205
+ */
206
+ radiusFactor?: number,
207
+ adjustWheelPrecision?: boolean,
208
+ adjustPanningSensibility?: boolean,
209
+ adjustPinchPrecision?: boolean
210
+ };
211
+
212
+ type LightDefinitions = {
213
+ [light: string]: LightDefinition
214
+ };
215
+
216
+ type LightDefinition = {
217
+ type: 'hemispheric' | 'point'
218
+ };
219
+
220
+ type CameraDefinitions = {
221
+ [camera: string]: CameraDefinition
222
+ };
223
+
224
+ type CameraDefinition = {
225
+ /**
226
+ * `fov` or "Field Of View" defines as it says the view of the scene. Further information about its [theory](https://en.wikipedia.org/wiki/Field_of_view) and [implementation](https://doc.babylonjs.com/typedoc/classes/babylon.camera#fov).
227
+ */
228
+ fov?: number,
229
+ active?: boolean
230
+ /**
231
+ * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
232
+ * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
233
+ *
234
+ * NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the `Specification`, it's still possible to use them in the viewer.\
235
+ * For the moment all camera definitions inside these files are automatically added to the scene and can be actived using the {@link switchCamera} function.\
236
+ * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
237
+ */
238
+ type: 'arc'
239
+ /**
240
+ * `target` overrides `arc`´s position and repositions the camera. The string has the syntax (x?: number, y?: number, z?: number) like [Vector3](https://doc.babylonjs.com/typedoc/classes/babylon.vector3).
241
+ */
242
+ target?: string
243
+ };
244
+
245
+ type VariantInstanceDefinition = {
246
+ name?: string,
247
+ variant: DottedPathArgument,
248
+ parameters?: ParameterBag,
249
+ lazy?: boolean
250
+ };
251
+
252
+ type SetupJson = {
253
+ instances: VariantInstanceDefinition[]
254
+ };
255
+
256
+ type ParameterDeclarations = {
257
+ [name: string]: ParameterDeclaration
258
+ };
259
+
260
+ type ParameterDeclaration = {
261
+ type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector',
262
+ options?: ParameterValue[]
263
+ };
264
+
265
+ type ParameterValue = string | number | boolean;
266
+
267
+ type ParameterBag = {
268
+ [name: string]: ParameterValue
269
+ };
270
+
271
+ type DottedPathArgument = string | string[] | DottedPath;
272
+
273
+ type ParameterObserver = (
274
+ object: any,
275
+ oldValue: ParameterValue,
276
+ newValue: ParameterValue
277
+ ) => void;
278
+
279
+ type PlacementDefinitions = {
280
+ [name: string]: PlacementDefinition
281
+ };
282
+
283
+ type PlacementDefinition = {
284
+ position?: string | Vector3,
285
+ alpha?: number,
286
+ beta?: number,
287
+ radius?: number,
288
+ target?: string | Vector3
289
+ };
290
+
291
+ type AnimationDefinitions = {
292
+ [name: string]: AnimationDefinition
293
+ };
294
+
295
+ /**
296
+ * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
297
+ *
298
+ * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
299
+ * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
300
+ * {@link AnimationDefinition}.
301
+ *
302
+ * Example usage in {@link SceneJson | SceneJson.animations}:
303
+ *
304
+ * ```js
305
+ * // ...
306
+ * scene: {
307
+ * // ...
308
+ * animations: {
309
+ * DefaultCameraAnimation: {
310
+ * ease: 'Power3.easeInOut',
311
+ * duration: 0.8,
312
+ * },
313
+ * },
314
+ * // ...
315
+ * }
316
+ * // ...
317
+ * ```
318
+ */
319
319
  type AnimationDefinition = GSAPTweenVars;