ソースを参照

WebVR: Support exclusive and immersive webxr sessions.

Mr.doob 7 年 前
コミット
2941033a27
1 ファイル変更10 行追加3 行削除
  1. 10 3
      examples/js/vr/WebVR.js

+ 10 - 3
examples/js/vr/WebVR.js

@@ -78,7 +78,10 @@ var WEBVR = {
 
 				if ( currentSession === null ) {
 
+					// TODO Remove exclusive
+
 					device.requestSession( { exclusive: true } ).then( onSessionStarted );
+					device.requestSession( { immersive: true } ).then( onSessionStarted );
 
 				} else {
 
@@ -137,11 +140,15 @@ var WEBVR = {
 
 			navigator.xr.requestDevice().then( function ( device ) {
 
-				device.supportsSession( { exclusive: true } ).then( function () {
+				// TODO Remove exclusive
 
-					showEnterXR( device );
+				device.supportsSession( { exclusive: true } )
+					.then( function () { showEnterXR( device ); } )
+					.catch( showVRNotFound );
 
-				} ).catch( showVRNotFound );
+				device.supportsSession( { immersive: true } )
+					.then( function () { showEnterXR( device ); } )
+					.catch( showVRNotFound );
 
 			} ).catch( showVRNotFound );