@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.
- package/README.md +111 -111
- package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
- package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-cjs/api/classes/dottedPath.js +190 -190
- package/dist/lib-cjs/api/classes/element.d.ts +125 -126
- package/dist/lib-cjs/api/classes/element.js +678 -674
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -14
- package/dist/lib-cjs/api/classes/elementParameterizable.js +134 -134
- package/dist/lib-cjs/api/classes/event.d.ts +312 -312
- package/dist/lib-cjs/api/classes/event.js +357 -357
- package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
- package/dist/lib-cjs/api/classes/parameter.d.ts +165 -165
- package/dist/lib-cjs/api/classes/parameter.js +267 -267
- package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-cjs/api/classes/parameterObservable.js +126 -126
- package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-cjs/api/classes/parameterizable.js +149 -149
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +38 -38
- package/dist/lib-cjs/api/classes/placementAnimation.js +138 -138
- package/dist/lib-cjs/api/classes/variant.d.ts +180 -190
- package/dist/lib-cjs/api/classes/variant.js +863 -873
- package/dist/lib-cjs/api/classes/variant.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantInstance.d.ts +41 -41
- package/dist/lib-cjs/api/classes/variantInstance.js +98 -98
- package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-cjs/api/classes/variantParameterizable.js +92 -92
- package/dist/lib-cjs/api/classes/viewer.d.ts +128 -128
- package/dist/lib-cjs/api/classes/viewer.js +486 -486
- package/dist/lib-cjs/api/classes/viewerLight.d.ts +65 -66
- package/dist/lib-cjs/api/classes/viewerLight.js +322 -389
- package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
- package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
- package/dist/lib-cjs/api/internal/debugViewer.js +87 -87
- package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
- package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
- package/dist/lib-cjs/api/internal/sceneSetup.d.ts +6 -6
- package/dist/lib-cjs/api/internal/sceneSetup.js +227 -227
- package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
- package/dist/lib-cjs/api/manager/animationManager.js +121 -121
- package/dist/lib-cjs/api/manager/sceneManager.d.ts +32 -32
- package/dist/lib-cjs/api/manager/sceneManager.js +132 -132
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +90 -90
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +321 -321
- package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
- package/dist/lib-cjs/api/store/specStorage.js +51 -51
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +125 -125
- package/dist/lib-cjs/api/util/babylonHelper.js +368 -368
- package/dist/lib-cjs/api/util/globalTypes.d.ts +275 -275
- package/dist/lib-cjs/api/util/globalTypes.js +1 -1
- package/dist/lib-cjs/api/util/resourceHelper.d.ts +30 -30
- package/dist/lib-cjs/api/util/resourceHelper.js +247 -203
- package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/stringHelper.js +25 -25
- package/dist/lib-cjs/buildinfo.json +3 -3
- package/dist/lib-cjs/index.d.ts +46 -46
- package/dist/lib-cjs/index.js +82 -82
- package/dist/webpack-stats.json +0 -0
- package/package.json +83 -83
- package/src/api/classes/animationInterface.ts +11 -11
- package/src/api/classes/dottedPath.ts +189 -189
- package/src/api/classes/element.ts +608 -606
- package/src/api/classes/elementParameterizable.ts +78 -78
- package/src/api/classes/event.ts +355 -355
- package/src/api/classes/eventBroadcaster.ts +54 -54
- package/src/api/classes/parameter.ts +277 -277
- package/src/api/classes/parameterObservable.ts +121 -121
- package/src/api/classes/placementAnimation.ts +133 -133
- package/src/api/classes/variant.ts +659 -670
- package/src/api/classes/variantInstance.ts +81 -81
- package/src/api/classes/viewer.ts +421 -421
- package/src/api/internal/debugViewer.ts +81 -81
- package/src/api/internal/lensRendering.ts +10 -10
- package/src/api/internal/sceneSetup.ts +203 -203
- package/src/api/manager/animationManager.ts +116 -116
- package/src/api/manager/sceneManager.ts +105 -105
- package/src/api/manager/variantInstanceManager.ts +236 -236
- package/src/api/store/specStorage.ts +53 -53
- package/src/api/util/babylonHelper.ts +392 -392
- package/src/api/util/globalTypes.ts +314 -314
- package/src/api/util/resourceHelper.ts +168 -155
- package/src/buildinfo.json +2 -2
- package/src/commonjs.tsconfig.json +13 -13
- package/src/declaration.tsconfig.json +10 -10
- package/src/dev.ts +44 -46
- package/src/es6.tsconfig.json +13 -13
- package/src/index.ts +87 -87
- package/src/pagesconfig.json +47 -47
- package/src/tsconfig.json +43 -43
- package/src/tsconfig.types.json +9 -9
- package/src/types.d.ts +4 -4
|
@@ -1,315 +1,315 @@
|
|
|
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
|
+
|
|
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
|
+
*/
|
|
315
315
|
type AnimationDefinition = GSAPTweenVars;
|