|
@@ -82,16 +82,17 @@ export class StatsPanel
|
82
|
82
|
/**
|
83
|
83
|
* A method to be called in the update loop
|
84
|
84
|
* @param time current time in ms
|
85
|
|
- * @param trackers the trackers attached to the session
|
86
|
85
|
* @param sources the sources of media linked to the session
|
|
86
|
+ * @param trackers the trackers attached to the session
|
|
87
|
+ * @param viewport the viewport
|
87
|
88
|
* @param gpu GPU cycles per second
|
88
|
89
|
* @param fps frames per second
|
89
|
90
|
*/
|
90
|
|
- update(time: DOMHighResTimeStamp, trackers: Tracker[], sources: Source[], gpu: number, fps: number): void
|
|
91
|
+ update(time: DOMHighResTimeStamp, sources: Source[], trackers: Tracker[], viewport: Viewport, gpu: number, fps: number): void
|
91
|
92
|
{
|
92
|
93
|
if(time >= this._lastUpdate + UPDATE_INTERVAL) {
|
93
|
94
|
this._lastUpdate = time;
|
94
|
|
- this._update(trackers, sources, fps, gpu);
|
|
95
|
+ this._update(sources, trackers, viewport, fps, gpu);
|
95
|
96
|
}
|
96
|
97
|
}
|
97
|
98
|
|
|
@@ -113,12 +114,13 @@ export class StatsPanel
|
113
|
114
|
|
114
|
115
|
/**
|
115
|
116
|
* Update the contents of the panel
|
116
|
|
- * @param trackers the trackers attached to the session
|
117
|
117
|
* @param sources the sources of media linked to the session
|
|
118
|
+ * @param trackers the trackers attached to the session
|
|
119
|
+ * @param viewport the viewport
|
118
|
120
|
* @param fps frames per second
|
119
|
121
|
* @param gpu GPU cycles per second
|
120
|
122
|
*/
|
121
|
|
- private _update(trackers: Tracker[], sources: Source[], fps: number, gpu: number): void
|
|
123
|
+ private _update(sources: Source[], trackers: Tracker[], viewport: Viewport, fps: number, gpu: number): void
|
122
|
124
|
{
|
123
|
125
|
// all sanitized
|
124
|
126
|
const lfps = this._label('_ar_fps');
|
|
@@ -148,6 +150,12 @@ export class StatsPanel
|
148
|
150
|
const trackerStats = trackers.map(tracker => tracker._stats).join(', ');
|
149
|
151
|
lout.innerText = trackerStats;
|
150
|
152
|
}
|
|
153
|
+
|
|
154
|
+ const ldraw = this._label('_ar_draw');
|
|
155
|
+ if(ldraw !== null) {
|
|
156
|
+ const size = viewport.virtualSize;
|
|
157
|
+ ldraw.innerText = `${size.width}x${size.height} viewport`;
|
|
158
|
+ }
|
151
|
159
|
}
|
152
|
160
|
|
153
|
161
|
/**
|
|
@@ -240,6 +248,9 @@ export class StatsPanel
|
240
|
248
|
print('<br>');
|
241
|
249
|
print('OUT: <span class="_ar_out"></span>');
|
242
|
250
|
|
|
251
|
+ print('<br>');
|
|
252
|
+ print('DRAW: <span class="_ar_draw"></span>');
|
|
253
|
+
|
243
|
254
|
return content;
|
244
|
255
|
}
|
245
|
256
|
}
|