@combeenation/3d-viewer 3.1.1-alpha7 → 3.1.2

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 (94) hide show
  1. package/README.md +111 -111
  2. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  3. package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +190 -190
  6. package/dist/lib-cjs/api/classes/element.d.ts +125 -126
  7. package/dist/lib-cjs/api/classes/element.js +678 -674
  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 +312 -312
  12. package/dist/lib-cjs/api/classes/event.js +357 -357
  13. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  14. package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
  15. package/dist/lib-cjs/api/classes/parameter.d.ts +165 -165
  16. package/dist/lib-cjs/api/classes/parameter.js +267 -267
  17. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  18. package/dist/lib-cjs/api/classes/parameterObservable.js +126 -126
  19. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  20. package/dist/lib-cjs/api/classes/parameterizable.js +149 -149
  21. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +38 -38
  22. package/dist/lib-cjs/api/classes/placementAnimation.js +138 -138
  23. package/dist/lib-cjs/api/classes/variant.d.ts +180 -190
  24. package/dist/lib-cjs/api/classes/variant.js +863 -873
  25. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  26. package/dist/lib-cjs/api/classes/variantInstance.d.ts +41 -41
  27. package/dist/lib-cjs/api/classes/variantInstance.js +98 -98
  28. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  29. package/dist/lib-cjs/api/classes/variantParameterizable.js +92 -92
  30. package/dist/lib-cjs/api/classes/viewer.d.ts +128 -128
  31. package/dist/lib-cjs/api/classes/viewer.js +486 -486
  32. package/dist/lib-cjs/api/classes/viewerLight.d.ts +65 -66
  33. package/dist/lib-cjs/api/classes/viewerLight.js +322 -389
  34. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
  35. package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
  36. package/dist/lib-cjs/api/internal/debugViewer.js +87 -87
  37. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  38. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  39. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +6 -6
  40. package/dist/lib-cjs/api/internal/sceneSetup.js +227 -227
  41. package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
  42. package/dist/lib-cjs/api/manager/animationManager.js +121 -121
  43. package/dist/lib-cjs/api/manager/sceneManager.d.ts +32 -32
  44. package/dist/lib-cjs/api/manager/sceneManager.js +132 -132
  45. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +90 -90
  46. package/dist/lib-cjs/api/manager/variantInstanceManager.js +321 -321
  47. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  48. package/dist/lib-cjs/api/store/specStorage.js +51 -51
  49. package/dist/lib-cjs/api/util/babylonHelper.d.ts +125 -125
  50. package/dist/lib-cjs/api/util/babylonHelper.js +368 -368
  51. package/dist/lib-cjs/api/util/globalTypes.d.ts +275 -275
  52. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  53. package/dist/lib-cjs/api/util/resourceHelper.d.ts +30 -30
  54. package/dist/lib-cjs/api/util/resourceHelper.js +247 -203
  55. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  56. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  57. package/dist/lib-cjs/api/util/stringHelper.js +25 -25
  58. package/dist/lib-cjs/buildinfo.json +3 -3
  59. package/dist/lib-cjs/index.d.ts +46 -46
  60. package/dist/lib-cjs/index.js +82 -82
  61. package/dist/webpack-stats.json +0 -0
  62. package/package.json +83 -83
  63. package/src/api/classes/animationInterface.ts +11 -11
  64. package/src/api/classes/dottedPath.ts +189 -189
  65. package/src/api/classes/element.ts +608 -606
  66. package/src/api/classes/elementParameterizable.ts +78 -78
  67. package/src/api/classes/event.ts +355 -355
  68. package/src/api/classes/eventBroadcaster.ts +54 -54
  69. package/src/api/classes/parameter.ts +277 -277
  70. package/src/api/classes/parameterObservable.ts +121 -121
  71. package/src/api/classes/placementAnimation.ts +133 -133
  72. package/src/api/classes/variant.ts +659 -670
  73. package/src/api/classes/variantInstance.ts +81 -81
  74. package/src/api/classes/viewer.ts +421 -421
  75. package/src/api/internal/debugViewer.ts +81 -81
  76. package/src/api/internal/lensRendering.ts +10 -10
  77. package/src/api/internal/sceneSetup.ts +203 -203
  78. package/src/api/manager/animationManager.ts +116 -116
  79. package/src/api/manager/sceneManager.ts +105 -105
  80. package/src/api/manager/variantInstanceManager.ts +236 -236
  81. package/src/api/store/specStorage.ts +53 -53
  82. package/src/api/util/babylonHelper.ts +392 -392
  83. package/src/api/util/globalTypes.ts +314 -314
  84. package/src/api/util/resourceHelper.ts +168 -155
  85. package/src/buildinfo.json +2 -2
  86. package/src/commonjs.tsconfig.json +13 -13
  87. package/src/declaration.tsconfig.json +10 -10
  88. package/src/dev.ts +44 -46
  89. package/src/es6.tsconfig.json +13 -13
  90. package/src/index.ts +87 -87
  91. package/src/pagesconfig.json +47 -47
  92. package/src/tsconfig.json +43 -43
  93. package/src/tsconfig.types.json +9 -9
  94. package/src/types.d.ts +4 -4
