@xtctwins/tctwins-core 1.1.0 → 1.1.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.
@@ -1,909 +1,909 @@
1
- import { Component } from "../Component";
2
- import { Camera } from "../camera/Camera";
3
- import { PickResult } from "../webgl/PickResult";
4
- import { SAO } from "../postfx/SAO";
5
- import { Entity } from "../Entity";
6
- import { ReadableGeometry } from "../geometry";
7
- import { EdgeMaterial, EmphasisMaterial, PhongMaterial, PointsMaterial, LinesMaterial } from "../materials";
8
- import { Viewport } from "../viewport/Viewport";
9
- import { VBOSceneModel } from "../models/VBOSceneModel/VBOSceneModel";
10
- import { Mesh } from "../mesh";
11
- import { Node } from "../nodes";
12
- import { Input } from "../input/input";
13
- import { SceneModel } from "../models";
14
-
15
- export declare type TickEvent = {
16
- /** The ID of this Scene. */
17
- sceneID: string;
18
- /** The time in seconds since 1970 that this Scene was instantiated. */
19
- startTime: Number;
20
- /** The time in seconds since 1970 of this "tick" event. */
21
- time: Number;
22
- /** The time of the previous "tick" event from this Scene.. */
23
- prevTime: Number;
24
- /** The time in seconds since the previous "tick" event from this Scene. */
25
- deltaTime: Number;
26
- };
27
-
28
- export declare class Scene extends Component {
29
- /**
30
- * Fires when a model is loaded
31
- * @param event The loaded event
32
- * @param callback Called fired on the event
33
- * @param scope Scope for the callback
34
- */
35
- on(event: "modelLoaded", callback: (modelId: string) => void, scope?: any): string;
36
-
37
- /**
38
- * Fires when a model is unloaded
39
- * @param event The loaded event
40
- * @param callback Called fired on the event
41
- * @param scope Scope for the callback
42
- */
43
- on(event: "modelUnloaded", callback: (modelId: string) => void, scope?: any): string;
44
-
45
- /**
46
- * Fired when about to render a frame for a Scene.
47
- * @param event The rendering event
48
- * @param callback Called fired on the event
49
- * @param scope Scope for the callback
50
- */
51
- on(event: "rendering", callback: (renderEvent: { sceneId: number; pass: number }) => void, scope?: any): string;
52
-
53
- /**
54
- * Fired when we have just rendered a frame for a Scene.
55
- * @param event The rendered event
56
- * @param callback Called fired on the event
57
- * @param scope Scope for the callback
58
- */
59
- on(event: "rendered", callback: (renderEvent: { sceneId: number; pass: number }) => void, scope?: any): string;
60
-
61
- /**
62
- * Fires when the entity visibility is updated.
63
- * @param event The rendered event
64
- * @param callback Called fired on the event
65
- * @param scope Scope for the callback
66
- */
67
- on(
68
- event: "objectVisibility" | "objectXRayed" | "objectHighlighted" | "objectSelected",
69
- callback: (entity: VBOSceneModel | Mesh | Node) => void,
70
- scope?: any
71
- ): string;
72
-
73
- /**
74
- * Fired on each game loop iteration.
75
- * @event event The tick event
76
- * @param callback Called fired on the event
77
- * @param scope Scope for the callback
78
- */
79
- on(event: "tick", callback: (tickEvent: TickEvent) => void, scope?: any): string;
80
-
81
- /**
82
- * fired when scene.aabb is update
83
- * @param event
84
- * @param callback
85
- */
86
- on(event: "aabb", callback: (aabb: Float32Array | Float64Array) => void): void;
87
-
88
- /**
89
- * return lights objects
90
- */
91
- get lightsObject(): any;
92
-
93
- /**
94
- * The epoch time (in milliseconds since 1970) when this Scene was instantiated.
95
- */
96
- get startTime(): Date;
97
-
98
- /**
99
- * canvas
100
- */
101
- get canvas(): any;
102
-
103
- /**
104
- * Sets whether data texture scene representation (DTX) is enabled for the {@link Scene}.
105
- *
106
- * Even when enabled, DTX will only work if supported.
107
- *
108
- * Default value is ````false````.
109
- *
110
- * @type {Boolean}
111
- */
112
- set dtxEnabled(value: boolean);
113
-
114
- /**
115
- * Gets whether data texture-based scene representation (DTX) is enabled for the {@link Scene}.
116
- *
117
- * Even when enabled, DTX will only apply if supported.
118
- *
119
- * Default value is ````false````.
120
- *
121
- * @type {Boolean}
122
- */
123
- get dtxEnabled(): boolean;
124
-
125
- /**
126
- * Sets whether physically-based rendering is enabled.
127
- * Default is ````false````.
128
- * @param {boolean} pbrEnabled
129
- */
130
- set pbrEnabled(pbrEnabled: boolean);
131
-
132
- /**
133
- * Gets whether physically-based rendering is enabled.
134
- * Default is ````false````.
135
- * @returns {Boolean} True if quality rendering is enabled.
136
- */
137
- get pbrEnabled(): boolean;
138
-
139
- /**+
140
- * Sets whether environment light rendering is enabled.
141
- * Default is ````false````.
142
- * @param {boolean} saoEnabled
143
- */
144
- set saoEnabled(saoEnabled: boolean);
145
-
146
- /**
147
- * Gets whether environment light rendering is enabled.
148
- * Default is ````false````.
149
- * @returns {boolean}
150
- */
151
- get saoEnabled(): boolean;
152
-
153
- /**
154
- * set showedges enable
155
- * @param {boolean} edgesEnabled
156
- */
157
- set edgesEnabled(edgesEnabled: boolean);
158
-
159
- /**
160
- * @param {boolean} trans
161
- */
162
- get edgesEnabled(): boolean;
163
-
164
- /**
165
- * Sets whether basic color texture rendering is enabled.
166
- *
167
- * Default is ````true````.
168
- *
169
- * @param {Boolean} colorTextureEnabled
170
- */
171
- set colorTextureEnabled(colorTextureEnabled: boolean);
172
-
173
- /**
174
- * Gets whether basic color texture rendering is enabled.
175
- *
176
- * Default is ````true````.
177
- *
178
- * @returns {Boolean} True if basic color texture rendering is enabled.
179
- */
180
- get colorTextureEnabled(): boolean;
181
-
182
- /**
183
- * set whether transparent of canvas background
184
- * @param {boolean} trans
185
- */
186
- set backgroundTransparent(trans: boolean);
187
-
188
- /**
189
- * @returns {boolean} backgroundTransparent
190
- */
191
- get backgroundTransparent(): boolean;
192
-
193
- /**
194
- * set background color
195
- * @param {[]} color
196
- */
197
- set backgroundColor(color: []);
198
-
199
- /**
200
- * return backgroundColor
201
- * @returns {boolean} backgroundColor
202
- */
203
- get backgroundColor(): [];
204
-
205
- /**
206
- * Map of {@link Entity}s that represent models.
207
- *
208
- * Each {@link Entity} is mapped here by {@link Entity.id} when {@link Entity.isModel} is ````true````.
209
- * @type {{String:Entity}}
210
- */
211
- get models(): { [key: string]: SceneModel };
212
-
213
- /**
214
- * Map of {@link Entity}s that represents objects.
215
- *
216
- * Each {@link Entity} is mapped here by {@link Entity.id} when {@link Entity.isObject} is ````true````.
217
- * @final
218
- * @type {{String:Entity}}
219
- */
220
- get objects(): { [key: string]: Entity };
221
-
222
- /**
223
- * Map of currently visible {@link Entity}s that represent objects.
224
- *
225
- * An Entity represents an object if {@link Entity.isObject} is ````true````, and is visible when {@link Entity.visible} is true.
226
- * @type {{String:Object}}
227
- */
228
- get visibleObjects(): { [key: string]: Entity };
229
-
230
- /**
231
- * Map of currently xrayed {@link Entity}s that represent objects.
232
- *
233
- * An Entity represents an object if {@link Entity.isObject} is ````true````, and is xrayed when {@link Entity.xrayed} is true.
234
- *
235
- * Each {@link Entity} is mapped here by {@link Entity.id}.
236
- *
237
- * @type {{String:Object}}
238
- */
239
- get xrayedObjects(): { [key: string]: Entity };
240
-
241
- /**
242
- * Map of currently highlighted {@link Entity}s that represent objects.
243
- *
244
- * An Entity represents an object if {@link Entity.isObject} is ````true```` is true, and is highlighted when {@link Entity.highlighted} is true.
245
- *
246
- * Each {@link Entity} is mapped here by {@link Entity.id}.
247
- *
248
- * @type {{String:Object}}
249
- */
250
- get highlightedObjects(): { [key: string]: Entity };
251
-
252
- /**
253
- * Map of currently selected {@link Entity}s that represent objects.
254
- *
255
- * An Entity represents an object if {@link Entity.isObject} is true, and is selected while {@link Entity.selected} is true.
256
- *
257
- * Each {@link Entity} is mapped here by {@link Entity.id}.
258
- *
259
- * @type {{String:Object}}
260
- */
261
- get selectedObjects(): { [key: string]: Entity };
262
-
263
- /**
264
- * Map of currently colorized {@link Entity}s that represent objects.
265
- *
266
- * An Entity represents an object if {@link Entity.isObject} is ````true````.
267
- *
268
- * Each {@link Entity} is mapped here by {@link Entity.id}.
269
- *
270
- * @type {{String:Object}}
271
- */
272
- get colorizedObjects(): { [key: string]: Entity };
273
-
274
- /**
275
- * Map of {@link Entity}s that represent objects whose opacity was updated.
276
- *
277
- * An Entity represents an object if {@link Entity.isObject} is ````true````.
278
- *
279
- * Each {@link Entity} is mapped here by {@link Entity.id}.
280
- *
281
- * @type {{String:Object}}
282
- */
283
- get opacityObjects(): { [key: string]: Entity };
284
-
285
- /**
286
- * Map of {@link Entity}s that represent objects whose {@link Entity.offset}s were updated.
287
- *
288
- * An Entity represents an object if {@link Entity.isObject} is ````true````.
289
- *
290
- * Each {@link Entity} is mapped here by {@link Entity.id}.
291
- *
292
- * @property offsetObjects
293
- * @final
294
- * @type {{String:Object}}
295
- */
296
- get offsetObjects(): { [key: string]: Entity };
297
-
298
- /**
299
- * Whether {@link Entity.offset} is enabled.
300
- *
301
- * This is set via the {@link Viewer} constructor and is ````false```` by default.
302
- *
303
- * @returns {Boolean} True if {@link Entity.offset} is enabled.
304
- */
305
- get entityOffsetsEnabled(): boolean;
306
-
307
- /**
308
- * Whether precision surface picking is enabled.
309
- *
310
- * This is set via the {@link Viewer} constructor and is ````false```` by default.
311
- *
312
- * The ````pickSurfacePrecision```` option for ````Scene.pick```` only works if this is set ````true````.
313
- *
314
- * Note that when ````true````, this configuration will increase the amount of browser memory used by the Viewer.
315
- *
316
- * @returns {Boolean} True if precision picking is enabled.
317
- */
318
- get pickSurfacePrecisionEnabled(): boolean;
319
-
320
- /**
321
- * Whether logarithmic depth buffer is enabled.
322
- *
323
- * This is set via the {@link Viewer} constructor and is ````false```` by default.
324
- *
325
- * @returns {Boolean} True if logarithmic depth buffer is enabled.
326
- */
327
- get logarithmicDepthBufferEnabled(): boolean;
328
-
329
- /**
330
- * Gets the IDs of the {@link Entity}s in {@link Scene.models}.
331
- *
332
- * @type {String[]}
333
- */
334
- get modelIds(): string[];
335
-
336
- /**
337
- * Gets the number of {@link Entity}s in {@link Scene.objects}.
338
- *
339
- * @type {Number}
340
- */
341
- get numObjects(): number;
342
-
343
- /**
344
- * Gets the IDs of the {@link Entity}s in {@link Scene.objects}.
345
- *
346
- * @type {String[]}
347
- */
348
- get objectIds(): string[];
349
-
350
- /**
351
- * Gets the number of {@link Entity}s in {@link Scene.visibleObjects}.
352
- *
353
- * @type {Number}
354
- */
355
- get numVisibleObjects(): number;
356
-
357
- /**
358
- * Gets the IDs of the {@link Entity}s in {@link Scene.visibleObjects}.
359
- *
360
- * @type {String[]}
361
- */
362
- get visibleObjectIds(): string[];
363
-
364
- /**
365
- * Gets the number of {@link Entity}s in {@link Scene.xrayedObjects}.
366
- *
367
- * @type {Number}
368
- */
369
- get numXRayedObjects(): number;
370
-
371
- /**
372
- * Gets the IDs of the {@link Entity}s in {@link Scene.xrayedObjects}.
373
- *
374
- * @type {String[]}
375
- */
376
- get xrayedObjectIds(): string[];
377
-
378
- /**
379
- * Gets the number of {@link Entity}s in {@link Scene.highlightedObjects}.
380
- *
381
- * @type {Number}
382
- */
383
- get numHighlightedObjects(): number;
384
-
385
- /**
386
- * Gets the IDs of the {@link Entity}s in {@link Scene.highlightedObjects}.
387
- *
388
- * @type {String[]}
389
- */
390
- get highlightedObjectIds(): string[];
391
-
392
- /**
393
- * Gets the number of {@link Entity}s in {@link Scene.selectedObjects}.
394
- *
395
- * @type {Number}
396
- */
397
- get numSelectedObjects(): number;
398
-
399
- /**
400
- * Gets the IDs of the {@link Entity}s in {@link Scene.selectedObjects}.
401
- *
402
- * @type {String[]}
403
- */
404
- get selectedObjectIds(): string[];
405
-
406
- /**
407
- * Gets the number of {@link Entity}s in {@link Scene.colorizedObjects}.
408
- *
409
- * @type {Number}
410
- */
411
- get numColorizedObjects(): number;
412
-
413
- /**
414
- * Gets the IDs of the {@link Entity}s in {@link Scene.colorizedObjects}.
415
- *
416
- * @type {String[]}
417
- */
418
- get colorizedObjectIds(): string[];
419
-
420
- /**
421
- * Gets the IDs of the {@link Entity}s in {@link Scene.opacityObjects}.
422
- *
423
- * @type {String[]}
424
- */
425
- get opacityObjectIds(): string[];
426
-
427
- /**
428
- * Gets the IDs of the {@link Entity}s in {@link Scene.offsetObjects}.
429
- *
430
- * @type {String[]}
431
- */
432
- get offsetObjectIds(): string[];
433
-
434
- /**
435
- * Sets the number of "ticks" that happen between each render or this Scene.
436
- *
437
- * Default value is ````1````.
438
- *
439
- * @type {Number}
440
- */
441
- set ticksPerRender(value: number);
442
-
443
- /**
444
- * Gets the number of "ticks" that happen between each render or this Scene.
445
- *
446
- * Default value is ````1````.
447
- *
448
- * @type {Number}
449
- */
450
- get ticksPerRender(): number;
451
-
452
- /**
453
- * Sets the number of "ticks" that happen between occlusion testing for {@link Marker}s.
454
- *
455
- * Default value is ````20````.
456
- *
457
- * @type {Number}
458
- */
459
- set ticksPerOcclusionTest(value: number);
460
-
461
- /**
462
- * Gets the number of "ticks" that happen between each render of this Scene.
463
- *
464
- * Default value is ````1````.
465
- *
466
- * @type {Number}
467
- */
468
- get ticksPerOcclusionTest(): number;
469
-
470
- /**
471
- * Sets the number of times this Scene renders per frame.
472
- *
473
- * Default value is ````1````.
474
- *
475
- * @type {Number}
476
- */
477
- set passes(value: number);
478
-
479
- /**
480
- * Gets the number of times this Scene renders per frame.
481
- *
482
- * Default value is ````1````.
483
- *
484
- * @type {Number}
485
- */
486
- get passes(): number;
487
-
488
- /**
489
- * When {@link Scene.passes} is greater than ````1````, indicates whether or not to clear the canvas before each pass (````true````) or just before the first pass (````false````).
490
- *
491
- * Default value is ````false````.
492
- *
493
- * @type {Boolean}
494
- */
495
- set clearEachPass(value: boolean);
496
-
497
- /**
498
- * When {@link Scene.passes} is greater than ````1````, indicates whether or not to clear the canvas before each pass (````true````) or just before the first pass (````false````).
499
- *
500
- * Default value is ````false````.
501
- *
502
- * @type {Boolean}
503
- */
504
- get clearEachPass(): boolean;
505
-
506
- /**
507
- * Sets whether or not {@link Scene} should expect all {@link Texture}s and colors to have pre-multiplied gamma.
508
- *
509
- * Default value is ````false````.
510
- *
511
- * @type {Boolean}
512
- */
513
- set gammaInput(value: boolean);
514
-
515
- /**
516
- * Gets whether or not {@link Scene} should expect all {@link Texture}s and colors to have pre-multiplied gamma.
517
- *
518
- * Default value is ````false````.
519
- *
520
- * @type {Boolean}
521
- */
522
- get gammaInput(): boolean;
523
-
524
- /**
525
- * Sets whether or not to render pixels with pre-multiplied gama.
526
- *
527
- * Default value is ````false````.
528
- *
529
- * @type {Boolean}
530
- */
531
- set gammaOutput(value: boolean);
532
-
533
- /**
534
- * Gets whether or not to render pixels with pre-multiplied gama.
535
- *
536
- * Default value is ````true````.
537
- *
538
- * @type {Boolean}
539
- */
540
- get gammaOutput(): boolean;
541
-
542
- /**
543
- * Sets the gamma factor to use when {@link Scene.gammaOutput} is set true.
544
- *
545
- * Default value is ````2.2````.
546
- *
547
- * @type {Number}
548
- */
549
- set gammaFactor(value: number);
550
-
551
- /**
552
- * Gets the gamma factor to use when {@link Scene.gammaOutput} is set true.
553
- *
554
- * Default value is ````2.2````.
555
- *
556
- * @type {Number}
557
- */
558
- get gammaFactor(): number;
559
-
560
- /**
561
- * Gets the default {@link Geometry} for this Scene, which is a {@link ReadableGeometry} with a unit-sized box shape.
562
- *
563
- * Has {@link ReadableGeometry.id} set to "default.geometry".
564
- *
565
- * {@link Mesh}s in this Scene have {@link Mesh.geometry} set to this {@link ReadableGeometry} by default.
566
- *
567
- * @type {ReadableGeometry}
568
- */
569
- get geometry(): ReadableGeometry;
570
-
571
- /**
572
- * Gets the default {@link Material} for this Scene, which is a {@link PhongMaterial}.
573
- *
574
- * Has {@link PhongMaterial.id} set to "default.material".
575
- *
576
- * {@link Mesh}s in this Scene have {@link Mesh.material} set to this {@link PhongMaterial} by default.
577
- *
578
- * @type {PhongMaterial}
579
- */
580
- get material(): PhongMaterial;
581
-
582
- /**
583
- * Gets the default xraying {@link EmphasisMaterial} for this Scene.
584
- *
585
- * Has {@link EmphasisMaterial.id} set to "default.xrayMaterial".
586
- *
587
- * {@link Mesh}s in this Scene have {@link Mesh.xrayMaterial} set to this {@link EmphasisMaterial} by default.
588
- *
589
- * {@link Mesh}s are xrayed while {@link Mesh.xrayed} is ````true````.
590
- *
591
- * @type {EmphasisMaterial}
592
- */
593
- get xrayMaterial(): EmphasisMaterial;
594
-
595
- /**
596
- * Gets the default highlight {@link EmphasisMaterial} for this Scene.
597
- *
598
- * Has {@link EmphasisMaterial.id} set to "default.highlightMaterial".
599
- *
600
- * {@link Mesh}s in this Scene have {@link Mesh.highlightMaterial} set to this {@link EmphasisMaterial} by default.
601
- *
602
- * {@link Mesh}s are highlighted while {@link Mesh.highlighted} is ````true````.
603
- *
604
- * @type {EmphasisMaterial}
605
- */
606
- get highlightMaterial(): EmphasisMaterial;
607
-
608
- /**
609
- * Gets the default selection {@link EmphasisMaterial} for this Scene.
610
- *
611
- * Has {@link EmphasisMaterial.id} set to "default.selectedMaterial".
612
- *
613
- * {@link Mesh}s in this Scene have {@link Mesh.highlightMaterial} set to this {@link EmphasisMaterial} by default.
614
- *
615
- * {@link Mesh}s are highlighted while {@link Mesh.highlighted} is ````true````.
616
- *
617
- * @type {EmphasisMaterial}
618
- */
619
- get selectedMaterial(): EmphasisMaterial;
620
-
621
- /**
622
- * Gets the default {@link EdgeMaterial} for this Scene.
623
- *
624
- * Has {@link EdgeMaterial.id} set to "default.edgeMaterial".
625
- *
626
- * {@link Mesh}s in this Scene have {@link Mesh.edgeMaterial} set to this {@link EdgeMaterial} by default.
627
- *
628
- * {@link Mesh}s have their edges emphasized while {@link Mesh.edges} is ````true````.
629
- *
630
- * @type {EdgeMaterial}
631
- */
632
- get edgeMaterial(): EdgeMaterial;
633
-
634
- /**
635
- * Gets the {@link PointsMaterial} for this Scene.
636
- *
637
- * @type {PointsMaterial}
638
- */
639
- get pointsMaterial(): PointsMaterial;
640
-
641
- /**
642
- * Gets the {@link LinesMaterial} for this Scene.
643
- *
644
- * @type {LinesMaterial}
645
- */
646
- get linesMaterial(): LinesMaterial;
647
-
648
- /**
649
- * Gets the {@link Viewport} for this Scene.
650
- *
651
- * @type Viewport
652
- */
653
- get viewport(): Viewport;
654
-
655
- /**
656
- * Gets the {@link Camera} for this Scene.
657
- *
658
- * @type {Camera}
659
- */
660
- get camera(): Camera;
661
-
662
- /**
663
- * Gets the World-space 3D center of this Scene.
664
- *
665
- *@type {Number[]}
666
- */
667
- get center(): number[];
668
-
669
- /**
670
- * Gets the World-space axis-aligned 3D boundary (AABB) of this Scene.
671
- *
672
- * The AABB is represented by a six-element Float64Array containing the min/max extents of the axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
673
- *
674
- * When the Scene has no content, will be ````[-100,-100,-100,100,100,100]````.
675
- *
676
- * @type {Number[]}
677
- */
678
- get aabb(): number[];
679
-
680
- get aabbs(): any;
681
-
682
- get sao(): SAO;
683
-
684
- get input(): Input;
685
-
686
- /**
687
- * Performs an occlusion test on all {@link Marker}s in this {@link Scene}.
688
- *
689
- * Sets each {@link Marker.visible} ````true```` if the Marker is currently not occluded by any opaque {@link Entity}s
690
- * in the Scene, or ````false```` if an Entity is occluding it.
691
- */
692
- doOcclusionTest(): void;
693
-
694
- /**
695
- * Renders a single frame of this Scene.
696
- *
697
- * The Scene will periodically render itself after any updates, but you can call this method to force a render
698
- * if required.
699
- *
700
- * @param {Boolean} [forceRender=false] Forces a render when true, otherwise only renders if something has changed in this Scene
701
- * since the last render.
702
- */
703
- render(forceRender?: boolean): void;
704
-
705
- /**
706
- * Attempts to pick an {@link Entity} in this Scene.
707
- * @param {*} params Picking parameters.
708
- * @param {Boolean} [params.pickSurface=false] Whether to find the picked position on the surface of the Entity.
709
- * @param {Boolean} [params.pickSurfacePrecision=false] When picking an Entity surface position, indicates whether or not we want full-precision {@link PickResult.worldPos}. Only works when {@link Scene.pickSurfacePrecisionEnabled} is ````true````. If pick succeeds, the returned {@link PickResult} will have {@link PickResult.precision} set ````true````, to indicate that it contains full-precision surface pick results.
710
- * @param {Boolean} [params.pickSurfaceNormal=false] Whether to find the picked normal on the surface of the Entity. Only works if ````pickSurface```` is given.
711
- * @param {Number[]} [params.canvasPos] Canvas-space coordinates. When ray-picking, this will override the **origin** and ** direction** parameters and will cause the ray to be fired through the canvas at this position, directly along the negative View-space Z-axis.
712
- * @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
713
- * @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
714
- * @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
715
- * @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
716
- * @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
717
- * @param {PickResult} [pickResult] Holds the results of the pick attempt. Will use the Scene's singleton PickResult if you don't supply your own.
718
- * @returns {PickResult} Holds results of the pick attempt, returned when an {@link Entity} is picked, else null. See method comments for description.
719
- */
720
- pick(
721
- params: {
722
- pickSurface?: boolean;
723
- pickSurfacePrecision?: boolean;
724
- pickSurfaceNormal?: boolean;
725
- canvasPos?: number[];
726
- origin?: number[];
727
- direction?: number[];
728
- matrix?: number[];
729
- includeEntities?: string[];
730
- excludeEntities?: string[];
731
- },
732
- pickResult?: PickResult
733
- ): PickResult | null;
734
-
735
- /**
736
- * Destroys all non-default {@link Component}s in this Scene.
737
- */
738
- clear(): void;
739
-
740
- /**
741
- * Destroys all {@link Light}s in this Scene..
742
- */
743
- clearLights(): void;
744
-
745
- /**
746
- * Destroys all {@link SectionPlane}s in this Scene.
747
- */
748
- clearSectionPlanes(): void;
749
-
750
- /**
751
- * Gets the collective axis-aligned boundary (AABB) of a batch of {@link Entity}s that represent objects.
752
- *
753
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
754
- *
755
- * Each {@link Entity} on which {@link Entity.isObject} is registered by {@link Entity.id} in {@link Scene.visibleObjects}.
756
- *
757
- * Each {@link Entity} is only included in the AABB when {@link Entity.collidable} is ````true````.
758
- *
759
- * @param {String[]} ids Array of {@link Entity.id} values.
760
- * @returns {[Number, Number, Number, Number, Number, Number]} An axis-aligned World-space bounding box, given as elements ````[xmin, ymin, zmin, xmax, ymax, zmax]````.
761
- */
762
- getAABB(ids?: string[] | null): number[];
763
-
764
- /**
765
- * Batch-updates {@link Entity.visible} on {@link Entity}s that represent objects.
766
- *
767
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
768
- *
769
- * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.visible} are ````true```` is
770
- * registered by {@link Entity.id} in {@link Scene.visibleObjects}.
771
- *
772
- * @param {String[]} ids Array of {@link Entity.id} values.
773
- * @param {Boolean} visible Whether or not to set visible.
774
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
775
- */
776
- setObjectsVisible(ids: string[], visible: boolean): boolean;
777
-
778
- /**
779
- * Batch-updates {@link Entity.collidable} on {@link Entity}s that represent objects.
780
- *
781
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
782
- *
783
- * @param {String[]} ids Array of {@link Entity.id} values.
784
- * @param {Boolean} collidable Whether or not to set collidable.
785
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
786
- */
787
- setObjectsCollidable(ids: string[], collidable: boolean): boolean;
788
-
789
- /**
790
- * Batch-updates {@link Entity.culled} on {@link Entity}s that represent objects.
791
- *
792
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
793
- *
794
- * @param {String[]} ids Array of {@link Entity.id} values.
795
- * @param {Boolean} culled Whether or not to cull.
796
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
797
- */
798
- setObjectsCulled(ids: string[], culled: boolean): boolean;
799
-
800
- /**
801
- * Batch-updates {@link Entity.selected} on {@link Entity}s that represent objects.
802
- *
803
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
804
- *
805
- * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.selected} are ````true```` is
806
- * registered by {@link Entity.id} in {@link Scene.selectedObjects}.
807
- *
808
- * @param {String[]} ids Array of {@link Entity.id} values.
809
- * @param {Boolean} selected Whether or not to select.
810
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
811
- */
812
- setObjectsSelected(ids: string[], selected: boolean): boolean;
813
-
814
- /**
815
- * Batch-updates {@link Entity.highlighted} on {@link Entity}s that represent objects.
816
- *
817
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
818
- *
819
- * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.highlighted} are ````true```` is
820
- * registered by {@link Entity.id} in {@link Scene.highlightedObjects}.
821
- *
822
- * @param {String[]} ids Array of {@link Entity.id} values.
823
- * @param {Boolean} highlighted Whether or not to highlight.
824
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
825
- */
826
- setObjectsHighlighted(ids: string[], highlighted: boolean): boolean;
827
-
828
- /**
829
- * Batch-updates {@link Entity.xrayed} on {@link Entity}s that represent objects.
830
- *
831
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
832
- *
833
- * @param {String[]} ids Array of {@link Entity.id} values.
834
- * @param {Boolean} xrayed Whether or not to xray.
835
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
836
- */
837
- setObjectsXRayed(ids: string[], xrayed: boolean): boolean;
838
-
839
- /**
840
- * Batch-updates {@link Entity.edges} on {@link Entity}s that represent objects.
841
- *
842
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
843
- *
844
- * @param {String[]} ids Array of {@link Entity.id} values.
845
- * @param {Boolean} edges Whether or not to show edges.
846
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
847
- */
848
- setObjectsEdges(ids: string[], edges: boolean): boolean;
849
-
850
- /**
851
- * Batch-updates {@link Entity.colorize} on {@link Entity}s that represent objects.
852
- *
853
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
854
- *
855
- * @param {String[]} ids Array of {@link Entity.id} values.
856
- * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
857
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
858
- */
859
- setObjectsColorized(ids: string[], colorize: number[]): boolean;
860
-
861
- /**
862
- * Batch-updates {@link Entity.opacity} on {@link Entity}s that represent objects.
863
- *
864
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
865
- *
866
- * @param {String[]} ids Array of {@link Entity.id} values.
867
- * @param {Number} [opacity=1.0] Opacity factor, multiplied by the rendered pixel alphas.
868
- * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
869
- */
870
- setObjectsOpacity(ids: string[], opacity: number): boolean;
871
-
872
- /**
873
- * Batch-updates {@link Entity.pickable} on {@link Entity}s that represent objects.
874
- *
875
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
876
- *
877
- * @param {String[]} ids Array of {@link Entity.id} values.
878
- * @param {Boolean} pickable Whether or not to set pickable.
879
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
880
- */
881
- setObjectsPickable(ids: string[], pickable: boolean): boolean;
882
-
883
- /**
884
- * Batch-updates {@link Entity.offset} on {@link Entity}s that represent objects.
885
- *
886
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
887
- *
888
- * @param {String[]} ids Array of {@link Entity.id} values.
889
- * @param {Number[]} [offset] 3D offset vector.
890
- */
891
- setObjectsOffset(ids: string[], offset: number[]): void;
892
-
893
- /**
894
- * Iterates with a callback over {@link Entity}s that represent objects.
895
- *
896
- * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
897
- *
898
- * @param {String[]} ids Array of {@link Entity.id} values.
899
- * @param {Function} callback Callback to execute on eacn {@link Entity}.
900
- * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
901
- */
902
- withObjects(ids: string[], callback: Function): boolean;
903
-
904
- /**
905
- * Destroys this Scene.
906
- */
907
- destroy(callback?: Function): void;
908
- }
909
-
1
+ import { Component } from "../Component";
2
+ import { Camera } from "../camera/Camera";
3
+ import { PickResult } from "../webgl/PickResult";
4
+ import { SAO } from "../postfx/SAO";
5
+ import { Entity } from "../Entity";
6
+ import { ReadableGeometry } from "../geometry";
7
+ import { EdgeMaterial, EmphasisMaterial, PhongMaterial, PointsMaterial, LinesMaterial } from "../materials";
8
+ import { Viewport } from "../viewport/Viewport";
9
+ import { VBOSceneModel } from "../models/VBOSceneModel/VBOSceneModel";
10
+ import { Mesh } from "../mesh";
11
+ import { Node } from "../nodes";
12
+ import { Input } from "../input/input";
13
+ import { SceneModel } from "../models";
14
+
15
+ export declare type TickEvent = {
16
+ /** The ID of this Scene. */
17
+ sceneID: string;
18
+ /** The time in seconds since 1970 that this Scene was instantiated. */
19
+ startTime: Number;
20
+ /** The time in seconds since 1970 of this "tick" event. */
21
+ time: Number;
22
+ /** The time of the previous "tick" event from this Scene.. */
23
+ prevTime: Number;
24
+ /** The time in seconds since the previous "tick" event from this Scene. */
25
+ deltaTime: Number;
26
+ };
27
+
28
+ export declare class Scene extends Component {
29
+ /**
30
+ * Fires when a model is loaded
31
+ * @param event The loaded event
32
+ * @param callback Called fired on the event
33
+ * @param scope Scope for the callback
34
+ */
35
+ on(event: "modelLoaded", callback: (modelId: string) => void, scope?: any): string;
36
+
37
+ /**
38
+ * Fires when a model is unloaded
39
+ * @param event The loaded event
40
+ * @param callback Called fired on the event
41
+ * @param scope Scope for the callback
42
+ */
43
+ on(event: "modelUnloaded", callback: (modelId: string) => void, scope?: any): string;
44
+
45
+ /**
46
+ * Fired when about to render a frame for a Scene.
47
+ * @param event The rendering event
48
+ * @param callback Called fired on the event
49
+ * @param scope Scope for the callback
50
+ */
51
+ on(event: "rendering", callback: (renderEvent: { sceneId: number; pass: number }) => void, scope?: any): string;
52
+
53
+ /**
54
+ * Fired when we have just rendered a frame for a Scene.
55
+ * @param event The rendered event
56
+ * @param callback Called fired on the event
57
+ * @param scope Scope for the callback
58
+ */
59
+ on(event: "rendered", callback: (renderEvent: { sceneId: number; pass: number }) => void, scope?: any): string;
60
+
61
+ /**
62
+ * Fires when the entity visibility is updated.
63
+ * @param event The rendered event
64
+ * @param callback Called fired on the event
65
+ * @param scope Scope for the callback
66
+ */
67
+ on(
68
+ event: "objectVisibility" | "objectXRayed" | "objectHighlighted" | "objectSelected",
69
+ callback: (entity: VBOSceneModel | Mesh | Node) => void,
70
+ scope?: any
71
+ ): string;
72
+
73
+ /**
74
+ * Fired on each game loop iteration.
75
+ * @event event The tick event
76
+ * @param callback Called fired on the event
77
+ * @param scope Scope for the callback
78
+ */
79
+ on(event: "tick", callback: (tickEvent: TickEvent) => void, scope?: any): string;
80
+
81
+ /**
82
+ * fired when scene.aabb is update
83
+ * @param event
84
+ * @param callback
85
+ */
86
+ on(event: "aabb", callback: (aabb: Float32Array | Float64Array) => void): void;
87
+
88
+ /**
89
+ * return lights objects
90
+ */
91
+ get lightsObject(): any;
92
+
93
+ /**
94
+ * The epoch time (in milliseconds since 1970) when this Scene was instantiated.
95
+ */
96
+ get startTime(): Date;
97
+
98
+ /**
99
+ * canvas
100
+ */
101
+ get canvas(): any;
102
+
103
+ /**
104
+ * Sets whether data texture scene representation (DTX) is enabled for the {@link Scene}.
105
+ *
106
+ * Even when enabled, DTX will only work if supported.
107
+ *
108
+ * Default value is ````false````.
109
+ *
110
+ * @type {Boolean}
111
+ */
112
+ set dtxEnabled(value: boolean);
113
+
114
+ /**
115
+ * Gets whether data texture-based scene representation (DTX) is enabled for the {@link Scene}.
116
+ *
117
+ * Even when enabled, DTX will only apply if supported.
118
+ *
119
+ * Default value is ````false````.
120
+ *
121
+ * @type {Boolean}
122
+ */
123
+ get dtxEnabled(): boolean;
124
+
125
+ /**
126
+ * Sets whether physically-based rendering is enabled.
127
+ * Default is ````false````.
128
+ * @param {boolean} pbrEnabled
129
+ */
130
+ set pbrEnabled(pbrEnabled: boolean);
131
+
132
+ /**
133
+ * Gets whether physically-based rendering is enabled.
134
+ * Default is ````false````.
135
+ * @returns {Boolean} True if quality rendering is enabled.
136
+ */
137
+ get pbrEnabled(): boolean;
138
+
139
+ /**+
140
+ * Sets whether environment light rendering is enabled.
141
+ * Default is ````false````.
142
+ * @param {boolean} saoEnabled
143
+ */
144
+ set saoEnabled(saoEnabled: boolean);
145
+
146
+ /**
147
+ * Gets whether environment light rendering is enabled.
148
+ * Default is ````false````.
149
+ * @returns {boolean}
150
+ */
151
+ get saoEnabled(): boolean;
152
+
153
+ /**
154
+ * set showedges enable
155
+ * @param {boolean} edgesEnabled
156
+ */
157
+ set edgesEnabled(edgesEnabled: boolean);
158
+
159
+ /**
160
+ * @param {boolean} trans
161
+ */
162
+ get edgesEnabled(): boolean;
163
+
164
+ /**
165
+ * Sets whether basic color texture rendering is enabled.
166
+ *
167
+ * Default is ````true````.
168
+ *
169
+ * @param {Boolean} colorTextureEnabled
170
+ */
171
+ set colorTextureEnabled(colorTextureEnabled: boolean);
172
+
173
+ /**
174
+ * Gets whether basic color texture rendering is enabled.
175
+ *
176
+ * Default is ````true````.
177
+ *
178
+ * @returns {Boolean} True if basic color texture rendering is enabled.
179
+ */
180
+ get colorTextureEnabled(): boolean;
181
+
182
+ /**
183
+ * set whether transparent of canvas background
184
+ * @param {boolean} trans
185
+ */
186
+ set backgroundTransparent(trans: boolean);
187
+
188
+ /**
189
+ * @returns {boolean} backgroundTransparent
190
+ */
191
+ get backgroundTransparent(): boolean;
192
+
193
+ /**
194
+ * set background color
195
+ * @param {[]} color
196
+ */
197
+ set backgroundColor(color: []);
198
+
199
+ /**
200
+ * return backgroundColor
201
+ * @returns {boolean} backgroundColor
202
+ */
203
+ get backgroundColor(): [];
204
+
205
+ /**
206
+ * Map of {@link Entity}s that represent models.
207
+ *
208
+ * Each {@link Entity} is mapped here by {@link Entity.id} when {@link Entity.isModel} is ````true````.
209
+ * @type {{String:Entity}}
210
+ */
211
+ get models(): { [key: string]: SceneModel };
212
+
213
+ /**
214
+ * Map of {@link Entity}s that represents objects.
215
+ *
216
+ * Each {@link Entity} is mapped here by {@link Entity.id} when {@link Entity.isObject} is ````true````.
217
+ * @final
218
+ * @type {{String:Entity}}
219
+ */
220
+ get objects(): { [key: string]: Entity };
221
+
222
+ /**
223
+ * Map of currently visible {@link Entity}s that represent objects.
224
+ *
225
+ * An Entity represents an object if {@link Entity.isObject} is ````true````, and is visible when {@link Entity.visible} is true.
226
+ * @type {{String:Object}}
227
+ */
228
+ get visibleObjects(): { [key: string]: Entity };
229
+
230
+ /**
231
+ * Map of currently xrayed {@link Entity}s that represent objects.
232
+ *
233
+ * An Entity represents an object if {@link Entity.isObject} is ````true````, and is xrayed when {@link Entity.xrayed} is true.
234
+ *
235
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
236
+ *
237
+ * @type {{String:Object}}
238
+ */
239
+ get xrayedObjects(): { [key: string]: Entity };
240
+
241
+ /**
242
+ * Map of currently highlighted {@link Entity}s that represent objects.
243
+ *
244
+ * An Entity represents an object if {@link Entity.isObject} is ````true```` is true, and is highlighted when {@link Entity.highlighted} is true.
245
+ *
246
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
247
+ *
248
+ * @type {{String:Object}}
249
+ */
250
+ get highlightedObjects(): { [key: string]: Entity };
251
+
252
+ /**
253
+ * Map of currently selected {@link Entity}s that represent objects.
254
+ *
255
+ * An Entity represents an object if {@link Entity.isObject} is true, and is selected while {@link Entity.selected} is true.
256
+ *
257
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
258
+ *
259
+ * @type {{String:Object}}
260
+ */
261
+ get selectedObjects(): { [key: string]: Entity };
262
+
263
+ /**
264
+ * Map of currently colorized {@link Entity}s that represent objects.
265
+ *
266
+ * An Entity represents an object if {@link Entity.isObject} is ````true````.
267
+ *
268
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
269
+ *
270
+ * @type {{String:Object}}
271
+ */
272
+ get colorizedObjects(): { [key: string]: Entity };
273
+
274
+ /**
275
+ * Map of {@link Entity}s that represent objects whose opacity was updated.
276
+ *
277
+ * An Entity represents an object if {@link Entity.isObject} is ````true````.
278
+ *
279
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
280
+ *
281
+ * @type {{String:Object}}
282
+ */
283
+ get opacityObjects(): { [key: string]: Entity };
284
+
285
+ /**
286
+ * Map of {@link Entity}s that represent objects whose {@link Entity.offset}s were updated.
287
+ *
288
+ * An Entity represents an object if {@link Entity.isObject} is ````true````.
289
+ *
290
+ * Each {@link Entity} is mapped here by {@link Entity.id}.
291
+ *
292
+ * @property offsetObjects
293
+ * @final
294
+ * @type {{String:Object}}
295
+ */
296
+ get offsetObjects(): { [key: string]: Entity };
297
+
298
+ /**
299
+ * Whether {@link Entity.offset} is enabled.
300
+ *
301
+ * This is set via the {@link Viewer} constructor and is ````false```` by default.
302
+ *
303
+ * @returns {Boolean} True if {@link Entity.offset} is enabled.
304
+ */
305
+ get entityOffsetsEnabled(): boolean;
306
+
307
+ /**
308
+ * Whether precision surface picking is enabled.
309
+ *
310
+ * This is set via the {@link Viewer} constructor and is ````false```` by default.
311
+ *
312
+ * The ````pickSurfacePrecision```` option for ````Scene.pick```` only works if this is set ````true````.
313
+ *
314
+ * Note that when ````true````, this configuration will increase the amount of browser memory used by the Viewer.
315
+ *
316
+ * @returns {Boolean} True if precision picking is enabled.
317
+ */
318
+ get pickSurfacePrecisionEnabled(): boolean;
319
+
320
+ /**
321
+ * Whether logarithmic depth buffer is enabled.
322
+ *
323
+ * This is set via the {@link Viewer} constructor and is ````false```` by default.
324
+ *
325
+ * @returns {Boolean} True if logarithmic depth buffer is enabled.
326
+ */
327
+ get logarithmicDepthBufferEnabled(): boolean;
328
+
329
+ /**
330
+ * Gets the IDs of the {@link Entity}s in {@link Scene.models}.
331
+ *
332
+ * @type {String[]}
333
+ */
334
+ get modelIds(): string[];
335
+
336
+ /**
337
+ * Gets the number of {@link Entity}s in {@link Scene.objects}.
338
+ *
339
+ * @type {Number}
340
+ */
341
+ get numObjects(): number;
342
+
343
+ /**
344
+ * Gets the IDs of the {@link Entity}s in {@link Scene.objects}.
345
+ *
346
+ * @type {String[]}
347
+ */
348
+ get objectIds(): string[];
349
+
350
+ /**
351
+ * Gets the number of {@link Entity}s in {@link Scene.visibleObjects}.
352
+ *
353
+ * @type {Number}
354
+ */
355
+ get numVisibleObjects(): number;
356
+
357
+ /**
358
+ * Gets the IDs of the {@link Entity}s in {@link Scene.visibleObjects}.
359
+ *
360
+ * @type {String[]}
361
+ */
362
+ get visibleObjectIds(): string[];
363
+
364
+ /**
365
+ * Gets the number of {@link Entity}s in {@link Scene.xrayedObjects}.
366
+ *
367
+ * @type {Number}
368
+ */
369
+ get numXRayedObjects(): number;
370
+
371
+ /**
372
+ * Gets the IDs of the {@link Entity}s in {@link Scene.xrayedObjects}.
373
+ *
374
+ * @type {String[]}
375
+ */
376
+ get xrayedObjectIds(): string[];
377
+
378
+ /**
379
+ * Gets the number of {@link Entity}s in {@link Scene.highlightedObjects}.
380
+ *
381
+ * @type {Number}
382
+ */
383
+ get numHighlightedObjects(): number;
384
+
385
+ /**
386
+ * Gets the IDs of the {@link Entity}s in {@link Scene.highlightedObjects}.
387
+ *
388
+ * @type {String[]}
389
+ */
390
+ get highlightedObjectIds(): string[];
391
+
392
+ /**
393
+ * Gets the number of {@link Entity}s in {@link Scene.selectedObjects}.
394
+ *
395
+ * @type {Number}
396
+ */
397
+ get numSelectedObjects(): number;
398
+
399
+ /**
400
+ * Gets the IDs of the {@link Entity}s in {@link Scene.selectedObjects}.
401
+ *
402
+ * @type {String[]}
403
+ */
404
+ get selectedObjectIds(): string[];
405
+
406
+ /**
407
+ * Gets the number of {@link Entity}s in {@link Scene.colorizedObjects}.
408
+ *
409
+ * @type {Number}
410
+ */
411
+ get numColorizedObjects(): number;
412
+
413
+ /**
414
+ * Gets the IDs of the {@link Entity}s in {@link Scene.colorizedObjects}.
415
+ *
416
+ * @type {String[]}
417
+ */
418
+ get colorizedObjectIds(): string[];
419
+
420
+ /**
421
+ * Gets the IDs of the {@link Entity}s in {@link Scene.opacityObjects}.
422
+ *
423
+ * @type {String[]}
424
+ */
425
+ get opacityObjectIds(): string[];
426
+
427
+ /**
428
+ * Gets the IDs of the {@link Entity}s in {@link Scene.offsetObjects}.
429
+ *
430
+ * @type {String[]}
431
+ */
432
+ get offsetObjectIds(): string[];
433
+
434
+ /**
435
+ * Sets the number of "ticks" that happen between each render or this Scene.
436
+ *
437
+ * Default value is ````1````.
438
+ *
439
+ * @type {Number}
440
+ */
441
+ set ticksPerRender(value: number);
442
+
443
+ /**
444
+ * Gets the number of "ticks" that happen between each render or this Scene.
445
+ *
446
+ * Default value is ````1````.
447
+ *
448
+ * @type {Number}
449
+ */
450
+ get ticksPerRender(): number;
451
+
452
+ /**
453
+ * Sets the number of "ticks" that happen between occlusion testing for {@link Marker}s.
454
+ *
455
+ * Default value is ````20````.
456
+ *
457
+ * @type {Number}
458
+ */
459
+ set ticksPerOcclusionTest(value: number);
460
+
461
+ /**
462
+ * Gets the number of "ticks" that happen between each render of this Scene.
463
+ *
464
+ * Default value is ````1````.
465
+ *
466
+ * @type {Number}
467
+ */
468
+ get ticksPerOcclusionTest(): number;
469
+
470
+ /**
471
+ * Sets the number of times this Scene renders per frame.
472
+ *
473
+ * Default value is ````1````.
474
+ *
475
+ * @type {Number}
476
+ */
477
+ set passes(value: number);
478
+
479
+ /**
480
+ * Gets the number of times this Scene renders per frame.
481
+ *
482
+ * Default value is ````1````.
483
+ *
484
+ * @type {Number}
485
+ */
486
+ get passes(): number;
487
+
488
+ /**
489
+ * When {@link Scene.passes} is greater than ````1````, indicates whether or not to clear the canvas before each pass (````true````) or just before the first pass (````false````).
490
+ *
491
+ * Default value is ````false````.
492
+ *
493
+ * @type {Boolean}
494
+ */
495
+ set clearEachPass(value: boolean);
496
+
497
+ /**
498
+ * When {@link Scene.passes} is greater than ````1````, indicates whether or not to clear the canvas before each pass (````true````) or just before the first pass (````false````).
499
+ *
500
+ * Default value is ````false````.
501
+ *
502
+ * @type {Boolean}
503
+ */
504
+ get clearEachPass(): boolean;
505
+
506
+ /**
507
+ * Sets whether or not {@link Scene} should expect all {@link Texture}s and colors to have pre-multiplied gamma.
508
+ *
509
+ * Default value is ````false````.
510
+ *
511
+ * @type {Boolean}
512
+ */
513
+ set gammaInput(value: boolean);
514
+
515
+ /**
516
+ * Gets whether or not {@link Scene} should expect all {@link Texture}s and colors to have pre-multiplied gamma.
517
+ *
518
+ * Default value is ````false````.
519
+ *
520
+ * @type {Boolean}
521
+ */
522
+ get gammaInput(): boolean;
523
+
524
+ /**
525
+ * Sets whether or not to render pixels with pre-multiplied gama.
526
+ *
527
+ * Default value is ````false````.
528
+ *
529
+ * @type {Boolean}
530
+ */
531
+ set gammaOutput(value: boolean);
532
+
533
+ /**
534
+ * Gets whether or not to render pixels with pre-multiplied gama.
535
+ *
536
+ * Default value is ````true````.
537
+ *
538
+ * @type {Boolean}
539
+ */
540
+ get gammaOutput(): boolean;
541
+
542
+ /**
543
+ * Sets the gamma factor to use when {@link Scene.gammaOutput} is set true.
544
+ *
545
+ * Default value is ````2.2````.
546
+ *
547
+ * @type {Number}
548
+ */
549
+ set gammaFactor(value: number);
550
+
551
+ /**
552
+ * Gets the gamma factor to use when {@link Scene.gammaOutput} is set true.
553
+ *
554
+ * Default value is ````2.2````.
555
+ *
556
+ * @type {Number}
557
+ */
558
+ get gammaFactor(): number;
559
+
560
+ /**
561
+ * Gets the default {@link Geometry} for this Scene, which is a {@link ReadableGeometry} with a unit-sized box shape.
562
+ *
563
+ * Has {@link ReadableGeometry.id} set to "default.geometry".
564
+ *
565
+ * {@link Mesh}s in this Scene have {@link Mesh.geometry} set to this {@link ReadableGeometry} by default.
566
+ *
567
+ * @type {ReadableGeometry}
568
+ */
569
+ get geometry(): ReadableGeometry;
570
+
571
+ /**
572
+ * Gets the default {@link Material} for this Scene, which is a {@link PhongMaterial}.
573
+ *
574
+ * Has {@link PhongMaterial.id} set to "default.material".
575
+ *
576
+ * {@link Mesh}s in this Scene have {@link Mesh.material} set to this {@link PhongMaterial} by default.
577
+ *
578
+ * @type {PhongMaterial}
579
+ */
580
+ get material(): PhongMaterial;
581
+
582
+ /**
583
+ * Gets the default xraying {@link EmphasisMaterial} for this Scene.
584
+ *
585
+ * Has {@link EmphasisMaterial.id} set to "default.xrayMaterial".
586
+ *
587
+ * {@link Mesh}s in this Scene have {@link Mesh.xrayMaterial} set to this {@link EmphasisMaterial} by default.
588
+ *
589
+ * {@link Mesh}s are xrayed while {@link Mesh.xrayed} is ````true````.
590
+ *
591
+ * @type {EmphasisMaterial}
592
+ */
593
+ get xrayMaterial(): EmphasisMaterial;
594
+
595
+ /**
596
+ * Gets the default highlight {@link EmphasisMaterial} for this Scene.
597
+ *
598
+ * Has {@link EmphasisMaterial.id} set to "default.highlightMaterial".
599
+ *
600
+ * {@link Mesh}s in this Scene have {@link Mesh.highlightMaterial} set to this {@link EmphasisMaterial} by default.
601
+ *
602
+ * {@link Mesh}s are highlighted while {@link Mesh.highlighted} is ````true````.
603
+ *
604
+ * @type {EmphasisMaterial}
605
+ */
606
+ get highlightMaterial(): EmphasisMaterial;
607
+
608
+ /**
609
+ * Gets the default selection {@link EmphasisMaterial} for this Scene.
610
+ *
611
+ * Has {@link EmphasisMaterial.id} set to "default.selectedMaterial".
612
+ *
613
+ * {@link Mesh}s in this Scene have {@link Mesh.highlightMaterial} set to this {@link EmphasisMaterial} by default.
614
+ *
615
+ * {@link Mesh}s are highlighted while {@link Mesh.highlighted} is ````true````.
616
+ *
617
+ * @type {EmphasisMaterial}
618
+ */
619
+ get selectedMaterial(): EmphasisMaterial;
620
+
621
+ /**
622
+ * Gets the default {@link EdgeMaterial} for this Scene.
623
+ *
624
+ * Has {@link EdgeMaterial.id} set to "default.edgeMaterial".
625
+ *
626
+ * {@link Mesh}s in this Scene have {@link Mesh.edgeMaterial} set to this {@link EdgeMaterial} by default.
627
+ *
628
+ * {@link Mesh}s have their edges emphasized while {@link Mesh.edges} is ````true````.
629
+ *
630
+ * @type {EdgeMaterial}
631
+ */
632
+ get edgeMaterial(): EdgeMaterial;
633
+
634
+ /**
635
+ * Gets the {@link PointsMaterial} for this Scene.
636
+ *
637
+ * @type {PointsMaterial}
638
+ */
639
+ get pointsMaterial(): PointsMaterial;
640
+
641
+ /**
642
+ * Gets the {@link LinesMaterial} for this Scene.
643
+ *
644
+ * @type {LinesMaterial}
645
+ */
646
+ get linesMaterial(): LinesMaterial;
647
+
648
+ /**
649
+ * Gets the {@link Viewport} for this Scene.
650
+ *
651
+ * @type Viewport
652
+ */
653
+ get viewport(): Viewport;
654
+
655
+ /**
656
+ * Gets the {@link Camera} for this Scene.
657
+ *
658
+ * @type {Camera}
659
+ */
660
+ get camera(): Camera;
661
+
662
+ /**
663
+ * Gets the World-space 3D center of this Scene.
664
+ *
665
+ *@type {Number[]}
666
+ */
667
+ get center(): number[];
668
+
669
+ /**
670
+ * Gets the World-space axis-aligned 3D boundary (AABB) of this Scene.
671
+ *
672
+ * The AABB is represented by a six-element Float64Array containing the min/max extents of the axis-aligned volume, ie. ````[xmin, ymin,zmin,xmax,ymax, zmax]````.
673
+ *
674
+ * When the Scene has no content, will be ````[-100,-100,-100,100,100,100]````.
675
+ *
676
+ * @type {Number[]}
677
+ */
678
+ get aabb(): number[];
679
+
680
+ get aabbs(): any;
681
+
682
+ get sao(): SAO;
683
+
684
+ get input(): Input;
685
+
686
+ /**
687
+ * Performs an occlusion test on all {@link Marker}s in this {@link Scene}.
688
+ *
689
+ * Sets each {@link Marker.visible} ````true```` if the Marker is currently not occluded by any opaque {@link Entity}s
690
+ * in the Scene, or ````false```` if an Entity is occluding it.
691
+ */
692
+ doOcclusionTest(): void;
693
+
694
+ /**
695
+ * Renders a single frame of this Scene.
696
+ *
697
+ * The Scene will periodically render itself after any updates, but you can call this method to force a render
698
+ * if required.
699
+ *
700
+ * @param {Boolean} [forceRender=false] Forces a render when true, otherwise only renders if something has changed in this Scene
701
+ * since the last render.
702
+ */
703
+ render(forceRender?: boolean): void;
704
+
705
+ /**
706
+ * Attempts to pick an {@link Entity} in this Scene.
707
+ * @param {*} params Picking parameters.
708
+ * @param {Boolean} [params.pickSurface=false] Whether to find the picked position on the surface of the Entity.
709
+ * @param {Boolean} [params.pickSurfacePrecision=false] When picking an Entity surface position, indicates whether or not we want full-precision {@link PickResult.worldPos}. Only works when {@link Scene.pickSurfacePrecisionEnabled} is ````true````. If pick succeeds, the returned {@link PickResult} will have {@link PickResult.precision} set ````true````, to indicate that it contains full-precision surface pick results.
710
+ * @param {Boolean} [params.pickSurfaceNormal=false] Whether to find the picked normal on the surface of the Entity. Only works if ````pickSurface```` is given.
711
+ * @param {Number[]} [params.canvasPos] Canvas-space coordinates. When ray-picking, this will override the **origin** and ** direction** parameters and will cause the ray to be fired through the canvas at this position, directly along the negative View-space Z-axis.
712
+ * @param {Number[]} [params.origin] World-space ray origin when ray-picking. Ignored when canvasPos given.
713
+ * @param {Number[]} [params.direction] World-space ray direction when ray-picking. Also indicates the length of the ray. Ignored when canvasPos given.
714
+ * @param {Number[]} [params.matrix] 4x4 transformation matrix to define the World-space ray origin and direction, as an alternative to ````origin```` and ````direction````.
715
+ * @param {String[]} [params.includeEntities] IDs of {@link Entity}s to restrict picking to. When given, ignores {@link Entity}s whose IDs are not in this list.
716
+ * @param {String[]} [params.excludeEntities] IDs of {@link Entity}s to ignore. When given, will pick *through* these {@link Entity}s, as if they were not there.
717
+ * @param {PickResult} [pickResult] Holds the results of the pick attempt. Will use the Scene's singleton PickResult if you don't supply your own.
718
+ * @returns {PickResult} Holds results of the pick attempt, returned when an {@link Entity} is picked, else null. See method comments for description.
719
+ */
720
+ pick(
721
+ params: {
722
+ pickSurface?: boolean;
723
+ pickSurfacePrecision?: boolean;
724
+ pickSurfaceNormal?: boolean;
725
+ canvasPos?: number[];
726
+ origin?: number[];
727
+ direction?: number[];
728
+ matrix?: number[];
729
+ includeEntities?: string[];
730
+ excludeEntities?: string[];
731
+ },
732
+ pickResult?: PickResult
733
+ ): PickResult | null;
734
+
735
+ /**
736
+ * Destroys all non-default {@link Component}s in this Scene.
737
+ */
738
+ clear(): void;
739
+
740
+ /**
741
+ * Destroys all {@link Light}s in this Scene..
742
+ */
743
+ clearLights(): void;
744
+
745
+ /**
746
+ * Destroys all {@link SectionPlane}s in this Scene.
747
+ */
748
+ clearSectionPlanes(): void;
749
+
750
+ /**
751
+ * Gets the collective axis-aligned boundary (AABB) of a batch of {@link Entity}s that represent objects.
752
+ *
753
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
754
+ *
755
+ * Each {@link Entity} on which {@link Entity.isObject} is registered by {@link Entity.id} in {@link Scene.visibleObjects}.
756
+ *
757
+ * Each {@link Entity} is only included in the AABB when {@link Entity.collidable} is ````true````.
758
+ *
759
+ * @param {String[]} ids Array of {@link Entity.id} values.
760
+ * @returns {[Number, Number, Number, Number, Number, Number]} An axis-aligned World-space bounding box, given as elements ````[xmin, ymin, zmin, xmax, ymax, zmax]````.
761
+ */
762
+ getAABB(ids?: string[] | null): number[];
763
+
764
+ /**
765
+ * Batch-updates {@link Entity.visible} on {@link Entity}s that represent objects.
766
+ *
767
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
768
+ *
769
+ * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.visible} are ````true```` is
770
+ * registered by {@link Entity.id} in {@link Scene.visibleObjects}.
771
+ *
772
+ * @param {String[]} ids Array of {@link Entity.id} values.
773
+ * @param {Boolean} visible Whether or not to set visible.
774
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
775
+ */
776
+ setObjectsVisible(ids: string[], visible: boolean): boolean;
777
+
778
+ /**
779
+ * Batch-updates {@link Entity.collidable} on {@link Entity}s that represent objects.
780
+ *
781
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
782
+ *
783
+ * @param {String[]} ids Array of {@link Entity.id} values.
784
+ * @param {Boolean} collidable Whether or not to set collidable.
785
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
786
+ */
787
+ setObjectsCollidable(ids: string[], collidable: boolean): boolean;
788
+
789
+ /**
790
+ * Batch-updates {@link Entity.culled} on {@link Entity}s that represent objects.
791
+ *
792
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
793
+ *
794
+ * @param {String[]} ids Array of {@link Entity.id} values.
795
+ * @param {Boolean} culled Whether or not to cull.
796
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
797
+ */
798
+ setObjectsCulled(ids: string[], culled: boolean): boolean;
799
+
800
+ /**
801
+ * Batch-updates {@link Entity.selected} on {@link Entity}s that represent objects.
802
+ *
803
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
804
+ *
805
+ * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.selected} are ````true```` is
806
+ * registered by {@link Entity.id} in {@link Scene.selectedObjects}.
807
+ *
808
+ * @param {String[]} ids Array of {@link Entity.id} values.
809
+ * @param {Boolean} selected Whether or not to select.
810
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
811
+ */
812
+ setObjectsSelected(ids: string[], selected: boolean): boolean;
813
+
814
+ /**
815
+ * Batch-updates {@link Entity.highlighted} on {@link Entity}s that represent objects.
816
+ *
817
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
818
+ *
819
+ * Each {@link Entity} on which both {@link Entity.isObject} and {@link Entity.highlighted} are ````true```` is
820
+ * registered by {@link Entity.id} in {@link Scene.highlightedObjects}.
821
+ *
822
+ * @param {String[]} ids Array of {@link Entity.id} values.
823
+ * @param {Boolean} highlighted Whether or not to highlight.
824
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
825
+ */
826
+ setObjectsHighlighted(ids: string[], highlighted: boolean): boolean;
827
+
828
+ /**
829
+ * Batch-updates {@link Entity.xrayed} on {@link Entity}s that represent objects.
830
+ *
831
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
832
+ *
833
+ * @param {String[]} ids Array of {@link Entity.id} values.
834
+ * @param {Boolean} xrayed Whether or not to xray.
835
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
836
+ */
837
+ setObjectsXRayed(ids: string[], xrayed: boolean): boolean;
838
+
839
+ /**
840
+ * Batch-updates {@link Entity.edges} on {@link Entity}s that represent objects.
841
+ *
842
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
843
+ *
844
+ * @param {String[]} ids Array of {@link Entity.id} values.
845
+ * @param {Boolean} edges Whether or not to show edges.
846
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
847
+ */
848
+ setObjectsEdges(ids: string[], edges: boolean): boolean;
849
+
850
+ /**
851
+ * Batch-updates {@link Entity.colorize} on {@link Entity}s that represent objects.
852
+ *
853
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
854
+ *
855
+ * @param {String[]} ids Array of {@link Entity.id} values.
856
+ * @param {Number[]} [colorize=(1,1,1)] RGB colorize factors, multiplied by the rendered pixel colors.
857
+ * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
858
+ */
859
+ setObjectsColorized(ids: string[], colorize: number[]): boolean;
860
+
861
+ /**
862
+ * Batch-updates {@link Entity.opacity} on {@link Entity}s that represent objects.
863
+ *
864
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
865
+ *
866
+ * @param {String[]} ids Array of {@link Entity.id} values.
867
+ * @param {Number} [opacity=1.0] Opacity factor, multiplied by the rendered pixel alphas.
868
+ * @returns {Boolean} True if any {@link Entity}s changed opacity, else false if all updates were redundant and not applied.
869
+ */
870
+ setObjectsOpacity(ids: string[], opacity: number): boolean;
871
+
872
+ /**
873
+ * Batch-updates {@link Entity.pickable} on {@link Entity}s that represent objects.
874
+ *
875
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
876
+ *
877
+ * @param {String[]} ids Array of {@link Entity.id} values.
878
+ * @param {Boolean} pickable Whether or not to set pickable.
879
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
880
+ */
881
+ setObjectsPickable(ids: string[], pickable: boolean): boolean;
882
+
883
+ /**
884
+ * Batch-updates {@link Entity.offset} on {@link Entity}s that represent objects.
885
+ *
886
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
887
+ *
888
+ * @param {String[]} ids Array of {@link Entity.id} values.
889
+ * @param {Number[]} [offset] 3D offset vector.
890
+ */
891
+ setObjectsOffset(ids: string[], offset: number[]): void;
892
+
893
+ /**
894
+ * Iterates with a callback over {@link Entity}s that represent objects.
895
+ *
896
+ * An {@link Entity} represents an object when {@link Entity.isObject} is ````true````.
897
+ *
898
+ * @param {String[]} ids Array of {@link Entity.id} values.
899
+ * @param {Function} callback Callback to execute on eacn {@link Entity}.
900
+ * @returns {Boolean} True if any {@link Entity}s were updated, else false if all updates were redundant and not applied.
901
+ */
902
+ withObjects(ids: string[], callback: Function): boolean;
903
+
904
+ /**
905
+ * Destroys this Scene.
906
+ */
907
+ destroy(callback?: Function): void;
908
+ }
909
+