@combeenation/3d-viewer 6.0.0 → 6.1.0-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) 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 +2 -2
  4. package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
  5. package/dist/lib-cjs/api/classes/dottedPath.js +166 -166
  6. package/dist/lib-cjs/api/classes/element.d.ts +149 -149
  7. package/dist/lib-cjs/api/classes/element.js +669 -669
  8. package/dist/lib-cjs/api/classes/event.d.ts +342 -326
  9. package/dist/lib-cjs/api/classes/event.js +365 -349
  10. package/dist/lib-cjs/api/classes/event.js.map +1 -1
  11. package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
  12. package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -49
  13. package/dist/lib-cjs/api/classes/parameter.d.ts +339 -339
  14. package/dist/lib-cjs/api/classes/parameter.js +464 -464
  15. package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
  16. package/dist/lib-cjs/api/classes/parameterObservable.js +97 -97
  17. package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
  18. package/dist/lib-cjs/api/classes/parameterizable.js +102 -102
  19. package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -45
  20. package/dist/lib-cjs/api/classes/placementAnimation.js +176 -176
  21. package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
  22. package/dist/lib-cjs/api/classes/variant.js +836 -836
  23. package/dist/lib-cjs/api/classes/variantInstance.d.ts +44 -44
  24. package/dist/lib-cjs/api/classes/variantInstance.js +105 -105
  25. package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
  26. package/dist/lib-cjs/api/classes/variantParameterizable.js +88 -88
  27. package/dist/lib-cjs/api/classes/viewer.d.ts +187 -189
  28. package/dist/lib-cjs/api/classes/viewer.js +594 -594
  29. package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
  30. package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
  31. package/dist/lib-cjs/api/classes/viewerLight.js +348 -348
  32. package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
  33. package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
  34. package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
  35. package/dist/lib-cjs/api/internal/sceneSetup.js +226 -226
  36. package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
  37. package/dist/lib-cjs/api/manager/animationManager.js +126 -126
  38. package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +78 -65
  39. package/dist/lib-cjs/api/manager/gltfExportManager.js +241 -197
  40. package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
  41. package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -31
  42. package/dist/lib-cjs/api/manager/sceneManager.js +130 -127
  43. package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
  44. package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -0
  45. package/dist/lib-cjs/api/manager/textureLoadManager.js +98 -0
  46. package/dist/lib-cjs/api/manager/textureLoadManager.js.map +1 -0
  47. package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
  48. package/dist/lib-cjs/api/manager/variantInstanceManager.js +260 -260
  49. package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
  50. package/dist/lib-cjs/api/store/specStorage.js +50 -50
  51. package/dist/lib-cjs/api/util/babylonHelper.d.ts +183 -174
  52. package/dist/lib-cjs/api/util/babylonHelper.js +596 -585
  53. package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
  54. package/dist/lib-cjs/api/util/globalTypes.d.ts +383 -370
  55. package/dist/lib-cjs/api/util/globalTypes.js +1 -1
  56. package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
  57. package/dist/lib-cjs/api/util/resourceHelper.js +203 -203
  58. package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +42 -35
  59. package/dist/lib-cjs/api/util/sceneLoaderHelper.js +139 -139
  60. package/dist/lib-cjs/api/util/sceneLoaderHelper.js.map +1 -1
  61. package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
  62. package/dist/lib-cjs/api/util/stringHelper.js +25 -25
  63. package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
  64. package/dist/lib-cjs/api/util/structureHelper.js +48 -48
  65. package/dist/lib-cjs/buildinfo.json +3 -3
  66. package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
  67. package/dist/lib-cjs/index.d.ts +51 -51
  68. package/dist/lib-cjs/index.js +110 -110
  69. package/dist/webpack-stats.json +0 -0
  70. package/package.json +79 -79
  71. package/src/api/classes/animationInterface.ts +10 -10
  72. package/src/api/classes/dottedPath.ts +181 -181
  73. package/src/api/classes/element.ts +717 -717
  74. package/src/api/classes/event.ts +385 -367
  75. package/src/api/classes/eventBroadcaster.ts +52 -52
  76. package/src/api/classes/parameter.ts +497 -497
  77. package/src/api/classes/parameterObservable.ts +100 -100
  78. package/src/api/classes/parameterizable.ts +87 -87
  79. package/src/api/classes/placementAnimation.ts +162 -162
  80. package/src/api/classes/variant.ts +904 -904
  81. package/src/api/classes/variantInstance.ts +97 -97
  82. package/src/api/classes/variantParameterizable.ts +85 -85
  83. package/src/api/classes/viewer.ts +672 -670
  84. package/src/api/classes/viewerLight.ts +339 -339
  85. package/src/api/internal/debugViewer.ts +90 -90
  86. package/src/api/internal/lensRendering.ts +9 -9
  87. package/src/api/internal/sceneSetup.ts +205 -205
  88. package/src/api/manager/animationManager.ts +143 -143
  89. package/src/api/manager/gltfExportManager.ts +236 -192
  90. package/src/api/manager/sceneManager.ts +132 -127
  91. package/src/api/manager/textureLoadManager.ts +95 -0
  92. package/src/api/manager/variantInstanceManager.ts +265 -265
  93. package/src/api/store/specStorage.ts +51 -51
  94. package/src/api/util/babylonHelper.ts +658 -645
  95. package/src/api/util/globalTypes.ts +432 -417
  96. package/src/api/util/resourceHelper.ts +191 -191
  97. package/src/api/util/sceneLoaderHelper.ts +137 -144
  98. package/src/api/util/stringHelper.ts +23 -23
  99. package/src/api/util/structureHelper.ts +49 -49
  100. package/src/buildinfo.json +3 -3
  101. package/src/dev.ts +61 -61
  102. package/src/index.ts +96 -96
  103. package/src/types.d.ts +28 -28
  104. package/dist/lib-es6/api/classes/animationInterface.d.ts +0 -8
  105. package/dist/lib-es6/api/classes/animationInterface.js +0 -2
  106. package/dist/lib-es6/api/classes/animationInterface.js.map +0 -1
  107. package/dist/lib-es6/api/classes/dottedPath.d.ts +0 -79
  108. package/dist/lib-es6/api/classes/dottedPath.js +0 -163
  109. package/dist/lib-es6/api/classes/dottedPath.js.map +0 -1
  110. package/dist/lib-es6/api/classes/element.d.ts +0 -149
  111. package/dist/lib-es6/api/classes/element.js +0 -666
  112. package/dist/lib-es6/api/classes/element.js.map +0 -1
  113. package/dist/lib-es6/api/classes/event.d.ts +0 -326
  114. package/dist/lib-es6/api/classes/event.js +0 -346
  115. package/dist/lib-es6/api/classes/event.js.map +0 -1
  116. package/dist/lib-es6/api/classes/eventBroadcaster.d.ts +0 -26
  117. package/dist/lib-es6/api/classes/eventBroadcaster.js +0 -43
  118. package/dist/lib-es6/api/classes/eventBroadcaster.js.map +0 -1
  119. package/dist/lib-es6/api/classes/parameter.d.ts +0 -339
  120. package/dist/lib-es6/api/classes/parameter.js +0 -461
  121. package/dist/lib-es6/api/classes/parameter.js.map +0 -1
  122. package/dist/lib-es6/api/classes/parameterObservable.d.ts +0 -36
  123. package/dist/lib-es6/api/classes/parameterObservable.js +0 -94
  124. package/dist/lib-es6/api/classes/parameterObservable.js.map +0 -1
  125. package/dist/lib-es6/api/classes/parameterizable.d.ts +0 -15
  126. package/dist/lib-es6/api/classes/parameterizable.js +0 -99
  127. package/dist/lib-es6/api/classes/parameterizable.js.map +0 -1
  128. package/dist/lib-es6/api/classes/placementAnimation.d.ts +0 -45
  129. package/dist/lib-es6/api/classes/placementAnimation.js +0 -173
  130. package/dist/lib-es6/api/classes/placementAnimation.js.map +0 -1
  131. package/dist/lib-es6/api/classes/variant.d.ts +0 -234
  132. package/dist/lib-es6/api/classes/variant.js +0 -833
  133. package/dist/lib-es6/api/classes/variant.js.map +0 -1
  134. package/dist/lib-es6/api/classes/variantInstance.d.ts +0 -44
  135. package/dist/lib-es6/api/classes/variantInstance.js +0 -102
  136. package/dist/lib-es6/api/classes/variantInstance.js.map +0 -1
  137. package/dist/lib-es6/api/classes/variantParameterizable.d.ts +0 -17
  138. package/dist/lib-es6/api/classes/variantParameterizable.js +0 -85
  139. package/dist/lib-es6/api/classes/variantParameterizable.js.map +0 -1
  140. package/dist/lib-es6/api/classes/viewer.d.ts +0 -189
  141. package/dist/lib-es6/api/classes/viewer.js +0 -588
  142. package/dist/lib-es6/api/classes/viewer.js.map +0 -1
  143. package/dist/lib-es6/api/classes/viewerLight.d.ts +0 -66
  144. package/dist/lib-es6/api/classes/viewerLight.js +0 -322
  145. package/dist/lib-es6/api/classes/viewerLight.js.map +0 -1
  146. package/dist/lib-es6/api/internal/lensRendering.d.ts +0 -8
  147. package/dist/lib-es6/api/internal/lensRendering.js +0 -9
  148. package/dist/lib-es6/api/internal/lensRendering.js.map +0 -1
  149. package/dist/lib-es6/api/internal/sceneSetup.d.ts +0 -13
  150. package/dist/lib-es6/api/internal/sceneSetup.js +0 -199
  151. package/dist/lib-es6/api/internal/sceneSetup.js.map +0 -1
  152. package/dist/lib-es6/api/manager/animationManager.d.ts +0 -30
  153. package/dist/lib-es6/api/manager/animationManager.js +0 -123
  154. package/dist/lib-es6/api/manager/animationManager.js.map +0 -1
  155. package/dist/lib-es6/api/manager/gltfExportManager.d.ts +0 -65
  156. package/dist/lib-es6/api/manager/gltfExportManager.js +0 -194
  157. package/dist/lib-es6/api/manager/gltfExportManager.js.map +0 -1
  158. package/dist/lib-es6/api/manager/sceneManager.d.ts +0 -31
  159. package/dist/lib-es6/api/manager/sceneManager.js +0 -124
  160. package/dist/lib-es6/api/manager/sceneManager.js.map +0 -1
  161. package/dist/lib-es6/api/manager/variantInstanceManager.d.ts +0 -92
  162. package/dist/lib-es6/api/manager/variantInstanceManager.js +0 -257
  163. package/dist/lib-es6/api/manager/variantInstanceManager.js.map +0 -1
  164. package/dist/lib-es6/api/store/specStorage.d.ts +0 -24
  165. package/dist/lib-es6/api/store/specStorage.js +0 -47
  166. package/dist/lib-es6/api/store/specStorage.js.map +0 -1
  167. package/dist/lib-es6/api/util/babylonHelper.d.ts +0 -174
  168. package/dist/lib-es6/api/util/babylonHelper.js +0 -556
  169. package/dist/lib-es6/api/util/babylonHelper.js.map +0 -1
  170. package/dist/lib-es6/api/util/globalTypes.d.ts +0 -370
  171. package/dist/lib-es6/api/util/globalTypes.js +0 -2
  172. package/dist/lib-es6/api/util/globalTypes.js.map +0 -1
  173. package/dist/lib-es6/api/util/resourceHelper.d.ts +0 -58
  174. package/dist/lib-es6/api/util/resourceHelper.js +0 -194
  175. package/dist/lib-es6/api/util/resourceHelper.js.map +0 -1
  176. package/dist/lib-es6/api/util/sceneLoaderHelper.d.ts +0 -35
  177. package/dist/lib-es6/api/util/sceneLoaderHelper.js +0 -130
  178. package/dist/lib-es6/api/util/sceneLoaderHelper.js.map +0 -1
  179. package/dist/lib-es6/api/util/stringHelper.d.ts +0 -9
  180. package/dist/lib-es6/api/util/stringHelper.js +0 -22
  181. package/dist/lib-es6/api/util/stringHelper.js.map +0 -1
  182. package/dist/lib-es6/api/util/structureHelper.d.ts +0 -9
  183. package/dist/lib-es6/api/util/structureHelper.js +0 -46
  184. package/dist/lib-es6/api/util/structureHelper.js.map +0 -1
  185. package/dist/lib-es6/buildinfo.json +0 -3
  186. package/dist/lib-es6/es6.tsconfig.tsbuildinfo +0 -1
  187. package/dist/lib-es6/index.d.ts +0 -51
  188. package/dist/lib-es6/index.js +0 -49
  189. package/dist/lib-es6/index.js.map +0 -1
