@xtctwins/tctwins-core 1.1.18 → 1.1.20

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 (151) hide show
  1. package/README.md +4 -4
  2. package/dist/tctwins-core.es5.js +27337 -27310
  3. package/dist/tctwins-core.min.es5.js +3 -3
  4. package/package.json +84 -84
  5. package/types/extras/ContextMenu/ContextMenu.d.ts +127 -127
  6. package/types/extras/ContextMenu/index.d.ts +1 -1
  7. package/types/extras/PointerCircle/PointerCircle.d.ts +51 -51
  8. package/types/extras/PointerCircle/index.d.ts +1 -1
  9. package/types/extras/PointerLens/PointerLens.d.ts +146 -146
  10. package/types/extras/index.d.ts +3 -3
  11. package/types/index.d.ts +3 -3
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +204 -204
  13. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +91 -91
  14. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +125 -125
  15. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +151 -151
  16. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsSimulateMouseControl.d.ts +86 -86
  17. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +124 -124
  18. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +5 -5
  19. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -135
  20. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +172 -172
  21. package/types/plugins/AnnotationsPlugin/index.d.ts +2 -2
  22. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +148 -148
  23. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -1
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +253 -253
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +96 -96
  26. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.d.ts +102 -102
  27. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +192 -192
  28. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsSimulateMouseControl.d.ts +83 -83
  29. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.d.ts +103 -103
  30. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +5 -5
  31. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +223 -223
  32. package/types/plugins/FastNavPlugin/index.d.ts +1 -1
  33. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +142 -142
  34. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -1
  35. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +240 -240
  36. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -1
  37. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +177 -177
  38. package/types/plugins/NavCubePlugin/index.d.ts +1 -1
  39. package/types/plugins/ObjectEditPlugin/ObjectEditPlugin.d.ts +242 -242
  40. package/types/plugins/ObjectEditPlugin/index.d.ts +1 -1
  41. package/types/plugins/SectionPlanesPlugin/SectionBoxControl.d.ts +36 -36
  42. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +186 -186
  43. package/types/plugins/SectionPlanesPlugin/index.d.ts +2 -2
  44. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +66 -66
  45. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -1
  46. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +69 -69
  47. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -41
  48. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -180
  49. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -1
  50. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -24
  51. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +71 -71
  52. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +267 -267
  53. package/types/plugins/TreeViewPlugin/index.d.ts +1 -1
  54. package/types/plugins/TreeViewPlugin/renderService.d.ts +128 -128
  55. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -34
  56. package/types/plugins/ViewCullPlugin/index.d.ts +1 -1
  57. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +236 -236
  58. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -1
  59. package/types/plugins/XTCLoaderPlugin/XTCLoaderPlugin.d.ts +288 -288
  60. package/types/plugins/XTCLoaderPlugin/index.d.ts +1 -1
  61. package/types/plugins/index.d.ts +30 -30
  62. package/types/viewer/Configs.d.ts +46 -46
  63. package/types/viewer/Plugin.d.ts +69 -69
  64. package/types/viewer/Viewer.d.ts +282 -282
  65. package/types/viewer/index.d.ts +6 -6
  66. package/types/viewer/localization/LocaleService.d.ts +183 -183
  67. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -9
  68. package/types/viewer/metadata/MetaModel.d.ts +94 -94
  69. package/types/viewer/metadata/MetaObject.d.ts +74 -74
  70. package/types/viewer/metadata/MetaScene.d.ts +135 -135
  71. package/types/viewer/metadata/Property.d.ts +29 -29
  72. package/types/viewer/metadata/PropertySet.d.ts +31 -31
  73. package/types/viewer/metadata/index.d.ts +6 -6
  74. package/types/viewer/scene/Bitmap/Bitmap.d.ts +255 -255
  75. package/types/viewer/scene/CameraControl/CameraControl.d.ts +777 -777
  76. package/types/viewer/scene/Component.d.ts +155 -155
  77. package/types/viewer/scene/Entity.d.ts +401 -401
  78. package/types/viewer/scene/LineSet/LineSet.d.ts +111 -111
  79. package/types/viewer/scene/camera/Camera.d.ts +364 -364
  80. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -167
  81. package/types/viewer/scene/camera/CameraPath.d.ts +28 -28
  82. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -95
  83. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -57
  84. package/types/viewer/scene/camera/Frustum.d.ts +166 -166
  85. package/types/viewer/scene/camera/Ortho.d.ts +115 -115
  86. package/types/viewer/scene/camera/Perspective.d.ts +136 -136
  87. package/types/viewer/scene/camera/index.d.ts +4 -4
  88. package/types/viewer/scene/geometry/Geometry.d.ts +7 -7
  89. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -95
  90. package/types/viewer/scene/geometry/VBOGeometry.d.ts +62 -62
  91. package/types/viewer/scene/geometry/builders/buildBoxGeometry.d.ts +21 -21
  92. package/types/viewer/scene/geometry/builders/buildBoxLinesGeometry.d.ts +21 -21
  93. package/types/viewer/scene/geometry/builders/buildCylinderGeometry.d.ts +27 -27
  94. package/types/viewer/scene/geometry/builders/buildGridGeometry.d.ts +17 -17
  95. package/types/viewer/scene/geometry/builders/buildPlaneGeometry.d.ts +21 -21
  96. package/types/viewer/scene/geometry/builders/buildSphereGeometry.d.ts +21 -21
  97. package/types/viewer/scene/geometry/builders/buildTorusGeometry.d.ts +25 -25
  98. package/types/viewer/scene/geometry/builders/buildVectorTextGeometry.d.ts +21 -21
  99. package/types/viewer/scene/geometry/builders/index.d.ts +8 -8
  100. package/types/viewer/scene/geometry/index.d.ts +2 -2
  101. package/types/viewer/scene/index.d.ts +23 -23
  102. package/types/viewer/scene/input/input.d.ts +69 -69
  103. package/types/viewer/scene/lights/AmbientLight.d.ts +19 -19
  104. package/types/viewer/scene/lights/DirLight.d.ts +25 -25
  105. package/types/viewer/scene/lights/Light.d.ts +3 -3
  106. package/types/viewer/scene/lights/PointLight.d.ts +30 -30
  107. package/types/viewer/scene/lights/index.d.ts +2 -2
  108. package/types/viewer/scene/marker/Marker.d.ts +136 -136
  109. package/types/viewer/scene/marker/SpriteMarker.d.ts +185 -185
  110. package/types/viewer/scene/marker/index.d.ts +2 -2
  111. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -83
  112. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -241
  113. package/types/viewer/scene/materials/Fresnel.d.ts +148 -148
  114. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -71
  115. package/types/viewer/scene/materials/Material.d.ts +3 -3
  116. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -468
  117. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -206
  118. package/types/viewer/scene/materials/Texture.d.ts +260 -260
  119. package/types/viewer/scene/materials/index.d.ts +6 -6
  120. package/types/viewer/scene/math/Frustum.d.ts +41 -41
  121. package/types/viewer/scene/math/index.d.ts +1 -1
  122. package/types/viewer/scene/math/math.d.ts +104 -104
  123. package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -28
  124. package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -44
  125. package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -39
  126. package/types/viewer/scene/mementos/index.d.ts +3 -3
  127. package/types/viewer/scene/mesh/Mesh.d.ts +793 -793
  128. package/types/viewer/scene/mesh/index.d.ts +1 -1
  129. package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +9 -9
  130. package/types/viewer/scene/models/PerformanceModel/index.d.ts +1 -1
  131. package/types/viewer/scene/models/SceneModel.d.ts +757 -757
  132. package/types/viewer/scene/models/SceneModelEntity.d.ts +417 -417
  133. package/types/viewer/scene/models/SceneModelMesh.d.ts +68 -68
  134. package/types/viewer/scene/models/SceneModelTexture.d.ts +16 -16
  135. package/types/viewer/scene/models/SceneModelTextureSet.d.ts +51 -51
  136. package/types/viewer/scene/models/SceneModelTransform.d.ts +197 -197
  137. package/types/viewer/scene/models/VBOSceneModel/VBOSceneModel.d.ts +7 -7
  138. package/types/viewer/scene/models/index.d.ts +7 -7
  139. package/types/viewer/scene/nodes/Node.d.ts +664 -664
  140. package/types/viewer/scene/nodes/index.d.ts +1 -1
  141. package/types/viewer/scene/postfx/CrossSections.d.ts +42 -42
  142. package/types/viewer/scene/postfx/SAO.d.ts +209 -209
  143. package/types/viewer/scene/scene/Scene.d.ts +1068 -1068
  144. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +110 -110
  145. package/types/viewer/scene/sectionPlane/index.d.ts +1 -1
  146. package/types/viewer/scene/stats.d.ts +40 -40
  147. package/types/viewer/scene/utils.d.ts +165 -165
  148. package/types/viewer/scene/viewport/Viewport.d.ts +23 -23
  149. package/types/viewer/scene/viewport/index.d.ts +1 -1
  150. package/types/viewer/scene/webgl/PickResult.d.ts +115 -115
  151. package/types/viewer/scene/webgl/index.d.ts +1 -1
