diff --git a/index.js b/index.js index 99c6684..a89be54 100644 --- a/index.js +++ b/index.js @@ -334,12 +334,6 @@ async function connect (options) { } lastTouch = e.touches[0] }, { passive: false }) - document.addEventListener('touchend', (e) => { - window.scrollTo(0, 0) - e.preventDefault() - e.stopPropagation() - lastTouch = undefined - }, { passive: false }) renderer.domElement.requestPointerLock = renderer.domElement.requestPointerLock || renderer.domElement.mozRequestPointerLock || diff --git a/lib/vr.js b/lib/vr.js index d1424bc..1f2a1a3 100644 --- a/lib/vr.js +++ b/lib/vr.js @@ -5,11 +5,9 @@ const { GLTFLoader } = require('three/examples/jsm/loaders/GLTFLoader.js') const { XRControllerModelFactory } = require('three/examples/jsm/webxr/XRControllerModelFactory.js') const TWEEN = require('@tweenjs/tween.js') -async function initVR (bot, renderer, viewer) { +function initVR (bot, renderer, viewer) { if (!('xr' in navigator)) return - - const supported = await navigator.xr.isSessionSupported('immersive-vr') - if (!supported) return + if (!navigator.userAgent.includes('OculusBrowser')) return // VR document.body.appendChild(VRButton.createButton(renderer))