bugfix: look-controls + device-motionsensors works again
This commit is contained in:
parent
f508d1e262
commit
b1a518bbd8
6 changed files with 11043 additions and 37 deletions
13
dist/xrfragment.aframe.all.js
vendored
13
dist/xrfragment.aframe.all.js
vendored
|
|
@ -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
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -4163,17 +4163,6 @@ window.AFRAME.registerComponent('xrf', {
|
||||||
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
|
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) => () => {
|
let repositionUser = (scale) => () => {
|
||||||
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
|
|
|
||||||
13
dist/xrfragment.aframe.js
vendored
13
dist/xrfragment.aframe.js
vendored
|
|
@ -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
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -4161,17 +4161,6 @@ window.AFRAME.registerComponent('xrf', {
|
||||||
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
|
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) => () => {
|
let repositionUser = (scale) => () => {
|
||||||
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
|
|
|
||||||
11039
dist/xrfragment.module.js
vendored
11039
dist/xrfragment.module.js
vendored
File diff suppressed because it is too large
Load diff
2
dist/xrfragment.three.js
vendored
2
dist/xrfragment.three.js
vendored
|
|
@ -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
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
2
dist/xrfragment.three.module.js
vendored
2
dist/xrfragment.three.module.js
vendored
|
|
@ -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
|
* https://xrfragment.org
|
||||||
* SPDX-License-Identifier: MPL-2.0
|
* SPDX-License-Identifier: MPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -53,17 +53,6 @@ window.AFRAME.registerComponent('xrf', {
|
||||||
if( VRbutton ) VRbutton.addEventListener('click', () => AFRAME.XRF.hashbus.pub( '#VR' ) )
|
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) => () => {
|
let repositionUser = (scale) => () => {
|
||||||
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
// sometimes AFRAME resets the user position to 0,0,0 when entering VR (not sure why)
|
||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue