File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,15 @@ THREE.WEBVR = {
9999
100100 if ( currentSession === null ) {
101101
102- navigator . xr . requestSession ( 'immersive-vr' ) . then ( onSessionStarted ) ;
102+ // WebXR's requestReferenceSpace only works if the corresponding feature
103+ // was requested at session creation time. For simplicity, just ask for
104+ // the interesting ones as optional features, but be aware that the
105+ // requestReferenceSpace call will fail if it turns out to be unavailable.
106+ // ('local' is always available for immersive sessions and doesn't need to
107+ // be requested separately.)
108+
109+ var sessionInit = { optionalFeatures : [ 'local-floor' , 'bounded-floor' ] } ;
110+ navigator . xr . requestSession ( 'immersive-vr' , sessionInit ) . then ( onSessionStarted ) ;
103111
104112 } else {
105113
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ var WEBVR = {
1414 if ( options && options . referenceSpaceType ) {
1515
1616 renderer . vr . setReferenceSpaceType ( options . referenceSpaceType ) ;
17-
1817 }
1918
2019 function showEnterVR ( device ) {
@@ -101,7 +100,15 @@ var WEBVR = {
101100
102101 if ( currentSession === null ) {
103102
104- navigator . xr . requestSession ( 'immersive-vr' ) . then ( onSessionStarted ) ;
103+ // WebXR's requestReferenceSpace only works if the corresponding feature
104+ // was requested at session creation time. For simplicity, just ask for
105+ // the interesting ones as optional features, but be aware that the
106+ // requestReferenceSpace call will fail if it turns out to be unavailable.
107+ // ('local' is always available for immersive sessions and doesn't need to
108+ // be requested separately.)
109+
110+ var sessionInit = { optionalFeatures : [ 'local-floor' , 'bounded-floor' ] } ;
111+ navigator . xr . requestSession ( 'immersive-vr' , sessionInit ) . then ( onSessionStarted ) ;
105112
106113 } else {
107114
You can’t perform that action at this time.
0 commit comments