@combeenation/3d-viewer 12.4.1 → 12.4.3
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 +9 -9
- package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-cjs/api/classes/animationInterface.js +2 -2
- package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-cjs/api/classes/dottedPath.js +166 -166
- package/dist/lib-cjs/api/classes/element.d.ts +153 -153
- package/dist/lib-cjs/api/classes/element.js +702 -702
- package/dist/lib-cjs/api/classes/event.d.ts +401 -401
- package/dist/lib-cjs/api/classes/event.js +424 -424
- package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -49
- package/dist/lib-cjs/api/classes/fuzzyMap.d.ts +7 -7
- package/dist/lib-cjs/api/classes/fuzzyMap.js +21 -21
- package/dist/lib-cjs/api/classes/parameter.d.ts +410 -410
- package/dist/lib-cjs/api/classes/parameter.js +642 -642
- package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-cjs/api/classes/parameterObservable.js +72 -72
- package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-cjs/api/classes/parameterizable.js +102 -102
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -45
- package/dist/lib-cjs/api/classes/placementAnimation.js +176 -176
- package/dist/lib-cjs/api/classes/variant.d.ts +261 -261
- package/dist/lib-cjs/api/classes/variant.js +872 -872
- package/dist/lib-cjs/api/classes/variantInstance.d.ts +53 -53
- package/dist/lib-cjs/api/classes/variantInstance.js +125 -125
- package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-cjs/api/classes/variantParameterizable.js +86 -86
- package/dist/lib-cjs/api/classes/viewer.d.ts +215 -215
- package/dist/lib-cjs/api/classes/viewer.js +708 -708
- package/dist/lib-cjs/api/classes/viewerError.d.ts +43 -43
- package/dist/lib-cjs/api/classes/viewerError.js +55 -55
- package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
- package/dist/lib-cjs/api/classes/viewerLight.js +344 -344
- 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 +13 -13
- package/dist/lib-cjs/api/internal/sceneSetup.js +227 -227
- package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -30
- package/dist/lib-cjs/api/manager/animationManager.js +126 -126
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +80 -80
- package/dist/lib-cjs/api/manager/gltfExportManager.js +300 -299
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.d.ts +33 -33
- package/dist/lib-cjs/api/manager/sceneManager.js +128 -128
- package/dist/lib-cjs/api/manager/tagManager.d.ts +118 -118
- package/dist/lib-cjs/api/manager/tagManager.js +530 -530
- package/dist/lib-cjs/api/manager/textureLoadManager.d.ts +22 -22
- package/dist/lib-cjs/api/manager/textureLoadManager.js +107 -107
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +106 -106
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +290 -290
- package/dist/lib-cjs/api/store/specStorage.d.ts +32 -32
- package/dist/lib-cjs/api/store/specStorage.js +65 -65
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +238 -238
- package/dist/lib-cjs/api/util/babylonHelper.js +825 -825
- package/dist/lib-cjs/api/util/debugHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/debugHelper.js +93 -93
- package/dist/lib-cjs/api/util/deviceHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/deviceHelper.js +28 -28
- package/dist/lib-cjs/api/util/geometryHelper.d.ts +17 -17
- package/dist/lib-cjs/api/util/geometryHelper.js +112 -112
- package/dist/lib-cjs/api/util/globalTypes.d.ts +490 -490
- package/dist/lib-cjs/api/util/globalTypes.js +1 -1
- package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
- package/dist/lib-cjs/api/util/resourceHelper.js +214 -214
- package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +58 -58
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js +228 -228
- package/dist/lib-cjs/api/util/stringHelper.d.ts +13 -13
- package/dist/lib-cjs/api/util/stringHelper.js +32 -32
- package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/structureHelper.js +57 -57
- package/dist/lib-cjs/buildinfo.json +3 -3
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/dist/lib-cjs/index.d.ts +63 -63
- package/dist/lib-cjs/index.js +128 -128
- package/package.json +93 -92
- package/src/api/classes/animationInterface.ts +10 -10
- package/src/api/classes/dottedPath.ts +181 -181
- package/src/api/classes/element.ts +766 -766
- package/src/api/classes/event.ts +457 -457
- package/src/api/classes/eventBroadcaster.ts +52 -52
- package/src/api/classes/fuzzyMap.ts +21 -21
- package/src/api/classes/parameter.ts +686 -686
- package/src/api/classes/parameterObservable.ts +73 -73
- package/src/api/classes/parameterizable.ts +87 -87
- package/src/api/classes/placementAnimation.ts +162 -162
- package/src/api/classes/variant.ts +965 -965
- package/src/api/classes/variantInstance.ts +123 -123
- package/src/api/classes/variantParameterizable.ts +83 -83
- package/src/api/classes/viewer.ts +751 -751
- package/src/api/classes/viewerError.ts +63 -63
- package/src/api/classes/viewerLight.ts +335 -335
- package/src/api/internal/debugViewer.ts +90 -90
- package/src/api/internal/lensRendering.ts +9 -9
- package/src/api/internal/sceneSetup.ts +208 -208
- package/src/api/manager/animationManager.ts +143 -143
- package/src/api/manager/gltfExportManager.ts +337 -334
- package/src/api/manager/sceneManager.ts +134 -134
- package/src/api/manager/tagManager.ts +572 -572
- package/src/api/manager/textureLoadManager.ts +107 -107
- package/src/api/manager/variantInstanceManager.ts +306 -306
- package/src/api/store/specStorage.ts +68 -68
- package/src/api/util/babylonHelper.ts +915 -915
- package/src/api/util/debugHelper.ts +121 -121
- package/src/api/util/deviceHelper.ts +31 -31
- package/src/api/util/geometryHelper.ts +142 -142
- package/src/api/util/globalTypes.ts +566 -566
- package/src/api/util/resourceHelper.ts +201 -201
- package/src/api/util/sceneLoaderHelper.ts +247 -247
- package/src/api/util/stringHelper.ts +30 -30
- package/src/api/util/structureHelper.ts +62 -62
- package/src/buildinfo.json +3 -3
- package/src/dev.ts +70 -70
- package/src/index.ts +116 -116
- package/src/types.d.ts +49 -49
|
@@ -1,490 +1,490 @@
|
|
|
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
|
-
declare type VariantParameterizable = import('../classes/variantParameterizable').VariantParameterizable;
|
|
6
|
-
/**
|
|
7
|
-
* Alias for {@link Element} which can be used to prevent name clashes with the web APIs
|
|
8
|
-
* [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
|
|
9
|
-
*/
|
|
10
|
-
declare type VariantElement = import('../classes/element').Element;
|
|
11
|
-
declare type DottedPath = import('../classes/dottedPath').DottedPath;
|
|
12
|
-
declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
|
|
13
|
-
declare type SceneManager = import('../manager/sceneManager').SceneManager;
|
|
14
|
-
declare type FuzzyMap<K, V> = import('../classes/fuzzyMap').FuzzyMap<K, V>;
|
|
15
|
-
declare type Scene = import('@babylonjs/core/scene').Scene;
|
|
16
|
-
declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
|
|
17
|
-
declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
|
|
18
|
-
declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
|
|
19
|
-
declare type Material = import('@babylonjs/core/Materials/material').Material;
|
|
20
|
-
declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
|
|
21
|
-
declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
|
|
22
|
-
declare type BackgroundMaterial = import('@babylonjs/core/Materials/Background/backgroundMaterial').BackgroundMaterial;
|
|
23
|
-
declare type NodeMaterial = import('@babylonjs/core/Materials/Node').NodeMaterial;
|
|
24
|
-
declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
|
|
25
|
-
declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
|
|
26
|
-
declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
|
|
27
|
-
declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
|
|
28
|
-
declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
|
|
29
|
-
declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
|
|
30
|
-
/**
|
|
31
|
-
* See Babylon JS docs for more information about available [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
|
|
32
|
-
*/
|
|
33
|
-
declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
|
|
34
|
-
declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
|
|
35
|
-
declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
|
|
36
|
-
declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
|
|
37
|
-
declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
|
|
38
|
-
declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
|
|
39
|
-
declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
|
|
40
|
-
declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
|
|
41
|
-
declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
|
|
42
|
-
declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
|
|
43
|
-
declare type IExportOptions = import('@babylonjs/serializers/glTF/2.0').IExportOptions;
|
|
44
|
-
declare type EventEmitter = import('eventemitter3');
|
|
45
|
-
declare type Undefinable<T> = T | undefined;
|
|
46
|
-
declare type Nullable<T> = T | null;
|
|
47
|
-
declare type PathDefinitions = {
|
|
48
|
-
include: string[];
|
|
49
|
-
exclude?: string[];
|
|
50
|
-
};
|
|
51
|
-
declare type TraceableDefinition = {
|
|
52
|
-
path: string;
|
|
53
|
-
};
|
|
54
|
-
declare type TraceableDefinitions = {
|
|
55
|
-
[name: string]: TraceableDefinition;
|
|
56
|
-
};
|
|
57
|
-
declare type PaintableDefinition = {
|
|
58
|
-
path: string;
|
|
59
|
-
textureOptions: {
|
|
60
|
-
width: number;
|
|
61
|
-
height: number;
|
|
62
|
-
} | number;
|
|
63
|
-
};
|
|
64
|
-
declare type PaintableDefinitions = {
|
|
65
|
-
[name: string]: PaintableDefinition;
|
|
66
|
-
};
|
|
67
|
-
declare type PaintableValue = {
|
|
68
|
-
src: string;
|
|
69
|
-
options?: PaintableOptions;
|
|
70
|
-
};
|
|
71
|
-
declare type PaintableOptions = {
|
|
72
|
-
uScale?: number;
|
|
73
|
-
uOffset?: number;
|
|
74
|
-
vScale?: number;
|
|
75
|
-
vOffset?: number;
|
|
76
|
-
};
|
|
77
|
-
declare type Asset = {
|
|
78
|
-
rootUrl: string;
|
|
79
|
-
fileName: string | undefined;
|
|
80
|
-
};
|
|
81
|
-
declare type ElementDefinitions = {
|
|
82
|
-
[name: string]: ElementDefinition | string[];
|
|
83
|
-
};
|
|
84
|
-
declare type ElementDefinition = {
|
|
85
|
-
paths: PathDefinitions;
|
|
86
|
-
traceables?: TraceableDefinitions;
|
|
87
|
-
paintables?: PaintableDefinitions;
|
|
88
|
-
};
|
|
89
|
-
declare type TransformationDefinition = {
|
|
90
|
-
scaling: Vector3;
|
|
91
|
-
position: Vector3;
|
|
92
|
-
rotation: Vector3;
|
|
93
|
-
};
|
|
94
|
-
declare type EnvironmentDefinition = {
|
|
95
|
-
environmentColor?: Color3;
|
|
96
|
-
environmentIntensity?: number;
|
|
97
|
-
environment?: string;
|
|
98
|
-
environmentBackground?: string;
|
|
99
|
-
environmentRotation?: number;
|
|
100
|
-
environmentUseDefault?: boolean;
|
|
101
|
-
};
|
|
102
|
-
declare type StructureJson = {
|
|
103
|
-
/**
|
|
104
|
-
* `scene` describes the visualisation of the babylon `scene` such as the incidence of light and camera position. If a
|
|
105
|
-
* string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
|
|
106
|
-
*/
|
|
107
|
-
scene?: string | SceneJson;
|
|
108
|
-
/**
|
|
109
|
-
* `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
|
|
110
|
-
* must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
|
|
111
|
-
* the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
|
|
112
|
-
* {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
|
|
113
|
-
* bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
|
|
114
|
-
*/
|
|
115
|
-
setup?: string | SetupJson;
|
|
116
|
-
file?: string;
|
|
117
|
-
glTF?: Asset | string;
|
|
118
|
-
parameterDeclaration?: ParameterDeclarations;
|
|
119
|
-
parameters?: ParameterBag;
|
|
120
|
-
elements?: ElementDefinitions;
|
|
121
|
-
lights?: LightDefinitions;
|
|
122
|
-
grounds?: GroundDefinitions;
|
|
123
|
-
/**
|
|
124
|
-
* `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
|
|
125
|
-
* {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
|
|
126
|
-
* `elements` in the value. FYI: Babylon.js's sandbox can show you the path of the 3D-model to properly define the
|
|
127
|
-
* `paths`.
|
|
128
|
-
*
|
|
129
|
-
* Example Code
|
|
130
|
-
* ```js
|
|
131
|
-
* variants: {
|
|
132
|
-
* 'My Pretty Variant' {
|
|
133
|
-
* glTF: {
|
|
134
|
-
* rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
|
|
135
|
-
* fileName: 'my_3d_model_file.glb',
|
|
136
|
-
* },
|
|
137
|
-
* elements: {
|
|
138
|
-
* 'My Little Element': {
|
|
139
|
-
* paths: {
|
|
140
|
-
* includes: ['__root__.MeshName']
|
|
141
|
-
* }
|
|
142
|
-
* }
|
|
143
|
-
* }
|
|
144
|
-
* }
|
|
145
|
-
* }
|
|
146
|
-
* ```
|
|
147
|
-
* `MeshName` has to be identical to the path in the glb-file of the 3D-model.
|
|
148
|
-
*/
|
|
149
|
-
variants?: {
|
|
150
|
-
[id: string]: StructureJson;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Extends the `StructureJson` by removing the optional flag from some properties which surely exist in the auto
|
|
155
|
-
* generated spec
|
|
156
|
-
*/
|
|
157
|
-
declare type AutoSpecStructureJson = StructureJson & {
|
|
158
|
-
scene: AutoSpecSceneJson;
|
|
159
|
-
setup: SetupJson;
|
|
160
|
-
variants: {
|
|
161
|
-
[id: string]: StructureJson;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
declare type SceneJson = {
|
|
165
|
-
parameterDeclaration?: ParameterDeclarations;
|
|
166
|
-
parameters?: ParameterBag;
|
|
167
|
-
meshPicking?: boolean;
|
|
168
|
-
engine?: {
|
|
169
|
-
antialiasing?: boolean;
|
|
170
|
-
options?: EngineOptions;
|
|
171
|
-
adaptToDeviceRatio?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* Possibility to limit the size of textures when getting loaded by the engine.
|
|
174
|
-
* Activating this feature potentially saves a lot of memory and can be used to avoid crashes when loading expensive
|
|
175
|
-
* models on weaker devices.
|
|
176
|
-
* In praxis this has been an issue with iPhones a lot, therefore it's possible to activate this feature for iPhones
|
|
177
|
-
* only as well.
|
|
178
|
-
*/
|
|
179
|
-
limitTextureSize?: LimitTextureSizeConfig | false;
|
|
180
|
-
/**
|
|
181
|
-
* See this forum entry for description of parallel shader compilition effect:
|
|
182
|
-
* https://forum.babylonjs.com/t/scene-flickering-when-turning-off-light/48733.
|
|
183
|
-
* Parallel shading compilition generally improves the speed of material compilition and helps when switching
|
|
184
|
-
* materials while objects are moving (eg: animations).
|
|
185
|
-
* Deactivating parallel shading compilition is benefitial when switching lights and materials in static scenarios.
|
|
186
|
-
* It's activated by default due to compatibility reasons but can be overwritten with this flag.
|
|
187
|
-
*/
|
|
188
|
-
useParallelShaderCompile?: boolean;
|
|
189
|
-
};
|
|
190
|
-
scene: SceneDefinition;
|
|
191
|
-
animations?: AnimationDefinitions;
|
|
192
|
-
placements?: PlacementDefinitions;
|
|
193
|
-
/**
|
|
194
|
-
* Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation).
|
|
195
|
-
* Default value is `false`.
|
|
196
|
-
*/
|
|
197
|
-
cloneMaterialsOnMutation?: boolean;
|
|
198
|
-
};
|
|
199
|
-
declare type LimitTextureSizeConfig = {
|
|
200
|
-
size: 512 | 1024;
|
|
201
|
-
devices: 'iPhone' | 'all';
|
|
202
|
-
};
|
|
203
|
-
/**
|
|
204
|
-
* Extends the `SceneJson` by removing the optional flag from some properties which surely exist in the auto generated
|
|
205
|
-
* spec
|
|
206
|
-
*/
|
|
207
|
-
declare type AutoSpecSceneJson = SceneJson & {
|
|
208
|
-
engine: {
|
|
209
|
-
antialiasing: boolean;
|
|
210
|
-
options: EngineOptions;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
declare type SceneDefinition = {
|
|
214
|
-
globals: SceneGlobals;
|
|
215
|
-
cameras?: CameraDefinitions;
|
|
216
|
-
};
|
|
217
|
-
declare type SceneGlobals = {
|
|
218
|
-
'shadows'?: {
|
|
219
|
-
enabled: boolean;
|
|
220
|
-
type: 'contact';
|
|
221
|
-
settings: [];
|
|
222
|
-
generator: [];
|
|
223
|
-
receiver: [];
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* `aa` or anti aliasing is not needed if hard edges are desired.\
|
|
227
|
-
* FYI: aa smooths edges and avoids stairs-effects.
|
|
228
|
-
*/
|
|
229
|
-
'aa'?: 'fxaa';
|
|
230
|
-
'tone-mapping'?: boolean;
|
|
231
|
-
/**
|
|
232
|
-
* @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel,
|
|
233
|
-
* relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to
|
|
234
|
-
* bloom).
|
|
235
|
-
* Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
|
|
236
|
-
*
|
|
237
|
-
* @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).
|
|
238
|
-
* @exposure specifies the intensity of the lightning of the view (not 3D-Model).
|
|
239
|
-
* @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
|
|
240
|
-
*/
|
|
241
|
-
'camera-settings'?: {
|
|
242
|
-
contrast: number;
|
|
243
|
-
exposure: number;
|
|
244
|
-
bloom?: {
|
|
245
|
-
enabled: boolean;
|
|
246
|
-
size?: number;
|
|
247
|
-
threshold?: number;
|
|
248
|
-
};
|
|
249
|
-
dof?: {
|
|
250
|
-
enabled: boolean;
|
|
251
|
-
settings: {};
|
|
252
|
-
};
|
|
253
|
-
sharpen?: {
|
|
254
|
-
enabled: boolean;
|
|
255
|
-
settings: {};
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* {@link Viewer.screenshot} internally uses Babylon.js [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
|
|
261
|
-
* See this link for additional info about the properties.
|
|
262
|
-
*/
|
|
263
|
-
declare type ScreenshotSettings = {
|
|
264
|
-
/** Defaults to canvas width & height */
|
|
265
|
-
size?: IScreenshotSize;
|
|
266
|
-
/**
|
|
267
|
-
* Default `image/png`
|
|
268
|
-
*
|
|
269
|
-
* **Info regarding JPEG:** \
|
|
270
|
-
* Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
|
|
271
|
-
* Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't
|
|
272
|
-
* support transparency. Otherwise background will always be black for jpeg's.
|
|
273
|
-
*/
|
|
274
|
-
mimeType?: string;
|
|
275
|
-
/** Default `1` */
|
|
276
|
-
samples?: number;
|
|
277
|
-
/** Default `false` */
|
|
278
|
-
antialiasing?: boolean;
|
|
279
|
-
/** NOTE: after update to Babylon.js V6: if file name is given, the screenshot image will be downloaded and the base64
|
|
280
|
-
* string will NOT be returned! */
|
|
281
|
-
fileName?: string;
|
|
282
|
-
/** Default `false` */
|
|
283
|
-
renderSprites?: boolean;
|
|
284
|
-
};
|
|
285
|
-
/**
|
|
286
|
-
* Use this to define geometry to be excluded from autofocus, GLB export, etc.
|
|
287
|
-
*/
|
|
288
|
-
declare type ExcludedGeometry = TransformNode | VariantInstance | Variant | VariantElement | TagManagerSubject;
|
|
289
|
-
declare type ExcludedGeometryList = ExcludedGeometry[];
|
|
290
|
-
declare type AutofocusSettings = {
|
|
291
|
-
/**
|
|
292
|
-
* Can be used to customize the margins shown around the 3d model when calling {@link Viewer.autofocusActiveCamera}.\
|
|
293
|
-
* Defaults to 1.5 when not set explicitly.
|
|
294
|
-
*/
|
|
295
|
-
radiusFactor?: number;
|
|
296
|
-
adjustWheelPrecision?: boolean;
|
|
297
|
-
adjustPanningSensibility?: boolean;
|
|
298
|
-
adjustPinchPrecision?: boolean;
|
|
299
|
-
/** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
|
|
300
|
-
alpha?: number;
|
|
301
|
-
/** Desired vertical camera angle, this won't be overwritten by the autofocus function */
|
|
302
|
-
beta?: number;
|
|
303
|
-
/** Optional animation for the focusing camera movement */
|
|
304
|
-
animation?: string | AnimationDefinition;
|
|
305
|
-
/** Optional list of geometry to be excluded from consideration */
|
|
306
|
-
exclude?: ExcludedGeometryList;
|
|
307
|
-
};
|
|
308
|
-
declare type LightDefinitions = {
|
|
309
|
-
[name: string]: LightDefinition | string;
|
|
310
|
-
};
|
|
311
|
-
declare type LightDefinition = {
|
|
312
|
-
type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
|
|
313
|
-
path?: string;
|
|
314
|
-
shadowGenerator?: ShadowGeneratorDefinition;
|
|
315
|
-
};
|
|
316
|
-
declare type ShadowGeneratorDefinition = {
|
|
317
|
-
mapSize: number;
|
|
318
|
-
[others: string]: any;
|
|
319
|
-
};
|
|
320
|
-
declare type GroundDefinitions = {
|
|
321
|
-
[ground: string]: GroundDefinition;
|
|
322
|
-
};
|
|
323
|
-
declare type GroundDefinition = {
|
|
324
|
-
type: 'baked' | 'ground' | 'heightmap';
|
|
325
|
-
meshId?: string;
|
|
326
|
-
url?: string;
|
|
327
|
-
width?: number;
|
|
328
|
-
height?: number;
|
|
329
|
-
subdivisions?: number;
|
|
330
|
-
receiveShadows?: boolean;
|
|
331
|
-
minHeight?: number;
|
|
332
|
-
maxHeight?: number;
|
|
333
|
-
alphaFilter?: number;
|
|
334
|
-
onReady?: any;
|
|
335
|
-
};
|
|
336
|
-
declare type CameraDefinitions = {
|
|
337
|
-
[camera: string]: CameraDefinition;
|
|
338
|
-
};
|
|
339
|
-
declare type CameraDefinition = {
|
|
340
|
-
/**
|
|
341
|
-
* `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).
|
|
342
|
-
*/
|
|
343
|
-
fov?: number;
|
|
344
|
-
active?: boolean;
|
|
345
|
-
/**
|
|
346
|
-
* `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
|
|
347
|
-
* More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
|
|
348
|
-
*
|
|
349
|
-
* NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the
|
|
350
|
-
* `Specification`, it's still possible to use them in the viewer.\
|
|
351
|
-
* For the moment all camera definitions inside these files are automatically added to the scene and can be actived
|
|
352
|
-
* using the {@link Viewer.switchCamera} function.\
|
|
353
|
-
* The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
|
|
354
|
-
*/
|
|
355
|
-
type: 'arc';
|
|
356
|
-
/**
|
|
357
|
-
* `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).
|
|
358
|
-
*/
|
|
359
|
-
target?: string;
|
|
360
|
-
};
|
|
361
|
-
declare type VariantInstanceDefinition = {
|
|
362
|
-
name?: string;
|
|
363
|
-
variant: DottedPathArgument;
|
|
364
|
-
parameters?: ParameterBag;
|
|
365
|
-
lazy?: boolean;
|
|
366
|
-
};
|
|
367
|
-
declare type SetupJson = {
|
|
368
|
-
instances: VariantInstanceDefinition[];
|
|
369
|
-
};
|
|
370
|
-
declare type ParameterDeclarations = {
|
|
371
|
-
[name: string]: ParameterDeclaration;
|
|
372
|
-
};
|
|
373
|
-
declare type ParameterDeclaration = {
|
|
374
|
-
type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl' | 'paintable';
|
|
375
|
-
parser?: any;
|
|
376
|
-
options?: ParameterValue[];
|
|
377
|
-
};
|
|
378
|
-
declare type ParameterValue = string | number | boolean;
|
|
379
|
-
declare type ParameterBag = {
|
|
380
|
-
[name: string]: ParameterValue;
|
|
381
|
-
};
|
|
382
|
-
declare type ParsedParameterBag = {
|
|
383
|
-
[name: string]: any;
|
|
384
|
-
};
|
|
385
|
-
declare type DottedPathArgument = string | string[] | DottedPath;
|
|
386
|
-
declare type ParameterObserverResult = boolean | void;
|
|
387
|
-
declare type ParameterObserver = (object: any, oldValue: Undefinable<ParameterValue>, newValue: ParameterValue) => Promise<ParameterObserverResult>;
|
|
388
|
-
declare type PlacementDefinitions = {
|
|
389
|
-
[name: string]: PlacementDefinition;
|
|
390
|
-
};
|
|
391
|
-
declare type PlacementDefinition = {
|
|
392
|
-
position?: string | Vector3;
|
|
393
|
-
alpha?: number;
|
|
394
|
-
beta?: number;
|
|
395
|
-
radius?: number;
|
|
396
|
-
target?: string | Vector3;
|
|
397
|
-
};
|
|
398
|
-
declare type AnimationDefinitions = {
|
|
399
|
-
[name: string]: AnimationDefinition;
|
|
400
|
-
};
|
|
401
|
-
/**
|
|
402
|
-
* See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
|
|
403
|
-
*
|
|
404
|
-
* You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
|
|
405
|
-
* liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
|
|
406
|
-
* {@link AnimationDefinition}.
|
|
407
|
-
*
|
|
408
|
-
* The `GSAPTWeenVars` are extended by the `shortestWay` property.\
|
|
409
|
-
* This property defines if the camera should move to the target position within the shortest possible distance.\
|
|
410
|
-
* If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target
|
|
411
|
-
* position and that could be > 360, which can appear very unconvenient to the operator.\
|
|
412
|
-
* The default value of this flag is `true`.
|
|
413
|
-
*
|
|
414
|
-
* Example usage in {@link SceneJson | SceneJson.animations}:
|
|
415
|
-
*
|
|
416
|
-
* ```js
|
|
417
|
-
* // ...
|
|
418
|
-
* scene: {
|
|
419
|
-
* // ...
|
|
420
|
-
* animations: {
|
|
421
|
-
* DefaultCameraAnimation: {
|
|
422
|
-
* ease: 'Power3.easeInOut',
|
|
423
|
-
* duration: 0.8,
|
|
424
|
-
* },
|
|
425
|
-
* },
|
|
426
|
-
* // ...
|
|
427
|
-
* }
|
|
428
|
-
* // ...
|
|
429
|
-
* ```
|
|
430
|
-
*/
|
|
431
|
-
declare type AnimationDefinition = GSAPTweenVars & {
|
|
432
|
-
shortestWay?: boolean;
|
|
433
|
-
};
|
|
434
|
-
declare type SpecGenerationData = {
|
|
435
|
-
name: string;
|
|
436
|
-
url: string;
|
|
437
|
-
};
|
|
438
|
-
/**
|
|
439
|
-
* Key = Old tag name\
|
|
440
|
-
* Value = New tag name
|
|
441
|
-
*/
|
|
442
|
-
declare type TagMapping = {
|
|
443
|
-
[tagName: string]: string;
|
|
444
|
-
};
|
|
445
|
-
declare type TagManagerSubject = {
|
|
446
|
-
tagName?: string;
|
|
447
|
-
nodeName?: string;
|
|
448
|
-
materialName?: string;
|
|
449
|
-
};
|
|
450
|
-
declare type TagManagerParameterObserverResult = ParameterObserverResult;
|
|
451
|
-
/**
|
|
452
|
-
* The observer should return `false` in cases where the given value was not actually applied. E.g. when wanting to
|
|
453
|
-
* apply a property on the given `node`s material which doesn't exist at the time the observer is called etc.
|
|
454
|
-
*/
|
|
455
|
-
declare type TagManagerParameterObserver = (payload: TagManagerParameterObserverPayload) => Promise<TagManagerParameterObserverResult>;
|
|
456
|
-
declare type TagManagerParameterBag = FuzzyMap<TagManagerSubject, ParameterBag>;
|
|
457
|
-
declare type TagManagerParameterObserverBag = Map<string, TagManagerParameterObserver>;
|
|
458
|
-
declare type TagManagerParameterObserverPayload = {
|
|
459
|
-
subject: TagManagerSubject;
|
|
460
|
-
nodes: TransformNode[];
|
|
461
|
-
materials: Material[];
|
|
462
|
-
newValue: ParameterValue;
|
|
463
|
-
oldValue: Undefinable<ParameterValue>;
|
|
464
|
-
};
|
|
465
|
-
declare type TagManagerParameterValue = {
|
|
466
|
-
tagName?: string;
|
|
467
|
-
nodeName?: string;
|
|
468
|
-
materialName?: string;
|
|
469
|
-
parameterName: string;
|
|
470
|
-
value: ParameterValue;
|
|
471
|
-
};
|
|
472
|
-
declare type TagManagerParameterObserverResultBag = {
|
|
473
|
-
subject: TagManagerSubject;
|
|
474
|
-
parameter: string;
|
|
475
|
-
nodes: TransformNode[];
|
|
476
|
-
materials: Material[];
|
|
477
|
-
oldValue: ParameterValue;
|
|
478
|
-
newValue: ParameterValue;
|
|
479
|
-
parameterObserverResult: TagManagerParameterObserverResult;
|
|
480
|
-
};
|
|
481
|
-
declare type NodeNamingStrategyPayload = {
|
|
482
|
-
variantInstance: VariantInstance;
|
|
483
|
-
variant: Variant;
|
|
484
|
-
variantParameterizable: VariantParameterizable;
|
|
485
|
-
};
|
|
486
|
-
declare type NodeNamingStrategyHandler = (node: TransformNode, payload: NodeNamingStrategyPayload) => string;
|
|
487
|
-
declare type NodeNamingStrategy = {
|
|
488
|
-
handler: NodeNamingStrategyHandler;
|
|
489
|
-
payload: NodeNamingStrategyPayload;
|
|
490
|
-
};
|
|
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
|
+
declare type VariantParameterizable = import('../classes/variantParameterizable').VariantParameterizable;
|
|
6
|
+
/**
|
|
7
|
+
* Alias for {@link Element} which can be used to prevent name clashes with the web APIs
|
|
8
|
+
* [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
|
|
9
|
+
*/
|
|
10
|
+
declare type VariantElement = import('../classes/element').Element;
|
|
11
|
+
declare type DottedPath = import('../classes/dottedPath').DottedPath;
|
|
12
|
+
declare type ViewerLight = import('../classes/viewerLight').ViewerLight;
|
|
13
|
+
declare type SceneManager = import('../manager/sceneManager').SceneManager;
|
|
14
|
+
declare type FuzzyMap<K, V> = import('../classes/fuzzyMap').FuzzyMap<K, V>;
|
|
15
|
+
declare type Scene = import('@babylonjs/core/scene').Scene;
|
|
16
|
+
declare type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
|
|
17
|
+
declare type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
|
|
18
|
+
declare type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
|
|
19
|
+
declare type Material = import('@babylonjs/core/Materials/material').Material;
|
|
20
|
+
declare type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
|
|
21
|
+
declare type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
|
|
22
|
+
declare type BackgroundMaterial = import('@babylonjs/core/Materials/Background/backgroundMaterial').BackgroundMaterial;
|
|
23
|
+
declare type NodeMaterial = import('@babylonjs/core/Materials/Node').NodeMaterial;
|
|
24
|
+
declare type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
|
|
25
|
+
declare type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
|
|
26
|
+
declare type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
|
|
27
|
+
declare type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
|
|
28
|
+
declare type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
|
|
29
|
+
declare type Engine = import('@babylonjs/core/Engines/engine').Engine;
|
|
30
|
+
/**
|
|
31
|
+
* See Babylon JS docs for more information about available [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
|
|
32
|
+
*/
|
|
33
|
+
declare type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
|
|
34
|
+
declare type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
|
|
35
|
+
declare type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
|
|
36
|
+
declare type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
|
|
37
|
+
declare type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
|
|
38
|
+
declare type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
|
|
39
|
+
declare type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
|
|
40
|
+
declare type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
|
|
41
|
+
declare type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
|
|
42
|
+
declare type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
|
|
43
|
+
declare type IExportOptions = import('@babylonjs/serializers/glTF/2.0').IExportOptions;
|
|
44
|
+
declare type EventEmitter = import('eventemitter3');
|
|
45
|
+
declare type Undefinable<T> = T | undefined;
|
|
46
|
+
declare type Nullable<T> = T | null;
|
|
47
|
+
declare type PathDefinitions = {
|
|
48
|
+
include: string[];
|
|
49
|
+
exclude?: string[];
|
|
50
|
+
};
|
|
51
|
+
declare type TraceableDefinition = {
|
|
52
|
+
path: string;
|
|
53
|
+
};
|
|
54
|
+
declare type TraceableDefinitions = {
|
|
55
|
+
[name: string]: TraceableDefinition;
|
|
56
|
+
};
|
|
57
|
+
declare type PaintableDefinition = {
|
|
58
|
+
path: string;
|
|
59
|
+
textureOptions: {
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
} | number;
|
|
63
|
+
};
|
|
64
|
+
declare type PaintableDefinitions = {
|
|
65
|
+
[name: string]: PaintableDefinition;
|
|
66
|
+
};
|
|
67
|
+
declare type PaintableValue = {
|
|
68
|
+
src: string;
|
|
69
|
+
options?: PaintableOptions;
|
|
70
|
+
};
|
|
71
|
+
declare type PaintableOptions = {
|
|
72
|
+
uScale?: number;
|
|
73
|
+
uOffset?: number;
|
|
74
|
+
vScale?: number;
|
|
75
|
+
vOffset?: number;
|
|
76
|
+
};
|
|
77
|
+
declare type Asset = {
|
|
78
|
+
rootUrl: string;
|
|
79
|
+
fileName: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
declare type ElementDefinitions = {
|
|
82
|
+
[name: string]: ElementDefinition | string[];
|
|
83
|
+
};
|
|
84
|
+
declare type ElementDefinition = {
|
|
85
|
+
paths: PathDefinitions;
|
|
86
|
+
traceables?: TraceableDefinitions;
|
|
87
|
+
paintables?: PaintableDefinitions;
|
|
88
|
+
};
|
|
89
|
+
declare type TransformationDefinition = {
|
|
90
|
+
scaling: Vector3;
|
|
91
|
+
position: Vector3;
|
|
92
|
+
rotation: Vector3;
|
|
93
|
+
};
|
|
94
|
+
declare type EnvironmentDefinition = {
|
|
95
|
+
environmentColor?: Color3;
|
|
96
|
+
environmentIntensity?: number;
|
|
97
|
+
environment?: string;
|
|
98
|
+
environmentBackground?: string;
|
|
99
|
+
environmentRotation?: number;
|
|
100
|
+
environmentUseDefault?: boolean;
|
|
101
|
+
};
|
|
102
|
+
declare type StructureJson = {
|
|
103
|
+
/**
|
|
104
|
+
* `scene` describes the visualisation of the babylon `scene` such as the incidence of light and camera position. If a
|
|
105
|
+
* string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
|
|
106
|
+
*/
|
|
107
|
+
scene?: string | SceneJson;
|
|
108
|
+
/**
|
|
109
|
+
* `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
|
|
110
|
+
* must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
|
|
111
|
+
* the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
|
|
112
|
+
* {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
|
|
113
|
+
* bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
|
|
114
|
+
*/
|
|
115
|
+
setup?: string | SetupJson;
|
|
116
|
+
file?: string;
|
|
117
|
+
glTF?: Asset | string;
|
|
118
|
+
parameterDeclaration?: ParameterDeclarations;
|
|
119
|
+
parameters?: ParameterBag;
|
|
120
|
+
elements?: ElementDefinitions;
|
|
121
|
+
lights?: LightDefinitions;
|
|
122
|
+
grounds?: GroundDefinitions;
|
|
123
|
+
/**
|
|
124
|
+
* `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
|
|
125
|
+
* {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
|
|
126
|
+
* `elements` in the value. FYI: Babylon.js's sandbox can show you the path of the 3D-model to properly define the
|
|
127
|
+
* `paths`.
|
|
128
|
+
*
|
|
129
|
+
* Example Code
|
|
130
|
+
* ```js
|
|
131
|
+
* variants: {
|
|
132
|
+
* 'My Pretty Variant' {
|
|
133
|
+
* glTF: {
|
|
134
|
+
* rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
|
|
135
|
+
* fileName: 'my_3d_model_file.glb',
|
|
136
|
+
* },
|
|
137
|
+
* elements: {
|
|
138
|
+
* 'My Little Element': {
|
|
139
|
+
* paths: {
|
|
140
|
+
* includes: ['__root__.MeshName']
|
|
141
|
+
* }
|
|
142
|
+
* }
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
* `MeshName` has to be identical to the path in the glb-file of the 3D-model.
|
|
148
|
+
*/
|
|
149
|
+
variants?: {
|
|
150
|
+
[id: string]: StructureJson;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Extends the `StructureJson` by removing the optional flag from some properties which surely exist in the auto
|
|
155
|
+
* generated spec
|
|
156
|
+
*/
|
|
157
|
+
declare type AutoSpecStructureJson = StructureJson & {
|
|
158
|
+
scene: AutoSpecSceneJson;
|
|
159
|
+
setup: SetupJson;
|
|
160
|
+
variants: {
|
|
161
|
+
[id: string]: StructureJson;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
declare type SceneJson = {
|
|
165
|
+
parameterDeclaration?: ParameterDeclarations;
|
|
166
|
+
parameters?: ParameterBag;
|
|
167
|
+
meshPicking?: boolean;
|
|
168
|
+
engine?: {
|
|
169
|
+
antialiasing?: boolean;
|
|
170
|
+
options?: EngineOptions;
|
|
171
|
+
adaptToDeviceRatio?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Possibility to limit the size of textures when getting loaded by the engine.
|
|
174
|
+
* Activating this feature potentially saves a lot of memory and can be used to avoid crashes when loading expensive
|
|
175
|
+
* models on weaker devices.
|
|
176
|
+
* In praxis this has been an issue with iPhones a lot, therefore it's possible to activate this feature for iPhones
|
|
177
|
+
* only as well.
|
|
178
|
+
*/
|
|
179
|
+
limitTextureSize?: LimitTextureSizeConfig | false;
|
|
180
|
+
/**
|
|
181
|
+
* See this forum entry for description of parallel shader compilition effect:
|
|
182
|
+
* https://forum.babylonjs.com/t/scene-flickering-when-turning-off-light/48733.
|
|
183
|
+
* Parallel shading compilition generally improves the speed of material compilition and helps when switching
|
|
184
|
+
* materials while objects are moving (eg: animations).
|
|
185
|
+
* Deactivating parallel shading compilition is benefitial when switching lights and materials in static scenarios.
|
|
186
|
+
* It's activated by default due to compatibility reasons but can be overwritten with this flag.
|
|
187
|
+
*/
|
|
188
|
+
useParallelShaderCompile?: boolean;
|
|
189
|
+
};
|
|
190
|
+
scene: SceneDefinition;
|
|
191
|
+
animations?: AnimationDefinitions;
|
|
192
|
+
placements?: PlacementDefinitions;
|
|
193
|
+
/**
|
|
194
|
+
* Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation).
|
|
195
|
+
* Default value is `false`.
|
|
196
|
+
*/
|
|
197
|
+
cloneMaterialsOnMutation?: boolean;
|
|
198
|
+
};
|
|
199
|
+
declare type LimitTextureSizeConfig = {
|
|
200
|
+
size: 512 | 1024;
|
|
201
|
+
devices: 'iPhone' | 'all';
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Extends the `SceneJson` by removing the optional flag from some properties which surely exist in the auto generated
|
|
205
|
+
* spec
|
|
206
|
+
*/
|
|
207
|
+
declare type AutoSpecSceneJson = SceneJson & {
|
|
208
|
+
engine: {
|
|
209
|
+
antialiasing: boolean;
|
|
210
|
+
options: EngineOptions;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
declare type SceneDefinition = {
|
|
214
|
+
globals: SceneGlobals;
|
|
215
|
+
cameras?: CameraDefinitions;
|
|
216
|
+
};
|
|
217
|
+
declare type SceneGlobals = {
|
|
218
|
+
'shadows'?: {
|
|
219
|
+
enabled: boolean;
|
|
220
|
+
type: 'contact';
|
|
221
|
+
settings: [];
|
|
222
|
+
generator: [];
|
|
223
|
+
receiver: [];
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* `aa` or anti aliasing is not needed if hard edges are desired.\
|
|
227
|
+
* FYI: aa smooths edges and avoids stairs-effects.
|
|
228
|
+
*/
|
|
229
|
+
'aa'?: 'fxaa';
|
|
230
|
+
'tone-mapping'?: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* @bloom is widely known as glow. There you can define it’s size (Specifies the size of the bloom blur kernel,
|
|
233
|
+
* relative to the final output size) and threshold (The luminance threshold to find bright areas of the image to
|
|
234
|
+
* bloom).
|
|
235
|
+
* Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
|
|
236
|
+
*
|
|
237
|
+
* @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).
|
|
238
|
+
* @exposure specifies the intensity of the lightning of the view (not 3D-Model).
|
|
239
|
+
* @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
|
|
240
|
+
*/
|
|
241
|
+
'camera-settings'?: {
|
|
242
|
+
contrast: number;
|
|
243
|
+
exposure: number;
|
|
244
|
+
bloom?: {
|
|
245
|
+
enabled: boolean;
|
|
246
|
+
size?: number;
|
|
247
|
+
threshold?: number;
|
|
248
|
+
};
|
|
249
|
+
dof?: {
|
|
250
|
+
enabled: boolean;
|
|
251
|
+
settings: {};
|
|
252
|
+
};
|
|
253
|
+
sharpen?: {
|
|
254
|
+
enabled: boolean;
|
|
255
|
+
settings: {};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* {@link Viewer.screenshot} internally uses Babylon.js [ScreenshotTools.CreateScreenshotUsingRenderTarget](https://doc.babylonjs.com/typedoc/classes/babylon.screenshottools#createscreenshotusingrendertarget). \
|
|
261
|
+
* See this link for additional info about the properties.
|
|
262
|
+
*/
|
|
263
|
+
declare type ScreenshotSettings = {
|
|
264
|
+
/** Defaults to canvas width & height */
|
|
265
|
+
size?: IScreenshotSize;
|
|
266
|
+
/**
|
|
267
|
+
* Default `image/png`
|
|
268
|
+
*
|
|
269
|
+
* **Info regarding JPEG:** \
|
|
270
|
+
* Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
|
|
271
|
+
* Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't
|
|
272
|
+
* support transparency. Otherwise background will always be black for jpeg's.
|
|
273
|
+
*/
|
|
274
|
+
mimeType?: string;
|
|
275
|
+
/** Default `1` */
|
|
276
|
+
samples?: number;
|
|
277
|
+
/** Default `false` */
|
|
278
|
+
antialiasing?: boolean;
|
|
279
|
+
/** NOTE: after update to Babylon.js V6: if file name is given, the screenshot image will be downloaded and the base64
|
|
280
|
+
* string will NOT be returned! */
|
|
281
|
+
fileName?: string;
|
|
282
|
+
/** Default `false` */
|
|
283
|
+
renderSprites?: boolean;
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Use this to define geometry to be excluded from autofocus, GLB export, etc.
|
|
287
|
+
*/
|
|
288
|
+
declare type ExcludedGeometry = TransformNode | VariantInstance | Variant | VariantElement | TagManagerSubject;
|
|
289
|
+
declare type ExcludedGeometryList = ExcludedGeometry[];
|
|
290
|
+
declare type AutofocusSettings = {
|
|
291
|
+
/**
|
|
292
|
+
* Can be used to customize the margins shown around the 3d model when calling {@link Viewer.autofocusActiveCamera}.\
|
|
293
|
+
* Defaults to 1.5 when not set explicitly.
|
|
294
|
+
*/
|
|
295
|
+
radiusFactor?: number;
|
|
296
|
+
adjustWheelPrecision?: boolean;
|
|
297
|
+
adjustPanningSensibility?: boolean;
|
|
298
|
+
adjustPinchPrecision?: boolean;
|
|
299
|
+
/** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
|
|
300
|
+
alpha?: number;
|
|
301
|
+
/** Desired vertical camera angle, this won't be overwritten by the autofocus function */
|
|
302
|
+
beta?: number;
|
|
303
|
+
/** Optional animation for the focusing camera movement */
|
|
304
|
+
animation?: string | AnimationDefinition;
|
|
305
|
+
/** Optional list of geometry to be excluded from consideration */
|
|
306
|
+
exclude?: ExcludedGeometryList;
|
|
307
|
+
};
|
|
308
|
+
declare type LightDefinitions = {
|
|
309
|
+
[name: string]: LightDefinition | string;
|
|
310
|
+
};
|
|
311
|
+
declare type LightDefinition = {
|
|
312
|
+
type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
|
|
313
|
+
path?: string;
|
|
314
|
+
shadowGenerator?: ShadowGeneratorDefinition;
|
|
315
|
+
};
|
|
316
|
+
declare type ShadowGeneratorDefinition = {
|
|
317
|
+
mapSize: number;
|
|
318
|
+
[others: string]: any;
|
|
319
|
+
};
|
|
320
|
+
declare type GroundDefinitions = {
|
|
321
|
+
[ground: string]: GroundDefinition;
|
|
322
|
+
};
|
|
323
|
+
declare type GroundDefinition = {
|
|
324
|
+
type: 'baked' | 'ground' | 'heightmap';
|
|
325
|
+
meshId?: string;
|
|
326
|
+
url?: string;
|
|
327
|
+
width?: number;
|
|
328
|
+
height?: number;
|
|
329
|
+
subdivisions?: number;
|
|
330
|
+
receiveShadows?: boolean;
|
|
331
|
+
minHeight?: number;
|
|
332
|
+
maxHeight?: number;
|
|
333
|
+
alphaFilter?: number;
|
|
334
|
+
onReady?: any;
|
|
335
|
+
};
|
|
336
|
+
declare type CameraDefinitions = {
|
|
337
|
+
[camera: string]: CameraDefinition;
|
|
338
|
+
};
|
|
339
|
+
declare type CameraDefinition = {
|
|
340
|
+
/**
|
|
341
|
+
* `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).
|
|
342
|
+
*/
|
|
343
|
+
fov?: number;
|
|
344
|
+
active?: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
|
|
347
|
+
* More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
|
|
348
|
+
*
|
|
349
|
+
* NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the
|
|
350
|
+
* `Specification`, it's still possible to use them in the viewer.\
|
|
351
|
+
* For the moment all camera definitions inside these files are automatically added to the scene and can be actived
|
|
352
|
+
* using the {@link Viewer.switchCamera} function.\
|
|
353
|
+
* The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
|
|
354
|
+
*/
|
|
355
|
+
type: 'arc';
|
|
356
|
+
/**
|
|
357
|
+
* `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).
|
|
358
|
+
*/
|
|
359
|
+
target?: string;
|
|
360
|
+
};
|
|
361
|
+
declare type VariantInstanceDefinition = {
|
|
362
|
+
name?: string;
|
|
363
|
+
variant: DottedPathArgument;
|
|
364
|
+
parameters?: ParameterBag;
|
|
365
|
+
lazy?: boolean;
|
|
366
|
+
};
|
|
367
|
+
declare type SetupJson = {
|
|
368
|
+
instances: VariantInstanceDefinition[];
|
|
369
|
+
};
|
|
370
|
+
declare type ParameterDeclarations = {
|
|
371
|
+
[name: string]: ParameterDeclaration;
|
|
372
|
+
};
|
|
373
|
+
declare type ParameterDeclaration = {
|
|
374
|
+
type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl' | 'paintable';
|
|
375
|
+
parser?: any;
|
|
376
|
+
options?: ParameterValue[];
|
|
377
|
+
};
|
|
378
|
+
declare type ParameterValue = string | number | boolean;
|
|
379
|
+
declare type ParameterBag = {
|
|
380
|
+
[name: string]: ParameterValue;
|
|
381
|
+
};
|
|
382
|
+
declare type ParsedParameterBag = {
|
|
383
|
+
[name: string]: any;
|
|
384
|
+
};
|
|
385
|
+
declare type DottedPathArgument = string | string[] | DottedPath;
|
|
386
|
+
declare type ParameterObserverResult = boolean | void;
|
|
387
|
+
declare type ParameterObserver = (object: any, oldValue: Undefinable<ParameterValue>, newValue: ParameterValue) => Promise<ParameterObserverResult>;
|
|
388
|
+
declare type PlacementDefinitions = {
|
|
389
|
+
[name: string]: PlacementDefinition;
|
|
390
|
+
};
|
|
391
|
+
declare type PlacementDefinition = {
|
|
392
|
+
position?: string | Vector3;
|
|
393
|
+
alpha?: number;
|
|
394
|
+
beta?: number;
|
|
395
|
+
radius?: number;
|
|
396
|
+
target?: string | Vector3;
|
|
397
|
+
};
|
|
398
|
+
declare type AnimationDefinitions = {
|
|
399
|
+
[name: string]: AnimationDefinition;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
|
|
403
|
+
*
|
|
404
|
+
* You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
|
|
405
|
+
* liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
|
|
406
|
+
* {@link AnimationDefinition}.
|
|
407
|
+
*
|
|
408
|
+
* The `GSAPTWeenVars` are extended by the `shortestWay` property.\
|
|
409
|
+
* This property defines if the camera should move to the target position within the shortest possible distance.\
|
|
410
|
+
* If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target
|
|
411
|
+
* position and that could be > 360, which can appear very unconvenient to the operator.\
|
|
412
|
+
* The default value of this flag is `true`.
|
|
413
|
+
*
|
|
414
|
+
* Example usage in {@link SceneJson | SceneJson.animations}:
|
|
415
|
+
*
|
|
416
|
+
* ```js
|
|
417
|
+
* // ...
|
|
418
|
+
* scene: {
|
|
419
|
+
* // ...
|
|
420
|
+
* animations: {
|
|
421
|
+
* DefaultCameraAnimation: {
|
|
422
|
+
* ease: 'Power3.easeInOut',
|
|
423
|
+
* duration: 0.8,
|
|
424
|
+
* },
|
|
425
|
+
* },
|
|
426
|
+
* // ...
|
|
427
|
+
* }
|
|
428
|
+
* // ...
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
431
|
+
declare type AnimationDefinition = GSAPTweenVars & {
|
|
432
|
+
shortestWay?: boolean;
|
|
433
|
+
};
|
|
434
|
+
declare type SpecGenerationData = {
|
|
435
|
+
name: string;
|
|
436
|
+
url: string;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Key = Old tag name\
|
|
440
|
+
* Value = New tag name
|
|
441
|
+
*/
|
|
442
|
+
declare type TagMapping = {
|
|
443
|
+
[tagName: string]: string;
|
|
444
|
+
};
|
|
445
|
+
declare type TagManagerSubject = {
|
|
446
|
+
tagName?: string;
|
|
447
|
+
nodeName?: string;
|
|
448
|
+
materialName?: string;
|
|
449
|
+
};
|
|
450
|
+
declare type TagManagerParameterObserverResult = ParameterObserverResult;
|
|
451
|
+
/**
|
|
452
|
+
* The observer should return `false` in cases where the given value was not actually applied. E.g. when wanting to
|
|
453
|
+
* apply a property on the given `node`s material which doesn't exist at the time the observer is called etc.
|
|
454
|
+
*/
|
|
455
|
+
declare type TagManagerParameterObserver = (payload: TagManagerParameterObserverPayload) => Promise<TagManagerParameterObserverResult>;
|
|
456
|
+
declare type TagManagerParameterBag = FuzzyMap<TagManagerSubject, ParameterBag>;
|
|
457
|
+
declare type TagManagerParameterObserverBag = Map<string, TagManagerParameterObserver>;
|
|
458
|
+
declare type TagManagerParameterObserverPayload = {
|
|
459
|
+
subject: TagManagerSubject;
|
|
460
|
+
nodes: TransformNode[];
|
|
461
|
+
materials: Material[];
|
|
462
|
+
newValue: ParameterValue;
|
|
463
|
+
oldValue: Undefinable<ParameterValue>;
|
|
464
|
+
};
|
|
465
|
+
declare type TagManagerParameterValue = {
|
|
466
|
+
tagName?: string;
|
|
467
|
+
nodeName?: string;
|
|
468
|
+
materialName?: string;
|
|
469
|
+
parameterName: string;
|
|
470
|
+
value: ParameterValue;
|
|
471
|
+
};
|
|
472
|
+
declare type TagManagerParameterObserverResultBag = {
|
|
473
|
+
subject: TagManagerSubject;
|
|
474
|
+
parameter: string;
|
|
475
|
+
nodes: TransformNode[];
|
|
476
|
+
materials: Material[];
|
|
477
|
+
oldValue: ParameterValue;
|
|
478
|
+
newValue: ParameterValue;
|
|
479
|
+
parameterObserverResult: TagManagerParameterObserverResult;
|
|
480
|
+
};
|
|
481
|
+
declare type NodeNamingStrategyPayload = {
|
|
482
|
+
variantInstance: VariantInstance;
|
|
483
|
+
variant: Variant;
|
|
484
|
+
variantParameterizable: VariantParameterizable;
|
|
485
|
+
};
|
|
486
|
+
declare type NodeNamingStrategyHandler = (node: TransformNode, payload: NodeNamingStrategyPayload) => string;
|
|
487
|
+
declare type NodeNamingStrategy = {
|
|
488
|
+
handler: NodeNamingStrategyHandler;
|
|
489
|
+
payload: NodeNamingStrategyPayload;
|
|
490
|
+
};
|