@combeenation/3d-viewer 5.0.1 → 5.0.3-beta2

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 (109) hide show
  1. package/README.md +111 -114
  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 +187 -187
  6. package/dist/lib-cjs/api/classes/element.d.ts +139 -139
  7. package/dist/lib-cjs/api/classes/element.js +794 -794
  8. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  9. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -0
  10. package/dist/lib-cjs/api/classes/elementParameterizable.js +135 -0
  11. package/dist/lib-cjs/api/classes/elementParameterizable.js.map +1 -0
  12. package/dist/lib-cjs/api/classes/event.d.ts +326 -326
  13. package/dist/lib-cjs/api/classes/event.js +371 -371
  14. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  15. package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
  16. package/dist/lib-cjs/api/classes/parameter.d.ts +316 -259
  17. package/dist/lib-cjs/api/classes/parameter.js +451 -388
  18. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  19. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  20. package/dist/lib-cjs/api/classes/parameterObservable.js +101 -101
  21. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  22. package/dist/lib-cjs/api/classes/parameterizable.js +149 -149
  23. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +44 -44
  24. package/dist/lib-cjs/api/classes/placementAnimation.js +163 -163
  25. package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
  26. package/dist/lib-cjs/api/classes/variant.js +1154 -1154
  27. package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -45
  28. package/dist/lib-cjs/api/classes/variantInstance.js +108 -108
  29. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  30. package/dist/lib-cjs/api/classes/variantParameterizable.js +99 -99
  31. package/dist/lib-cjs/api/classes/viewer.d.ts +177 -175
  32. package/dist/lib-cjs/api/classes/viewer.js +717 -701
  33. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  34. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  35. package/dist/lib-cjs/api/classes/viewerLight.js +392 -392
  36. package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
  37. package/dist/lib-cjs/api/internal/debugViewer.js +86 -86
  38. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  39. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  40. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -10
  41. package/dist/lib-cjs/api/internal/sceneSetup.js +238 -234
  42. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  43. package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
  44. package/dist/lib-cjs/api/manager/animationManager.js +130 -130
  45. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +65 -65
  46. package/dist/lib-cjs/api/manager/gltfExportManager.js +223 -222
  47. package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
  48. package/dist/lib-cjs/api/manager/sceneManager.d.ts +31 -32
  49. package/dist/lib-cjs/api/manager/sceneManager.js +153 -132
  50. package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
  51. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
  52. package/dist/lib-cjs/api/manager/variantInstanceManager.js +335 -335
  53. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  54. package/dist/lib-cjs/api/store/specStorage.js +51 -51
  55. package/dist/lib-cjs/api/util/babylonHelper.d.ts +174 -166
  56. package/dist/lib-cjs/api/util/babylonHelper.js +575 -497
  57. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  58. package/dist/lib-cjs/api/util/globalTypes.d.ts +366 -356
  59. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  60. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -53
  61. package/dist/lib-cjs/api/util/resourceHelper.js +257 -242
  62. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  63. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  64. package/dist/lib-cjs/api/util/stringHelper.js +25 -25
  65. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  66. package/dist/lib-cjs/api/util/structureHelper.js +48 -44
  67. package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
  68. package/dist/lib-cjs/buildinfo.json +3 -3
  69. package/dist/lib-cjs/index.d.ts +49 -49
  70. package/dist/lib-cjs/index.js +89 -89
  71. package/dist/webpack-stats.json +0 -0
  72. package/package.json +87 -87
  73. package/src/api/classes/animationInterface.ts +10 -10
  74. package/src/api/classes/dottedPath.ts +181 -181
  75. package/src/api/classes/element.ts +690 -692
  76. package/src/api/classes/event.ts +367 -367
  77. package/src/api/classes/eventBroadcaster.ts +52 -52
  78. package/src/api/classes/parameter.ts +474 -405
  79. package/src/api/classes/parameterObservable.ts +100 -100
  80. package/src/api/classes/parameterizable.ts +87 -87
  81. package/src/api/classes/placementAnimation.ts +160 -160
  82. package/src/api/classes/variant.ts +845 -845
  83. package/src/api/classes/variantInstance.ts +97 -97
  84. package/src/api/classes/variantParameterizable.ts +85 -85
  85. package/src/api/classes/viewer.ts +650 -624
  86. package/src/api/classes/viewerLight.ts +334 -334
  87. package/src/api/internal/debugViewer.ts +90 -90
  88. package/src/api/internal/lensRendering.ts +10 -10
  89. package/src/api/internal/sceneSetup.ts +204 -201
  90. package/src/api/manager/animationManager.ts +142 -142
  91. package/src/api/manager/gltfExportManager.ts +191 -191
  92. package/src/api/manager/sceneManager.ts +128 -102
  93. package/src/api/manager/variantInstanceManager.ts +265 -265
  94. package/src/api/store/specStorage.ts +51 -51
  95. package/src/api/util/babylonHelper.ts +628 -538
  96. package/src/api/util/globalTypes.ts +413 -402
  97. package/src/api/util/resourceHelper.ts +189 -173
  98. package/src/api/util/stringHelper.ts +23 -23
  99. package/src/api/util/structureHelper.ts +49 -43
  100. package/src/buildinfo.json +3 -3
  101. package/src/commonjs.tsconfig.json +10 -10
  102. package/src/declaration.tsconfig.json +8 -8
  103. package/src/dev.ts +42 -42
  104. package/src/es6.tsconfig.json +10 -10
  105. package/src/index.ts +94 -94
  106. package/src/pagesconfig.json +77 -73
  107. package/src/tsconfig.json +32 -32
  108. package/src/tsconfig.types.json +9 -9
  109. package/src/types.d.ts +3 -3
