@combeenation/3d-viewer 3.0.0-rc2 → 4.0.0-alpha6

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 (212) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +111 -111
  3. package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
  4. package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
  5. package/dist/lib-cjs/api/classes/animationInterface.js.map +0 -0
  6. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  7. package/dist/lib-cjs/api/classes/dottedPath.js +190 -190
  8. package/dist/lib-cjs/api/classes/dottedPath.js.map +0 -0
  9. package/dist/lib-cjs/api/classes/element.d.ts +130 -125
  10. package/dist/lib-cjs/api/classes/element.js +752 -638
  11. package/dist/lib-cjs/api/classes/element.js.map +1 -1
  12. package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -14
  13. package/dist/lib-cjs/api/classes/elementParameterizable.js +134 -134
  14. package/dist/lib-cjs/api/classes/elementParameterizable.js.map +0 -0
  15. package/dist/lib-cjs/api/classes/event.d.ts +326 -312
  16. package/dist/lib-cjs/api/classes/event.js +371 -357
  17. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  18. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  19. package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
  20. package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +0 -0
  21. package/dist/lib-cjs/api/classes/parameter.d.ts +259 -161
  22. package/dist/lib-cjs/api/classes/parameter.js +387 -261
  23. package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
  24. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  25. package/dist/lib-cjs/api/classes/parameterObservable.js +101 -126
  26. package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
  27. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -0
  28. package/dist/lib-cjs/api/classes/parameterizable.js +150 -0
  29. package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -0
  30. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +38 -38
  31. package/dist/lib-cjs/api/classes/placementAnimation.js +138 -138
  32. package/dist/lib-cjs/api/classes/placementAnimation.js.map +0 -0
  33. package/dist/lib-cjs/api/classes/variant.d.ts +224 -176
  34. package/dist/lib-cjs/api/classes/variant.js +1126 -770
  35. package/dist/lib-cjs/api/classes/variant.js.map +1 -1
  36. package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -41
  37. package/dist/lib-cjs/api/classes/variantInstance.js +108 -98
  38. package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
  39. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -0
  40. package/dist/lib-cjs/api/classes/variantParameterizable.js +93 -0
  41. package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -0
  42. package/dist/lib-cjs/api/classes/viewer.d.ts +127 -128
  43. package/dist/lib-cjs/api/classes/viewer.js +486 -486
  44. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  45. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -0
  46. package/dist/lib-cjs/api/classes/viewerLight.js +350 -0
  47. package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -0
  48. package/dist/lib-cjs/api/emitter.d.ts +35 -0
  49. package/dist/lib-cjs/api/emitter.js +61 -0
  50. package/dist/lib-cjs/api/emitter.js.map +1 -0
  51. package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
  52. package/dist/lib-cjs/api/internal/debugViewer.js +87 -87
  53. package/dist/lib-cjs/api/internal/debugViewer.js.map +0 -0
  54. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  55. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  56. package/dist/lib-cjs/api/internal/lensRendering.js.map +0 -0
  57. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +10 -6
  58. package/dist/lib-cjs/api/internal/sceneSetup.js +231 -227
  59. package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
  60. package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
  61. package/dist/lib-cjs/api/manager/animationManager.js +121 -121
  62. package/dist/lib-cjs/api/manager/animationManager.js.map +0 -0
  63. package/dist/lib-cjs/api/manager/sceneManager.d.ts +32 -32
  64. package/dist/lib-cjs/api/manager/sceneManager.js +132 -132
  65. package/dist/lib-cjs/api/manager/sceneManager.js.map +0 -0
  66. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +90 -90
  67. package/dist/lib-cjs/api/manager/variantInstanceManager.js +321 -321
  68. package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +0 -0
  69. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  70. package/dist/lib-cjs/api/store/specStorage.js +51 -51
  71. package/dist/lib-cjs/api/store/specStorage.js.map +0 -0
  72. package/dist/lib-cjs/api/util/babylonHelper.d.ts +160 -125
  73. package/dist/lib-cjs/api/util/babylonHelper.js +465 -368
  74. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  75. package/dist/lib-cjs/api/util/globalTypes.d.ts +321 -275
  76. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  77. package/dist/lib-cjs/api/util/globalTypes.js.map +0 -0
  78. package/dist/lib-cjs/api/util/resourceHelper.d.ts +26 -30
  79. package/dist/lib-cjs/api/util/resourceHelper.js +237 -247
  80. package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
  81. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -0
  82. package/dist/lib-cjs/api/util/stringHelper.js +26 -0
  83. package/dist/lib-cjs/api/util/stringHelper.js.map +1 -0
  84. package/dist/lib-cjs/buildinfo.json +3 -3
  85. package/dist/lib-cjs/index.d.ts +48 -46
  86. package/dist/lib-cjs/index.js +86 -82
  87. package/dist/lib-cjs/index.js.map +1 -1
  88. package/package.json +83 -83
  89. package/src/api/classes/animationInterface.ts +11 -11
  90. package/src/api/classes/dottedPath.ts +189 -189
  91. package/src/api/classes/element.ts +648 -606
  92. package/src/api/classes/event.ts +370 -355
  93. package/src/api/classes/eventBroadcaster.ts +54 -54
  94. package/src/api/classes/parameter.ts +408 -270
  95. package/src/api/classes/parameterObservable.ts +99 -121
  96. package/src/api/classes/{elementParameterizable.ts → parameterizable.ts} +89 -78
  97. package/src/api/classes/placementAnimation.ts +133 -133
  98. package/src/api/classes/variant.ts +799 -652
  99. package/src/api/classes/variantInstance.ts +88 -81
  100. package/src/api/classes/variantParameterizable.ts +73 -0
  101. package/src/api/classes/viewer.ts +420 -421
  102. package/src/api/classes/viewerLight.ts +295 -0
  103. package/src/api/internal/debugViewer.ts +81 -81
  104. package/src/api/internal/lensRendering.ts +10 -10
  105. package/src/api/internal/sceneSetup.ts +194 -204
  106. package/src/api/manager/animationManager.ts +116 -116
  107. package/src/api/manager/sceneManager.ts +105 -105
  108. package/src/api/manager/variantInstanceManager.ts +236 -236
  109. package/src/api/store/specStorage.ts +53 -53
  110. package/src/api/util/babylonHelper.ts +497 -392
  111. package/src/api/util/globalTypes.ts +369 -314
  112. package/src/api/util/resourceHelper.ts +157 -168
  113. package/src/api/util/stringHelper.ts +26 -0
  114. package/src/buildinfo.json +2 -2
  115. package/src/commonjs.tsconfig.json +13 -13
  116. package/src/declaration.tsconfig.json +10 -10
  117. package/src/dev.ts +45 -60
  118. package/src/es6.tsconfig.json +13 -13
  119. package/src/index.ts +91 -87
  120. package/src/pagesconfig.json +51 -47
  121. package/src/tsconfig.json +43 -43
  122. package/src/tsconfig.types.json +9 -9
  123. package/src/types.d.ts +4 -4
  124. package/src/assets/02_environment.env +0 -0
  125. package/src/assets/02_test_hdri_flipped.hdr +0 -0
  126. package/src/assets/07rDvxP2xTk.glb +0 -0
  127. package/src/assets/08L8DrdZt8y.glb +0 -0
  128. package/src/assets/CB-6250/main.js +0 -427
  129. package/src/assets/CB-6250/models/.gitkeep +0 -1
  130. package/src/assets/CB-6250/models/candle.glb +0 -0
  131. package/src/assets/CB-6250/models/lamp.glb +0 -0
  132. package/src/assets/CB-6250/models/molto-bido.glb +0 -0
  133. package/src/assets/CB-6250/models/mtron.glb +0 -0
  134. package/src/assets/CB-6250/models/mtron_split_geometry.glb +0 -0
  135. package/src/assets/CB-6250/models/mtron_split_material.glb +0 -0
  136. package/src/assets/KTM1290SA/AvatarAdv.glb +0 -0
  137. package/src/assets/KTM1290SA/ktm1290SA.ts +0 -77
  138. package/src/assets/KTM1290SA/scene.json +0 -16
  139. package/src/assets/_draft/main.js +0 -117
  140. package/src/assets/_draft/models/.gitkeep +0 -1
  141. package/src/assets/_draft/models/_demo.glb +0 -0
  142. package/src/assets/_draft/studio.env +0 -0
  143. package/src/assets/bike/CompleteBike_Optim_986K_01.glb +0 -0
  144. package/src/assets/bike/complete.json +0 -19
  145. package/src/assets/bike/index.json +0 -9
  146. package/src/assets/bike/setup.json +0 -11
  147. package/src/assets/ctrls-helper.ts +0 -89
  148. package/src/assets/cube/10 environment.env +0 -0
  149. package/src/assets/cube/bin_svg_logo_test.glb +0 -0
  150. package/src/assets/cube/cube.ts +0 -42
  151. package/src/assets/cube/cube_v2.glb +0 -0
  152. package/src/assets/cube/scene.ts +0 -83
  153. package/src/assets/cube/testCylinderUVs.glb +0 -0
  154. package/src/assets/environment.env +0 -0
  155. package/src/assets/hoferkerzen/hoferkerzen.glb +0 -0
  156. package/src/assets/hoferkerzen/index.json +0 -9
  157. package/src/assets/hoferkerzen/setup.json +0 -11
  158. package/src/assets/hoferkerzen/variant_kgl.json +0 -41
  159. package/src/assets/husqvarna-instanced-meshes/husqvarna.env +0 -0
  160. package/src/assets/husqvarna-instanced-meshes/husqvarna.glb +0 -0
  161. package/src/assets/husqvarna-instanced-meshes/main.ts +0 -108
  162. package/src/assets/index.html +0 -144
  163. package/src/assets/index.json +0 -9
  164. package/src/assets/linkeddups/example_2_instances.glb +0 -0
  165. package/src/assets/linkeddups/spec.ts +0 -32
  166. package/src/assets/molto-mova-multi-instance-shown-bug/main.ts +0 -106
  167. package/src/assets/molto-mova-multi-instance-shown-bug/molto-mova-rc82.glb +0 -0
  168. package/src/assets/molto-mova-multi-instance-shown-bug/molto-mova-volare.glb +0 -0
  169. package/src/assets/molto-mova-multi-instance-shown-bug/studio.env +0 -0
  170. package/src/assets/moltomova/10 environment.env +0 -0
  171. package/src/assets/moltomova/RC65.glb +0 -0
  172. package/src/assets/moltomova/RC82.glb +0 -0
  173. package/src/assets/moltomova/TPH67.glb +0 -0
  174. package/src/assets/moltomova/TPH82.glb +0 -0
  175. package/src/assets/moltomova/Volare.glb +0 -0
  176. package/src/assets/moltomova/moltomova-cl3d-spec-rc65.ts +0 -159
  177. package/src/assets/moltomova/moltomova-cl3d-spec-rc82.ts +0 -118
  178. package/src/assets/moltomova/moltomova-cl3d-spec-scene.ts +0 -57
  179. package/src/assets/moltomova/moltomova-cl3d-spec-tph67.ts +0 -199
  180. package/src/assets/moltomova/moltomova-cl3d-spec-tph82.ts +0 -173
  181. package/src/assets/moltomova/moltomova-cl3d-spec-volare65.ts +0 -173
  182. package/src/assets/moltomova/moltomova.ts +0 -175
  183. package/src/assets/mova.json +0 -18
  184. package/src/assets/mova_3_phase_rail.glb +0 -0
  185. package/src/assets/mova_3_phase_rail.json +0 -86
  186. package/src/assets/mova_recessed_luminaire.glb +0 -0
  187. package/src/assets/mova_recessed_luminaire.json +0 -81
  188. package/src/assets/nessie/gltf-test-no-material.gltf +0 -142
  189. package/src/assets/nessie/gltf-test-no-material_data.bin +0 -0
  190. package/src/assets/nessie/gltf-test-rotation.gltf +0 -142
  191. package/src/assets/nessie/gltf-test-rotation_data.bin +0 -0
  192. package/src/assets/nessie/gltf-test.gltf +0 -178
  193. package/src/assets/nessie/gltf-test_data.bin +0 -0
  194. package/src/assets/nessie/index.json +0 -9
  195. package/src/assets/nessie/nessie_basic.json +0 -24
  196. package/src/assets/nessie/setup.json +0 -12
  197. package/src/assets/scene.json +0 -64
  198. package/src/assets/setup.json +0 -25
  199. package/src/assets/small_cave_1k.hdr +0 -0
  200. package/src/assets/svgTo3D/09aJssVZrjk.env +0 -0
  201. package/src/assets/svgTo3D/09f0zfBQBWK.glb +0 -0
  202. package/src/assets/svgTo3D/9bae062709f8a7803769ba955cde3c4a.jpg +0 -0
  203. package/src/assets/svgTo3D/logo-cyledge.svg +0 -19
  204. package/src/assets/svgTo3D/spec.ts +0 -56
  205. package/src/assets/svgTo3D/svg_assets/09fmVjc59hQ.png +0 -0
  206. package/src/assets/svgTo3D/svg_assets/LDI2apCSOBg7S-QT7pb0EPOreec.woff2 +0 -0
  207. package/src/assets/svgTo3D/svg_assets/unineue_regular.woff2 +0 -0
  208. package/src/assets/svgTo3D/testCube.glb +0 -0
  209. package/src/assets/svgTo3D/testCube001.glb +0 -0
  210. package/src/assets/svgTo3D/testCubeSpec.ts +0 -49
  211. package/src/assets/textures/grass.png +0 -0
  212. package/src/assets/textures/seamless-grunge-scratched-texture.jpg +0 -0
