Browse Source

Add Session.trackers and Session.sources

customisations
alemart 11 months ago
parent
commit
82b33a2244
2 changed files with 38 additions and 6 deletions
  1. 19
    3
      docs/api/session.md
  2. 19
    3
      src/core/session.ts

+ 19
- 3
docs/api/session.md View File

@@ -46,17 +46,33 @@ Whether or not the session has been ended. See also: [end](#end).
46 46
 
47 47
 A reference to the [Time](time.md) utilities of this session.
48 48
 
49
+### gizmos
50
+
51
+`session.gizmos: Gizmos, read-only`
52
+
53
+A reference to the [Gizmos](gizmos.md) object.
54
+
49 55
 ### viewport
50 56
 
51 57
 `session.viewport: Viewport, read-only`
52 58
 
53 59
 A reference to the [Viewport](viewport.md) linked to this session.
54 60
 
55
-### gizmos
61
+### trackers
56 62
 
57
-`session.gizmos: Gizmos, read-only`
63
+`session.trackers: Iterable<Tracker>, read-only`
58 64
 
59
-A reference to the [Gizmos](gizmos.md) object.
65
+The [trackers](tracker.md) that are attached to the session.
66
+
67
+*Since:* 0.3.0
68
+
69
+### sources
70
+
71
+`session.sources: Iterable<Source>, read-only`
72
+
73
+The [sources of data](source.md) that are linked to the session.
74
+
75
+*Since:* 0.3.0
60 76
 
61 77
 ## Methods
62 78
 

+ 19
- 3
src/core/session.ts View File

@@ -483,6 +483,14 @@ export class Session extends AREventTarget<SessionEventType>
483 483
     }
484 484
 
485 485
     /**
486
+     * Visual cues for testing & debugging
487
+     */
488
+    get gizmos(): Gizmos
489
+    {
490
+        return this._gizmos;
491
+    }
492
+
493
+    /**
486 494
      * Rendering viewport
487 495
      */
488 496
     get viewport(): Viewport
@@ -491,11 +499,19 @@ export class Session extends AREventTarget<SessionEventType>
491 499
     }
492 500
 
493 501
     /**
494
-     * Visual cues for testing & debugging
502
+     * Attached trackers
495 503
      */
496
-    get gizmos(): Gizmos
504
+    get trackers(): Iterable<Tracker>
497 505
     {
498
-        return this._gizmos;
506
+        return this._trackers[Symbol.iterator]();
507
+    }
508
+
509
+    /**
510
+     * Sources of data
511
+     */
512
+    get sources(): Iterable<Source>
513
+    {
514
+        return this._sources[Symbol.iterator]();
499 515
     }
500 516
 
501 517
     /**

Loading…
Cancel
Save