Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
bugfix: look-controls + device-motionsensors works again
Browse files Browse the repository at this point in the history
  • Loading branch information
coderofsalvation committed Jun 15, 2024
1 parent f508d1e commit b1a518b
Show file tree
Hide file tree
Showing 6 changed files with 11,043 additions and 37 deletions.
13 changes: 1 addition & 12 deletions dist/xrfragment.aframe.all.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions dist/xrfragment.aframe.js
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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( () => {
Expand Down
Loading

0 comments on commit b1a518b

Please sign in to comment.