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

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