@combeenation/3d-viewer 4.2.0 → 5.0.0-ar1

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