@combeenation/3d-viewer 4.2.0 → 5.0.0-alpha1
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 +2 -2
- package/dist/lib-cjs/api/classes/dottedPath.js +2 -5
- package/dist/lib-cjs/api/classes/dottedPath.js.map +1 -1
- package/dist/lib-cjs/api/classes/element.d.ts +9 -0
- package/dist/lib-cjs/api/classes/element.js +114 -66
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/event.js.map +1 -1
- package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameter.js +3 -2
- package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -1
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +1 -0
- package/dist/lib-cjs/api/classes/placementAnimation.js +2 -2
- package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
- package/dist/lib-cjs/api/classes/variant.js +26 -19
- package/dist/lib-cjs/api/classes/variant.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantInstance.js +19 -19
- package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewer.d.ts +40 -1
- package/dist/lib-cjs/api/classes/viewer.js +144 -48
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewerLight.js +25 -25
- package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
- package/dist/lib-cjs/api/internal/debugViewer.js +1 -2
- package/dist/lib-cjs/api/internal/debugViewer.js.map +1 -1
- package/dist/lib-cjs/api/internal/lensRendering.js.map +1 -1
- package/dist/lib-cjs/api/internal/sceneSetup.js +25 -22
- package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
- package/dist/lib-cjs/api/manager/animationManager.js +24 -15
- package/dist/lib-cjs/api/manager/animationManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +40 -10
- package/dist/lib-cjs/api/manager/gltfExportManager.js +135 -20
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.js +3 -3
- package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +10 -7
- package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
- package/dist/lib-cjs/api/store/specStorage.js.map +1 -1
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +1 -1
- package/dist/lib-cjs/api/util/babylonHelper.js +12 -15
- package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/globalTypes.d.ts +41 -25
- package/dist/lib-cjs/api/util/resourceHelper.js +3 -1
- package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/stringHelper.d.ts +1 -1
- package/dist/lib-cjs/api/util/stringHelper.js +2 -2
- package/dist/lib-cjs/api/util/stringHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -0
- package/dist/lib-cjs/api/util/structureHelper.js +45 -0
- package/dist/lib-cjs/api/util/structureHelper.js.map +1 -0
- package/dist/lib-cjs/index.js +1 -0
- package/dist/lib-cjs/index.js.map +1 -1
- package/package.json +11 -7
- package/src/api/classes/animationInterface.ts +4 -6
- package/src/api/classes/dottedPath.ts +179 -187
- package/src/api/classes/element.ts +665 -621
- package/src/api/classes/event.ts +310 -313
- package/src/api/classes/eventBroadcaster.ts +47 -49
- package/src/api/classes/parameter.ts +394 -397
- package/src/api/classes/parameterObservable.ts +84 -83
- package/src/api/classes/parameterizable.ts +71 -73
- package/src/api/classes/placementAnimation.ts +130 -130
- package/src/api/classes/variant.ts +806 -778
- package/src/api/classes/variantInstance.ts +60 -52
- package/src/api/classes/variantParameterizable.ts +72 -67
- package/src/api/classes/viewer.ts +592 -490
- package/src/api/classes/viewerLight.ts +301 -301
- package/src/api/internal/debugViewer.ts +61 -53
- package/src/api/internal/lensRendering.ts +2 -3
- package/src/api/internal/sceneSetup.ts +144 -137
- package/src/api/manager/animationManager.ts +122 -97
- package/src/api/manager/gltfExportManager.ts +192 -0
- package/src/api/manager/sceneManager.ts +83 -86
- package/src/api/manager/variantInstanceManager.ts +234 -224
- package/src/api/store/specStorage.ts +48 -51
- package/src/api/util/babylonHelper.ts +329 -325
- package/src/api/util/globalTypes.ts +260 -246
- package/src/api/util/resourceHelper.ts +97 -109
- package/src/api/util/stringHelper.ts +13 -16
- package/src/api/util/structureHelper.ts +43 -0
- package/src/buildinfo.json +2 -2
- package/src/commonjs.tsconfig.json +8 -11
- package/src/declaration.tsconfig.json +6 -8
- package/src/dev.ts +28 -29
- package/src/es6.tsconfig.json +8 -11
- package/src/index.ts +40 -39
- package/src/pagesconfig.json +4 -0
- package/src/tsconfig.json +30 -41
- package/src/tsconfig.types.json +8 -9
- package/src/types.d.ts +0 -1
- package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +0 -14
- package/dist/lib-cjs/api/classes/elementParameterizable.js +0 -135
- package/dist/lib-cjs/api/classes/elementParameterizable.js.map +0 -1
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
// global accessible types imported from 3d-viewer
|
|
2
|
-
type Viewer = import(
|
|
3
|
-
type Variant = import(
|
|
4
|
-
type VariantInstance = import(
|
|
2
|
+
type Viewer = import('../classes/viewer').Viewer;
|
|
3
|
+
type Variant = import('../classes/variant').Variant;
|
|
4
|
+
type VariantInstance = import('../classes/variantInstance').VariantInstance;
|
|
5
5
|
/**
|
|
6
6
|
* Alias for {@link Element} which can be used to prevent name clashes with the web APIs
|
|
7
7
|
* [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) class
|
|
8
8
|
*/
|
|
9
|
-
type VariantElement = import(
|
|
10
|
-
type DottedPath = import(
|
|
11
|
-
type ViewerLight = import(
|
|
9
|
+
type VariantElement = import('../classes/element').Element;
|
|
10
|
+
type DottedPath = import('../classes/dottedPath').DottedPath;
|
|
11
|
+
type ViewerLight = import('../classes/viewerLight').ViewerLight;
|
|
12
12
|
|
|
13
13
|
// global accessible types imported from BabylonJS
|
|
14
|
-
type Scene = import(
|
|
15
|
-
type Vector3 = import(
|
|
16
|
-
type Color3 = import(
|
|
17
|
-
type Color4 = import(
|
|
18
|
-
type Material = import(
|
|
19
|
-
type PBRMaterial = import(
|
|
20
|
-
type StandardMaterial = import(
|
|
21
|
-
type DynamicTexture = import(
|
|
22
|
-
type Mesh = import(
|
|
23
|
-
type AbstractMesh = import(
|
|
24
|
-
type InstancedMesh = import(
|
|
25
|
-
type TransformNode = import(
|
|
26
|
-
type Engine = import(
|
|
27
|
-
type EngineOptions = import(
|
|
28
|
-
type ArcRotateCamera = import(
|
|
29
|
-
type IScreenshotSize = import(
|
|
14
|
+
type Scene = import('@babylonjs/core/scene').Scene;
|
|
15
|
+
type Vector3 = import('@babylonjs/core/Maths/math.vector').Vector3;
|
|
16
|
+
type Color3 = import('@babylonjs/core/Maths/math.color').Color3;
|
|
17
|
+
type Color4 = import('@babylonjs/core/Maths/math.color').Color4;
|
|
18
|
+
type Material = import('@babylonjs/core/Materials/material').Material;
|
|
19
|
+
type PBRMaterial = import('@babylonjs/core/Materials/PBR/pbrMaterial').PBRMaterial;
|
|
20
|
+
type StandardMaterial = import('@babylonjs/core/Materials/standardMaterial').StandardMaterial;
|
|
21
|
+
type DynamicTexture = import('@babylonjs/core/Materials/Textures/dynamicTexture').DynamicTexture;
|
|
22
|
+
type Mesh = import('@babylonjs/core/Meshes/mesh').Mesh;
|
|
23
|
+
type AbstractMesh = import('@babylonjs/core/Meshes/abstractMesh').AbstractMesh;
|
|
24
|
+
type InstancedMesh = import('@babylonjs/core/Meshes/instancedMesh').InstancedMesh;
|
|
25
|
+
type TransformNode = import('@babylonjs/core/Meshes/transformNode').TransformNode;
|
|
26
|
+
type Engine = import('@babylonjs/core/Engines/engine').Engine;
|
|
27
|
+
type EngineOptions = import('@babylonjs/core/Engines/thinEngine').EngineOptions;
|
|
28
|
+
type ArcRotateCamera = import('@babylonjs/core/Cameras/arcRotateCamera').ArcRotateCamera;
|
|
29
|
+
type IScreenshotSize = import('@babylonjs/core/Misc/interfaces/screenshotSize').IScreenshotSize;
|
|
30
30
|
type BabylonAnimation = import('@babylonjs/core/Animations/animation').Animation;
|
|
31
31
|
type CubeTexture = import('@babylonjs/core/Materials/Textures/cubeTexture').CubeTexture;
|
|
32
|
-
type MeshBuilder = import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
|
|
32
|
+
type MeshBuilder = typeof import('@babylonjs/core/Meshes/meshBuilder').MeshBuilder;
|
|
33
33
|
type Texture = import('@babylonjs/core/Materials/Textures/texture').Texture;
|
|
34
34
|
type HemisphericLight = import('@babylonjs/core/Lights/hemisphericLight').HemisphericLight;
|
|
35
35
|
type DirectionalLight = import('@babylonjs/core/Lights/directionalLight').DirectionalLight;
|
|
36
|
+
type IInspectorOptions = import('@babylonjs/core/Debug').IInspectorOptions;
|
|
36
37
|
// Node is already defined in lib.dom.d.ts, so it can't be declared that way
|
|
37
38
|
// type Node = import("@babylonjs/core/node").Node;
|
|
38
39
|
|
|
@@ -40,163 +41,173 @@ type EventEmitter = import('eventemitter3');
|
|
|
40
41
|
|
|
41
42
|
// some more global accessible types
|
|
42
43
|
type PathDefinitions = {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
include: string[];
|
|
45
|
+
exclude?: string[];
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
type TraceableDefinition = {
|
|
48
|
-
|
|
49
|
+
path: string;
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
type TraceableDefinitions = {
|
|
52
|
-
|
|
53
|
+
[name: string]: TraceableDefinition;
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
type PaintableDefinition = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
path: string;
|
|
58
|
+
textureOptions:
|
|
59
|
+
| {
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
}
|
|
63
|
+
| number;
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
type PaintableDefinitions = {
|
|
64
|
-
|
|
67
|
+
[name: string]: PaintableDefinition;
|
|
65
68
|
};
|
|
66
69
|
|
|
67
70
|
type Asset = {
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
rootUrl: string;
|
|
72
|
+
fileName: string | undefined;
|
|
70
73
|
};
|
|
71
74
|
|
|
72
75
|
type ElementDefinitions = {
|
|
73
|
-
|
|
76
|
+
[name: string]: ElementDefinition | string[];
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
type ElementDefinition = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
paths: PathDefinitions;
|
|
81
|
+
traceables?: TraceableDefinitions;
|
|
82
|
+
paintables?: PaintableDefinitions;
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
type TransformationDefinition = {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
scaling: Vector3;
|
|
87
|
+
position: Vector3;
|
|
88
|
+
rotation: Vector3;
|
|
86
89
|
};
|
|
87
90
|
|
|
88
91
|
type StructureJson = {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
92
|
+
/**
|
|
93
|
+
* `scene` describes the visualisation of the Babylon `scene` such as the incidence of light and camera position. If a
|
|
94
|
+
* string is given, the {@link Viewer} will resolve the URL or path and pass the parsed JSON to this property.
|
|
95
|
+
*/
|
|
96
|
+
scene?: string | SceneJson;
|
|
97
|
+
/**
|
|
98
|
+
* `setup` is a kind of construction plan for the {@link Viewer}. You can pass a {@link SetupJson} or a string, which
|
|
99
|
+
* must represent a valid URL or path. If a string is given, the {@link Viewer} will resolve the URL or path and pass
|
|
100
|
+
* the parsed JSON to this property. The {@link SetupJson} is responsible for managing a list of
|
|
101
|
+
* {@link VariantInstanceDefinition}s. These definitions define the instances that should be instantiated during the
|
|
102
|
+
* bootstrapping process. Each instance has a name and a reference to it's {@link Variant}.
|
|
103
|
+
*/
|
|
104
|
+
setup?: string | SetupJson;
|
|
105
|
+
file?: string;
|
|
106
|
+
glTF?: Asset | string;
|
|
107
|
+
parameterDeclaration?: ParameterDeclarations;
|
|
108
|
+
parameters?: ParameterBag;
|
|
109
|
+
elements?: ElementDefinitions;
|
|
110
|
+
lights?: LightDefinitions;
|
|
111
|
+
grounds?: GroundDefinitions;
|
|
112
|
+
/**
|
|
113
|
+
* `variants` is a declarative description of 3D-model variations in the configurator. Each variant itself is a
|
|
114
|
+
* {@link StructureJson} which must at least define a `name` in the key of the list and the properties `glTF` and
|
|
115
|
+
* `elements` in the value. FYI: BabylonJS's sandbox can show you the path of the 3D-model to properly define the
|
|
116
|
+
* `paths`.
|
|
117
|
+
*
|
|
118
|
+
* Example Code
|
|
119
|
+
* ```js
|
|
120
|
+
* variants: {
|
|
121
|
+
* 'My Pretty Variant' {
|
|
122
|
+
* glTF: {
|
|
123
|
+
* rootUrl: 'https:/my.awesome.domain/path/to/my/project/',
|
|
124
|
+
* fileName: 'my_3d_model_file.glb',
|
|
125
|
+
* },
|
|
126
|
+
* elements: {
|
|
127
|
+
* 'My Little Element': {
|
|
128
|
+
* paths: {
|
|
129
|
+
* includes: ['__root__.MeshName']
|
|
130
|
+
* }
|
|
131
|
+
* }
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
* `MeshName` has to be identical to the path in the glb-file of the 3D-model.
|
|
137
|
+
*/
|
|
138
|
+
variants?: {
|
|
139
|
+
[id: string]: StructureJson;
|
|
140
|
+
};
|
|
138
141
|
};
|
|
139
142
|
|
|
140
143
|
type SceneJson = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
parameterDeclaration?: ParameterDeclarations;
|
|
145
|
+
parameters?: ParameterBag;
|
|
146
|
+
meshPicking?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Information about [EngineOptions](https://doc.babylonjs.com/typedoc/interfaces/babylon.engineoptions).
|
|
149
|
+
*/
|
|
150
|
+
engine?: {
|
|
151
|
+
antialiasing?: boolean;
|
|
152
|
+
options?: EngineOptions;
|
|
153
|
+
};
|
|
154
|
+
scene: SceneDefinition;
|
|
155
|
+
animations?: AnimationDefinitions;
|
|
156
|
+
placements?: PlacementDefinitions;
|
|
157
|
+
/**
|
|
158
|
+
* Information about [material cloning](pages/Release%20Notes/releases/4-3-0.html#material-cloning-on-mutation)
|
|
159
|
+
*/
|
|
160
|
+
cloneMaterialsOnMutation?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Set dedicated [scene flag](https://doc.babylonjs.com/typedoc/classes/babylon.scene#userighthandedsystem) on creation
|
|
163
|
+
*/
|
|
164
|
+
useRightHandedSystem?: boolean;
|
|
154
165
|
};
|
|
155
166
|
|
|
156
167
|
type SceneDefinition = {
|
|
157
|
-
|
|
158
|
-
|
|
168
|
+
globals: SceneGlobals;
|
|
169
|
+
cameras?: CameraDefinitions;
|
|
159
170
|
};
|
|
160
171
|
|
|
161
172
|
type SceneGlobals = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
173
|
+
'shadows'?: {
|
|
174
|
+
enabled: boolean;
|
|
175
|
+
type: 'contact';
|
|
176
|
+
settings: [];
|
|
177
|
+
generator: [];
|
|
178
|
+
receiver: [];
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* `aa` or anti aliasing is not needed if hard edges are desired.\
|
|
182
|
+
* FYI: aa smooths edges and avoids stairs-effects.
|
|
183
|
+
*/
|
|
184
|
+
'aa'?: 'fxaa';
|
|
185
|
+
'tone-mapping'?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* @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).
|
|
188
|
+
* Further Information under [BloomEffect](https://doc.babylonjs.com/typedoc/classes/babylon.bloomeffect).
|
|
189
|
+
*
|
|
190
|
+
* @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).
|
|
191
|
+
* @exposure specifies the intensity of the lightning of the view (not 3D-Model).
|
|
192
|
+
* @sharpen´s parameter `settings` are listed in [Default Rendering Pipeline Sharpening link](https://doc.babylonjs.com/divingDeeper/postProcesses/defaultRenderingPipeline#sharpening).
|
|
193
|
+
*/
|
|
194
|
+
'camera-settings'?: {
|
|
195
|
+
contrast: number;
|
|
196
|
+
exposure: number;
|
|
197
|
+
bloom?: {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
size?: number;
|
|
200
|
+
threshold?: number;
|
|
201
|
+
};
|
|
202
|
+
dof?: {
|
|
203
|
+
enabled: boolean;
|
|
204
|
+
settings: {};
|
|
205
|
+
};
|
|
206
|
+
sharpen?: {
|
|
207
|
+
enabled: boolean;
|
|
208
|
+
settings: {};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
200
211
|
};
|
|
201
212
|
|
|
202
213
|
/**
|
|
@@ -204,176 +215,179 @@ type SceneGlobals = {
|
|
|
204
215
|
* See this link for additional info about the properties.
|
|
205
216
|
*/
|
|
206
217
|
type ScreenshotSettings = {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
/** Defaults to canvas width & height */
|
|
219
|
+
size?: IScreenshotSize;
|
|
220
|
+
/**
|
|
221
|
+
* Default `image/png`
|
|
222
|
+
*
|
|
223
|
+
* **Info regarding JPEG:** \
|
|
224
|
+
* Use mimeType `image/jpeg` (**not** `image/jpg`) when creating jpeg's. \
|
|
225
|
+
* Also ensure that {@link Scene.clearColor | viewer.scene.clearColor} has an alpha value of `1` as jpeg's don't support
|
|
226
|
+
* transparency. Otherwise background will always be black for jpeg's.
|
|
227
|
+
*/
|
|
228
|
+
mimeType?: string;
|
|
229
|
+
/** Default `1` */
|
|
230
|
+
samples?: number;
|
|
231
|
+
/** Default `false` */
|
|
232
|
+
antialiasing?: boolean;
|
|
233
|
+
/** Default `screenshot.png` */
|
|
234
|
+
fileName?: string;
|
|
235
|
+
/** Default `false` */
|
|
236
|
+
renderSprites?: boolean;
|
|
226
237
|
};
|
|
227
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Use this to define geometry to be excluded from autofocus, GLB export, etc.
|
|
241
|
+
*/
|
|
242
|
+
type ExcludedGeometry = (Mesh | VariantInstance | Variant | VariantElement)[];
|
|
243
|
+
|
|
228
244
|
type AutofocusSettings = {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Can be used to customize the margins shown around the 3d model when calling {@link autofocusActiveCamera}.\
|
|
247
|
+
* Defaults to 1.5 when not set explicitly.
|
|
248
|
+
*/
|
|
249
|
+
radiusFactor?: number;
|
|
250
|
+
adjustWheelPrecision?: boolean;
|
|
251
|
+
adjustPanningSensibility?: boolean;
|
|
252
|
+
adjustPinchPrecision?: boolean;
|
|
253
|
+
/** Desired horizontal camera angle, this won't be overwritten by the autofocus function */
|
|
254
|
+
alpha?: number;
|
|
255
|
+
/** Desired vertical camera angle, this won't be overwritten by the autofocus function */
|
|
256
|
+
beta?: number;
|
|
257
|
+
/** Optional animation for the focusing camera movement */
|
|
258
|
+
animation?: string | AnimationDefinition;
|
|
259
|
+
/** Optional list of geometry to be excluded from consideration */
|
|
260
|
+
exclude?: ExcludedGeometry;
|
|
243
261
|
};
|
|
244
262
|
|
|
245
263
|
type LightDefinitions = {
|
|
246
|
-
|
|
264
|
+
[name: string]: LightDefinition | string;
|
|
247
265
|
};
|
|
248
266
|
|
|
249
267
|
type LightDefinition = {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
268
|
+
type: 'baked' | 'hemispheric' | 'point' | 'directional' | 'spot';
|
|
269
|
+
path?: string;
|
|
270
|
+
shadowGenerator?: ShadowGeneratorDefinition;
|
|
253
271
|
};
|
|
254
272
|
|
|
255
273
|
type ShadowGeneratorDefinition = {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
274
|
+
mapSize: number;
|
|
275
|
+
[others: string]: any;
|
|
276
|
+
/**
|
|
277
|
+
* Further properties like `usePoissonSampling` are set directly on the ShadowGenerator object.
|
|
278
|
+
* [Shadows](https://doc.babylonjs.com/divingDeeper/lights/shadows)
|
|
279
|
+
*/
|
|
262
280
|
};
|
|
263
281
|
|
|
264
282
|
type GroundDefinitions = {
|
|
265
|
-
|
|
283
|
+
[ground: string]: GroundDefinition;
|
|
266
284
|
};
|
|
267
285
|
|
|
268
286
|
type GroundDefinition = {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
287
|
+
type: 'baked' | 'ground' | 'heightmap';
|
|
288
|
+
meshId?: string;
|
|
289
|
+
url?: string;
|
|
290
|
+
width?: number;
|
|
291
|
+
height?: number;
|
|
292
|
+
subdivisions?: number;
|
|
293
|
+
receiveShadows?: boolean;
|
|
294
|
+
minHeight?: number;
|
|
295
|
+
maxHeight?: number;
|
|
296
|
+
alphaFilter?: number;
|
|
297
|
+
onReady?: any;
|
|
280
298
|
};
|
|
281
299
|
|
|
282
300
|
type CameraDefinitions = {
|
|
283
|
-
|
|
301
|
+
[camera: string]: CameraDefinition;
|
|
284
302
|
};
|
|
285
303
|
|
|
286
304
|
type CameraDefinition = {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
+
/**
|
|
306
|
+
* `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).
|
|
307
|
+
*/
|
|
308
|
+
fov?: number;
|
|
309
|
+
active?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* `arc` is a default camera position where the 3D-model is the center and the camera rotates around the 3D-model.
|
|
312
|
+
* More Information about `arc` in [ArcRotateCamera](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera).
|
|
313
|
+
*
|
|
314
|
+
* NOTE: While "baked" camera definitions from a GLB or babylon file can currently not be instatiated within the `Specification`, it's still possible to use them in the viewer.\
|
|
315
|
+
* For the moment all camera definitions inside these files are automatically added to the scene and can be actived using the {@link switchCamera} function.\
|
|
316
|
+
* The `newCamera` input has to match the name of the camera node inside the GLB/babylon file.
|
|
317
|
+
*/
|
|
318
|
+
type: 'arc';
|
|
319
|
+
/**
|
|
320
|
+
* `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).
|
|
321
|
+
*/
|
|
322
|
+
target?: string;
|
|
305
323
|
};
|
|
306
324
|
|
|
307
325
|
type VariantInstanceDefinition = {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
326
|
+
name?: string;
|
|
327
|
+
variant: DottedPathArgument;
|
|
328
|
+
parameters?: ParameterBag;
|
|
329
|
+
lazy?: boolean;
|
|
312
330
|
};
|
|
313
331
|
|
|
314
332
|
type SetupJson = {
|
|
315
|
-
|
|
333
|
+
instances: VariantInstanceDefinition[];
|
|
316
334
|
};
|
|
317
335
|
|
|
318
336
|
type ParameterDeclarations = {
|
|
319
|
-
|
|
337
|
+
[name: string]: ParameterDeclaration;
|
|
320
338
|
};
|
|
321
339
|
|
|
322
340
|
type ParameterDeclaration = {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
341
|
+
type: 'string' | 'boolean' | 'number' | 'color' | 'select' | 'vector' | 'csl';
|
|
342
|
+
parser?: any;
|
|
343
|
+
options?: ParameterValue[];
|
|
326
344
|
};
|
|
327
345
|
|
|
328
346
|
type ParameterValue = string | number | boolean;
|
|
329
347
|
|
|
330
348
|
type ParameterBag = {
|
|
331
|
-
|
|
349
|
+
[name: string]: ParameterValue;
|
|
332
350
|
};
|
|
333
351
|
|
|
334
352
|
type ParsedParameterBag = {
|
|
335
|
-
|
|
353
|
+
[name: string]: any;
|
|
336
354
|
};
|
|
337
355
|
|
|
338
356
|
type DottedPathArgument = string | string[] | DottedPath;
|
|
339
357
|
|
|
340
|
-
type ParameterObserver = (
|
|
341
|
-
object: any,
|
|
342
|
-
oldValue: ParameterValue,
|
|
343
|
-
newValue: ParameterValue
|
|
344
|
-
) => void;
|
|
358
|
+
type ParameterObserver = (object: any, oldValue: ParameterValue, newValue: ParameterValue) => void;
|
|
345
359
|
|
|
346
360
|
type PlacementDefinitions = {
|
|
347
|
-
|
|
361
|
+
[name: string]: PlacementDefinition;
|
|
348
362
|
};
|
|
349
363
|
|
|
350
364
|
type PlacementDefinition = {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
365
|
+
position?: string | Vector3;
|
|
366
|
+
alpha?: number;
|
|
367
|
+
beta?: number;
|
|
368
|
+
radius?: number;
|
|
369
|
+
target?: string | Vector3;
|
|
356
370
|
};
|
|
357
371
|
|
|
358
372
|
type AnimationDefinitions = {
|
|
359
|
-
|
|
373
|
+
[name: string]: AnimationDefinition;
|
|
360
374
|
};
|
|
361
375
|
|
|
362
376
|
/**
|
|
363
377
|
* See [GSAP API Docs](https://greensock.com/docs/v3/GSAP/Tween/vars) for description of `GSAPTWeenVars`.
|
|
364
|
-
*
|
|
378
|
+
*
|
|
365
379
|
* You can use the [GreenSock Ease Visualizer](https://greensock.com/ease-visualizer/) to create an animation of your
|
|
366
380
|
* liking and simply copy the `ease` function shown at the bottom of the visualizer into the `ease` property of your
|
|
367
381
|
* {@link AnimationDefinition}.
|
|
368
|
-
*
|
|
382
|
+
*
|
|
369
383
|
* The `GSAPTWeenVars` are extended by the `shortestWay` property.\
|
|
370
384
|
* This property defines if the camera should move to the target position within the shortest possible distance.\
|
|
371
385
|
* If `shortestWay` is `false`, the camera moves the whole difference between the current camera position and the target position
|
|
372
386
|
* and that could be > 360, which can appear very unconvenient to the operator.\
|
|
373
387
|
* The default value of this flag is `true`.
|
|
374
|
-
*
|
|
388
|
+
*
|
|
375
389
|
* Example usage in {@link SceneJson | SceneJson.animations}:
|
|
376
|
-
*
|
|
390
|
+
*
|
|
377
391
|
* ```js
|
|
378
392
|
* // ...
|
|
379
393
|
* scene: {
|
|
@@ -389,4 +403,4 @@ type AnimationDefinitions = {
|
|
|
389
403
|
* // ...
|
|
390
404
|
* ```
|
|
391
405
|
*/
|
|
392
|
-
type AnimationDefinition = GSAPTweenVars & { shortestWay?: boolean }
|
|
406
|
+
type AnimationDefinition = GSAPTweenVars & { shortestWay?: boolean };
|