Explorar o código

Automatically enter VR on vrdisplayactivate event. see #13105.

Propagate VR-mode upon link traversal so the the user doesn't have
to manually click on the 'enter VR' button each time.
vt5491 %!s(int64=7) %!d(string=hai) anos
pai
achega
6e7137dcf5
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      examples/js/vr/WebVR.js

+ 6 - 0
examples/js/vr/WebVR.js

@@ -93,6 +93,12 @@ var WEBVR = {
 
 			}, false );
 
+			window.addEventListener( 'vrdisplayactivate', function ( event ) {
+
+				event.display.requestPresent( [ { source: renderer.domElement } ] );
+
+			}, false );
+
 			navigator.getVRDisplays()
 				.then( function ( displays ) {