aframe-look-controls-z
An A-Frame WebVR component. Drop-in replacement for core look-controls, except in magic-window mode, the virtual horizon stays parallel to the real horizon. (Rotation around the z-axis is tracked, like the x- and y-axes.)
Useful when flying, as in Elfland Glider
You may also want to lock the screen orientation, which usually requires first going to fullscreen mode.
Basic Usage
Screen Orientation Lock and Fullscreen Mode
Call goFullscreenLandscape() on a user gesture, such as a mouse click:
{ if ! return; let canvasEl = document; let requestFullscreen = canvasElrequestFullscreen || canvasElwebkitRequestFullscreen || canvasElmozRequestFullScreen || // The capitalized `S` is not a typo. canvasElmsRequestFullscreen; let promise; if requestFullscreen promise = requestFullscreen; if !promise && promisethen promise = Promise; promise;} { if screenorientation && screenorientationlock screenorientation; } { return AFRAMEutilsdevice && ! AFRAMEutilsdevice && // ! AFRAME.utils.device.isOculusGo() && ! AFRAMEscenes0}