Parcourir la source

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 il y a 7 ans
Parent
commit
6e7137dcf5
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  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 ) {