@@ -1,315 +1,370 @@
1
- // global accessible types imported from 3d-viewer
2
- type Viewer = import("../classes/viewer").Viewer;
3
- type Variant = import("../classes/variant").Variant;
4
- type VariantInstance = import("../classes/variantInstance").VariantInstance;
5
- /**
6
- * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
7
- * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
8
- */
9
- type VariantElement = import("../classes/element").Element;
10
- type DottedPath = import("../classes/dottedPath").DottedPath;
11
-
12
- // global accessible types imported from BabylonJS
13
- type Scene = import("@babylonjs/core/scene").Scene;
14
- type Vector3 = import("@babylonjs/core/Maths/math.vector").Vector3;
15
- type Color3 = import("@babylonjs/core/Maths/math.color").Color3;
16
- type Color4 = import("@babylonjs/core/Maths/math.color").Color4;
17
- type Material = import("@babylonjs/core/Materials/material").Material;
18
- type PBRMaterial = import("@babylonjs/core/Materials/PBR/pbrMaterial").PBRMaterial;
19
- type StandardMaterial = import("@babylonjs/core/Materials/standardMaterial").StandardMaterial;
20
- type DynamicTexture = import("@babylonjs/core/Materials/Textures/dynamicTexture").DynamicTexture;
21
- type Mesh = import("@babylonjs/core/Meshes/mesh").Mesh;
22
- type AbstractMesh = import("@babylonjs/core/Meshes/abstractMesh").AbstractMesh;
23
- type InstancedMesh = import("@babylonjs/core/Meshes/instancedMesh").InstancedMesh;
24
- type TransformNode = import("@babylonjs/core/Meshes/transformNode").TransformNode;
25
- type Engine = import("@babylonjs/core/Engines/engine").Engine;
26
- type EngineOptions = import("@babylonjs/core/Engines/thinEngine").EngineOptions;
27
- type ArcRotateCamera = import("@babylonjs/core/Cameras/arcRotateCamera").ArcRotateCamera;
28
- type IScreenshotSize = import("@babylonjs/core/Misc/interfaces/screenshotSize").IScreenshotSize;
29
- type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
30
- type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
31
- type MeshBuilder = import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
32
- type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
33
- type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
34
- type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
35
- // Node is already defined in lib.dom.d.ts, so it can't be declared that way
36
- // type Node = import("@babylonjs/core/node").Node;
37
-
38
- type EventEmitter = import('eventemitter3');
39
-
40
- // some more global accessible types
41
- type PathDefinitions = {
42
- include: string[],
43
- exclude?: string[]
44
- };
45
-
46
- type TraceableDefinition = {
47
- path: string
48
- };
49
-
50
- type TraceableDefinitions = {
51
- [name: string]: TraceableDefinition
52
- };
53
-
54
- type PaintableDefinition = {
55
- path: string,
56
- textureOptions: {
57
- width: number,
58
- height: number,
59
- } | number
60
- };
61
-
62
- type PaintableDefinitions = {
63
- [name: string]: PaintableDefinition
64
- };
65
-
66
- type Asset = {
67
- rootUrl: string,
68
- fileName: string | undefined
69
- };
70
-
71
- type ElementDefinition = {
72
- paths: PathDefinitions,
73
- traceables?: TraceableDefinitions,
74
- paintables?: PaintableDefinitions
75
- };
76
-
77
- type StructureJson = {
78
- /**
79
- * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
80
- * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
81
- */
82
- scene?: string | SceneJson,
83
- /**
84
- * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
85
- * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
86
- * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
87
- * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
88
- * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
89
- */
90
- setup?: string | SetupJson,
91
- file?: string
92
- glTF?: Asset | string,
93
- parameterDeclaration?: ParameterDeclarations,
94
- parameters?: ParameterBag,
95
- elements?: {
96
- [name: string]: ElementDefinition | string[]
97
- },
98
- /**
99
- * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
100
- * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
101
- * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
102
- * `paths`.
103
- *
104
- * Example Code
105
- * ```js
106
- * variants: {
107
- * 'My Pretty Variant' {
108
- * glTF: {
109
- * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
110
- * fileName: 'my_3d_model_file.glb',
111
- * },
112
- * elements: {
113
- * 'My Little Element': {
114
- * paths: {
115
- * includes: ['__root__.MeshName']
116
- * }
117
- * }
118
- * }
119
- * }
120
- * }
121
- * ```
122
- * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
123
- */
124
- variants?: {
125
- [id: string]: StructureJson,
126
- }
127
- };
128
-
129
- type SceneJson = {
130
- parameterDeclaration?: ParameterDeclarations,
131
- parameters?: ParameterBag,
132
- meshPicking?: boolean,
133
- /**
134
- * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
135
- */
136
- engine?: {
137
- antialiasing?: boolean
138
- options?: EngineOptions
139
- }
140
- scene: SceneDefinition,
141
- animations?: AnimationDefinitions,
142
- placements?: PlacementDefinitions
143
- };
144
-
145
- type SceneDefinition = {
146
- globals: SceneGlobals,
147
- lights?: LightDefinitions,
148
- cameras?: CameraDefinitions
149
- };
150
-
151
- type SceneGlobals = {
152
- shadows?: {
153
- enabled: boolean,
154
- type: 'contact',
155
- settings: [],
156
- generator: [],
157
- receiver: []
158
- },
159
- /**
160
- * `aa` or anti aliasing is not needed if hard edges are desired.\
161
- * FYI: aa smooths edges and avoids stairs-effects.
162
- */
163
- aa?: 'fxaa',
164
- 'tone-mapping'?: boolean,
165
- /**
166
- * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel, relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to bloom).
167
- * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
168
- *
169
- * @dof short for "depth-of-field" defines the focus in the view. Parameters in settings are listed in [Depth of Field and Other Lens Effects link](https://doc.babylonjs.com/divingDeeper/postProcesses/dofLenseEffects).
170
- * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
171
- * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
172
- */
173
- 'camera-settings'?: {
174
- contrast: number,
175
- exposure: number,
176
- bloom?: {
177
- enabled: boolean,
178
- size?: number,
179
- threshold?: number
180
- },
181
- dof?: {
182
- enabled: boolean,
183
- settings: {}
184
- },
185
- sharpen?: {
186
- enabled: boolean,
187
- settings: {}
188
- }
189
- }
190
- };
191
-
192
- type ScreenshotSettings = {
193
- size?: IScreenshotSize,
194
- mimeType?: string,
195
- samples?: number,
196
- antialiasing?: boolean,
197
- fileName?: string,
198
- renderSprites?: boolean
199
- };
200
-
201
- type AutofocusSettings = {
202
- /**
203
- * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
204
- * Defaults to 1.5 when not set explicitly.
205
- */
206
- radiusFactor?: number,
207
- adjustWheelPrecision?: boolean,
208
- adjustPanningSensibility?: boolean,
209
- adjustPinchPrecision?: boolean
210
- };
211
-
212
- type LightDefinitions = {
213
- [light: string]: LightDefinition
214
- };
215
-
216
- type LightDefinition = {
217
- type: 'hemispheric' | 'point'
218
- };
219
-
220
- type CameraDefinitions = {
221
- [camera: string]: CameraDefinition
222
- };
223
-
224
- type CameraDefinition = {
225
- /**
226
- * `fov` or "Field Of View" defines as it says the view of the scene. Further information about its [theory](https://en.wikipedia.org/wiki/Field_of_view) and [implementation](https://doc.babylonjs.com/typedoc/classes/babylon.camera#fov).
227
- */
228
- fov?: number,
229
- active?: boolean
230
- /**
231
- * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
232
- * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
233
- */
234
- type: 'arc'
235
- /**
236
- * `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).
237
- */
238
- target?: string
239
- };
240
-
241
- type VariantInstanceDefinition = {
242
- name?: string,
243
- variant: DottedPathArgument,
244
- parameters?: ParameterBag,
245
- lazy?: boolean
246
- };
247
-
248
- type SetupJson = {
249
- instances: VariantInstanceDefinition[]
250
- };
251
-
252
- type ParameterDeclarations = {
253
- [name: string]: ParameterDeclaration
254
- };
255
-
256
- type ParameterDeclaration = {
257
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector',
258
- options?: ParameterValue[]
259
- };
260
-
261
- type ParameterValue = string | number | boolean;
262
-
263
- type ParameterBag = {
264
- [name: string]: ParameterValue
265
- };
266
-
267
- type DottedPathArgument = string | string[] | DottedPath;
268
-
269
- type ParameterObserver = (
270
- object: any,
271
- oldValue: ParameterValue,
272
- newValue: ParameterValue
273
- ) => void;
274
-
275
- type PlacementDefinitions = {
276
- [name: string]: PlacementDefinition
277
- };
278
-
279
- type PlacementDefinition = {
280
- position?: string | Vector3,
281
- alpha?: number,
282
- beta?: number,
283
- radius?: number,
284
- target?: string | Vector3
285
- };
286
-
287
- type AnimationDefinitions = {
288
- [name: string]: AnimationDefinition
289
- };
290
-
291
- /**
292
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
293
- *
294
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
295
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
296
- * {@link AnimationDefinition}.
297
- *
298
- * Example usage in {@link SceneJson | SceneJson.animations}:
299
- *
300
- * ```js
301
- * // ...
302
- * scene: {
303
- * // ...
304
- * animations: {
305
- * DefaultCameraAnimation: {
306
- * ease: 'Power3.easeInOut',
307
- * duration: 0.8,
308
- * },
309
- * },
310
- * // ...
311
- * }
312
- * // ...
313
- * ```
314
- */
1
+ // global accessible types imported from 3d-viewer
2
+ type Viewer = import("../classes/viewer").Viewer;
3
+ type Variant = import("../classes/variant").Variant;
4
+ type VariantInstance = import("../classes/variantInstance").VariantInstance;
5
+ /**
6
+ * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
7
+ * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
8
+ */
9
+ type VariantElement = import("../classes/element").Element;
10
+ type DottedPath = import("../classes/dottedPath").DottedPath;
11
+ type ViewerLight = import("../classes/viewerLight").ViewerLight;
12
+
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;
30
+ type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
31
+ type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
32
+ type MeshBuilder = import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
33
+ type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
34
+ type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
35
+ type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
36
+ // Node is already defined in lib.dom.d.ts, so it can't be declared that way
37
+ // type Node = import("@babylonjs/core/node").Node;
38
+
39
+ type EventEmitter = import('eventemitter3');
40
+
41
+ // some more global accessible types
42
+ type PathDefinitions = {
43
+ include: string[],
44
+ exclude?: string[]
45
+ };
46
+
47
+ type TraceableDefinition = {
48
+ path: string
49
+ };
50
+
51
+ type TraceableDefinitions = {
52
+ [name: string]: TraceableDefinition
53
+ };
54
+
55
+ type PaintableDefinition = {
56
+ path: string,
57
+ textureOptions: {
58
+ width: number,
59
+ height: number,
60
+ } | number
61
+ };
62
+
63
+ type PaintableDefinitions = {
64
+ [name: string]: PaintableDefinition
65
+ };
66
+
67
+ type Asset = {
68
+ rootUrl: string,
69
+ fileName: string | undefined
70
+ };
71
+
72
+ type ElementDefinitions = {
73
+ [name: string]: ElementDefinition | string[]
74
+ };
75
+
76
+ type ElementDefinition = {
77
+ paths: PathDefinitions,
78
+ traceables?: TraceableDefinitions,
79
+ paintables?: PaintableDefinitions
80
+ };
81
+
82
+ type StructureJson = {
83
+ /**
84
+ * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
85
+ * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
86
+ */
87
+ scene?: string | SceneJson,
88
+ /**
89
+ * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
90
+ * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
91
+ * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
92
+ * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
93
+ * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
94
+ */
95
+ setup?: string | SetupJson,
96
+ file?: string
97
+ glTF?: Asset | string,
98
+ parameterDeclaration?: ParameterDeclarations,
99
+ parameters?: ParameterBag,
100
+ elements?: ElementDefinitions,
101
+ lights?: LightDefinitions,
102
+ grounds?: GroundDefinitions,
103
+ /**
104
+ * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
105
+ * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
106
+ * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
107
+ * `paths`.
108
+ *
109
+ * Example Code
110
+ * ```js
111
+ * variants: {
112
+ * 'My Pretty Variant' {
113
+ * glTF: {
114
+ * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
115
+ * fileName: 'my_3d_model_file.glb',
116
+ * },
117
+ * elements: {
118
+ * 'My Little Element': {
119
+ * paths: {
120
+ * includes: ['__root__.MeshName']
121
+ * }
122
+ * }
123
+ * }
124
+ * }
125
+ * }
126
+ * ```
127
+ * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
128
+ */
129
+ variants?: {
130
+ [id: string]: StructureJson,
131
+ },
132
+ };
133
+
134
+ type SceneJson = {
135
+ parameterDeclaration?: ParameterDeclarations,
136
+ parameters?: ParameterBag,
137
+ meshPicking?: boolean,
138
+ /**
139
+ * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
140
+ */
141
+ engine?: {
142
+ antialiasing?: boolean
143
+ options?: EngineOptions
144
+ }
145
+ scene: SceneDefinition,
146
+ animations?: AnimationDefinitions,
147
+ placements?: PlacementDefinitions
148
+ };
149
+
150
+ type SceneDefinition = {
151
+ globals: SceneGlobals,
152
+ cameras?: CameraDefinitions,
153
+ };
154
+
155
+ type SceneGlobals = {
156
+ shadows?: {
157
+ enabled: boolean,
158
+ type: 'contact',
159
+ settings: [],
160
+ generator: [],
161
+ receiver: []
162
+ },
163
+ /**
164
+ * `aa` or anti aliasing is not needed if hard edges are desired.\
165
+ * FYI: aa smooths edges and avoids stairs-effects.
166
+ */
167
+ aa?: 'fxaa',
168
+ 'tone-mapping'?: boolean,
169
+ /**
170
+ * @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).
171
+ * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
172
+ *
173
+ * @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).
174
+ * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
175
+ * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
176
+ */
177
+ 'camera-settings'?: {
178
+ contrast: number,
179
+ exposure: number,
180
+ bloom?: {
181
+ enabled: boolean,
182
+ size?: number,
183
+ threshold?: number
184
+ },
185
+ dof?: {
186
+ enabled: boolean,
187
+ settings: {}
188
+ },
189
+ sharpen?: {
190
+ enabled: boolean,
191
+ settings: {}
192
+ }
193
+ }
194
+ };
195
+
196
+ /**
197
+ * {@link Viewer.screenshot} internally uses Babylons [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
198
+ * See this link for additional info about the properties.
199
+ */
200
+ type ScreenshotSettings = {
201
+ /** Defaults to canvas width & height */
202
+ size?: IScreenshotSize,
203
+ /**
204
+ * Default `image/png`
205
+ *
206
+ * **Info regarding JPEG:** \
207
+ * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
208
+ * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't support
209
+ * transparency. Otherwise background will always be black for jpeg's.
210
+ */
211
+ mimeType?: string,
212
+ /** Default `1` */
213
+ samples?: number,
214
+ /** Default `false` */
215
+ antialiasing?: boolean,
216
+ /** Default `screenshot.png` */
217
+ fileName?: string,
218
+ /** Default `false` */
219
+ renderSprites?: boolean
220
+ };
221
+
222
+ type AutofocusSettings = {
223
+ /**
224
+ * Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
225
+ * Defaults to 1.5 when not set explicitly.
226
+ */
227
+ radiusFactor?: number,
228
+ adjustWheelPrecision?: boolean,
229
+ adjustPanningSensibility?: boolean,
230
+ adjustPinchPrecision?: boolean
231
+ };
232
+
233
+ type LightDefinitions = {
234
+ [name: string]: LightDefinition | string
235
+ };
236
+
237
+ type LightDefinition = {
238
+ type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot',
239
+ path?: string,
240
+ shadowGenerator?: ShadowGeneratorDefinition
241
+ };
242
+
243
+ type ShadowGeneratorDefinition = {
244
+ mapSize: number
245
+ [others: string]: any,
246
+ /**
247
+ * Further properties like `usePoissonSampling` are set directly on the ShadowGenerator object.
248
+ * [Shadows](https://doc.babylonjs.com/divingDeeper/lights/shadows)
249
+ */
250
+ };
251
+
252
+ type GroundDefinitions = {
253
+ [ground: string]: GroundDefinition
254
+ };
255
+
256
+ type GroundDefinition = {
257
+ type: 'baked' | 'ground' | 'heightmap',
258
+ meshId?: string,
259
+ url?: string,
260
+ width?: number,
261
+ height?: number,
262
+ subdivisions?: number,
263
+ receiveShadows?: boolean,
264
+ minHeight?: number,
265
+ maxHeight?: number,
266
+ alphaFilter?: number,
267
+ onReady?: any
268
+ };
269
+
270
+ type CameraDefinitions = {
271
+ [camera: string]: CameraDefinition
272
+ };
273
+
274
+ type CameraDefinition = {
275
+ /**
276
+ * `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).
277
+ */
278
+ fov?: number,
279
+ active?: boolean
280
+ /**
281
+ * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
282
+ * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
283
+ */
284
+ type: 'arc'
285
+ /**
286
+ * `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).
287
+ */
288
+ target?: string
289
+ };
290
+
291
+ type VariantInstanceDefinition = {
292
+ name?: string,
293
+ variant: DottedPathArgument,
294
+ parameters?: ParameterBag,
295
+ lazy?: boolean
296
+ };
297
+
298
+ type SetupJson = {
299
+ instances: VariantInstanceDefinition[]
300
+ };
301
+
302
+ type ParameterDeclarations = {
303
+ [name: string]: ParameterDeclaration
304
+ };
305
+
306
+ type ParameterDeclaration = {
307
+ type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl',
308
+ parser?: any,
309
+ options?: ParameterValue[]
310
+ };
311
+
312
+ type ParameterValue = string | number | boolean;
313
+
314
+ type ParameterBag = {
315
+ [name: string]: ParameterValue
316
+ };
317
+
318
+ type ParsedParameterBag = {
319
+ [name: string]: any
320
+ };
321
+
322
+ type DottedPathArgument = string | string[] | DottedPath;
323
+
324
+ type ParameterObserver = (
325
+ object: any,
326
+ oldValue: ParameterValue,
327
+ newValue: ParameterValue
328
+ ) => void;
329
+
330
+ type PlacementDefinitions = {
331
+ [name: string]: PlacementDefinition
332
+ };
333
+
334
+ type PlacementDefinition = {
335
+ position?: string | Vector3,
336
+ alpha?: number,
337
+ beta?: number,
338
+ radius?: number,
339
+ target?: string | Vector3
340
+ };
341
+
342
+ type AnimationDefinitions = {
343
+ [name: string]: AnimationDefinition
344
+ };
345
+
346
+ /**
347
+ * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
348
+ *
349
+ * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
350
+ * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
351
+ * {@link AnimationDefinition}.
352
+ *
353
+ * Example usage in {@link SceneJson | SceneJson.animations}:
354
+ *
355
+ * ```js
356
+ * // ...
357
+ * scene: {
358
+ * // ...
359
+ * animations: {
360
+ * DefaultCameraAnimation: {
361
+ * ease: 'Power3.easeInOut',
362
+ * duration: 0.8,
363
+ * },
364
+ * },
365
+ * // ...
366
+ * }
367
+ * // ...
368
+ * ```
369
+ */
315
370
  type AnimationDefinition = GSAPTweenVars;