|
@@ -2,6 +2,7 @@
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*/
|
|
|
|
|
|
+import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
|
import { Group } from '../../objects/Group.js';
|
|
|
import { Matrix4 } from '../../math/Matrix4.js';
|
|
|
import { Vector4 } from '../../math/Vector4.js';
|
|
@@ -12,6 +13,8 @@ import { setProjectionFromUnion } from './WebVRUtils.js';
|
|
|
|
|
|
function WebXRManager( renderer ) {
|
|
|
|
|
|
+ var scope = this;
|
|
|
+
|
|
|
var gl = renderer.context;
|
|
|
|
|
|
var session = null;
|
|
@@ -90,6 +93,8 @@ function WebXRManager( renderer ) {
|
|
|
renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
|
|
|
animation.stop();
|
|
|
|
|
|
+ scope.dispatchEvent( { type: 'sessionend' } );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function onRequestReferenceSpace( value ) {
|
|
@@ -99,6 +104,8 @@ function WebXRManager( renderer ) {
|
|
|
animation.setContext( session );
|
|
|
animation.start();
|
|
|
|
|
|
+ scope.dispatchEvent( { type: 'sessionstart' } );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
this.setFramebufferScaleFactor = function ( value ) {
|
|
@@ -321,4 +328,6 @@ function WebXRManager( renderer ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+Object.assign( WebXRManager.prototype, EventDispatcher.prototype );
|
|
|
+
|
|
|
export { WebXRManager };
|