From 34a398da1dedaa876279263592b78f8756a9d38d Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Wed, 7 Jun 2023 15:36:19 +0200 Subject: [PATCH] better teleport wip --- example/aframe/sandbox/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/example/aframe/sandbox/index.html b/example/aframe/sandbox/index.html index 5356359..1d39eab 100644 --- a/example/aframe/sandbox/index.html +++ b/example/aframe/sandbox/index.html @@ -61,13 +61,15 @@ if( e.click ){ const { mesh, model, camera, scene, renderer, THREE} = e.XRF const url = e.xrf.string - const isExtern = url != '#' + const isExtern = url[0] != '#' const notIsHome = url != $('#home').getAttribute("xrf") const promise = e.promise() // promisify event - if( !renderer.xr.isPresenting && isExtern && notIsHome ){ - if( confirm("teleport to "+url+" ?") ) promise.resolve() - else promise.reject('teleport not ok') + if( !renderer.xr.isPresenting ){ + if( isExtern && notIsHome ){ + if( !confirm("teleport to "+url+" ?") ) return promise.reject('teleport rejected') + } } + promise.resolve() } })