aframe: Look-controls stops working after enter vr

  • A-Frame Version: 0.8.2
  • Platform / Device: Samsung S7 Chrome 66

Using look-controls component on first load, I am able to swipe to change the y rotation of the camera. After enter vr is called, the rotation doesn’t change with swipe anymore. Also when you exit vr the rotation doesn’t change. The swipe functionality use to work in 0.7.1, regardless if you were in VR or not.

In look-controls.js, debugging shows that the touchmove handler is still firing, but it seems when you try to set the object3d rotation, it doesn’t have any effect.

https://github.com/aframevr/aframe/blob/429591a7d3034f471ea01c4232246aca0fb90b6b/src/components/look-controls.js#L198

    el.object3D.rotation.x = hmdEuler.x + pitchObject.rotation.x;
    el.object3D.rotation.y = hmdEuler.y + yawObject.rotation.y;
    el.object3D.rotation.z = 0;

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@dmarcos

“When using a headset you want to honor the user head rotation or it will cause disconfort. It’s a design decision”

Could anyone point me to where this is being done in the code?

I’m trying to do swipe controls on mobile with a separate VR mode where device orientation then takes over.

To do this, I’m firstly removing the default look-controls on load, and then adding a different component to handle rotation which only uses touch/drag. (I’m using removeAttribute, and setAtrribute to remove and add the components).

(I need look-controls on desktop, so I’m only doing the above on mobile)

That works fine initially, but on entering VR on mobile and then returning from VR, then trying to do the same again as described above, it no longer works - instead the device rotation is controlling the camera rotation as would be expected from the default look-controls even though I’ve removed them on exit.

Here is a link if anyone had like to try it I’m trying on S7 Android. This problem only pertains to mobile, I’ve no problem on desktop.

I believe this is some way related to the issue above, but if anyone thinks this would be better posed as a a Stack Overflow question or a separate issue, let me know and I’ll remove this and try that.

There’s something happening in aframe when the device is returning from VR mode, but I can’t find where or what is going on.

I have the same issue on Samsung S8 ( Chrome 66.0.3359.158) with Aframe 0.8.2. Accelerometer doesn’t work before to enter on VR Mode Swipe doesn’t work after exit VR mode

Everything works with Aframe 0.7.1