@@ -1,757 +1,757 @@
1
- import { Component } from "../Component";
2
- import { SceneModelEntity } from "./SceneModelEntity";
3
- import { EdgeMaterial, EmphasisMaterial } from "../materials";
4
- import { SceneModelMesh } from "./SceneModelMesh";
5
- import { SceneModelTextureSet } from "./SceneModelTextureSet";
6
-
7
- /**
8
- * A high-performance model representation for efficient rendering and low memory usage.
9
- */
10
- export declare class SceneModel extends Component {
11
- /**
12
- * Fires when the model is loaded
13
- * @param event The loaded event
14
- * @param callback Called fired on the event
15
- * @param scope Scope for the callback
16
- */
17
- on(event: "loaded", callback: (loaded: true) => void, scope?: any): string;
18
-
19
- /**
20
- * Fires when the loading the model has an error
21
- * @param event The error event
22
- * @param callback Called fired on the event
23
- * @param scope Scope for the callback
24
- */
25
- on(event: "error", callback: (msg: string) => void, scope?: any): string;
26
-
27
- /**
28
- * Returns the {@link SceneModelEntity}s in this SceneModel.
29
- * @returns {*|{}}
30
- */
31
- get objects(): { [key: string]: SceneModelEntity };
32
-
33
- /**
34
- * Gets the 3D World-space origin for this SceneModel.
35
- *
36
- * Each geometry or mesh origin, if supplied, is relative to this origin.
37
- *
38
- * Default value is ````[0,0,0]````.
39
- *
40
- * @type {number[]}
41
- */
42
- get origin(): number[];
43
-
44
- /**
45
- * Gets the SceneModel's local translation.
46
- *
47
- * Default value is ````[0,0,0]````.
48
- *
49
- * @type {number[]}
50
- */
51
- get position(): number[];
52
-
53
- /**
54
- * Gets the SceneModel's local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
55
- *
56
- * Default value is ````[0,0,0]````.
57
- *
58
- * @type {number[]}
59
- */
60
- get rotation(): number[];
61
-
62
- /**
63
- * Gets the VBOSceneModels's local rotation quaternion.
64
- *
65
- * Default value is ````[0,0,0,1]````.
66
- *
67
- * @type {number[]}
68
- */
69
- get quaternion(): number[];
70
-
71
- /**
72
- * Gets the SceneModel's local scale.
73
- *
74
- * Default value is ````[1,1,1]````.
75
- *
76
- * @type {number[]}
77
- */
78
- get scale(): number[];
79
-
80
- /**
81
- * Gets the SceneModel's local modeling transform matrix.
82
- *
83
- * Default value is ````[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]````.
84
- *
85
- * @type {number[]}
86
- */
87
- get matrix(): number[];
88
-
89
- /**
90
- * Gets the SceneModel's World matrix.
91
- *
92
- * @type {number[]}
93
- */
94
- get worldMatrix(): number[];
95
-
96
- /**
97
- * Gets the SceneModel's World normal matrix.
98
- *
99
- * @type {number[]}
100
- */
101
- get worldNormalMatrix(): number[];
102
-
103
- /**
104
- * Sets if backfaces are rendered for this SceneModel.
105
- *
106
- * Default is ````false````.
107
- *
108
- * @type {Boolean}
109
- */
110
- get backfaces(): boolean;
111
-
112
- /**
113
- * Sets if backfaces are rendered for this SceneModel.
114
- *
115
- * Default is ````false````.
116
- *
117
- * When we set this ````true````, then backfaces are always rendered for this SceneModel.
118
- *
119
- * When we set this ````false````, then we allow the Viewer to decide whether to render backfaces. In this case,
120
- * the Viewer will:
121
- *
122
- * * hide backfaces on watertight meshes,
123
- * * show backfaces on open meshes, and
124
- * * always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
125
- *
126
- * @type {Boolean}
127
- */
128
- set backfaces(backfaces: boolean);
129
-
130
- /**
131
- * Gets the list of {@link SceneModelEntity}s within this SceneModel.
132
- *
133
- * @returns {SceneModelEntity[]}
134
- */
135
- get entityList(): SceneModelEntity[];
136
-
137
- /**
138
- * Returns true to indicate that SceneModel is an {@link SceneModelEntity}.
139
- * @type {Boolean}
140
- */
141
- get isEntity(): boolean;
142
-
143
- /**
144
- * Returns ````true```` if this SceneModel represents a model.
145
- *
146
- * When ````true```` the SceneModel will be registered by {@link SceneModel.id} in
147
- * {@link Scene.models} and may also have a {@link MetaObject} with matching {@link MetaObject.id}.
148
- *
149
- * @type {Boolean}
150
- */
151
- get isModel(): boolean;
152
-
153
- /**
154
- * Returns ````false```` to indicate that SceneModel never represents an object.
155
- *
156
- * @type {Boolean}
157
- */
158
- get isObject(): boolean;
159
-
160
- /**
161
- * Gets the SceneModel's World-space 3D axis-aligned bounding box.
162
- *
163
- * Represented by a six-element Float64Array containing the min/max extents of the
164
- * axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
165
- *
166
- * @type {number[]}
167
- */
168
- get aabb(): number[];
169
-
170
- /**
171
- * 获取aabb排除在外的对象id
172
- * @type {string[]}
173
- */
174
- get exceptionIds(): string[];
175
-
176
- /**
177
- * 设置aabb排除在外的对象id(自动更新新的aabb)
178
- * @param {string[]} exceptionIds
179
- */
180
- set exceptionIds(exceptionIds: string[]);
181
-
182
- /**
183
- * 排除异常构建以更新包围盒
184
- * @param exceptionIds
185
- * @param callback
186
- */
187
- updateAABBCullException(exceptionIds: any, callback?: Function): void;
188
-
189
- /**
190
- * 取消模型构建异常检测更新效果
191
- */
192
- cancelCullException(callback?: Function): void;
193
-
194
- /**
195
- * The number of entities in this SceneModel.
196
- *
197
- * @type {number}
198
- */
199
- get numEntities(): number;
200
-
201
- /**
202
- * The approximate number of triangle primitives in this SceneModel.
203
- *
204
- * @type {number}
205
- */
206
- get numTriangles(): number;
207
-
208
- /**
209
- * The approximate number of line primitives in this SceneModel.
210
- *
211
- * @type {number}
212
- */
213
- get numLines(): number;
214
-
215
- /**
216
- * The approximate number of point primitives in this SceneModel.
217
- *
218
- * @type {number}
219
- */
220
- get numPoints(): number;
221
-
222
- /**
223
- * Gets if any {@link SceneModelEntity}s in this SceneModel are visible.
224
- *
225
- * The SceneModel is only rendered when {@link SceneModel.visible} is ````true```` and {@link SceneModel.culled} is ````false````.
226
- *
227
- * @type {Boolean}
228
- */
229
- get visible(): boolean;
230
-
231
- /**
232
- * Sets if this SceneModel is visible.
233
- *
234
- * The SceneModel is only rendered when {@link SceneModel.visible} is ````true```` and {@link SceneModel.culled} is ````false````.
235
- **
236
- * @type {Boolean}
237
- */
238
- set visible(visible: boolean);
239
-
240
- /**
241
- * Gets if any {@link SceneModelEntity}s in this SceneModel are xrayed.
242
- *
243
- * @type {Boolean}
244
- */
245
- get xrayed(): boolean;
246
-
247
- /**
248
- * Sets if all {@link SceneModelEntity}s in this SceneModel are xrayed.
249
- *
250
- * @type {Boolean}
251
- */
252
- set xrayed(xrayed: boolean);
253
-
254
- /**
255
- * Gets if any {@link SceneModelEntity}s in this SceneModel are highlighted.
256
- *
257
- * @type {Boolean}
258
- */
259
- get highlighted(): boolean;
260
-
261
- /**
262
- * Sets if all {@link SceneModelEntity}s in this SceneModel are highlighted.
263
- *
264
- * @type {Boolean}
265
- */
266
- set highlighted(highlighted: boolean);
267
-
268
- /**
269
- * Gets if any {@link SceneModelEntity}s in this SceneModel are selected.
270
- *
271
- * @type {Boolean}
272
- */
273
- get selected(): boolean;
274
-
275
- /**
276
- * Sets if all {@link SceneModelEntity}s in this SceneModel are selected.
277
- *
278
- * @type {Boolean}
279
- */
280
- set selected(selected: boolean);
281
-
282
- /**
283
- * Gets if any {@link SceneModelEntity}s in this SceneModel have edges emphasised.
284
- *
285
- * @type {Boolean}
286
- */
287
- get edges(): boolean;
288
-
289
- /**
290
- * Sets if all {@link SceneModelEntity}s in this SceneModel have edges emphasised.
291
- *
292
- * @type {Boolean}
293
- */
294
- set edges(edges: boolean);
295
-
296
- /**
297
- * Gets if this SceneModel is culled from view.
298
- *
299
- * The SceneModel is only rendered when {@link SceneModel.visible} is true and {@link SceneModel.culled} is false.
300
- *
301
- * @type {Boolean}
302
- */
303
- get culled(): boolean;
304
-
305
- /**
306
- * Sets if this SceneModel is culled from view.
307
- *
308
- * The SceneModel is only rendered when {@link SceneModel.visible} is true and {@link SceneModel.culled} is false.
309
- *
310
- * @type {Boolean}
311
- */
312
- set culled(culled: boolean);
313
-
314
- /**
315
- * Gets if {@link SceneModelEntity}s in this SceneModel are clippable.
316
- *
317
- * Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
318
- *
319
- * @type {Boolean}
320
- */
321
- get clippable(): boolean;
322
-
323
- /**
324
- * Sets if {@link SceneModelEntity}s in this SceneModel are clippable.
325
- *
326
- * Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
327
- *
328
- * @type {Boolean}
329
- */
330
- set clippable(clippable: boolean);
331
-
332
- /**
333
- * Gets if this SceneModel is collidable.
334
- *
335
- * @type {Boolean}
336
- */
337
- get collidable(): boolean;
338
-
339
- /**
340
- * Sets if {@link SceneModelEntity}s in this SceneModel are collidable.
341
- *
342
- * @type {Boolean}
343
- */
344
- set collidable(collidable: boolean);
345
-
346
- /**
347
- * Gets if this SceneModel is pickable.
348
- *
349
- * Picking is done via calls to {@link Scene.pick}.
350
- *
351
- * @type {Boolean}
352
- */
353
- get pickable(): boolean;
354
-
355
- /**
356
- * Sets if {@link SceneModelEntity}s in this SceneModel are pickable.
357
- *
358
- * Picking is done via calls to {@link Scene.pick}.
359
- *
360
- * @type {Boolean}
361
- */
362
- set pickable(pickable: boolean);
363
-
364
- /**
365
- * Gets the RGB colorize color for this SceneModel.
366
- *
367
- * Each element of the color is in range ````[0..1]````.
368
- *
369
- * @type {number[]}
370
- */
371
- get colorize(): number[];
372
-
373
- /**
374
- * Sets the RGB colorize color for this SceneModel.
375
- *
376
- * Multiplies by rendered fragment colors.
377
- *
378
- * Each element of the color is in range ````[0..1]````.
379
- *
380
- * @type {number[]}
381
- */
382
- set colorize(colorize: number[]);
383
-
384
- /**
385
- * Gets this SceneModel's opacity factor.
386
- *
387
- * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
388
- *
389
- * @type {number}
390
- */
391
- get opacity(): number;
392
-
393
- /**
394
- * Sets the opacity factor for this SceneModel.
395
- *
396
- * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
397
- *
398
- * @type {number}
399
- */
400
- set opacity(opacity: number);
401
-
402
- /**
403
- * Gets the brightness factor for this SceneModel.
404
- *
405
- * A factor > 1 brightens the model, < 1 darkens. Default is ````1.0````.
406
- *
407
- * @type {number}
408
- */
409
- get brightness(): number;
410
-
411
- /**
412
- * Sets the brightness factor for this SceneModel.
413
- *
414
- * Multiplies by the rendered fragment colors of the model's main color render
415
- * passes, for both textured and untextured meshes. Applied in the render
416
- * pipeline, so it can be freely changed at any time. A factor > 1 brightens,
417
- * < 1 darkens. Default is ````1.0````.
418
- *
419
- * @type {number}
420
- */
421
- set brightness(brightness: number);
422
-
423
- /**
424
- * Gets if this SceneModel casts a shadow.
425
- *
426
- * @type {Boolean}
427
- */
428
- get castsShadow(): boolean;
429
-
430
- /**
431
- * Sets if this SceneModel casts a shadow.
432
- *
433
- * @type {Boolean}
434
- */
435
- set castsShadow(castsShadow: boolean);
436
-
437
- /**
438
- * Sets if this SceneModel can have shadow cast upon it.
439
- *
440
- * @type {Boolean}
441
- */
442
- get receivesShadow(): boolean;
443
-
444
- /**
445
- * Sets if this SceneModel can have shadow cast upon it.
446
- *
447
- * @type {Boolean}
448
- */
449
- set receivesShadow(receivesShadow: boolean);
450
-
451
- /**
452
- * Gets if Scalable Ambient Obscurance (SAO) will apply to this SceneModel.
453
- *
454
- * SAO is configured by the Scene's {@link SAO} component.
455
- *
456
- * Only works when {@link SAO.enabled} is also true.
457
- *
458
- * @type {Boolean}
459
- */
460
- get saoEnabled(): boolean;
461
-
462
- /**
463
- * Gets if physically-based rendering (PBR) is enabled for this SceneModel.
464
- *
465
- * Only works when {@link Scene.pbrEnabled} is also true.
466
- *
467
- * @type {Boolean}
468
- */
469
- get pbrEnabled(): boolean;
470
-
471
- /**
472
- * Returns true to indicate that SceneModel is implements {@link Drawable}.
473
- *
474
- * @type {Boolean}
475
- */
476
- get isDrawable(): boolean;
477
-
478
- /**
479
- * Configures the appearance of xrayed {@link SceneModelEntity}s within this SceneModel.
480
- *
481
- * This is the {@link Scene.xrayMaterial}.
482
- *
483
- * @type {EmphasisMaterial}
484
- */
485
- get xrayMaterial(): EmphasisMaterial;
486
-
487
- /**
488
- * Configures the appearance of highlighted {@link SceneModelEntity}s within this SceneModel.
489
- *
490
- * This is the {@link Scene.highlightMaterial}.
491
- *
492
- * @type {EmphasisMaterial}
493
- */
494
- get highlightMaterial(): EmphasisMaterial;
495
-
496
- /**
497
- * Configures the appearance of selected {@link SceneModelEntity}s within this SceneModel.
498
- *
499
- * This is the {@link Scene.selectedMaterial}.
500
- *
501
- * @type {EmphasisMaterial}
502
- */
503
- get selectedMaterial(): EmphasisMaterial;
504
-
505
- /**
506
- * Configures the appearance of edges of {@link SceneModelEntity}s within this SceneModel.
507
- *
508
- * This is the {@link Scene.edgeMaterial}.
509
- *
510
- * @type {EdgeMaterial}
511
- */
512
- get edgeMaterial(): EdgeMaterial;
513
-
514
- /**
515
- * Creates a texture within this SceneModel.
516
- *
517
- * We can then supply the texture ID to {@link SceneModel#createTextureSet} when we want to create texture sets that use the texture.
518
- *
519
- * @param {*} cfg Texture properties.
520
- * @param {string|number} cfg.id Mandatory ID for the texture, to refer to with {@link SceneModel#createTextureSet}.
521
- * @param {string} [cfg.src] Image file for the texture. Assumed to be transcoded if not having a recognized image file
522
- * extension (jpg, jpeg, png etc.). If transcoded, then assumes ````SceneModel```` is configured with a {@link TextureTranscoder}.
523
- * @param {ArrayBuffer[]} [cfg.buffers] Transcoded texture data. Assumes ````SceneModel```` is
524
- * configured with a {@link TextureTranscoder}. This parameter is given as an array of buffers so we can potentially support multi-image textures, such as cube maps.
525
- * @param {HTMLImageElement} [cfg.image] HTML Image object to load into this texture. Overrides ````src```` and ````buffers````. Never transcoded.
526
- * @param {number} [cfg.minFilter=LinearMipmapLinearFilter] How the texture is sampled when a texel covers less than one pixel.
527
- * Supported values are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter}, {@link NearestMipMapNearestFilter}, {@link NearestMipMapLinearFilter} and {@link LinearMipMapLinearFilter}.
528
- * @param {number} [cfg.magFilter=LinearFilter] How the texture is sampled when a texel covers more than one pixel. Supported values are {@link LinearFilter} and {@link NearestFilter}.
529
- * @param {number} [cfg.wrapS=RepeatWrapping] Wrap parameter for texture coordinate *S*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.
530
- * @param {number} [cfg.wrapT=RepeatWrapping] Wrap parameter for texture coordinate *T*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}..
531
- * @param {number} [cfg.wrapR=RepeatWrapping] Wrap parameter for texture coordinate *R*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.
532
- * @param {Boolean} [cfg.flipY=false] Flips this Texture's source data along its vertical axis when ````true````.
533
- * @param {number} [cfg.encoding=LinearEncoding] Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}.
534
- */
535
- createTexture(cfg: {
536
- id: string | number;
537
- src?: string;
538
- buffer?: ArrayBuffer[];
539
- image?: HTMLImageElement;
540
- minFilter?: number;
541
- magFilter?: number;
542
- wrapS?: number;
543
- wrapT?: number;
544
- flipY?: boolean;
545
- encoding?: number;
546
- }): void;
547
-
548
- /**
549
- * Creates a texture set within this SceneModel.
550
- *
551
- * * Stores the new {@link SceneModelTextureSet} in {@link SceneModel#textureSets}.
552
- *
553
- * A texture set is a collection of textures that can be shared among meshes. We can then supply the texture set
554
- * ID to {@link SceneModel#createMesh} when we want to create meshes that use the texture set.
555
- *
556
- * The textures can work as a texture atlas, where each mesh can have geometry UVs that index
557
- * a different part of the textures. This allows us to minimize the number of textures in our models, which
558
- * means faster rendering.
559
- *
560
- * @param {*} cfg Texture set properties.
561
- * @param {string|number} cfg.id Mandatory ID for the texture set, to refer to with {@link SceneModel#createMesh}.
562
- * @param {*} [cfg.colorTextureId] ID of *RGBA* base color texture, with color in *RGB* and alpha in *A*.
563
- * @param {*} [cfg.metallicRoughnessTextureId] ID of *RGBA* metal-roughness texture, with the metallic factor in *R*, and roughness factor in *G*.
564
- * @param {*} [cfg.normalsTextureId] ID of *RGBA* normal map texture, with normal map vectors in *RGB*.
565
- * @param {*} [cfg.emissiveTextureId] ID of *RGBA* emissive map texture, with emissive color in *RGB*.
566
- * @param {*} [cfg.occlusionTextureId] ID of *RGBA* occlusion map texture, with occlusion factor in *R*.
567
- * @returns {SceneModelTransform} The new texture set.
568
- */
569
- createTextureSet(cfg: {
570
- id: string | number;
571
- colorTextureId?: string | number;
572
- metallicRoughnessTextureId?: string | number;
573
- normalsTextureId?: string | number;
574
- emissiveTextureId?: string | number;
575
- occlusionTextureId?: string | number;
576
- }): SceneModelTextureSet;
577
-
578
- /**
579
- * Creates a reusable geometry within this SceneModel.
580
- *
581
- * We can then supply the geometry ID to {@link SceneModel.createMesh} when we want to create meshes that instance the geometry.
582
- *
583
- * If provide a ````positionsDecodeMatrix```` , then ````createGeometry()```` will assume
584
- * that the ````positions```` and ````normals```` arrays are compressed. When compressed, ````positions```` will be
585
- * quantized and in World-space, and ````normals```` will be oct-encoded and in World-space.
586
- *
587
- * Note that ````positions````, ````normals```` and ````indices```` are all required together.
588
- *
589
- * @param {*} cfg Geometry properties.
590
- * @param {string|number} cfg.id Mandatory ID for the geometry, to refer to with {@link SceneModel.createMesh}.
591
- * @param {string} cfg.primitive The primitive type. Accepted values are 'points', 'lines', 'triangles', 'solid' and 'surface'.
592
- * @param {number[]} cfg.positions Flat array of positions.
593
- * @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.
594
- * @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````.
595
- * @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````.
596
- * @param {number[]} [cfg.indices] Array of indices. Not required for `points` primitives.
597
- * @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 ````SceneModel```` constructor.
598
- * @param {number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positions````.
599
- * @param {number[]} [cfg.origin] Optional geometry origin, relative to {@link SceneModel.origin}. When this is given, then every mesh created with {@link SceneModel.createMesh} that uses this geometry will
600
- * be transformed relative to this origin.
601
- */
602
- createGeometry(cfg: {
603
- id: string | number;
604
- primitive: "lines" | "triangles" | "solid" | "surface";
605
- positions: number[];
606
- normals: number[];
607
- colors: number[];
608
- colorsCompressed: number[];
609
- indices: number[];
610
- edgeIndices: number[];
611
- positionsDecodeMatrix: number[];
612
- origin?: number[];
613
- }): void;
614
-
615
- /**
616
- * Creates a new {@link SceneModelTransform} within this SceneModel.
617
- *
618
- * * Stores the new {@link SceneModelTransform} in {@link SceneModel#transforms}.
619
- * * Can be connected into hierarchies
620
- * * Each {@link SceneModelTransform} can be used by unlimited {@link SceneModelMesh}es
621
- *
622
- * @param {*} cfg Transform creation parameters.
623
- * @param {string} cfg.id Mandatory ID for the new transform. Must not clash with any existing components within the {@link Scene}.
624
- * @param {string} [cfg.parentTransformId] ID of a parent transform, previously created with {@link SceneModel#createTextureSet}.
625
- * @param {number[]} [cfg.position=[0,0,0]] Local 3D position of the mesh. Overridden by ````transformId````.
626
- * @param {number[]} [cfg.scale=[1,1,1]] Scale of the transform.
627
- * @param {number[]} [cfg.rotation=[0,0,0]] Rotation of the transform as Euler angles given in degrees, for each of the X, Y and Z axis.
628
- * @param {number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] Modelling transform matrix. Overrides the ````position````, ````scale```` and ````rotation```` parameters.
629
- * @returns {SceneModelTransform} The new transform.
630
- */
631
- createTransform(cfg: {
632
- id: string | number;
633
- parentTransformId: string | number;
634
- position?: number[];
635
- scale?: number[];
636
- rotation?: number[];
637
- matrix?: number[];
638
- }): SceneModelMesh;
639
-
640
- /**
641
- * Creates a new {@link SceneModelMesh} within this SceneModel.
642
- *
643
- * * It prepares and saves data for a SceneModelMesh {@link SceneModel#meshes} creation. SceneModelMesh will be created only once the SceneModelEntity (which references this particular SceneModelMesh) will be created.
644
- * * The SceneModelMesh can either define its own geometry or share it with other SceneModelMeshes. To define own geometry, provide the
645
- * various geometry arrays to this method. To share a geometry, provide the ID of a geometry created earlier
646
- * with {@link SceneModel#createGeometry}.
647
- * * If you accompany the arrays with an ````origin````, then ````createMesh()```` will assume
648
- * that the geometry ````positions```` are in relative-to-center (RTC) coordinates, with ````origin```` being the
649
- * origin of their RTC coordinate system.
650
- *
651
- * @param {object} cfg Object properties.
652
- * @param {String} cfg.id Mandatory ID for the new mesh. Must not clash with any existing components within the {@link Scene}.
653
- * @param {String|Number} [cfg.textureSetId] ID of a {@link SceneModelTextureSet} previously created with {@link SceneModel#createTextureSet}.
654
- * @param {String|Number} [cfg.transformId] ID of a {@link SceneModelTransform} to instance, previously created with {@link SceneModel#createTransform}. Overrides all other transform parameters given to this method.
655
- * @param {String|Number} [cfg.geometryId] ID of a geometry to instance, previously created with {@link SceneModel#createGeometry}. Overrides all other geometry parameters given to this method.
656
- * @param {String} cfg.primitive The primitive type. Accepted values are 'points', 'lines', 'triangles', 'solid' and 'surface'.
657
- * @param {Number[]} [cfg.positions] Flat array of uncompressed 3D vertex positions positions. Required for all primitive types. Overridden by ````positionsCompressed````.
658
- * @param {Number[]} [cfg.positionsCompressed] Flat array of quantized 3D vertex positions. Overrides ````positions````, and must be accompanied by ````positionsDecodeMatrix````.
659
- * @param {Number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positionsCompressed````. Must be accompanied by ````positionsCompressed````.
660
- * @param {Number[]} [cfg.normals] Flat array of normal vectors. Only used with "triangles", "solid" and "surface" primitives. When no normals are given, the geometry will be flat shaded using auto-generated face-aligned normals.
661
- * @param {Number[]} [cfg.normalsCompressed] Flat array of oct-encoded normal vectors. Overrides ````normals````. Only used with "triangles", "solid" and "surface" primitives. When no normals are given, the geometry will be flat shaded using auto-generated face-aligned normals.
662
- * @param {Number[]} [cfg.colors] Flat array of uncompressed RGBA vertex colors, as float values in range ````[0..1]````. Ignored when ````geometryId```` is given. Overridden by ````color```` and ````colorsCompressed````.
663
- * @param {Number[]} [cfg.colorsCompressed] Flat array of compressed RGBA vertex colors, as unsigned short integers in range ````[0..255]````. Ignored when ````geometryId```` is given. Overrides ````colors```` and is overridden by ````color````.
664
- * @param {Number[]} [cfg.uv] Flat array of uncompressed vertex UV coordinates. Only used with "triangles", "solid" and "surface" primitives. Required for textured rendering.
665
- * @param {Number[]} [cfg.uvCompressed] Flat array of compressed vertex UV coordinates. Only used with "triangles", "solid" and "surface" primitives. Overrides ````uv````. Must be accompanied by ````uvDecodeMatrix````. Only used with "triangles", "solid" and "surface" primitives. Required for textured rendering.
666
- * @param {Number[]} [cfg.uvDecodeMatrix] A 3x3 matrix for decompressing ````uvCompressed````.
667
- * @param {Number[]} [cfg.indices] Array of primitive connectivity indices. Not required for `points` primitives.
668
- * @param {Number[]} [cfg.edgeIndices] Array of edge line indices. Used only with 'triangles', 'solid' and 'surface' primitives. Automatically generated internally if not supplied, using the optional ````edgeThreshold```` given to the ````SceneModel```` constructor.
669
- * @param {Number[]} [cfg.origin] Optional geometry origin, relative to {@link SceneModel#origin}. When this is given, then ````positions```` are assumed to be relative to this.
670
- * @param {Number[]} [cfg.position=[0,0,0]] Local 3D position of the mesh. Overridden by ````transformId````.
671
- * @param {Number[]} [cfg.scale=[1,1,1]] Scale of the mesh. Overridden by ````transformId````.
672
- * @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. Overridden by ````transformId````.
673
- * @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. Also overridden by ````transformId````.
674
- * @param {Number[]} [cfg.color=[1,1,1]] RGB color in range ````[0..1, 0..1, 0..1]````. Overridden by texture set ````colorTexture````. Overrides ````colors```` and ````colorsCompressed````.
675
- * @param {Number} [cfg.opacity=1] Opacity in range ````[0..1]````. Overridden by texture set ````colorTexture````.
676
- * @param {Number} [cfg.metallic=0] Metallic factor in range ````[0..1]````. Overridden by texture set ````metallicRoughnessTexture````.
677
- * @param {Number} [cfg.roughness=1] Roughness factor in range ````[0..1]````. Overridden by texture set ````metallicRoughnessTexture````.
678
- * @returns {Boolean} True = successfully mesh was created. False = error during creation of a mesh.
679
- */
680
- createMesh(cfg: {
681
- id: string;
682
- textureSetId?: string | number;
683
- transformId?: string | number;
684
- geometryId?: string | number;
685
- primitive: "lines" | "triangles" | "points";
686
- positions: number[];
687
- positionsCompressed: number[];
688
- positionsDecodeMatrix: number[];
689
- normals: number[];
690
- normalsCompressed: number[];
691
- colors: number[];
692
- colorsCompressed: number[];
693
- uv: number[];
694
- uvCompressed: number[];
695
- uvDecodeMatrix: number[];
696
- indices: number[];
697
- edgeIndices: number[];
698
- origin?: number[];
699
- position?: number[];
700
- scale?: number[];
701
- rotation?: number[];
702
- matrix?: number[];
703
- color?: number[];
704
- opacity?: number;
705
- metallic?: number;
706
- roughness?: number;
707
- }): boolean;
708
-
709
- /**
710
- * Creates an {@link SceneModelEntity} within this SceneModel, giving it one or more meshes previously created with {@link SceneModel.createMesh}.
711
- *
712
- * A mesh can only belong to one {@link SceneModelEntity}, so you'll get an error if you try to reuse a mesh among multiple {@link SceneModelEntity}s.
713
- *
714
- * @param {Object} cfg SceneModelEntity configuration.
715
- * @param {string} cfg.id Optional ID for the new SceneModelEntity. Must not clash with any existing components within the {@link Scene}.
716
- * @param {string[]} cfg.meshIds IDs of one or more meshes created previously with {@link SceneModel@createMesh}.
717
-
718
- * @param {Boolean} [cfg.isObject] Set ````true```` if the {@link SceneModelEntity} represents an object, in which case it will be registered by {@link SceneModelEntity.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}.
719
- * @param {Boolean} [cfg.visible=true] Indicates if the SceneModelEntity is initially visible.
720
- * @param {Boolean} [cfg.culled=false] Indicates if the SceneModelEntity is initially culled from view.
721
- * @param {Boolean} [cfg.pickable=true] Indicates if the SceneModelEntity is initially pickable.
722
- * @param {Boolean} [cfg.clippable=true] Indicates if the SceneModelEntity is initially clippable.
723
- * @param {Boolean} [cfg.collidable=true] Indicates if the SceneModelEntity is initially included in boundary calculations.
724
- * @param {Boolean} [cfg.castsShadow=true] Indicates if the SceneModelEntity initially casts shadows.
725
- * @param {Boolean} [cfg.receivesShadow=true] Indicates if the SceneModelEntity initially receives shadows.
726
- * @param {Boolean} [cfg.xrayed=false] Indicates if the SceneModelEntity is initially xrayed. XRayed appearance is configured by {@link SceneModel.xrayMaterial}.
727
- * @param {Boolean} [cfg.highlighted=false] Indicates if the SceneModelEntity is initially highlighted. Highlighted appearance is configured by {@link SceneModel.highlightMaterial}.
728
- * @param {Boolean} [cfg.selected=false] Indicates if the SceneModelEntity is initially selected. Selected appearance is configured by {@link SceneModel.selectedMaterial}.
729
- * @param {Boolean} [cfg.edges=false] Indicates if the SceneModelEntity's edges are initially emphasized. Edges appearance is configured by {@link SceneModel.edgeMaterial}.
730
- * @returns {SceneModelEntity}
731
- */
732
- createEntity(cfg: {
733
- id: string;
734
- meshIds: string[];
735
- isObject: boolean;
736
- visible?: boolean;
737
- culled?: boolean;
738
- pickable?: boolean;
739
- clippable?: boolean;
740
- collidable?: boolean;
741
- castsShadow?: boolean;
742
- receivesShadow?: boolean;
743
- xrayed?: boolean;
744
- highlighted?: boolean;
745
- selected?: boolean;
746
- edges?: boolean;
747
- }): SceneModelEntity;
748
-
749
- /**
750
- * Finalizes this SceneModel.
751
- *
752
- * Immediately creates the SceneModel's {@link SceneModelEntity}s within the {@link Scene}.
753
- *
754
- * Once finalized, you can't add anything more to this SceneModel.
755
- */
756
- finalize(): void;
757
- }
1
+ import { Component } from "../Component";
2
+ import { SceneModelEntity } from "./SceneModelEntity";
3
+ import { EdgeMaterial, EmphasisMaterial } from "../materials";
4
+ import { SceneModelMesh } from "./SceneModelMesh";
5
+ import { SceneModelTextureSet } from "./SceneModelTextureSet";
6
+
7
+ /**
8
+ * A high-performance model representation for efficient rendering and low memory usage.
9
+ */
10
+ export declare class SceneModel extends Component {
11
+ /**
12
+ * Fires when the model is loaded
13
+ * @param event The loaded event
14
+ * @param callback Called fired on the event
15
+ * @param scope Scope for the callback
16
+ */
17
+ on(event: "loaded", callback: (loaded: true) => void, scope?: any): string;
18
+
19
+ /**
20
+ * Fires when the loading the model has an error
21
+ * @param event The error event
22
+ * @param callback Called fired on the event
23
+ * @param scope Scope for the callback
24
+ */
25
+ on(event: "error", callback: (msg: string) => void, scope?: any): string;
26
+
27
+ /**
28
+ * Returns the {@link SceneModelEntity}s in this SceneModel.
29
+ * @returns {*|{}}
30
+ */
31
+ get objects(): { [key: string]: SceneModelEntity };
32
+
33
+ /**
34
+ * Gets the 3D World-space origin for this SceneModel.
35
+ *
36
+ * Each geometry or mesh origin, if supplied, is relative to this origin.
37
+ *
38
+ * Default value is ````[0,0,0]````.
39
+ *
40
+ * @type {number[]}
41
+ */
42
+ get origin(): number[];
43
+
44
+ /**
45
+ * Gets the SceneModel's local translation.
46
+ *
47
+ * Default value is ````[0,0,0]````.
48
+ *
49
+ * @type {number[]}
50
+ */
51
+ get position(): number[];
52
+
53
+ /**
54
+ * Gets the SceneModel's local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
55
+ *
56
+ * Default value is ````[0,0,0]````.
57
+ *
58
+ * @type {number[]}
59
+ */
60
+ get rotation(): number[];
61
+
62
+ /**
63
+ * Gets the VBOSceneModels's local rotation quaternion.
64
+ *
65
+ * Default value is ````[0,0,0,1]````.
66
+ *
67
+ * @type {number[]}
68
+ */
69
+ get quaternion(): number[];
70
+
71
+ /**
72
+ * Gets the SceneModel's local scale.
73
+ *
74
+ * Default value is ````[1,1,1]````.
75
+ *
76
+ * @type {number[]}
77
+ */
78
+ get scale(): number[];
79
+
80
+ /**
81
+ * Gets the SceneModel's local modeling transform matrix.
82
+ *
83
+ * Default value is ````[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]````.
84
+ *
85
+ * @type {number[]}
86
+ */
87
+ get matrix(): number[];
88
+
89
+ /**
90
+ * Gets the SceneModel's World matrix.
91
+ *
92
+ * @type {number[]}
93
+ */
94
+ get worldMatrix(): number[];
95
+
96
+ /**
97
+ * Gets the SceneModel's World normal matrix.
98
+ *
99
+ * @type {number[]}
100
+ */
101
+ get worldNormalMatrix(): number[];
102
+
103
+ /**
104
+ * Sets if backfaces are rendered for this SceneModel.
105
+ *
106
+ * Default is ````false````.
107
+ *
108
+ * @type {Boolean}
109
+ */
110
+ get backfaces(): boolean;
111
+
112
+ /**
113
+ * Sets if backfaces are rendered for this SceneModel.
114
+ *
115
+ * Default is ````false````.
116
+ *
117
+ * When we set this ````true````, then backfaces are always rendered for this SceneModel.
118
+ *
119
+ * When we set this ````false````, then we allow the Viewer to decide whether to render backfaces. In this case,
120
+ * the Viewer will:
121
+ *
122
+ * * hide backfaces on watertight meshes,
123
+ * * show backfaces on open meshes, and
124
+ * * always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
125
+ *
126
+ * @type {Boolean}
127
+ */
128
+ set backfaces(backfaces: boolean);
129
+
130
+ /**
131
+ * Gets the list of {@link SceneModelEntity}s within this SceneModel.
132
+ *
133
+ * @returns {SceneModelEntity[]}
134
+ */
135
+ get entityList(): SceneModelEntity[];
136
+
137
+ /**
138
+ * Returns true to indicate that SceneModel is an {@link SceneModelEntity}.
139
+ * @type {Boolean}
140
+ */
141
+ get isEntity(): boolean;
142
+
143
+ /**
144
+ * Returns ````true```` if this SceneModel represents a model.
145
+ *
146
+ * When ````true```` the SceneModel will be registered by {@link SceneModel.id} in
147
+ * {@link Scene.models} and may also have a {@link MetaObject} with matching {@link MetaObject.id}.
148
+ *
149
+ * @type {Boolean}
150
+ */
151
+ get isModel(): boolean;
152
+
153
+ /**
154
+ * Returns ````false```` to indicate that SceneModel never represents an object.
155
+ *
156
+ * @type {Boolean}
157
+ */
158
+ get isObject(): boolean;
159
+
160
+ /**
161
+ * Gets the SceneModel's World-space 3D axis-aligned bounding box.
162
+ *
163
+ * Represented by a six-element Float64Array containing the min/max extents of the
164
+ * axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
165
+ *
166
+ * @type {number[]}
167
+ */
168
+ get aabb(): number[];
169
+
170
+ /**
171
+ * 获取aabb排除在外的对象id
172
+ * @type {string[]}
173
+ */
174
+ get exceptionIds(): string[];
175
+
176
+ /**
177
+ * 设置aabb排除在外的对象id(自动更新新的aabb)
178
+ * @param {string[]} exceptionIds
179
+ */
180
+ set exceptionIds(exceptionIds: string[]);
181
+
182
+ /**
183
+ * 排除异常构建以更新包围盒
184
+ * @param exceptionIds
185
+ * @param callback
186
+ */
187
+ updateAABBCullException(exceptionIds: any, callback?: Function): void;
188
+
189
+ /**
190
+ * 取消模型构建异常检测更新效果
191
+ */
192
+ cancelCullException(callback?: Function): void;
193
+
194
+ /**
195
+ * The number of entities in this SceneModel.
196
+ *
197
+ * @type {number}
198
+ */
199
+ get numEntities(): number;
200
+
201
+ /**
202
+ * The approximate number of triangle primitives in this SceneModel.
203
+ *
204
+ * @type {number}
205
+ */
206
+ get numTriangles(): number;
207
+
208
+ /**
209
+ * The approximate number of line primitives in this SceneModel.
210
+ *
211
+ * @type {number}
212
+ */
213
+ get numLines(): number;
214
+
215
+ /**
216
+ * The approximate number of point primitives in this SceneModel.
217
+ *
218
+ * @type {number}
219
+ */
220
+ get numPoints(): number;
221
+
222
+ /**
223
+ * Gets if any {@link SceneModelEntity}s in this SceneModel are visible.
224
+ *
225
+ * The SceneModel is only rendered when {@link SceneModel.visible} is ````true```` and {@link SceneModel.culled} is ````false````.
226
+ *
227
+ * @type {Boolean}
228
+ */
229
+ get visible(): boolean;
230
+
231
+ /**
232
+ * Sets if this SceneModel is visible.
233
+ *
234
+ * The SceneModel is only rendered when {@link SceneModel.visible} is ````true```` and {@link SceneModel.culled} is ````false````.
235
+ **
236
+ * @type {Boolean}
237
+ */
238
+ set visible(visible: boolean);
239
+
240
+ /**
241
+ * Gets if any {@link SceneModelEntity}s in this SceneModel are xrayed.
242
+ *
243
+ * @type {Boolean}
244
+ */
245
+ get xrayed(): boolean;
246
+
247
+ /**
248
+ * Sets if all {@link SceneModelEntity}s in this SceneModel are xrayed.
249
+ *
250
+ * @type {Boolean}
251
+ */
252
+ set xrayed(xrayed: boolean);
253
+
254
+ /**
255
+ * Gets if any {@link SceneModelEntity}s in this SceneModel are highlighted.
256
+ *
257
+ * @type {Boolean}
258
+ */
259
+ get highlighted(): boolean;
260
+
261
+ /**
262
+ * Sets if all {@link SceneModelEntity}s in this SceneModel are highlighted.
263
+ *
264
+ * @type {Boolean}
265
+ */
266
+ set highlighted(highlighted: boolean);
267
+
268
+ /**
269
+ * Gets if any {@link SceneModelEntity}s in this SceneModel are selected.
270
+ *
271
+ * @type {Boolean}
272
+ */
273
+ get selected(): boolean;
274
+
275
+ /**
276
+ * Sets if all {@link SceneModelEntity}s in this SceneModel are selected.
277
+ *
278
+ * @type {Boolean}
279
+ */
280
+ set selected(selected: boolean);
281
+
282
+ /**
283
+ * Gets if any {@link SceneModelEntity}s in this SceneModel have edges emphasised.
284
+ *
285
+ * @type {Boolean}
286
+ */
287
+ get edges(): boolean;
288
+
289
+ /**
290
+ * Sets if all {@link SceneModelEntity}s in this SceneModel have edges emphasised.
291
+ *
292
+ * @type {Boolean}
293
+ */
294
+ set edges(edges: boolean);
295
+
296
+ /**
297
+ * Gets if this SceneModel is culled from view.
298
+ *
299
+ * The SceneModel is only rendered when {@link SceneModel.visible} is true and {@link SceneModel.culled} is false.
300
+ *
301
+ * @type {Boolean}
302
+ */
303
+ get culled(): boolean;
304
+
305
+ /**
306
+ * Sets if this SceneModel is culled from view.
307
+ *
308
+ * The SceneModel is only rendered when {@link SceneModel.visible} is true and {@link SceneModel.culled} is false.
309
+ *
310
+ * @type {Boolean}
311
+ */
312
+ set culled(culled: boolean);
313
+
314
+ /**
315
+ * Gets if {@link SceneModelEntity}s in this SceneModel are clippable.
316
+ *
317
+ * Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
318
+ *
319
+ * @type {Boolean}
320
+ */
321
+ get clippable(): boolean;
322
+
323
+ /**
324
+ * Sets if {@link SceneModelEntity}s in this SceneModel are clippable.
325
+ *
326
+ * Clipping is done by the {@link SectionPlane}s in {@link Scene.sectionPlanes}.
327
+ *
328
+ * @type {Boolean}
329
+ */
330
+ set clippable(clippable: boolean);
331
+
332
+ /**
333
+ * Gets if this SceneModel is collidable.
334
+ *
335
+ * @type {Boolean}
336
+ */
337
+ get collidable(): boolean;
338
+
339
+ /**
340
+ * Sets if {@link SceneModelEntity}s in this SceneModel are collidable.
341
+ *
342
+ * @type {Boolean}
343
+ */
344
+ set collidable(collidable: boolean);
345
+
346
+ /**
347
+ * Gets if this SceneModel is pickable.
348
+ *
349
+ * Picking is done via calls to {@link Scene.pick}.
350
+ *
351
+ * @type {Boolean}
352
+ */
353
+ get pickable(): boolean;
354
+
355
+ /**
356
+ * Sets if {@link SceneModelEntity}s in this SceneModel are pickable.
357
+ *
358
+ * Picking is done via calls to {@link Scene.pick}.
359
+ *
360
+ * @type {Boolean}
361
+ */
362
+ set pickable(pickable: boolean);
363
+
364
+ /**
365
+ * Gets the RGB colorize color for this SceneModel.
366
+ *
367
+ * Each element of the color is in range ````[0..1]````.
368
+ *
369
+ * @type {number[]}
370
+ */
371
+ get colorize(): number[];
372
+
373
+ /**
374
+ * Sets the RGB colorize color for this SceneModel.
375
+ *
376
+ * Multiplies by rendered fragment colors.
377
+ *
378
+ * Each element of the color is in range ````[0..1]````.
379
+ *
380
+ * @type {number[]}
381
+ */
382
+ set colorize(colorize: number[]);
383
+
384
+ /**
385
+ * Gets this SceneModel's opacity factor.
386
+ *
387
+ * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
388
+ *
389
+ * @type {number}
390
+ */
391
+ get opacity(): number;
392
+
393
+ /**
394
+ * Sets the opacity factor for this SceneModel.
395
+ *
396
+ * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
397
+ *
398
+ * @type {number}
399
+ */
400
+ set opacity(opacity: number);
401
+
402
+ /**
403
+ * Gets the brightness factor for this SceneModel.
404
+ *
405
+ * A factor > 1 brightens the model, < 1 darkens. Default is ````1.0````.
406
+ *
407
+ * @type {number}
408
+ */
409
+ get brightness(): number;
410
+
411
+ /**
412
+ * Sets the brightness factor for this SceneModel.
413
+ *
414
+ * Multiplies by the rendered fragment colors of the model's main color render
415
+ * passes, for both textured and untextured meshes. Applied in the render
416
+ * pipeline, so it can be freely changed at any time. A factor > 1 brightens,
417
+ * < 1 darkens. Default is ````1.0````.
418
+ *
419
+ * @type {number}
420
+ */
421
+ set brightness(brightness: number);
422
+
423
+ /**
424
+ * Gets if this SceneModel casts a shadow.
425
+ *
426
+ * @type {Boolean}
427
+ */
428
+ get castsShadow(): boolean;
429
+
430
+ /**
431
+ * Sets if this SceneModel casts a shadow.
432
+ *
433
+ * @type {Boolean}
434
+ */
435
+ set castsShadow(castsShadow: boolean);
436
+
437
+ /**
438
+ * Sets if this SceneModel can have shadow cast upon it.
439
+ *
440
+ * @type {Boolean}
441
+ */
442
+ get receivesShadow(): boolean;
443
+
444
+ /**
445
+ * Sets if this SceneModel can have shadow cast upon it.
446
+ *
447
+ * @type {Boolean}
448
+ */
449
+ set receivesShadow(receivesShadow: boolean);
450
+
451
+ /**
452
+ * Gets if Scalable Ambient Obscurance (SAO) will apply to this SceneModel.
453
+ *
454
+ * SAO is configured by the Scene's {@link SAO} component.
455
+ *
456
+ * Only works when {@link SAO.enabled} is also true.
457
+ *
458
+ * @type {Boolean}
459
+ */
460
+ get saoEnabled(): boolean;
461
+
462
+ /**
463
+ * Gets if physically-based rendering (PBR) is enabled for this SceneModel.
464
+ *
465
+ * Only works when {@link Scene.pbrEnabled} is also true.
466
+ *
467
+ * @type {Boolean}
468
+ */
469
+ get pbrEnabled(): boolean;
470
+
471
+ /**
472
+ * Returns true to indicate that SceneModel is implements {@link Drawable}.
473
+ *
474
+ * @type {Boolean}
475
+ */
476
+ get isDrawable(): boolean;
477
+
478
+ /**
479
+ * Configures the appearance of xrayed {@link SceneModelEntity}s within this SceneModel.
480
+ *
481
+ * This is the {@link Scene.xrayMaterial}.
482
+ *
483
+ * @type {EmphasisMaterial}
484
+ */
485
+ get xrayMaterial(): EmphasisMaterial;
486
+
487
+ /**
488
+ * Configures the appearance of highlighted {@link SceneModelEntity}s within this SceneModel.
489
+ *
490
+ * This is the {@link Scene.highlightMaterial}.
491
+ *
492
+ * @type {EmphasisMaterial}
493
+ */
494
+ get highlightMaterial(): EmphasisMaterial;
495
+
496
+ /**
497
+ * Configures the appearance of selected {@link SceneModelEntity}s within this SceneModel.
498
+ *
499
+ * This is the {@link Scene.selectedMaterial}.
500
+ *
501
+ * @type {EmphasisMaterial}
502
+ */
503
+ get selectedMaterial(): EmphasisMaterial;
504
+
505
+ /**
506
+ * Configures the appearance of edges of {@link SceneModelEntity}s within this SceneModel.
507
+ *
508
+ * This is the {@link Scene.edgeMaterial}.
509
+ *
510
+ * @type {EdgeMaterial}
511
+ */
512
+ get edgeMaterial(): EdgeMaterial;
513
+
514
+ /**
515
+ * Creates a texture within this SceneModel.
516
+ *
517
+ * We can then supply the texture ID to {@link SceneModel#createTextureSet} when we want to create texture sets that use the texture.
518
+ *
519
+ * @param {*} cfg Texture properties.
520
+ * @param {string|number} cfg.id Mandatory ID for the texture, to refer to with {@link SceneModel#createTextureSet}.
521
+ * @param {string} [cfg.src] Image file for the texture. Assumed to be transcoded if not having a recognized image file
522
+ * extension (jpg, jpeg, png etc.). If transcoded, then assumes ````SceneModel```` is configured with a {@link TextureTranscoder}.
523
+ * @param {ArrayBuffer[]} [cfg.buffers] Transcoded texture data. Assumes ````SceneModel```` is
524
+ * configured with a {@link TextureTranscoder}. This parameter is given as an array of buffers so we can potentially support multi-image textures, such as cube maps.
525
+ * @param {HTMLImageElement} [cfg.image] HTML Image object to load into this texture. Overrides ````src```` and ````buffers````. Never transcoded.
526
+ * @param {number} [cfg.minFilter=LinearMipmapLinearFilter] How the texture is sampled when a texel covers less than one pixel.
527
+ * Supported values are {@link LinearMipmapLinearFilter}, {@link LinearMipMapNearestFilter}, {@link NearestMipMapNearestFilter}, {@link NearestMipMapLinearFilter} and {@link LinearMipMapLinearFilter}.
528
+ * @param {number} [cfg.magFilter=LinearFilter] How the texture is sampled when a texel covers more than one pixel. Supported values are {@link LinearFilter} and {@link NearestFilter}.
529
+ * @param {number} [cfg.wrapS=RepeatWrapping] Wrap parameter for texture coordinate *S*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.
530
+ * @param {number} [cfg.wrapT=RepeatWrapping] Wrap parameter for texture coordinate *T*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}..
531
+ * @param {number} [cfg.wrapR=RepeatWrapping] Wrap parameter for texture coordinate *R*. Supported values are {@link ClampToEdgeWrapping}, {@link MirroredRepeatWrapping} and {@link RepeatWrapping}.
532
+ * @param {Boolean} [cfg.flipY=false] Flips this Texture's source data along its vertical axis when ````true````.
533
+ * @param {number} [cfg.encoding=LinearEncoding] Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}.
534
+ */
535
+ createTexture(cfg: {
536
+ id: string | number;
537
+ src?: string;
538
+ buffer?: ArrayBuffer[];
539
+ image?: HTMLImageElement;
540
+ minFilter?: number;
541
+ magFilter?: number;
542
+ wrapS?: number;
543
+ wrapT?: number;
544
+ flipY?: boolean;
545
+ encoding?: number;
546
+ }): void;
547
+
548
+ /**
549
+ * Creates a texture set within this SceneModel.
550
+ *
551
+ * * Stores the new {@link SceneModelTextureSet} in {@link SceneModel#textureSets}.
552
+ *
553
+ * A texture set is a collection of textures that can be shared among meshes. We can then supply the texture set
554
+ * ID to {@link SceneModel#createMesh} when we want to create meshes that use the texture set.
555
+ *
556
+ * The textures can work as a texture atlas, where each mesh can have geometry UVs that index
557
+ * a different part of the textures. This allows us to minimize the number of textures in our models, which
558
+ * means faster rendering.
559
+ *
560
+ * @param {*} cfg Texture set properties.
561
+ * @param {string|number} cfg.id Mandatory ID for the texture set, to refer to with {@link SceneModel#createMesh}.
562
+ * @param {*} [cfg.colorTextureId] ID of *RGBA* base color texture, with color in *RGB* and alpha in *A*.
563
+ * @param {*} [cfg.metallicRoughnessTextureId] ID of *RGBA* metal-roughness texture, with the metallic factor in *R*, and roughness factor in *G*.
564
+ * @param {*} [cfg.normalsTextureId] ID of *RGBA* normal map texture, with normal map vectors in *RGB*.
565
+ * @param {*} [cfg.emissiveTextureId] ID of *RGBA* emissive map texture, with emissive color in *RGB*.
566
+ * @param {*} [cfg.occlusionTextureId] ID of *RGBA* occlusion map texture, with occlusion factor in *R*.
567
+ * @returns {SceneModelTransform} The new texture set.
568
+ */
569
+ createTextureSet(cfg: {
570
+ id: string | number;
571
+ colorTextureId?: string | number;
572
+ metallicRoughnessTextureId?: string | number;
573
+ normalsTextureId?: string | number;
574
+ emissiveTextureId?: string | number;
575
+ occlusionTextureId?: string | number;
576
+ }): SceneModelTextureSet;
577
+
578
+ /**
579
+ * Creates a reusable geometry within this SceneModel.
580
+ *
581
+ * We can then supply the geometry ID to {@link SceneModel.createMesh} when we want to create meshes that instance the geometry.
582
+ *
583
+ * If provide a ````positionsDecodeMatrix```` , then ````createGeometry()```` will assume
584
+ * that the ````positions```` and ````normals```` arrays are compressed. When compressed, ````positions```` will be
585
+ * quantized and in World-space, and ````normals```` will be oct-encoded and in World-space.
586
+ *
587
+ * Note that ````positions````, ````normals```` and ````indices```` are all required together.
588
+ *
589
+ * @param {*} cfg Geometry properties.
590
+ * @param {string|number} cfg.id Mandatory ID for the geometry, to refer to with {@link SceneModel.createMesh}.
591
+ * @param {string} cfg.primitive The primitive type. Accepted values are 'points', 'lines', 'triangles', 'solid' and 'surface'.
592
+ * @param {number[]} cfg.positions Flat array of positions.
593
+ * @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.
594
+ * @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````.
595
+ * @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````.
596
+ * @param {number[]} [cfg.indices] Array of indices. Not required for `points` primitives.
597
+ * @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 ````SceneModel```` constructor.
598
+ * @param {number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positions````.
599
+ * @param {number[]} [cfg.origin] Optional geometry origin, relative to {@link SceneModel.origin}. When this is given, then every mesh created with {@link SceneModel.createMesh} that uses this geometry will
600
+ * be transformed relative to this origin.
601
+ */
602
+ createGeometry(cfg: {
603
+ id: string | number;
604
+ primitive: "lines" | "triangles" | "solid" | "surface";
605
+ positions: number[];
606
+ normals: number[];
607
+ colors: number[];
608
+ colorsCompressed: number[];
609
+ indices: number[];
610
+ edgeIndices: number[];
611
+ positionsDecodeMatrix: number[];
612
+ origin?: number[];
613
+ }): void;
614
+
615
+ /**
616
+ * Creates a new {@link SceneModelTransform} within this SceneModel.
617
+ *
618
+ * * Stores the new {@link SceneModelTransform} in {@link SceneModel#transforms}.
619
+ * * Can be connected into hierarchies
620
+ * * Each {@link SceneModelTransform} can be used by unlimited {@link SceneModelMesh}es
621
+ *
622
+ * @param {*} cfg Transform creation parameters.
623
+ * @param {string} cfg.id Mandatory ID for the new transform. Must not clash with any existing components within the {@link Scene}.
624
+ * @param {string} [cfg.parentTransformId] ID of a parent transform, previously created with {@link SceneModel#createTextureSet}.
625
+ * @param {number[]} [cfg.position=[0,0,0]] Local 3D position of the mesh. Overridden by ````transformId````.
626
+ * @param {number[]} [cfg.scale=[1,1,1]] Scale of the transform.
627
+ * @param {number[]} [cfg.rotation=[0,0,0]] Rotation of the transform as Euler angles given in degrees, for each of the X, Y and Z axis.
628
+ * @param {number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] Modelling transform matrix. Overrides the ````position````, ````scale```` and ````rotation```` parameters.
629
+ * @returns {SceneModelTransform} The new transform.
630
+ */
631
+ createTransform(cfg: {
632
+ id: string | number;
633
+ parentTransformId: string | number;
634
+ position?: number[];
635
+ scale?: number[];
636
+ rotation?: number[];
637
+ matrix?: number[];
638
+ }): SceneModelMesh;
639
+
640
+ /**
641
+ * Creates a new {@link SceneModelMesh} within this SceneModel.
642
+ *
643
+ * * It prepares and saves data for a SceneModelMesh {@link SceneModel#meshes} creation. SceneModelMesh will be created only once the SceneModelEntity (which references this particular SceneModelMesh) will be created.
644
+ * * The SceneModelMesh can either define its own geometry or share it with other SceneModelMeshes. To define own geometry, provide the
645
+ * various geometry arrays to this method. To share a geometry, provide the ID of a geometry created earlier
646
+ * with {@link SceneModel#createGeometry}.
647
+ * * If you accompany the arrays with an ````origin````, then ````createMesh()```` will assume
648
+ * that the geometry ````positions```` are in relative-to-center (RTC) coordinates, with ````origin```` being the
649
+ * origin of their RTC coordinate system.
650
+ *
651
+ * @param {object} cfg Object properties.
652
+ * @param {String} cfg.id Mandatory ID for the new mesh. Must not clash with any existing components within the {@link Scene}.
653
+ * @param {String|Number} [cfg.textureSetId] ID of a {@link SceneModelTextureSet} previously created with {@link SceneModel#createTextureSet}.
654
+ * @param {String|Number} [cfg.transformId] ID of a {@link SceneModelTransform} to instance, previously created with {@link SceneModel#createTransform}. Overrides all other transform parameters given to this method.
655
+ * @param {String|Number} [cfg.geometryId] ID of a geometry to instance, previously created with {@link SceneModel#createGeometry}. Overrides all other geometry parameters given to this method.
656
+ * @param {String} cfg.primitive The primitive type. Accepted values are 'points', 'lines', 'triangles', 'solid' and 'surface'.
657
+ * @param {Number[]} [cfg.positions] Flat array of uncompressed 3D vertex positions positions. Required for all primitive types. Overridden by ````positionsCompressed````.
658
+ * @param {Number[]} [cfg.positionsCompressed] Flat array of quantized 3D vertex positions. Overrides ````positions````, and must be accompanied by ````positionsDecodeMatrix````.
659
+ * @param {Number[]} [cfg.positionsDecodeMatrix] A 4x4 matrix for decompressing ````positionsCompressed````. Must be accompanied by ````positionsCompressed````.
660
+ * @param {Number[]} [cfg.normals] Flat array of normal vectors. Only used with "triangles", "solid" and "surface" primitives. When no normals are given, the geometry will be flat shaded using auto-generated face-aligned normals.
661
+ * @param {Number[]} [cfg.normalsCompressed] Flat array of oct-encoded normal vectors. Overrides ````normals````. Only used with "triangles", "solid" and "surface" primitives. When no normals are given, the geometry will be flat shaded using auto-generated face-aligned normals.
662
+ * @param {Number[]} [cfg.colors] Flat array of uncompressed RGBA vertex colors, as float values in range ````[0..1]````. Ignored when ````geometryId```` is given. Overridden by ````color```` and ````colorsCompressed````.
663
+ * @param {Number[]} [cfg.colorsCompressed] Flat array of compressed RGBA vertex colors, as unsigned short integers in range ````[0..255]````. Ignored when ````geometryId```` is given. Overrides ````colors```` and is overridden by ````color````.
664
+ * @param {Number[]} [cfg.uv] Flat array of uncompressed vertex UV coordinates. Only used with "triangles", "solid" and "surface" primitives. Required for textured rendering.
665
+ * @param {Number[]} [cfg.uvCompressed] Flat array of compressed vertex UV coordinates. Only used with "triangles", "solid" and "surface" primitives. Overrides ````uv````. Must be accompanied by ````uvDecodeMatrix````. Only used with "triangles", "solid" and "surface" primitives. Required for textured rendering.
666
+ * @param {Number[]} [cfg.uvDecodeMatrix] A 3x3 matrix for decompressing ````uvCompressed````.
667
+ * @param {Number[]} [cfg.indices] Array of primitive connectivity indices. Not required for `points` primitives.
668
+ * @param {Number[]} [cfg.edgeIndices] Array of edge line indices. Used only with 'triangles', 'solid' and 'surface' primitives. Automatically generated internally if not supplied, using the optional ````edgeThreshold```` given to the ````SceneModel```` constructor.
669
+ * @param {Number[]} [cfg.origin] Optional geometry origin, relative to {@link SceneModel#origin}. When this is given, then ````positions```` are assumed to be relative to this.
670
+ * @param {Number[]} [cfg.position=[0,0,0]] Local 3D position of the mesh. Overridden by ````transformId````.
671
+ * @param {Number[]} [cfg.scale=[1,1,1]] Scale of the mesh. Overridden by ````transformId````.
672
+ * @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. Overridden by ````transformId````.
673
+ * @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. Also overridden by ````transformId````.
674
+ * @param {Number[]} [cfg.color=[1,1,1]] RGB color in range ````[0..1, 0..1, 0..1]````. Overridden by texture set ````colorTexture````. Overrides ````colors```` and ````colorsCompressed````.
675
+ * @param {Number} [cfg.opacity=1] Opacity in range ````[0..1]````. Overridden by texture set ````colorTexture````.
676
+ * @param {Number} [cfg.metallic=0] Metallic factor in range ````[0..1]````. Overridden by texture set ````metallicRoughnessTexture````.
677
+ * @param {Number} [cfg.roughness=1] Roughness factor in range ````[0..1]````. Overridden by texture set ````metallicRoughnessTexture````.
678
+ * @returns {Boolean} True = successfully mesh was created. False = error during creation of a mesh.
679
+ */
680
+ createMesh(cfg: {
681
+ id: string;
682
+ textureSetId?: string | number;
683
+ transformId?: string | number;
684
+ geometryId?: string | number;
685
+ primitive: "lines" | "triangles" | "points";
686
+ positions: number[];
687
+ positionsCompressed: number[];
688
+ positionsDecodeMatrix: number[];
689
+ normals: number[];
690
+ normalsCompressed: number[];
691
+ colors: number[];
692
+ colorsCompressed: number[];
693
+ uv: number[];
694
+ uvCompressed: number[];
695
+ uvDecodeMatrix: number[];
696
+ indices: number[];
697
+ edgeIndices: number[];
698
+ origin?: number[];
699
+ position?: number[];
700
+ scale?: number[];
701
+ rotation?: number[];
702
+ matrix?: number[];
703
+ color?: number[];
704
+ opacity?: number;
705
+ metallic?: number;
706
+ roughness?: number;
707
+ }): boolean;
708
+
709
+ /**
710
+ * Creates an {@link SceneModelEntity} within this SceneModel, giving it one or more meshes previously created with {@link SceneModel.createMesh}.
711
+ *
712
+ * A mesh can only belong to one {@link SceneModelEntity}, so you'll get an error if you try to reuse a mesh among multiple {@link SceneModelEntity}s.
713
+ *
714
+ * @param {Object} cfg SceneModelEntity configuration.
715
+ * @param {string} cfg.id Optional ID for the new SceneModelEntity. Must not clash with any existing components within the {@link Scene}.
716
+ * @param {string[]} cfg.meshIds IDs of one or more meshes created previously with {@link SceneModel@createMesh}.
717
+
718
+ * @param {Boolean} [cfg.isObject] Set ````true```` if the {@link SceneModelEntity} represents an object, in which case it will be registered by {@link SceneModelEntity.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}.
719
+ * @param {Boolean} [cfg.visible=true] Indicates if the SceneModelEntity is initially visible.
720
+ * @param {Boolean} [cfg.culled=false] Indicates if the SceneModelEntity is initially culled from view.
721
+ * @param {Boolean} [cfg.pickable=true] Indicates if the SceneModelEntity is initially pickable.
722
+ * @param {Boolean} [cfg.clippable=true] Indicates if the SceneModelEntity is initially clippable.
723
+ * @param {Boolean} [cfg.collidable=true] Indicates if the SceneModelEntity is initially included in boundary calculations.
724
+ * @param {Boolean} [cfg.castsShadow=true] Indicates if the SceneModelEntity initially casts shadows.
725
+ * @param {Boolean} [cfg.receivesShadow=true] Indicates if the SceneModelEntity initially receives shadows.
726
+ * @param {Boolean} [cfg.xrayed=false] Indicates if the SceneModelEntity is initially xrayed. XRayed appearance is configured by {@link SceneModel.xrayMaterial}.
727
+ * @param {Boolean} [cfg.highlighted=false] Indicates if the SceneModelEntity is initially highlighted. Highlighted appearance is configured by {@link SceneModel.highlightMaterial}.
728
+ * @param {Boolean} [cfg.selected=false] Indicates if the SceneModelEntity is initially selected. Selected appearance is configured by {@link SceneModel.selectedMaterial}.
729
+ * @param {Boolean} [cfg.edges=false] Indicates if the SceneModelEntity's edges are initially emphasized. Edges appearance is configured by {@link SceneModel.edgeMaterial}.
730
+ * @returns {SceneModelEntity}
731
+ */
732
+ createEntity(cfg: {
733
+ id: string;
734
+ meshIds: string[];
735
+ isObject: boolean;
736
+ visible?: boolean;
737
+ culled?: boolean;
738
+ pickable?: boolean;
739
+ clippable?: boolean;
740
+ collidable?: boolean;
741
+ castsShadow?: boolean;
742
+ receivesShadow?: boolean;
743
+ xrayed?: boolean;
744
+ highlighted?: boolean;
745
+ selected?: boolean;
746
+ edges?: boolean;
747
+ }): SceneModelEntity;
748
+
749
+ /**
750
+ * Finalizes this SceneModel.
751
+ *
752
+ * Immediately creates the SceneModel's {@link SceneModelEntity}s within the {@link Scene}.
753
+ *
754
+ * Once finalized, you can't add anything more to this SceneModel.
755
+ */
756
+ finalize(): void;
757
+ }