@xeokit/xeokit-sdk 2.4.2-beta-8 → 2.4.2-beta-9
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/xeokit-sdk.cjs.js +47 -18
- package/dist/xeokit-sdk.es.js +47 -18
- package/dist/xeokit-sdk.es5.js +75 -66
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/dist/xeokit-sdk.min.es5.js +1 -1
- package/package.json +1 -1
- package/src/viewer/metadata/MetaModel.js +17 -2
- package/src/viewer/scene/model/vbo/linesInstancing/LinesInstancingLayer.js +5 -0
- package/src/viewer/scene/model/vbo/pointsInstancing/PointsInstancingLayer.js +4 -0
- package/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js +21 -16
- package/types/viewer/scene/mesh/Mesh.d.ts +7 -0
- package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +3 -609
- package/types/viewer/scene/models/SceneModel.d.ts +708 -0
- package/types/viewer/scene/models/SceneModelEntity.d.ts +418 -0
- package/types/viewer/scene/models/SceneModelMesh.d.ts +68 -0
- package/types/viewer/scene/models/SceneModelTexture.d.ts +16 -0
- package/types/viewer/scene/models/SceneModelTextureSet.d.ts +51 -0
- package/types/viewer/scene/models/SceneModelTransform.d.ts +197 -0
- package/types/viewer/scene/models/VBOSceneModel/VBOSceneModel.d.ts +2 -610
- package/types/viewer/scene/models/index.d.ts +8 -1
|
@@ -1,615 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component } from "../../Component";
|
|
3
|
-
import { EdgeMaterial, EmphasisMaterial } from "../../materials";
|
|
1
|
+
import {SceneModel} from "../SceneModel";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* A high-performance model representation for efficient rendering and low memory usage.
|
|
7
5
|
*/
|
|
8
|
-
export declare class VBOSceneModel extends
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Fires when the model is loaded
|
|
12
|
-
* @param event The loaded event
|
|
13
|
-
* @param callback Called fired on the event
|
|
14
|
-
* @param scope Scope for the callback
|
|
15
|
-
*/
|
|
16
|
-
on(event: "loaded", callback: (loaded: true) => void, scope?: any): string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Fires when the loading the model has an error
|
|
20
|
-
* @param event The error event
|
|
21
|
-
* @param callback Called fired on the event
|
|
22
|
-
* @param scope Scope for the callback
|
|
23
|
-
*/
|
|
24
|
-
on(event: "error", callback: (msg: string) => void, scope?: any): string;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Returns the {@link Entity}s in this VBOSceneModel.
|
|
28
|
-
* @returns {*|{}}
|
|
29
|
-
*/
|
|
30
|
-
get objects(): {[key: string]: Entity}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Gets the 3D World-space origin for this VBOSceneModel.
|
|
34
|
-
*
|
|
35
|
-
* Each geometry or mesh origin, if supplied, is relative to this origin.
|
|
36
|
-
*
|
|
37
|
-
* Default value is ````[0,0,0]````.
|
|
38
|
-
*
|
|
39
|
-
* @type {Number[]}
|
|
40
|
-
*/
|
|
41
|
-
get origin(): number[];
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Gets the VBOSceneModel's local translation.
|
|
45
|
-
*
|
|
46
|
-
* Default value is ````[0,0,0]````.
|
|
47
|
-
*
|
|
48
|
-
* @type {Number[]}
|
|
49
|
-
*/
|
|
50
|
-
get position(): number[];
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Gets the VBOSceneModel's local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
|
|
54
|
-
*
|
|
55
|
-
* Default value is ````[0,0,0]````.
|
|
56
|
-
*
|
|
57
|
-
* @type {Number[]}
|
|
58
|
-
*/
|
|
59
|
-
get rotation(): number[];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Gets the VBOSceneModels's local rotation quaternion.
|
|
63
|
-
*
|
|
64
|
-
* Default value is ````[0,0,0,1]````.
|
|
65
|
-
*
|
|
66
|
-
* @type {Number[]}
|
|
67
|
-
*/
|
|
68
|
-
get quaternion(): number[];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Gets the VBOSceneModel's local scale.
|
|
72
|
-
*
|
|
73
|
-
* Default value is ````[1,1,1]````.
|
|
74
|
-
*
|
|
75
|
-
* @type {Number[]}
|
|
76
|
-
*/
|
|
77
|
-
get scale(): number[];
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Gets the VBOSceneModel's local modeling transform matrix.
|
|
81
|
-
*
|
|
82
|
-
* Default value is ````[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]````.
|
|
83
|
-
*
|
|
84
|
-
* @type {Number[]}
|
|
85
|
-
*/
|
|
86
|
-
get matrix(): number[];
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Gets the VBOSceneModel's World matrix.
|
|
90
|
-
*
|
|
91
|
-
* @type {Number[]}
|
|
92
|
-
*/
|
|
93
|
-
get worldMatrix(): number[];
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Gets the VBOSceneModel's World normal matrix.
|
|
97
|
-
*
|
|
98
|
-
* @type {Number[]}
|
|
99
|
-
*/
|
|
100
|
-
get worldNormalMatrix(): number[];
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Sets if backfaces are rendered for this VBOSceneModel.
|
|
104
|
-
*
|
|
105
|
-
* Default is ````false````.
|
|
106
|
-
*
|
|
107
|
-
* @type {Boolean}
|
|
108
|
-
*/
|
|
109
|
-
get backfaces(): boolean;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Sets if backfaces are rendered for this VBOSceneModel.
|
|
113
|
-
*
|
|
114
|
-
* Default is ````false````.
|
|
115
|
-
*
|
|
116
|
-
* When we set this ````true````, then backfaces are always rendered for this VBOSceneModel.
|
|
117
|
-
*
|
|
118
|
-
* When we set this ````false````, then we allow the Viewer to decide whether to render backfaces. In this case,
|
|
119
|
-
* the Viewer will:
|
|
120
|
-
*
|
|
121
|
-
* * hide backfaces on watertight meshes,
|
|
122
|
-
* * show backfaces on open meshes, and
|
|
123
|
-
* * always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
|
|
124
|
-
*
|
|
125
|
-
* @type {Boolean}
|
|
126
|
-
*/
|
|
127
|
-
set backfaces(backfaces: boolean);
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Gets the list of {@link Entity}s within this VBOSceneModel.
|
|
131
|
-
*
|
|
132
|
-
* @returns {Entity[]}
|
|
133
|
-
*/
|
|
134
|
-
get entityList(): Entity[];
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Returns true to indicate that VBOSceneModel is an {@link Entity}.
|
|
138
|
-
* @type {Boolean}
|
|
139
|
-
*/
|
|
140
|
-
get isEntity(): boolean;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Returns ````true```` if this VBOSceneModel represents a model.
|
|
144
|
-
*
|
|
145
|
-
* When ````true```` the VBOSceneModel will be registered by {@link VBOSceneModel.id} in
|
|
146
|
-
* {@link Scene.models} and may also have a {@link MetaObject} with matching {@link MetaObject.id}.
|
|
147
|
-
*
|
|
148
|
-
* @type {Boolean}
|
|
149
|
-
*/
|
|
150
|
-
get isModel(): boolean;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Returns ````false```` to indicate that VBOSceneModel never represents an object.
|
|
154
|
-
*
|
|
155
|
-
* @type {Boolean}
|
|
156
|
-
*/
|
|
157
|
-
get isObject(): boolean;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Gets the VBOSceneModel's World-space 3D axis-aligned bounding box.
|
|
161
|
-
*
|
|
162
|
-
* Represented by a six-element Float64Array containing the min/max extents of the
|
|
163
|
-
* axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
|
|
164
|
-
*
|
|
165
|
-
* @type {Number[]}
|
|
166
|
-
*/
|
|
167
|
-
get aabb(): number[];
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* The approximate number of triangle primitives in this VBOSceneModel.
|
|
171
|
-
*
|
|
172
|
-
* @type {Number}
|
|
173
|
-
*/
|
|
174
|
-
get numTriangles(): number;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* The approximate number of line primitives in this VBOSceneModel.
|
|
178
|
-
*
|
|
179
|
-
* @type {Number}
|
|
180
|
-
*/
|
|
181
|
-
get numLines(): number;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* The approximate number of point primitives in this VBOSceneModel.
|
|
185
|
-
*
|
|
186
|
-
* @type {Number}
|
|
187
|
-
*/
|
|
188
|
-
get numPoints(): number;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Gets if any {@link Entity}s in this VBOSceneModel are visible.
|
|
192
|
-
*
|
|
193
|
-
* The VBOSceneModel is only rendered when {@link VBOSceneModel.visible} is ````true```` and {@link VBOSceneModel.culled} is ````false````.
|
|
194
|
-
*
|
|
195
|
-
* @type {Boolean}
|
|
196
|
-
*/
|
|
197
|
-
get visible(): boolean;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Sets if this VBOSceneModel is visible.
|
|
201
|
-
*
|
|
202
|
-
* The VBOSceneModel is only rendered when {@link VBOSceneModel.visible} is ````true```` and {@link VBOSceneModel.culled} is ````false````.
|
|
203
|
-
**
|
|
204
|
-
* @type {Boolean}
|
|
205
|
-
*/
|
|
206
|
-
set visible(visible: boolean);
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Gets if any {@link Entity}s in this VBOSceneModel are xrayed.
|
|
210
|
-
*
|
|
211
|
-
* @type {Boolean}
|
|
212
|
-
*/
|
|
213
|
-
get xrayed(): boolean
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Sets if all {@link Entity}s in this VBOSceneModel are xrayed.
|
|
217
|
-
*
|
|
218
|
-
* @type {Boolean}
|
|
219
|
-
*/
|
|
220
|
-
set xrayed(xrayed: boolean);
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Gets if any {@link Entity}s in this VBOSceneModel are highlighted.
|
|
224
|
-
*
|
|
225
|
-
* @type {Boolean}
|
|
226
|
-
*/
|
|
227
|
-
get highlighted(): boolean;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Sets if all {@link Entity}s in this VBOSceneModel are highlighted.
|
|
231
|
-
*
|
|
232
|
-
* @type {Boolean}
|
|
233
|
-
*/
|
|
234
|
-
set highlighted(highlighted: boolean);
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Gets if any {@link Entity}s in this VBOSceneModel are selected.
|
|
238
|
-
*
|
|
239
|
-
* @type {Boolean}
|
|
240
|
-
*/
|
|
241
|
-
get selected(): boolean;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Sets if all {@link Entity}s in this VBOSceneModel are selected.
|
|
245
|
-
*
|
|
246
|
-
* @type {Boolean}
|
|
247
|
-
*/
|
|
248
|
-
set selected(selected: boolean);
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Gets if any {@link Entity}s in this VBOSceneModel have edges emphasised.
|
|
252
|
-
*
|
|
253
|
-
* @type {Boolean}
|
|
254
|
-
*/
|
|
255
|
-
get edges(): boolean;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Sets if all {@link Entity}s in this VBOSceneModel have edges emphasised.
|
|
259
|
-
*
|
|
260
|
-
* @type {Boolean}
|
|
261
|
-
*/
|
|
262
|
-
set edges(edges: boolean);
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Gets if this VBOSceneModel is culled from view.
|
|
266
|
-
*
|
|
267
|
-
* The VBOSceneModel is only rendered when {@link VBOSceneModel.visible} is true and {@link VBOSceneModel.culled} is false.
|
|
268
|
-
*
|
|
269
|
-
* @type {Boolean}
|
|
270
|
-
*/
|
|
271
|
-
get culled(): boolean;
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Sets if this VBOSceneModel is culled from view.
|
|
275
|
-
*
|
|
276
|
-
* The VBOSceneModel is only rendered when {@link VBOSceneModel.visible} is true and {@link VBOSceneModel.culled} is false.
|
|
277
|
-
*
|
|
278
|
-
* @type {Boolean}
|
|
279
|
-
*/
|
|
280
|
-
set culled(culled: boolean);
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Gets if {@link Entity}s in this VBOSceneModel are clippable.
|
|
284
|
-
*
|
|
285
|
-
* Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
|
|
286
|
-
*
|
|
287
|
-
* @type {Boolean}
|
|
288
|
-
*/
|
|
289
|
-
get clippable(): boolean;
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Sets if {@link Entity}s in this VBOSceneModel are clippable.
|
|
293
|
-
*
|
|
294
|
-
* Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
|
|
295
|
-
*
|
|
296
|
-
* @type {Boolean}
|
|
297
|
-
*/
|
|
298
|
-
set clippable(clippable: boolean) ;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Gets if this VBOSceneModel is collidable.
|
|
302
|
-
*
|
|
303
|
-
* @type {Boolean}
|
|
304
|
-
*/
|
|
305
|
-
get collidable(): boolean;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Sets if {@link Entity}s in this VBOSceneModel are collidable.
|
|
309
|
-
*
|
|
310
|
-
* @type {Boolean}
|
|
311
|
-
*/
|
|
312
|
-
set collidable(collidable: boolean);
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Gets if this VBOSceneModel is pickable.
|
|
316
|
-
*
|
|
317
|
-
* Picking is done via calls to {@link Scene.pick}.
|
|
318
|
-
*
|
|
319
|
-
* @type {Boolean}
|
|
320
|
-
*/
|
|
321
|
-
get pickable(): boolean;
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Sets if {@link Entity}s in this VBOSceneModel are pickable.
|
|
325
|
-
*
|
|
326
|
-
* Picking is done via calls to {@link Scene.pick}.
|
|
327
|
-
*
|
|
328
|
-
* @type {Boolean}
|
|
329
|
-
*/
|
|
330
|
-
set pickable(pickable: boolean);
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Gets the RGB colorize color for this VBOSceneModel.
|
|
334
|
-
*
|
|
335
|
-
* Each element of the color is in range ````[0..1]````.
|
|
336
|
-
*
|
|
337
|
-
* @type {Number[]}
|
|
338
|
-
*/
|
|
339
|
-
get colorize(): number[];
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Sets the RGB colorize color for this VBOSceneModel.
|
|
343
|
-
*
|
|
344
|
-
* Multiplies by rendered fragment colors.
|
|
345
|
-
*
|
|
346
|
-
* Each element of the color is in range ````[0..1]````.
|
|
347
|
-
*
|
|
348
|
-
* @type {Number[]}
|
|
349
|
-
*/
|
|
350
|
-
set colorize(colorize: number[]);
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Gets this VBOSceneModel's opacity factor.
|
|
354
|
-
*
|
|
355
|
-
* This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
|
|
356
|
-
*
|
|
357
|
-
* @type {Number}
|
|
358
|
-
*/
|
|
359
|
-
get opacity(): number;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Sets the opacity factor for this VBOSceneModel.
|
|
363
|
-
*
|
|
364
|
-
* This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
|
|
365
|
-
*
|
|
366
|
-
* @type {Number}
|
|
367
|
-
*/
|
|
368
|
-
set opacity(opacity: number);
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Gets if this VBOSceneModel casts a shadow.
|
|
372
|
-
*
|
|
373
|
-
* @type {Boolean}
|
|
374
|
-
*/
|
|
375
|
-
get castsShadow(): boolean;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Sets if this VBOSceneModel casts a shadow.
|
|
379
|
-
*
|
|
380
|
-
* @type {Boolean}
|
|
381
|
-
*/
|
|
382
|
-
set castsShadow(castsShadow: boolean);
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Sets if this VBOSceneModel can have shadow cast upon it.
|
|
386
|
-
*
|
|
387
|
-
* @type {Boolean}
|
|
388
|
-
*/
|
|
389
|
-
get receivesShadow(): boolean;
|
|
390
|
-
|
|
391
|
-
/**
|
|
392
|
-
* Sets if this VBOSceneModel can have shadow cast upon it.
|
|
393
|
-
*
|
|
394
|
-
* @type {Boolean}
|
|
395
|
-
*/
|
|
396
|
-
set receivesShadow(receivesShadow: boolean) ;
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Gets if Scalable Ambient Obscurance (SAO) will apply to this VBOSceneModel.
|
|
400
|
-
*
|
|
401
|
-
* SAO is configured by the Scene's {@link SAO} component.
|
|
402
|
-
*
|
|
403
|
-
* Only works when {@link SAO.enabled} is also true.
|
|
404
|
-
*
|
|
405
|
-
* @type {Boolean}
|
|
406
|
-
*/
|
|
407
|
-
get saoEnabled(): boolean;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Gets if physically-based rendering (PBR) is enabled for this VBOSceneModel.
|
|
411
|
-
*
|
|
412
|
-
* Only works when {@link Scene.pbrEnabled} is also true.
|
|
413
|
-
*
|
|
414
|
-
* @type {Boolean}
|
|
415
|
-
*/
|
|
416
|
-
get pbrEnabled(): boolean;
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Returns true to indicate that VBOSceneModel is implements {@link Drawable}.
|
|
420
|
-
*
|
|
421
|
-
* @type {Boolean}
|
|
422
|
-
*/
|
|
423
|
-
get isDrawable(): boolean;
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Configures the appearance of xrayed {@link Entity}s within this VBOSceneModel.
|
|
427
|
-
*
|
|
428
|
-
* This is the {@link Scene.xrayMaterial}.
|
|
429
|
-
*
|
|
430
|
-
* @type {EmphasisMaterial}
|
|
431
|
-
*/
|
|
432
|
-
get xrayMaterial(): EmphasisMaterial;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Configures the appearance of highlighted {@link Entity}s within this VBOSceneModel.
|
|
436
|
-
*
|
|
437
|
-
* This is the {@link Scene.highlightMaterial}.
|
|
438
|
-
*
|
|
439
|
-
* @type {EmphasisMaterial}
|
|
440
|
-
*/
|
|
441
|
-
get highlightMaterial(): EmphasisMaterial;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Configures the appearance of selected {@link Entity}s within this VBOSceneModel.
|
|
445
|
-
*
|
|
446
|
-
* This is the {@link Scene.selectedMaterial}.
|
|
447
|
-
*
|
|
448
|
-
* @type {EmphasisMaterial}
|
|
449
|
-
*/
|
|
450
|
-
get selectedMaterial(): EmphasisMaterial;
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Configures the appearance of edges of {@link Entity}s within this VBOSceneModel.
|
|
454
|
-
*
|
|
455
|
-
* This is the {@link Scene.edgeMaterial}.
|
|
456
|
-
*
|
|
457
|
-
* @type {EdgeMaterial}
|
|
458
|
-
*/
|
|
459
|
-
get edgeMaterial(): EdgeMaterial;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Creates a reusable geometry within this VBOSceneModel.
|
|
463
|
-
*
|
|
464
|
-
* We can then supply the geometry ID to {@link VBOSceneModel.createMesh} when we want to create meshes that instance the geometry.
|
|
465
|
-
*
|
|
466
|
-
* If provide a ````positionsDecodeMatrix```` , then ````createGeometry()```` will assume
|
|
467
|
-
* that the ````positions```` and ````normals```` arrays are compressed. When compressed, ````positions```` will be
|
|
468
|
-
* quantized and in World-space, and ````normals```` will be oct-encoded and in World-space.
|
|
469
|
-
*
|
|
470
|
-
* Note that ````positions````, ````normals```` and ````indices```` are all required together.
|
|
471
|
-
*
|
|
472
|
-
* @param {*} cfg Geometry properties.
|
|
473
|
-
* @param {String|Number} cfg.id Mandatory ID for the geometry, to refer to with {@link VBOSceneModel.createMesh}.
|
|
474
|
-
* @param {String} cfg.primitive The primitive type. Accepted values are 'points', 'lines', 'triangles', 'solid' and 'surface'.
|
|
475
|
-
* @param {Number[]} cfg.positions Flat array of positions.
|
|
476
|
-
* @param {Number[]} [cfg.normals] Flat array of normal vectors. Only used with 'triangles' primitives. When no normals are given, the geometry will be flat shaded using auto-generated face-aligned normals.
|
|
477
|
-
* @param {Number[]} [cfg.colors] Flat array of RGBA vertex colors as float values in range ````[0..1]````. Ignored when ````geometryId```` is given, overidden by ````color```` and ````colorsCompressed````.
|
|
478
|
-
* @param {Number[]} [cfg.colorsCompressed] Flat array of RGBA vertex colors as unsigned short integers in range ````[0..255]````. Ignored when ````geometryId```` is given, overrides ````colors```` and is overriden by ````color````.
|
|
479
|
-
* @param {Number[]} [cfg.indices] Array of indices. Not required for `points` primitives.
|
|
480
|
-
* @param {Number[]} [cfg.edgeIndices] Array of edge line indices. Used only for Required for 'triangles' primitives. These are automatically generated internally if not supplied, using the ````edgeThreshold```` given to the ````VBOSceneModel```` constructor.
|
|
481
|
-
* @param {Number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positions````.
|
|
482
|
-
* @param {Number[]} [cfg.origin] Optional geometry origin, relative to {@link VBOSceneModel.origin}. When this is given, then every mesh created with {@link VBOSceneModel.createMesh} that uses this geometry will
|
|
483
|
-
* be transformed relative to this origin.
|
|
484
|
-
*/
|
|
485
|
-
createGeometry(cfg: {
|
|
486
|
-
id: string | number;
|
|
487
|
-
primitive: "lines" | "triangles" | "solid" | "surface";
|
|
488
|
-
positions: number[];
|
|
489
|
-
normals: number[];
|
|
490
|
-
colors: number[];
|
|
491
|
-
colorsCompressed: number[];
|
|
492
|
-
indices: number[];
|
|
493
|
-
edgeIndices: number[];
|
|
494
|
-
positionsDecodeMatrix: number[];
|
|
495
|
-
origin?: number[];
|
|
496
|
-
}): void;
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Creates a mesh within this VBOSceneModel.
|
|
500
|
-
*
|
|
501
|
-
* A mesh can either share geometry with other meshes, or have its own unique geometry.
|
|
502
|
-
*
|
|
503
|
-
* To share a geometry with other meshes, provide the ID of a geometry created earlier
|
|
504
|
-
* with {@link VBOSceneModel.createGeometry}.
|
|
505
|
-
*
|
|
506
|
-
* To create unique geometry for the mesh, provide geometry data arrays.
|
|
507
|
-
*
|
|
508
|
-
* Internally, VBOSceneModel will batch all unique mesh geometries into the same arrays, which improves
|
|
509
|
-
* rendering performance.
|
|
510
|
-
*
|
|
511
|
-
* If you accompany the arrays with a ````positionsDecodeMatrix```` , then ````createMesh()```` will assume
|
|
512
|
-
* that the ````positions```` and ````normals```` arrays are compressed. When compressed, ````positions```` will be
|
|
513
|
-
* quantized and in World-space, and ````normals```` will be oct-encoded and in World-space.
|
|
514
|
-
*
|
|
515
|
-
* If you accompany the arrays with an ````origin````, then ````createMesh()```` will assume
|
|
516
|
-
* that the ````positions```` are in relative-to-center (RTC) coordinates, with ````origin```` being the origin of their
|
|
517
|
-
* RTC coordinate system.
|
|
518
|
-
*
|
|
519
|
-
* When providing either ````positionsDecodeMatrix```` or ````origin````, ````createMesh()```` will start a new
|
|
520
|
-
* batch each time either of those two parameters change since the last call. Therefore, to combine arrays into the
|
|
521
|
-
* minimum number of batches, it's best for performance to create your shared meshes in runs that have the same value
|
|
522
|
-
* for ````positionsDecodeMatrix```` and ````origin````.
|
|
523
|
-
*
|
|
524
|
-
* Note that ````positions````, ````normals```` and ````indices```` are all required together.
|
|
525
|
-
*
|
|
526
|
-
* @param {object} cfg Object properties.
|
|
527
|
-
* @param {String} cfg.id Mandatory ID for the new mesh. Must not clash with any existing components within the {@link Scene}.
|
|
528
|
-
* @param {String|Number} [cfg.geometryId] ID of a geometry to instance, previously created with {@link VBOSceneModel.createGeometry:method"}}createMesh(){{/crossLink}}. Overrides all other geometry parameters given to this method.
|
|
529
|
-
* @param {String} [cfg.primitive="triangles"] Geometry primitive type. Ignored when ````geometryId```` is given. Accepted values are 'points', 'lines' and 'triangles'.
|
|
530
|
-
* @param {Number[]} [cfg.positions] Flat array of vertex positions. Ignored when ````geometryId```` is given.
|
|
531
|
-
* @param {Number[]} [cfg.colors] Flat array of RGB vertex colors as float values in range ````[0..1]````. Ignored when ````geometryId```` is given, overriden by ````color```` and ````colorsCompressed````.
|
|
532
|
-
* @param {Number[]} [cfg.colorsCompressed] Flat array of RGB vertex colors as unsigned short integers in range ````[0..255]````. Ignored when ````geometryId```` is given, overrides ````colors```` and is overriden by ````color````.
|
|
533
|
-
* @param {Number[]} [cfg.normals] Flat array of normal vectors. Only used with 'triangles' primitives. When no normals are given, the mesh will be flat shaded using auto-generated face-aligned normals.
|
|
534
|
-
* @param {Number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positions````.
|
|
535
|
-
* @param {Number[]} [cfg.origin] Optional geometry origin, relative to {@link VBOSceneModel.origin}. When this is given, then ````positions```` are assumed to be relative to this.
|
|
536
|
-
* @param {Number[]} [cfg.indices] Array of triangle indices. Ignored when ````geometryId```` is given.
|
|
537
|
-
* @param {Number[]} [cfg.edgeIndices] Array of edge line indices. If ````geometryId```` is not given, edge line indices are
|
|
538
|
-
* automatically generated internally if not given, using the ````edgeThreshold```` given to the ````VBOSceneModel````
|
|
539
|
-
* constructor. This parameter is ignored when ````geometryId```` is given.
|
|
540
|
-
* @param {Number[]} [cfg.position=[0,0,0]] Local 3D position. of the mesh
|
|
541
|
-
* @param {Number[]} [cfg.scale=[1,1,1]] Scale of the mesh.
|
|
542
|
-
* @param {Number[]} [cfg.rotation=[0,0,0]] Rotation of the mesh as Euler angles given in degrees, for each of the X, Y and Z axis.
|
|
543
|
-
* @param {Number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] Mesh modelling transform matrix. Overrides the ````position````, ````scale```` and ````rotation```` parameters.
|
|
544
|
-
* @param {Number[]} [cfg.color=[1,1,1]] RGB color in range ````[0..1, 0..`, 0..1]````. Overrides ````colors```` and ````colorsCompressed````.
|
|
545
|
-
* @param {Number} [cfg.opacity=1] Opacity in range ````[0..1]````.
|
|
546
|
-
*/
|
|
547
|
-
createMesh(cfg: {
|
|
548
|
-
id: string;
|
|
549
|
-
geometryId?: string | number;
|
|
550
|
-
primitive: "lines" | "triangles" | "points";
|
|
551
|
-
positions: number[];
|
|
552
|
-
normals: number[];
|
|
553
|
-
colors: number[];
|
|
554
|
-
colorsCompressed: number[];
|
|
555
|
-
indices: number[];
|
|
556
|
-
edgeIndices: number[];
|
|
557
|
-
positionsDecodeMatrix: number[];
|
|
558
|
-
origin?: number[];
|
|
559
|
-
position?: number[];
|
|
560
|
-
scale?: number[];
|
|
561
|
-
rotation?: number[];
|
|
562
|
-
matrix?: number[];
|
|
563
|
-
color?: number[];
|
|
564
|
-
opacity?: number;
|
|
565
|
-
}): void;
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* Creates an {@link Entity} within this VBOSceneModel, giving it one or more meshes previously created with {@link VBOSceneModel.createMesh}.
|
|
569
|
-
*
|
|
570
|
-
* A mesh can only belong to one {@link Entity}, so you'll get an error if you try to reuse a mesh among multiple {@link Entity}s.
|
|
571
|
-
*
|
|
572
|
-
* @param {Object} cfg Entity configuration.
|
|
573
|
-
* @param {String} cfg.id Optional ID for the new Entity. Must not clash with any existing components within the {@link Scene}.
|
|
574
|
-
* @param {String[]} cfg.meshIds IDs of one or more meshes created previously with {@link VBOSceneModel@createMesh}.
|
|
575
|
-
|
|
576
|
-
* @param {Boolean} [cfg.isObject] Set ````true```` if the {@link Entity} represents an object, in which case it will be registered by {@link Entity.id} in {@link Scene.objects} and can also have a corresponding {@link MetaObject} with matching {@link MetaObject.id}, registered by that ID in {@link MetaScene.metaObjects}.
|
|
577
|
-
* @param {Boolean} [cfg.visible=true] Indicates if the Entity is initially visible.
|
|
578
|
-
* @param {Boolean} [cfg.culled=false] Indicates if the Entity is initially culled from view.
|
|
579
|
-
* @param {Boolean} [cfg.pickable=true] Indicates if the Entity is initially pickable.
|
|
580
|
-
* @param {Boolean} [cfg.clippable=true] Indicates if the Entity is initially clippable.
|
|
581
|
-
* @param {Boolean} [cfg.collidable=true] Indicates if the Entity is initially included in boundary calculations.
|
|
582
|
-
* @param {Boolean} [cfg.castsShadow=true] Indicates if the Entity initially casts shadows.
|
|
583
|
-
* @param {Boolean} [cfg.receivesShadow=true] Indicates if the Entity initially receives shadows.
|
|
584
|
-
* @param {Boolean} [cfg.xrayed=false] Indicates if the Entity is initially xrayed. XRayed appearance is configured by {@link VBOSceneModel.xrayMaterial}.
|
|
585
|
-
* @param {Boolean} [cfg.highlighted=false] Indicates if the Entity is initially highlighted. Highlighted appearance is configured by {@link VBOSceneModel.highlightMaterial}.
|
|
586
|
-
* @param {Boolean} [cfg.selected=false] Indicates if the Entity is initially selected. Selected appearance is configured by {@link VBOSceneModel.selectedMaterial}.
|
|
587
|
-
* @param {Boolean} [cfg.edges=false] Indicates if the Entity's edges are initially emphasized. Edges appearance is configured by {@link VBOSceneModel.edgeMaterial}.
|
|
588
|
-
* @returns {Entity}
|
|
589
|
-
*/
|
|
590
|
-
createEntity(cfg: {
|
|
591
|
-
id: string;
|
|
592
|
-
meshIds: string[]
|
|
593
|
-
isObject: boolean;
|
|
594
|
-
visible?: boolean;
|
|
595
|
-
culled?: boolean;
|
|
596
|
-
pickable?: boolean;
|
|
597
|
-
clippable?: boolean;
|
|
598
|
-
collidable?: boolean;
|
|
599
|
-
castsShadow?: boolean;
|
|
600
|
-
receivesShadow?: boolean;
|
|
601
|
-
xrayed?: boolean;
|
|
602
|
-
highlighted?: boolean;
|
|
603
|
-
selected?: boolean;
|
|
604
|
-
edges?: boolean;
|
|
605
|
-
}): Entity;
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Finalizes this VBOSceneModel.
|
|
609
|
-
*
|
|
610
|
-
* Immediately creates the VBOSceneModel's {@link Entity}s within the {@link Scene}.
|
|
611
|
-
*
|
|
612
|
-
* Once finalized, you can't add anything more to this VBOSceneModel.
|
|
613
|
-
*/
|
|
614
|
-
finalize(): void;
|
|
6
|
+
export declare class VBOSceneModel extends SceneModel {
|
|
615
7
|
}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export * from "./VBOSceneModel/";
|
|
1
|
+
export * from "./VBOSceneModel/";
|
|
2
|
+
export * from "./PerformanceModel/";
|
|
3
|
+
export * from "./SceneModel";
|
|
4
|
+
export * from "./SceneModelMesh";
|
|
5
|
+
export * from "./SceneModelTransform";
|
|
6
|
+
export * from "./SceneModelTexture";
|
|
7
|
+
export * from "./SceneModelTextureSet";
|
|
8
|
+
export * from "./SceneModelEntity";
|