@@ -1,356 +1,366 @@
1
- /// <reference types="gsap" />
2
- declare type Viewer = import('../classes/viewer').Viewer;
3
- declare type Variant = import('../classes/variant').Variant;
4
- declare 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
- declare type VariantElement = import('../classes/element').Element;
10
- declare type DottedPath = import('../classes/dottedPath').DottedPath;
11
- declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
12
- declare type Scene = import('@babylonjs/core/scene').Scene;
13
- declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
14
- declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
15
- declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
16
- declare type Material = import('@babylonjs/core/Materials/material').Material;
17
- declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
18
- declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
19
- declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
20
- declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
21
- declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
22
- declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
23
- declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
24
- declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
25
- declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
26
- declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
27
- declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
28
- declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
29
- declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
30
- declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
31
- declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
32
- declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
33
- declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
34
- declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
35
- declare type EventEmitter = import('eventemitter3');
36
- declare type PathDefinitions = {
37
- include: string[];
38
- exclude?: string[];
39
- };
40
- declare type TraceableDefinition = {
41
- path: string;
42
- };
43
- declare type TraceableDefinitions = {
44
- [name: string]: TraceableDefinition;
45
- };
46
- declare type PaintableDefinition = {
47
- path: string;
48
- textureOptions: {
49
- width: number;
50
- height: number;
51
- } | number;
52
- };
53
- declare type PaintableDefinitions = {
54
- [name: string]: PaintableDefinition;
55
- };
56
- declare type Asset = {
57
- rootUrl: string;
58
- fileName: string | undefined;
59
- };
60
- declare type ElementDefinitions = {
61
- [name: string]: ElementDefinition | string[];
62
- };
63
- declare type ElementDefinition = {
64
- paths: PathDefinitions;
65
- traceables?: TraceableDefinitions;
66
- paintables?: PaintableDefinitions;
67
- };
68
- declare type TransformationDefinition = {
69
- scaling: Vector3;
70
- position: Vector3;
71
- rotation: Vector3;
72
- };
73
- declare type StructureJson = {
74
- /**
75
- * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
76
- * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
77
- */
78
- scene?: string | SceneJson;
79
- /**
80
- * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
81
- * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
82
- * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
83
- * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
84
- * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
85
- */
86
- setup?: string | SetupJson;
87
- file?: string;
88
- glTF?: Asset | string;
89
- parameterDeclaration?: ParameterDeclarations;
90
- parameters?: ParameterBag;
91
- elements?: ElementDefinitions;
92
- lights?: LightDefinitions;
93
- grounds?: GroundDefinitions;
94
- /**
95
- * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
96
- * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
97
- * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
98
- * `paths`.
99
- *
100
- * Example Code
101
- * ```js
102
- * variants: {
103
- * 'My Pretty Variant' {
104
- * glTF: {
105
- * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
106
- * fileName: 'my_3d_model_file.glb',
107
- * },
108
- * elements: {
109
- * 'My Little Element': {
110
- * paths: {
111
- * includes: ['__root__.MeshName']
112
- * }
113
- * }
114
- * }
115
- * }
116
- * }
117
- * ```
118
- * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
119
- */
120
- variants?: {
121
- [id: string]: StructureJson;
122
- };
123
- };
124
- declare type SceneJson = {
125
- parameterDeclaration?: ParameterDeclarations;
126
- parameters?: ParameterBag;
127
- meshPicking?: boolean;
128
- /**
129
- * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
130
- */
131
- engine?: {
132
- antialiasing?: boolean;
133
- options?: EngineOptions;
134
- };
135
- scene: SceneDefinition;
136
- animations?: AnimationDefinitions;
137
- placements?: PlacementDefinitions;
138
- /**
139
- * Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation)
140
- */
141
- cloneMaterialsOnMutation?: boolean;
142
- };
143
- declare type SceneDefinition = {
144
- globals: SceneGlobals;
145
- cameras?: CameraDefinitions;
146
- };
147
- declare type SceneGlobals = {
148
- 'shadows'?: {
149
- enabled: boolean;
150
- type: 'contact';
151
- settings: [];
152
- generator: [];
153
- receiver: [];
154
- };
155
- /**
156
- * `aa` or anti aliasing is not needed if hard edges are desired.\
157
- * FYI: aa smooths edges and avoids stairs-effects.
158
- */
159
- 'aa'?: 'fxaa';
160
- 'tone-mapping'?: boolean;
161
- /**
162
- * @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).
163
- * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
164
- *
165
- * @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).
166
- * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
167
- * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
168
- */
169
- 'camera-settings'?: {
170
- contrast: number;
171
- exposure: number;
172
- bloom?: {
173
- enabled: boolean;
174
- size?: number;
175
- threshold?: number;
176
- };
177
- dof?: {
178
- enabled: boolean;
179
- settings: {};
180
- };
181
- sharpen?: {
182
- enabled: boolean;
183
- settings: {};
184
- };
185
- };
186
- };
187
- /**
188
- * {@link Viewer.screenshot} internally uses Babylons [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
189
- * See this link for additional info about the properties.
190
- */
191
- declare type ScreenshotSettings = {
192
- /** Defaults to canvas width & height */
193
- size?: IScreenshotSize;
194
- /**
195
- * Default `image/png`
196
- *
197
- * **Info regarding JPEG:** \
198
- * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
199
- * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't support
200
- * transparency. Otherwise background will always be black for jpeg's.
201
- */
202
- mimeType?: string;
203
- /** Default `1` */
204
- samples?: number;
205
- /** Default `false` */
206
- antialiasing?: boolean;
207
- /** Default `screenshot.png` */
208
- fileName?: string;
209
- /** Default `false` */
210
- renderSprites?: boolean;
211
- };
212
- /**
213
- * Use this to define geometry to be excluded from autofocus, GLB export, etc.
214
- */
215
- declare type ExcludedGeometry = (Mesh | VariantInstance | Variant | VariantElement)[];
216
- declare type AutofocusSettings = {
217
- /**
218
- * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
219
- * Defaults to 1.5 when not set explicitly.
220
- */
221
- radiusFactor?: number;
222
- adjustWheelPrecision?: boolean;
223
- adjustPanningSensibility?: boolean;
224
- adjustPinchPrecision?: boolean;
225
- /** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
226
- alpha?: number;
227
- /** Desired vertical camera angle, this won't be overwritten by the autofocus function */
228
- beta?: number;
229
- /** Optional animation for the focusing camera movement */
230
- animation?: string | AnimationDefinition;
231
- /** Optional list of geometry to be excluded from consideration */
232
- exclude?: ExcludedGeometry;
233
- };
234
- declare type LightDefinitions = {
235
- [name: string]: LightDefinition | string;
236
- };
237
- declare type LightDefinition = {
238
- type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
239
- path?: string;
240
- shadowGenerator?: ShadowGeneratorDefinition;
241
- };
242
- declare type ShadowGeneratorDefinition = {
243
- mapSize: number;
244
- [others: string]: any;
245
- };
246
- declare type GroundDefinitions = {
247
- [ground: string]: GroundDefinition;
248
- };
249
- declare type GroundDefinition = {
250
- type: 'baked' | 'ground' | 'heightmap';
251
- meshId?: string;
252
- url?: string;
253
- width?: number;
254
- height?: number;
255
- subdivisions?: number;
256
- receiveShadows?: boolean;
257
- minHeight?: number;
258
- maxHeight?: number;
259
- alphaFilter?: number;
260
- onReady?: any;
261
- };
262
- declare type CameraDefinitions = {
263
- [camera: string]: CameraDefinition;
264
- };
265
- declare type CameraDefinition = {
266
- /**
267
- * `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).
268
- */
269
- fov?: number;
270
- active?: boolean;
271
- /**
272
- * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
273
- * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
274
- *
275
- * 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.\
276
- * For the moment all camera definitions inside these files are automatically added to the scene and can be actived using the {@link switchCamera} function.\
277
- * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
278
- */
279
- type: 'arc';
280
- /**
281
- * `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).
282
- */
283
- target?: string;
284
- };
285
- declare type VariantInstanceDefinition = {
286
- name?: string;
287
- variant: DottedPathArgument;
288
- parameters?: ParameterBag;
289
- lazy?: boolean;
290
- };
291
- declare type SetupJson = {
292
- instances: VariantInstanceDefinition[];
293
- };
294
- declare type ParameterDeclarations = {
295
- [name: string]: ParameterDeclaration;
296
- };
297
- declare type ParameterDeclaration = {
298
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl';
299
- parser?: any;
300
- options?: ParameterValue[];
301
- };
302
- declare type ParameterValue = string | number | boolean;
303
- declare type ParameterBag = {
304
- [name: string]: ParameterValue;
305
- };
306
- declare type ParsedParameterBag = {
307
- [name: string]: any;
308
- };
309
- declare type DottedPathArgument = string | string[] | DottedPath;
310
- declare type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
311
- declare type PlacementDefinitions = {
312
- [name: string]: PlacementDefinition;
313
- };
314
- declare type PlacementDefinition = {
315
- position?: string | Vector3;
316
- alpha?: number;
317
- beta?: number;
318
- radius?: number;
319
- target?: string | Vector3;
320
- };
321
- declare type AnimationDefinitions = {
322
- [name: string]: AnimationDefinition;
323
- };
324
- /**
325
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
326
- *
327
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
328
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
329
- * {@link AnimationDefinition}.
330
- *
331
- * The `GSAPTWeenVars` are extended by the `shortestWay` property.\
332
- * This property defines if the camera should move to the target position within the shortest possible distance.\
333
- * If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target position
334
- * and that could be > 360, which can appear very unconvenient to the operator.\
335
- * The default value of this flag is `true`.
336
- *
337
- * Example usage in {@link SceneJson | SceneJson.animations}:
338
- *
339
- * ```js
340
- * // ...
341
- * scene: {
342
- * // ...
343
- * animations: {
344
- * DefaultCameraAnimation: {
345
- * ease: 'Power3.easeInOut',
346
- * duration: 0.8,
347
- * },
348
- * },
349
- * // ...
350
- * }
351
- * // ...
352
- * ```
353
- */
354
- declare type AnimationDefinition = GSAPTweenVars & {
355
- shortestWay?: boolean;
356
- };
1
+ /// <reference types="gsap" />
2
+ declare type Viewer = import('../classes/viewer').Viewer;
3
+ declare type Variant = import('../classes/variant').Variant;
4
+ declare 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
+ declare type VariantElement = import('../classes/element').Element;
10
+ declare type DottedPath = import('../classes/dottedPath').DottedPath;
11
+ declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
12
+ declare type SceneManager = import('../manager/sceneManager').SceneManager;
13
+ declare type Scene = import('@babylonjs/core/scene').Scene;
14
+ declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
15
+ declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
16
+ declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
17
+ declare type Material = import('@babylonjs/core/Materials/material').Material;
18
+ declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
19
+ declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
20
+ declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
21
+ declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
22
+ declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
23
+ declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
24
+ declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
25
+ declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
26
+ declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
27
+ declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
28
+ declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
29
+ declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
30
+ declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
31
+ declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
32
+ declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
33
+ declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
34
+ declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
35
+ declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
36
+ declare type EventEmitter = import('eventemitter3');
37
+ declare type PathDefinitions = {
38
+ include: string[];
39
+ exclude?: string[];
40
+ };
41
+ declare type TraceableDefinition = {
42
+ path: string;
43
+ };
44
+ declare type TraceableDefinitions = {
45
+ [name: string]: TraceableDefinition;
46
+ };
47
+ declare type PaintableDefinition = {
48
+ path: string;
49
+ textureOptions: {
50
+ width: number;
51
+ height: number;
52
+ } | number;
53
+ };
54
+ declare type PaintableDefinitions = {
55
+ [name: string]: PaintableDefinition;
56
+ };
57
+ declare type Asset = {
58
+ rootUrl: string;
59
+ fileName: string | undefined;
60
+ };
61
+ declare type ElementDefinitions = {
62
+ [name: string]: ElementDefinition | string[];
63
+ };
64
+ declare type ElementDefinition = {
65
+ paths: PathDefinitions;
66
+ traceables?: TraceableDefinitions;
67
+ paintables?: PaintableDefinitions;
68
+ };
69
+ declare type TransformationDefinition = {
70
+ scaling: Vector3;
71
+ position: Vector3;
72
+ rotation: Vector3;
73
+ };
74
+ declare type EnvironmentDefinition = {
75
+ environmentColor?: Color3;
76
+ environmentIntensity?: number;
77
+ environment?: string;
78
+ environmentBackground?: string;
79
+ environmentRotation?: number;
80
+ environmentUseDefault?: boolean;
81
+ };
82
+ declare type StructureJson = {
83
+ /**
84
+ * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
85
+ * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
86
+ */
87
+ scene?: string | SceneJson;
88
+ /**
89
+ * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
90
+ * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
91
+ * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
92
+ * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
93
+ * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
94
+ */
95
+ setup?: string | SetupJson;
96
+ file?: string;
97
+ glTF?: Asset | string;
98
+ parameterDeclaration?: ParameterDeclarations;
99
+ parameters?: ParameterBag;
100
+ elements?: ElementDefinitions;
101
+ lights?: LightDefinitions;
102
+ grounds?: GroundDefinitions;
103
+ /**
104
+ * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
105
+ * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
106
+ * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
107
+ * `paths`.
108
+ *
109
+ * Example Code
110
+ * ```js
111
+ * variants: {
112
+ * 'My Pretty Variant' {
113
+ * glTF: {
114
+ * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
115
+ * fileName: 'my_3d_model_file.glb',
116
+ * },
117
+ * elements: {
118
+ * 'My Little Element': {
119
+ * paths: {
120
+ * includes: ['__root__.MeshName']
121
+ * }
122
+ * }
123
+ * }
124
+ * }
125
+ * }
126
+ * ```
127
+ * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
128
+ */
129
+ variants?: {
130
+ [id: string]: StructureJson;
131
+ };
132
+ };
133
+ declare type SceneJson = {
134
+ parameterDeclaration?: ParameterDeclarations;
135
+ parameters?: ParameterBag;
136
+ meshPicking?: boolean;
137
+ /**
138
+ * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
139
+ */
140
+ engine?: {
141
+ antialiasing?: boolean;
142
+ options?: EngineOptions;
143
+ };
144
+ scene: SceneDefinition;
145
+ animations?: AnimationDefinitions;
146
+ placements?: PlacementDefinitions;
147
+ /**
148
+ * Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation)
149
+ */
150
+ cloneMaterialsOnMutation?: boolean;
151
+ };
152
+ declare type SceneDefinition = {
153
+ globals: SceneGlobals;
154
+ cameras?: CameraDefinitions;
155
+ };
156
+ declare type SceneGlobals = {
157
+ 'shadows'?: {
158
+ enabled: boolean;
159
+ type: 'contact';
160
+ settings: [];
161
+ generator: [];
162
+ receiver: [];
163
+ };
164
+ /**
165
+ * `aa` or anti aliasing is not needed if hard edges are desired.\
166
+ * FYI: aa smooths edges and avoids stairs-effects.
167
+ */
168
+ 'aa'?: 'fxaa';
169
+ 'tone-mapping'?: boolean;
170
+ /**
171
+ * @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).
172
+ * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
173
+ *
174
+ * @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).
175
+ * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
176
+ * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
177
+ */
178
+ 'camera-settings'?: {
179
+ contrast: number;
180
+ exposure: number;
181
+ bloom?: {
182
+ enabled: boolean;
183
+ size?: number;
184
+ threshold?: number;
185
+ };
186
+ dof?: {
187
+ enabled: boolean;
188
+ settings: {};
189
+ };
190
+ sharpen?: {
191
+ enabled: boolean;
192
+ settings: {};
193
+ };
194
+ };
195
+ };
196
+ /**
197
+ * {@link Viewer.screenshot} internally uses Babylons [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
198
+ * See this link for additional info about the properties.
199
+ */
200
+ declare type ScreenshotSettings = {
201
+ /** Defaults to canvas width & height */
202
+ size?: IScreenshotSize;
203
+ /**
204
+ * Default `image/png`
205
+ *
206
+ * **Info regarding JPEG:** \
207
+ * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
208
+ * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't support
209
+ * transparency. Otherwise background will always be black for jpeg's.
210
+ */
211
+ mimeType?: string;
212
+ /** Default `1` */
213
+ samples?: number;
214
+ /** Default `false` */
215
+ antialiasing?: boolean;
216
+ /** Default `screenshot.png` */
217
+ fileName?: string;
218
+ /** Default `false` */
219
+ renderSprites?: boolean;
220
+ };
221
+ /**
222
+ * Use this to define geometry to be excluded from autofocus, GLB export, etc.
223
+ */
224
+ declare type ExcludedGeometry = Mesh | AbstractMesh | VariantInstance | Variant | VariantElement | Node;
225
+ declare type ExcludedGeometryList = ExcludedGeometry[];
226
+ declare type AutofocusSettings = {
227
+ /**
228
+ * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
229
+ * Defaults to 1.5 when not set explicitly.
230
+ */
231
+ radiusFactor?: number;
232
+ adjustWheelPrecision?: boolean;
233
+ adjustPanningSensibility?: boolean;
234
+ adjustPinchPrecision?: boolean;
235
+ /** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
236
+ alpha?: number;
237
+ /** Desired vertical camera angle, this won't be overwritten by the autofocus function */
238
+ beta?: number;
239
+ /** Optional animation for the focusing camera movement */
240
+ animation?: string | AnimationDefinition;
241
+ /** Optional list of geometry to be excluded from consideration */
242
+ exclude?: ExcludedGeometryList;
243
+ };
244
+ declare type LightDefinitions = {
245
+ [name: string]: LightDefinition | string;
246
+ };
247
+ declare type LightDefinition = {
248
+ type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
249
+ path?: string;
250
+ shadowGenerator?: ShadowGeneratorDefinition;
251
+ };
252
+ declare type ShadowGeneratorDefinition = {
253
+ mapSize: number;
254
+ [others: string]: any;
255
+ };
256
+ declare type GroundDefinitions = {
257
+ [ground: string]: GroundDefinition;
258
+ };
259
+ declare type GroundDefinition = {
260
+ type: 'baked' | 'ground' | 'heightmap';
261
+ meshId?: string;
262
+ url?: string;
263
+ width?: number;
264
+ height?: number;
265
+ subdivisions?: number;
266
+ receiveShadows?: boolean;
267
+ minHeight?: number;
268
+ maxHeight?: number;
269
+ alphaFilter?: number;
270
+ onReady?: any;
271
+ };
272
+ declare type CameraDefinitions = {
273
+ [camera: string]: CameraDefinition;
274
+ };
275
+ declare type CameraDefinition = {
276
+ /**
277
+ * `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).
278
+ */
279
+ fov?: number;
280
+ active?: boolean;
281
+ /**
282
+ * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
283
+ * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
284
+ *
285
+ * 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.\
286
+ * For the moment all camera definitions inside these files are automatically added to the scene and can be actived using the {@link switchCamera} function.\
287
+ * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
288
+ */
289
+ type: 'arc';
290
+ /**
291
+ * `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).
292
+ */
293
+ target?: string;
294
+ };
295
+ declare type VariantInstanceDefinition = {
296
+ name?: string;
297
+ variant: DottedPathArgument;
298
+ parameters?: ParameterBag;
299
+ lazy?: boolean;
300
+ };
301
+ declare type SetupJson = {
302
+ instances: VariantInstanceDefinition[];
303
+ };
304
+ declare type ParameterDeclarations = {
305
+ [name: string]: ParameterDeclaration;
306
+ };
307
+ declare type ParameterDeclaration = {
308
+ type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl';
309
+ parser?: any;
310
+ options?: ParameterValue[];
311
+ };
312
+ declare type ParameterValue = string | number | boolean;
313
+ declare type ParameterBag = {
314
+ [name: string]: ParameterValue;
315
+ };
316
+ declare type ParsedParameterBag = {
317
+ [name: string]: any;
318
+ };
319
+ declare type DottedPathArgument = string | string[] | DottedPath;
320
+ declare type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
321
+ declare type PlacementDefinitions = {
322
+ [name: string]: PlacementDefinition;
323
+ };
324
+ declare type PlacementDefinition = {
325
+ position?: string | Vector3;
326
+ alpha?: number;
327
+ beta?: number;
328
+ radius?: number;
329
+ target?: string | Vector3;
330
+ };
331
+ declare type AnimationDefinitions = {
332
+ [name: string]: AnimationDefinition;
333
+ };
334
+ /**
335
+ * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
336
+ *
337
+ * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
338
+ * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
339
+ * {@link AnimationDefinition}.
340
+ *
341
+ * The `GSAPTWeenVars` are extended by the `shortestWay` property.\
342
+ * This property defines if the camera should move to the target position within the shortest possible distance.\
343
+ * If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target position
344
+ * and that could be > 360, which can appear very unconvenient to the operator.\
345
+ * The default value of this flag is `true`.
346
+ *
347
+ * Example usage in {@link SceneJson | SceneJson.animations}:
348
+ *
349
+ * ```js
350
+ * // ...
351
+ * scene: {
352
+ * // ...
353
+ * animations: {
354
+ * DefaultCameraAnimation: {
355
+ * ease: 'Power3.easeInOut',
356
+ * duration: 0.8,
357
+ * },
358
+ * },
359
+ * // ...
360
+ * }
361
+ * // ...
362
+ * ```
363
+ */
364
+ declare type AnimationDefinition = GSAPTweenVars & {
365
+ shortestWay?: boolean;
366
+ };