@@ -1,275 +1,275 @@
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
- type: 'arc';
211
- /**
212
- * `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).
213
- */
214
- target?: string;
215
- };
216
- declare type VariantInstanceDefinition = {
217
- name?: string;
218
- variant: DottedPathArgument;
219
- parameters?: ParameterBag;
220
- lazy?: boolean;
221
- };
222
- declare type SetupJson = {
223
- instances: VariantInstanceDefinition[];
224
- };
225
- declare type ParameterDeclarations = {
226
- [name: string]: ParameterDeclaration;
227
- };
228
- declare type ParameterDeclaration = {
229
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector';
230
- options?: ParameterValue[];
231
- };
232
- declare type ParameterValue = string | number | boolean;
233
- declare type ParameterBag = {
234
- [name: string]: ParameterValue;
235
- };
236
- declare type DottedPathArgument = string | string[] | DottedPath;
237
- declare type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
238
- declare type PlacementDefinitions = {
239
- [name: string]: PlacementDefinition;
240
- };
241
- declare type PlacementDefinition = {
242
- position?: string | Vector3;
243
- alpha?: number;
244
- beta?: number;
245
- radius?: number;
246
- target?: string | Vector3;
247
- };
248
- declare type AnimationDefinitions = {
249
- [name: string]: AnimationDefinition;
250
- };
251
- /**
252
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
253
- *
254
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
255
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
256
- * {@link AnimationDefinition}.
257
- *
258
- * Example usage in {@link SceneJson | SceneJson.animations}:
259
- *
260
- * ```js
261
- * // ...
262
- * scene: {
263
- * // ...
264
- * animations: {
265
- * DefaultCameraAnimation: {
266
- * ease: 'Power3.easeInOut',
267
- * duration: 0.8,
268
- * },
269
- * },
270
- * // ...
271
- * }
272
- * // ...
273
- * ```
274
- */
275
- 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 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
+ type: 'arc';
211
+ /**
212
+ * `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).
213
+ */
214
+ target?: string;
215
+ };
216
+ declare type VariantInstanceDefinition = {
217
+ name?: string;
218
+ variant: DottedPathArgument;
219
+ parameters?: ParameterBag;
220
+ lazy?: boolean;
221
+ };
222
+ declare type SetupJson = {
223
+ instances: VariantInstanceDefinition[];
224
+ };
225
+ declare type ParameterDeclarations = {
226
+ [name: string]: ParameterDeclaration;
227
+ };
228
+ declare type ParameterDeclaration = {
229
+ type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector';
230
+ options?: ParameterValue[];
231
+ };
232
+ declare type ParameterValue = string | number | boolean;
233
+ declare type ParameterBag = {
234
+ [name: string]: ParameterValue;
235
+ };
236
+ declare type DottedPathArgument = string | string[] | DottedPath;
237
+ declare type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
238
+ declare type PlacementDefinitions = {
239
+ [name: string]: PlacementDefinition;
240
+ };
241
+ declare type PlacementDefinition = {
242
+ position?: string | Vector3;
243
+ alpha?: number;
244
+ beta?: number;
245
+ radius?: number;
246
+ target?: string | Vector3;
247
+ };
248
+ declare type AnimationDefinitions = {
249
+ [name: string]: AnimationDefinition;
250
+ };
251
+ /**
252
+ * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
253
+ *
254
+ * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
255
+ * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
256
+ * {@link AnimationDefinition}.
257
+ *
258
+ * Example usage in {@link SceneJson | SceneJson.animations}:
259
+ *
260
+ * ```js
261
+ * // ...
262
+ * scene: {
263
+ * // ...
264
+ * animations: {
265
+ * DefaultCameraAnimation: {
266
+ * ease: 'Power3.easeInOut',
267
+ * duration: 0.8,
268
+ * },
269
+ * },
270
+ * // ...
271
+ * }
272
+ * // ...
273
+ * ```
274
+ */
275
+ declare type AnimationDefinition = GSAPTweenVars;
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ "use strict";
2
2
  //# sourceMappingURL=globalTypes.js.map
