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