bugfix: look-controls + device-motionsensors works again

This commit is contained in:
Leon van Kammen 2024-06-15 17:46:32 +02:00
parent f508d1e262
commit b1a518bbd8
6 changed files with 11043 additions and 37 deletions

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Sat Jun 15 05:22:38 PM CEST 2024
* v0.5.1 generated at Sat Jun 15 05:46:02 PM CEST 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -4163,17 +4163,6 @@ window.AFRAME.registerComponent('xrf', {
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
})
// (de)active look-controls because of 'rot=' XR Fragment
aScene.addEventListener('loaded', () => {
// this is just for convenience (not part of spec): enforce AR + hide/show stuff based on VR tags in 3D model
aScene.canvas.addEventListener('mousedown', () => xrf.camera.el.setAttribute("look-controls","") )
})
XRF.addEventListener('rot',(e) => {
let lookcontrols = document.querySelector('[look-controls]')
if( lookcontrols ) lookcontrols.removeAttribute("look-controls")
})
let repositionUser = (scale) => () => {
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
setTimeout( () => {

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Sat Jun 15 05:22:37 PM CEST 2024
* v0.5.1 generated at Sat Jun 15 05:46:02 PM CEST 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/
@ -4161,17 +4161,6 @@ window.AFRAME.registerComponent('xrf', {
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
})
// (de)active look-controls because of 'rot=' XR Fragment
aScene.addEventListener('loaded', () => {
// this is just for convenience (not part of spec): enforce AR + hide/show stuff based on VR tags in 3D model
aScene.canvas.addEventListener('mousedown', () => xrf.camera.el.setAttribute("look-controls","") )
})
XRF.addEventListener('rot',(e) => {
let lookcontrols = document.querySelector('[look-controls]')
if( lookcontrols ) lookcontrols.removeAttribute("look-controls")
})
let repositionUser = (scale) => () => {
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
setTimeout( () => {

11039
dist/xrfragment.module.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Sat Jun 15 05:22:38 PM CEST 2024
* v0.5.1 generated at Sat Jun 15 05:46:02 PM CEST 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/

View File

@ -1,5 +1,5 @@
/*
* v0.5.1 generated at Sat Jun 15 05:22:38 PM CEST 2024
* v0.5.1 generated at Sat Jun 15 05:46:02 PM CEST 2024
* https://xrfragment.org
* SPDX-License-Identifier: MPL-2.0
*/

View File

@ -53,17 +53,6 @@ window.AFRAME.registerComponent('xrf', {
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
})
// (de)active look-controls because of 'rot=' XR Fragment
aScene.addEventListener('loaded', () => {
// this is just for convenience (not part of spec): enforce AR + hide/show stuff based on VR tags in 3D model
aScene.canvas.addEventListener('mousedown', () => xrf.camera.el.setAttribute("look-controls","") )
})
XRF.addEventListener('rot',(e) => {
let lookcontrols = document.querySelector('[look-controls]')
if( lookcontrols ) lookcontrols.removeAttribute("look-controls")
})
let repositionUser = (scale) => () => {
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
setTimeout( () => {