@@ -1,30 +1,30 @@
1
- /**
2
- * Loads a JSON from a given path.
3
- * @emits {@link Event.LOADING_START}
4
- * @emits {@link Event.LOADING_END}
5
- */
6
- declare const loadJson: <T>(path: string) => Promise<T>;
7
- /**
8
- * Loads a Text from a given path.
9
- * @emits {@link Event.LOADING_START}
10
- * @emits {@link Event.LOADING_END}
11
- */
12
- declare const loadText: (path: string) => Promise<string>;
13
- /**
14
- * Debounces: it limits the rate at which a function can fire.
15
- */
16
- declare const debounce: (func: Function, wait: number, immediate?: boolean) => () => void;
17
- /**
18
- * Creates a random uuidv4.
19
- */
20
- declare const uuidv4: () => any;
21
- /**
22
- * Merges multiple maps.
23
- */
24
- declare const mergeMaps: <TKey, TValue>(...maps: Map<TKey, TValue>[]) => Map<TKey, TValue>;
25
- /**
26
- * Converts a svg string into an URL with a base64 representation of that image.\
27
- * This URL can be used as the basis of a paintable texture.
28
- */
29
- declare const createImageUrlFromSvg: (svgSrc: string) => Promise<string>;
30
- export { loadJson, loadText, debounce, uuidv4, mergeMaps, createImageUrlFromSvg };
1
+ /**
2
+ * Loads a JSON from a given path.
3
+ * @emits {@link Event.LOADING_START}
4
+ * @emits {@link Event.LOADING_END}
5
+ */
6
+ declare const loadJson: <T>(path: string) => Promise<T>;
7
+ /**
8
+ * Loads a Text from a given path.
9
+ * @emits {@link Event.LOADING_START}
10
+ * @emits {@link Event.LOADING_END}
11
+ */
12
+ declare const loadText: (path: string) => Promise<string>;
13
+ /**
14
+ * Debounces: it limits the rate at which a function can fire.
15
+ */
16
+ declare const debounce: (func: Function, wait: number, immediate?: boolean) => () => void;
17
+ /**
18
+ * Creates a random uuidv4.
19
+ */
20
+ declare const uuidv4: () => any;
21
+ /**
22
+ * Merges multiple maps.
23
+ */
24
+ declare const mergeMaps: <TKey, TValue>(...maps: Map<TKey, TValue>[]) => Map<TKey, TValue>;
25
+ /**
26
+ * Creates an `ImageBitmap` from a SVG string using native `createImageBitmap` functionality.
27
+ */
28
+ declare const createImageBitmapFromSvg: (svgSrc: string) => Promise<ImageBitmap>;
29
+ declare const createImageBitmapFromImgSrc: (imgSrc: string) => Promise<ImageBitmap>;
30
+ export { loadJson, loadText, debounce, uuidv4, mergeMaps, createImageBitmapFromSvg, createImageBitmapFromImgSrc };