Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/js/vr/WebVR.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

var WEBVR = {

createButton: function ( renderer ) {
createButton: function ( renderer, options ) {

function showEnterVR( device ) {

Expand Down Expand Up @@ -38,9 +38,12 @@ var WEBVR = {

function onSessionStarted( session ) {

if ( options === undefined ) options = {};
if ( options.frameOfReferenceType === undefined ) options.frameOfReferenceType = 'stage';

session.addEventListener( 'end', onSessionEnded );

renderer.vr.setSession( session );
renderer.vr.setSession( session, options );
button.textContent = 'EXIT XR';

currentSession = session;
Expand Down
2 changes: 1 addition & 1 deletion examples/webvr_panorama.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
renderer.vr.userHeight = 0; // TOFIX
document.body.appendChild( renderer.domElement );

document.body.appendChild( WEBVR.createButton( renderer ) );
document.body.appendChild( WEBVR.createButton( renderer, { frameOfReferenceType: 'headModel' } ) );

//

Expand Down
2 changes: 1 addition & 1 deletion examples/webvr_rollercoaster.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
renderer.vr.userHeight = 0; // TOFIX
document.body.appendChild( renderer.domElement );

document.body.appendChild( WEBVR.createButton( renderer ) );
document.body.appendChild( WEBVR.createButton( renderer, { frameOfReferenceType: 'eyeLevel' } ) );

//

Expand Down
4 changes: 2 additions & 2 deletions src/renderers/webvr/WebXRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function WebXRManager( renderer ) {

//

this.setSession = function ( value ) {
this.setSession = function ( value, options ) {

session = value;

Expand All @@ -72,7 +72,7 @@ function WebXRManager( renderer ) {
} );

session.baseLayer = new XRWebGLLayer( session, gl );
session.requestFrameOfReference( 'stage' ).then( function ( value ) {
session.requestFrameOfReference( options.frameOfReferenceType ).then( function ( value ) {

frameOfRef = value;

Expand Down