@@ -1,370 +0,0 @@
1
- /// <reference types="gsap" />
2
- declare type Viewer = import('../classes/viewer').Viewer;
3
- declare type Variant = import('../classes/variant').Variant;
4
- declare type VariantInstance = import('../classes/variantInstance').VariantInstance;
5
- /**
6
- * Alias for {@link Element} which can be used to prevent name clashes with the web APIs
7
- * [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
8
- */
9
- declare type VariantElement = import('../classes/element').Element;
10
- declare type DottedPath = import('../classes/dottedPath').DottedPath;
11
- declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
12
- declare type SceneManager = import('../manager/sceneManager').SceneManager;
13
- declare type Scene = import('@babylonjs/core/scene').Scene;
14
- declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
15
- declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
16
- declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
17
- declare type Material = import('@babylonjs/core/Materials/material').Material;
18
- declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
19
- declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
20
- declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
21
- declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
22
- declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
23
- declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
24
- declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
25
- declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
26
- declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
27
- declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
28
- declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
29
- declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
30
- declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
31
- declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
32
- declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
33
- declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
34
- declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
35
- declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
36
- declare type EventEmitter = import('eventemitter3');
37
- declare type PathDefinitions = {
38
- include: string[];
39
- exclude?: string[];
40
- };
41
- declare type TraceableDefinition = {
42
- path: string;
43
- };
44
- declare type TraceableDefinitions = {
45
- [name: string]: TraceableDefinition;
46
- };
47
- declare type PaintableDefinition = {
48
- path: string;
49
- textureOptions: {
50
- width: number;
51
- height: number;
52
- } | number;
53
- };
54
- declare type PaintableDefinitions = {
55
- [name: string]: PaintableDefinition;
56
- };
57
- declare type Asset = {
58
- rootUrl: string;
59
- fileName: string | undefined;
60
- };
61
- declare type ElementDefinitions = {
62
- [name: string]: ElementDefinition | string[];
63
- };
64
- declare type ElementDefinition = {
65
- paths: PathDefinitions;
66
- traceables?: TraceableDefinitions;
67
- paintables?: PaintableDefinitions;
68
- };
69
- declare type TransformationDefinition = {
70
- scaling: Vector3;
71
- position: Vector3;
72
- rotation: Vector3;
73
- };
74
- declare type EnvironmentDefinition = {
75
- environmentColor?: Color3;
76
- environmentIntensity?: number;
77
- environment?: string;
78
- environmentBackground?: string;
79
- environmentRotation?: number;
80
- environmentUseDefault?: boolean;
81
- };
82
- declare type StructureJson = {
83
- /**
84
- * `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
85
- * string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
86
- */
87
- scene?: string | SceneJson;
88
- /**
89
- * `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
90
- * must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
91
- * the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
92
- * {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
93
- * bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
94
- */
95
- setup?: string | SetupJson;
96
- file?: string;
97
- glTF?: Asset | string;
98
- parameterDeclaration?: ParameterDeclarations;
99
- parameters?: ParameterBag;
100
- elements?: ElementDefinitions;
101
- lights?: LightDefinitions;
102
- grounds?: GroundDefinitions;
103
- /**
104
- * `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
105
- * {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
106
- * `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
107
- * `paths`.
108
- *
109
- * Example Code
110
- * ```js
111
- * variants: {
112
- * 'My Pretty Variant' {
113
- * glTF: {
114
- * rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
115
- * fileName: 'my_3d_model_file.glb',
116
- * },
117
- * elements: {
118
- * 'My Little Element': {
119
- * paths: {
120
- * includes: ['__root__.MeshName']
121
- * }
122
- * }
123
- * }
124
- * }
125
- * }
126
- * ```
127
- * `MeshName` has to be identical to the path in the glb-file of the 3D-model.
128
- */
129
- variants?: {
130
- [id: string]: StructureJson;
131
- };
132
- };
133
- declare type SceneJson = {
134
- parameterDeclaration?: ParameterDeclarations;
135
- parameters?: ParameterBag;
136
- meshPicking?: boolean;
137
- /**
138
- * Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
139
- */
140
- engine?: {
141
- antialiasing?: boolean;
142
- options?: EngineOptions;
143
- };
144
- scene: SceneDefinition;
145
- animations?: AnimationDefinitions;
146
- placements?: PlacementDefinitions;
147
- /**
148
- * Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation)
149
- */
150
- cloneMaterialsOnMutation?: boolean;
151
- };
152
- declare type SceneDefinition = {
153
- globals: SceneGlobals;
154
- cameras?: CameraDefinitions;
155
- };
156
- declare type SceneGlobals = {
157
- 'shadows'?: {
158
- enabled: boolean;
159
- type: 'contact';
160
- settings: [];
161
- generator: [];
162
- receiver: [];
163
- };
164
- /**
165
- * `aa` or anti aliasing is not needed if hard edges are desired.\
166
- * FYI: aa smooths edges and avoids stairs-effects.
167
- */
168
- 'aa'?: 'fxaa';
169
- 'tone-mapping'?: boolean;
170
- /**
171
- * @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel,
172
- * relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to
173
- * bloom).
174
- * Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
175
- *
176
- * @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).
177
- * @exposure specifies the intensity of the lightning of the view (not 3D-Model).
178
- * @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
179
- */
180
- 'camera-settings'?: {
181
- contrast: number;
182
- exposure: number;
183
- bloom?: {
184
- enabled: boolean;
185
- size?: number;
186
- threshold?: number;
187
- };
188
- dof?: {
189
- enabled: boolean;
190
- settings: {};
191
- };
192
- sharpen?: {
193
- enabled: boolean;
194
- settings: {};
195
- };
196
- };
197
- };
198
- /**
199
- * {@link Viewer.screenshot} internally uses Babylons [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
200
- * See this link for additional info about the properties.
201
- */
202
- declare type ScreenshotSettings = {
203
- /** Defaults to canvas width & height */
204
- size?: IScreenshotSize;
205
- /**
206
- * Default `image/png`
207
- *
208
- * **Info regarding JPEG:** \
209
- * Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
210
- * Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't
211
- * support transparency. Otherwise background will always be black for jpeg's.
212
- */
213
- mimeType?: string;
214
- /** Default `1` */
215
- samples?: number;
216
- /** Default `false` */
217
- antialiasing?: boolean;
218
- /** Default `screenshot.png` */
219
- fileName?: string;
220
- /** Default `false` */
221
- renderSprites?: boolean;
222
- };
223
- /**
224
- * Use this to define geometry to be excluded from autofocus, GLB export, etc.
225
- */
226
- declare type ExcludedGeometry = Mesh | AbstractMesh | VariantInstance | Variant | VariantElement | Node;
227
- declare type ExcludedGeometryList = ExcludedGeometry[];
228
- declare type AutofocusSettings = {
229
- /**
230
- * Can be used to customize the margins shown around the 3d model when calling {@link Viewer.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;
243
- /** Optional list of geometry to be excluded from consideration */
244
- exclude?: ExcludedGeometryList;
245
- };
246
- declare type LightDefinitions = {
247
- [name: string]: LightDefinition | string;
248
- };
249
- declare type LightDefinition = {
250
- type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
251
- path?: string;
252
- shadowGenerator?: ShadowGeneratorDefinition;
253
- };
254
- declare type ShadowGeneratorDefinition = {
255
- mapSize: number;
256
- [others: string]: any;
257
- };
258
- declare type GroundDefinitions = {
259
- [ground: string]: GroundDefinition;
260
- };
261
- declare type GroundDefinition = {
262
- type: 'baked' | 'ground' | 'heightmap';
263
- meshId?: string;
264
- url?: string;
265
- width?: number;
266
- height?: number;
267
- subdivisions?: number;
268
- receiveShadows?: boolean;
269
- minHeight?: number;
270
- maxHeight?: number;
271
- alphaFilter?: number;
272
- onReady?: any;
273
- };
274
- declare type CameraDefinitions = {
275
- [camera: string]: CameraDefinition;
276
- };
277
- declare type CameraDefinition = {
278
- /**
279
- * `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).
280
- */
281
- fov?: number;
282
- active?: boolean;
283
- /**
284
- * `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
285
- * More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
286
- *
287
- * NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the
288
- * `Specification`, it's still possible to use them in the viewer.\
289
- * For the moment all camera definitions inside these files are automatically added to the scene and can be actived
290
- * using the {@link Viewer.switchCamera} function.\
291
- * The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
292
- */
293
- type: 'arc';
294
- /**
295
- * `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).
296
- */
297
- target?: string;
298
- };
299
- declare type VariantInstanceDefinition = {
300
- name?: string;
301
- variant: DottedPathArgument;
302
- parameters?: ParameterBag;
303
- lazy?: boolean;
304
- };
305
- declare type SetupJson = {
306
- instances: VariantInstanceDefinition[];
307
- };
308
- declare type ParameterDeclarations = {
309
- [name: string]: ParameterDeclaration;
310
- };
311
- declare type ParameterDeclaration = {
312
- type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl';
313
- parser?: any;
314
- options?: ParameterValue[];
315
- };
316
- declare type ParameterValue = string | number | boolean;
317
- declare type ParameterBag = {
318
- [name: string]: ParameterValue;
319
- };
320
- declare type ParsedParameterBag = {
321
- [name: string]: any;
322
- };
323
- declare type DottedPathArgument = string | string[] | DottedPath;
324
- declare type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
325
- declare type PlacementDefinitions = {
326
- [name: string]: PlacementDefinition;
327
- };
328
- declare type PlacementDefinition = {
329
- position?: string | Vector3;
330
- alpha?: number;
331
- beta?: number;
332
- radius?: number;
333
- target?: string | Vector3;
334
- };
335
- declare type AnimationDefinitions = {
336
- [name: string]: AnimationDefinition;
337
- };
338
- /**
339
- * See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
340
- *
341
- * You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
342
- * liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
343
- * {@link AnimationDefinition}.
344
- *
345
- * The `GSAPTWeenVars` are extended by the `shortestWay` property.\
346
- * This property defines if the camera should move to the target position within the shortest possible distance.\
347
- * If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target
348
- * position and that could be > 360, which can appear very unconvenient to the operator.\
349
- * The default value of this flag is `true`.
350
- *
351
- * Example usage in {@link SceneJson | SceneJson.animations}:
352
- *
353
- * ```js
354
- * // ...
355
- * scene: {
356
- * // ...
357
- * animations: {
358
- * DefaultCameraAnimation: {
359
- * ease: 'Power3.easeInOut',
360
- * duration: 0.8,
361
- * },
362
- * },
363
- * // ...
364
- * }
365
- * // ...
366
- * ```
367
- */
368
- declare type AnimationDefinition = GSAPTweenVars & {
369
- shortestWay?: boolean;
370
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=globalTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globalTypes.js","sourceRoot":"","sources":["../../../../src/api/util/globalTypes.ts"],"names":[],"mappings":""}
@@ -1,58 +0,0 @@
1
- /**
2
- * Sleeps for a certain amount of microseconds.
3
- */
4
- declare const sleep: (ms: number) => Promise<unknown>;
5
- /**
6
- * Loads a JSON from a given path.
7
- * @emits {@link Event.LOADING_START}
8
- * @emits {@link Event.LOADING_END}
9
- */
10
- declare const loadJson: <T>(path: string) => Promise<T>;
11
- /**
12
- * Loads a Text from a given path.
13
- * @emits {@link Event.LOADING_START}
14
- * @emits {@link Event.LOADING_END}
15
- */
16
- declare const loadText: (path: string) => Promise<string>;
17
- /**
18
- * Loads a Javascript ressource.\
19
- * Usefull for including packages via CDN (eg: BabylonJS Inspector)
20
- */
21
- declare const loadJavascript: (url: string) => Promise<void>;
22
- /**
23
- * Debounces: it limits the rate at which a function can fire.
24
- */
25
- declare const debounce: (func: Function, wait: number, immediate?: boolean) => () => void;
26
- /**
27
- * Merges multiple maps.
28
- */
29
- declare const mergeMaps: <TKey, TValue>(...maps: Map<TKey, TValue>[]) => Map<TKey, TValue>;
30
- /**
31
- * Creates a HTML image element based on a SVG string, whereas all the embedded assets in the SVG (eg: fonts, images)
32
- * are already loaded and exchanged by their base64 representation.\
33
- * There the output image can exist as "standalone" image and may be used for example as a paintable.
34
- *
35
- * !!CAUTION!!: The used functions within this code section are very well evaluated since most alternatives
36
- * somehow don't work in Safari, as mentioned in the following BJS forum entries:
37
- * - https://forum.babylonjs.com/t/drawing-svg-content-text-into-dynamictexture-doesnt-work-in-safari-v15/25048
38
- * - https://forum.babylonjs.com/t/texture-createfrombase64string-doesnt-seem-to-work-for-ios-devices-initially/25502
39
- */
40
- declare const createImageFromSvg: (svgSrc: string) => Promise<HTMLImageElement>;
41
- /**
42
- * Creates an HTML image element from a dedicated image source.\
43
- * Also waits until the image has loaded.
44
- *
45
- * !!CAUTION!!: The `setTimeout` after loading is finished is required due to a Safari bug:
46
- * - https://bugs.webkit.org/show_bug.cgi?id=39059
47
- * - https://bugs.webkit.org/show_bug.cgi?id=219770
48
- *
49
- * It's not 100% ensured that the timeout solves the issue in every case, but there is no other way unfortunately.\
50
- * => Keep an eye on it in future projects
51
- *
52
- * @param imgSrc Theoretically every source is valid which is also supported by
53
- * [HTMLImageElement.src](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src).\
54
- * Known exceptions are SVGs with embedded assets that are provided as object URL. See comments in
55
- * {@link createImageFromSvg} for further details.
56
- */
57
- declare const createImageFromImgSrc: (imgSrc: string) => Promise<HTMLImageElement>;
58
- export { sleep, loadJson, loadText, loadJavascript, debounce, mergeMaps, createImageFromSvg, createImageFromImgSrc };
@@ -1,194 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Event, emitter } from '../classes/event';
11
- /**
12
- * Sleeps for a certain amount of microseconds.
13
- */
14
- const sleep = (ms) => new Promise(resolve => window.setTimeout(resolve, ms));
15
- /**
16
- * Loads any kind of response from given path.
17
- * @emits {@link Event.LOADING_START}
18
- * @emits {@link Event.LOADING_END}
19
- */
20
- const load = function (path) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- emitter.emit(Event.LOADING_START, path);
23
- const data = yield fetch(path);
24
- emitter.emit(Event.LOADING_END, path);
25
- return data;
26
- });
27
- };
28
- /**
29
- * Loads a JSON from a given path.
30
- * @emits {@link Event.LOADING_START}
31
- * @emits {@link Event.LOADING_END}
32
- */
33
- const loadJson = function (path) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const response = yield load(path);
36
- return response.json();
37
- });
38
- };
39
- /**
40
- * Loads a Text from a given path.
41
- * @emits {@link Event.LOADING_START}
42
- * @emits {@link Event.LOADING_END}
43
- */
44
- const loadText = function (path) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const response = yield load(path);
47
- return response.text();
48
- });
49
- };
50
- /**
51
- * Loads a Javascript ressource.\
52
- * Usefull for including packages via CDN (eg: BabylonJS Inspector)
53
- */
54
- const loadJavascript = (url) => new Promise(resolve => {
55
- const scriptEl = document.createElement('script');
56
- scriptEl.setAttribute('src', url);
57
- scriptEl.setAttribute('type', 'text/javascript');
58
- scriptEl.setAttribute('crossorigin', 'anonymous');
59
- scriptEl.onload = () => resolve();
60
- document.head.appendChild(scriptEl);
61
- });
62
- /**
63
- * Debounces: it limits the rate at which a function can fire.
64
- */
65
- const debounce = function (func, wait, immediate = false) {
66
- let timeout;
67
- return function () {
68
- // @ts-ignore this function is not very "ESLint friendly", also see ESLint disable comment 2 lines below
69
- // => take some time to refactor this function when there is time
70
- const context = this;
71
- // eslint-disable-next-line prefer-rest-params
72
- const args = arguments;
73
- const later = function () {
74
- timeout = null;
75
- if (!immediate) {
76
- func.apply(context, args);
77
- }
78
- };
79
- const callNow = immediate && !timeout;
80
- clearTimeout(timeout);
81
- timeout = setTimeout(later, wait);
82
- if (callNow) {
83
- func.apply(context, args);
84
- }
85
- };
86
- };
87
- /**
88
- * Merges multiple maps.
89
- */
90
- const mergeMaps = function (...maps) {
91
- const resultMap = new Map();
92
- maps.forEach(map => {
93
- map.forEach((v, k) => {
94
- resultMap.set(k, v);
95
- });
96
- });
97
- return resultMap;
98
- };
99
- /**
100
- * Creates a HTML image element based on a SVG string, whereas all the embedded assets in the SVG (eg: fonts, images)
101
- * are already loaded and exchanged by their base64 representation.\
102
- * There the output image can exist as "standalone" image and may be used for example as a paintable.
103
- *
104
- * !!CAUTION!!: The used functions within this code section are very well evaluated since most alternatives
105
- * somehow don't work in Safari, as mentioned in the following BJS forum entries:
106
- * - https://forum.babylonjs.com/t/drawing-svg-content-text-into-dynamictexture-doesnt-work-in-safari-v15/25048
107
- * - https://forum.babylonjs.com/t/texture-createfrombase64string-doesnt-seem-to-work-for-ios-devices-initially/25502
108
- */
109
- const createImageFromSvg = function (svgSrc) {
110
- return __awaiter(this, void 0, void 0, function* () {
111
- // replace assets with their base64 versions in svg source code
112
- const svgWithAssetsEmbedded = yield _embedAssets(svgSrc);
113
- // create data string which can be used as an image source
114
- const svgEncoded = 'data:image/svg+xml,' + encodeURIComponent(svgWithAssetsEmbedded);
115
- return createImageFromImgSrc(svgEncoded);
116
- });
117
- };
118
- /**
119
- * Creates an HTML image element from a dedicated image source.\
120
- * Also waits until the image has loaded.
121
- *
122
- * !!CAUTION!!: The `setTimeout` after loading is finished is required due to a Safari bug:
123
- * - https://bugs.webkit.org/show_bug.cgi?id=39059
124
- * - https://bugs.webkit.org/show_bug.cgi?id=219770
125
- *
126
- * It's not 100% ensured that the timeout solves the issue in every case, but there is no other way unfortunately.\
127
- * => Keep an eye on it in future projects
128
- *
129
- * @param imgSrc Theoretically every source is valid which is also supported by
130
- * [HTMLImageElement.src](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src).\
131
- * Known exceptions are SVGs with embedded assets that are provided as object URL. See comments in
132
- * {@link createImageFromSvg} for further details.
133
- */
134
- const createImageFromImgSrc = function (imgSrc) {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- const img = new Image();
137
- yield new Promise(resolve => {
138
- img.onload = () => {
139
- setTimeout(resolve, 0);
140
- };
141
- img.src = imgSrc;
142
- });
143
- return img;
144
- });
145
- };
146
- /**
147
- * Replaces all supported image & font URLs in the given SVG with their base64 representation.
148
- */
149
- const _embedAssets = function (svgSrc) {
150
- return __awaiter(this, void 0, void 0, function* () {
151
- const _imageExtensions = ['png', 'gif', 'jpg', 'jpeg', 'svg', 'bmp'];
152
- const _fontExtensions = ['woff2', 'woff', 'ttf', 'otf'];
153
- const _assetExtensions = [..._imageExtensions, ..._fontExtensions];
154
- // Regex copied from https://stackoverflow.com/a/8943487/1273551, not "stress tested"...
155
- const urlRegex = /(\bhttps?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gi;
156
- const allUrls = svgSrc.match(urlRegex);
157
- const assetUrls = allUrls.filter(url => _assetExtensions.some(extension => url.toLowerCase().endsWith(`.${extension}`)));
158
- const assetBase64Fetcher = assetUrls.map(_fetchBase64AssetUrl);
159
- const assetFetcherResults = yield Promise.all(assetBase64Fetcher);
160
- return assetFetcherResults.reduce((svgSrc, x) => svgSrc.replace(x.url, x.base64), svgSrc);
161
- });
162
- };
163
- /**
164
- * Fetch asset (image or font) and convert it to base64 string representation.
165
- */
166
- const _fetchBase64AssetUrl = function (assetUrl) {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- // TODO: Cache known base64 representation and only fetch/convert when not already known.
169
- // Usually the fetch shouldn't hit the network but the browser cache since the SVG was already drawn.
170
- // See comments of "createImageBitmapFromSvg" for some considerations...
171
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
172
- const resp = yield fetch(assetUrl);
173
- const blob = yield resp.blob();
174
- const reader = new FileReader();
175
- reader.onloadend = event => {
176
- const target = event.target;
177
- if (!target) {
178
- return reject(`Asset with URL "${assetUrl}" could not be loaded.`);
179
- }
180
- const result = target.result;
181
- if (!result) {
182
- return reject(`Asset with URL "${assetUrl}" returned an empty result.`);
183
- }
184
- resolve({
185
- url: assetUrl,
186
- base64: result.toString(),
187
- });
188
- };
189
- reader.readAsDataURL(blob);
190
- }));
191
- });
192
- };
193
- export { sleep, loadJson, loadText, loadJavascript, debounce, mergeMaps, createImageFromSvg, createImageFromImgSrc };
194
- //# sourceMappingURL=resourceHelper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resourceHelper.js","sourceRoot":"","sources":["../../../../src/api/util/resourceHelper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAErF;;;;GAIG;AACH,MAAM,IAAI,GAAG,UAAgB,IAAY;;QACvC,OAAO,CAAC,IAAI,CAAC,KA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/Loading/sceneLoader';
2
- import { Material } from '@babylonjs/core/Materials/material';
3
- import { Node as BjsNode } from '@babylonjs/core/node';
4
- import { Scene } from '@babylonjs/core/scene';
5
- declare const missingMaterialMetadataName = "missingMaterial";
6
- /**
7
- * Create and return a custom loader plugin to be registered with SceneLoader, that allows
8
- * us to run our own code against the input data before using the standard procedure to
9
- * import.
10
- * @param previousLoaderPlugin the actual loader that's executed after manipulating the input data
11
- * @returns Custom loader plugin to be registered with SceneLoader.RegisterPlugin()
12
- */
13
- declare const getCustomCbnBabylonLoaderPlugin: (previousLoaderPlugin: ISceneLoaderPlugin) => ISceneLoaderPlugin;
14
- /**
15
- * Return an observer to be applied to meshes in order to post-load missing materials
16
- * upon set enabled/visible.
17
- * @param targetMeshOrInstance AbstractMesh the observer will be applied to
18
- * @param concerningMesh Mesh to look for missing materials on, and create/apply to (when found).
19
- * @returns observer
20
- */
21
- declare const getMaterialPostLoadObserver: (targetMeshOrInstance: AbstractMesh, concerningMesh: Mesh) => () => void;
22
- /**
23
- * Adds an "onEnabledStateChanged" observer to the given mesh and all its parents:
24
- * The added observer (`getMaterialPostLoadObserver`) handles creation of missing materials once the given node is
25
- * enabled.
26
- */
27
- declare const addMissingMaterialObserver: (node: BjsNode) => void;
28
- /**
29
- * Look up the provided materials (see library import) and create and return one if found.
30
- * @param materialId BabylonJs material-id. E.g. 'concrete".
31
- * @param scene BabylonJs scene
32
- * @returns PBRMaterial | null
33
- */
34
- export declare const createMaterialFromCbnAssets: (materialId: string, scene: Scene) => Material | null;
35
- export { getCustomCbnBabylonLoaderPlugin, getMaterialPostLoadObserver, missingMaterialMetadataName, addMissingMaterialObserver, };