update with CV fps
This commit is contained in:
Родитель
a9e13b4dcb
Коммит
88aa96cc8a
|
@ -164,8 +164,23 @@
|
|||
//}, 500);
|
||||
</script>
|
||||
<script>
|
||||
var beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;
|
||||
|
||||
var stats = new Stats();
|
||||
stats.showPanel( 1 ); // 0: fps, 1: ms, 2: mb, 3+: custom
|
||||
var cvPanel = stats.addPanel( new Stats.Panel( 'CV fps', '#ff8', '#221' ) );
|
||||
stats.showPanel( 2 ); // 0: fps, 1: ms, 2: mb, 3+: custom
|
||||
|
||||
var updateCVFPS = function () {
|
||||
frames ++;
|
||||
var time = ( performance || Date ).now();
|
||||
if ( time >= prevTime + 1000 ) {
|
||||
cvPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );
|
||||
prevTime = time;
|
||||
frames = 0;
|
||||
}
|
||||
beginTime = time;
|
||||
}
|
||||
|
||||
document.body.appendChild( stats.dom );
|
||||
|
||||
class ARAnchorExample extends XRExampleBase {
|
||||
|
@ -195,6 +210,7 @@
|
|||
self.intensity = ev.data.intensity;
|
||||
self.cr = ev.data.cr;
|
||||
self.cb = ev.data.cb;
|
||||
updateCVFPS();
|
||||
}
|
||||
this.setVideoWorker(this.worker);
|
||||
// this.setVideoWorker(ev => { this.handleVideoFrame(ev) })
|
||||
|
|
Загрузка…
Ссылка в новой задаче