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