@xeokit/xeokit-sdk 2.2.4 → 2.2.5-beta-2

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