Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

"Enter XR" button toggle VR entry/exiting #37

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3305,25 +3305,6 @@
}

// bootstrap

const _emitLayersVrDisplayActivate = () => {
for (let i = 0; i < layers.length; i++) {
const layer = layers[i];

if (layer.tagName === 'IFRAME' && layer.d === 3) {
layer.contentWindow.runAsync('vrdisplayactivate');
}
}
};
const _emitLayersExitPresent = () => {
for (let i = 0; i < layers.length; i++) {
const layer = layers[i];

if (layer.tagName === 'IFRAME' && layer.d === 3) {
layer.contentWindow.runAsync('exitPresent');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If one window exits presentation, how are the other windows notified?

}
}
};
const _startFakeVrDisplay = async (width, height) => {
fakeXrDisplay = new FakeXRDisplay();
if (isFinite(width)) {
Expand All @@ -3346,7 +3327,6 @@
renderer.vr.setSession(null);
renderer.vr.setAnimationLoop(null);

_emitLayersExitPresent();

session.removeEventListener('end', _end);
};
Expand All @@ -3362,7 +3342,6 @@
});
renderer.vr.setAnimationLoop(animate);

_emitLayersVrDisplayActivate();

accept();
});
Expand All @@ -3377,7 +3356,6 @@
fakeXrDisplay.display = display;

const _vrdisplaypresentchange = () => {
_emitLayersExitPresent();

display.removeEventListener('vrdisplaypresentchange', _vrdisplaypresentchange);
};
Expand Down