|
@@ -10,10 +10,11 @@ import { ArrayCamera } from '../../cameras/ArrayCamera.js';
|
|
import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js';
|
|
import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js';
|
|
import { WebGLAnimation } from '../webgl/WebGLAnimation.js';
|
|
import { WebGLAnimation } from '../webgl/WebGLAnimation.js';
|
|
|
|
|
|
-function WebXRManager( gl ) {
|
|
|
|
|
|
+function WebXRManager( renderer ) {
|
|
|
|
|
|
var scope = this;
|
|
var scope = this;
|
|
|
|
|
|
|
|
+ var gl = renderer.context;
|
|
var device = null;
|
|
var device = null;
|
|
var session = null;
|
|
var session = null;
|
|
|
|
|
|
@@ -70,7 +71,7 @@ function WebXRManager( gl ) {
|
|
|
|
|
|
session.addEventListener( 'end', function () {
|
|
session.addEventListener( 'end', function () {
|
|
|
|
|
|
- gl.bindFramebuffer( gl.FRAMEBUFFER, null );
|
|
|
|
|
|
+ renderer.setFramebuffer( null );
|
|
animation.stop();
|
|
animation.stop();
|
|
|
|
|
|
} );
|
|
} );
|
|
@@ -81,6 +82,8 @@ function WebXRManager( gl ) {
|
|
frameOfRef = value;
|
|
frameOfRef = value;
|
|
isExclusive = session.exclusive;
|
|
isExclusive = session.exclusive;
|
|
|
|
|
|
|
|
+ renderer.setFramebuffer( session.baseLayer.framebuffer );
|
|
|
|
+
|
|
animation.setContext( session );
|
|
animation.setContext( session );
|
|
animation.start();
|
|
animation.start();
|
|
|
|
|
|
@@ -135,8 +138,6 @@ function WebXRManager( gl ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- gl.bindFramebuffer( gl.FRAMEBUFFER, session.baseLayer.framebuffer );
|
|
|
|
-
|
|
|
|
if ( onAnimationFrameCallback ) onAnimationFrameCallback();
|
|
if ( onAnimationFrameCallback ) onAnimationFrameCallback();
|
|
|
|
|
|
}
|
|
}
|