|
@@ -2,6 +2,7 @@
|
|
* @author mrdoob / http://mrdoob.com/
|
|
* @author mrdoob / http://mrdoob.com/
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
import { Group } from '../../objects/Group.js';
|
|
import { Group } from '../../objects/Group.js';
|
|
import { Matrix4 } from '../../math/Matrix4.js';
|
|
import { Matrix4 } from '../../math/Matrix4.js';
|
|
import { Vector4 } from '../../math/Vector4.js';
|
|
import { Vector4 } from '../../math/Vector4.js';
|
|
@@ -12,6 +13,8 @@ import { setProjectionFromUnion } from './WebVRUtils.js';
|
|
|
|
|
|
function WebXRManager( renderer ) {
|
|
function WebXRManager( renderer ) {
|
|
|
|
|
|
|
|
+ var scope = this;
|
|
|
|
+
|
|
var gl = renderer.context;
|
|
var gl = renderer.context;
|
|
|
|
|
|
var device = null;
|
|
var device = null;
|
|
@@ -97,6 +100,8 @@ function WebXRManager( renderer ) {
|
|
renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
|
|
renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
|
|
animation.stop();
|
|
animation.stop();
|
|
|
|
|
|
|
|
+ scope.dispatchEvent( { type: 'endSession' } );
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
this.setFramebufferScaleFactor = function ( value ) {
|
|
this.setFramebufferScaleFactor = function ( value ) {
|
|
@@ -132,6 +137,8 @@ function WebXRManager( renderer ) {
|
|
animation.setContext( session );
|
|
animation.setContext( session );
|
|
animation.start();
|
|
animation.start();
|
|
|
|
|
|
|
|
+ scope.dispatchEvent( { type: 'startSession' } );
|
|
|
|
+
|
|
} );
|
|
} );
|
|
|
|
|
|
//
|
|
//
|
|
@@ -312,4 +319,6 @@ function WebXRManager( renderer ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+Object.assign( WebXRManager.prototype, EventDispatcher.prototype );
|
|
|
|
+
|
|
export { WebXRManager };
|
|
export { WebXRManager };
|