File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2
2
* @author mrdoob / http://mrdoob.com/
3
3
*/
4
4
5
+ import { EventDispatcher } from '../../core/EventDispatcher.js' ;
5
6
import { Group } from '../../objects/Group.js' ;
6
7
import { Matrix4 } from '../../math/Matrix4.js' ;
7
8
import { Vector2 } from '../../math/Vector2.js' ;
@@ -82,6 +83,8 @@ function WebVRManager( renderer ) {
82
83
83
84
animation . start ( ) ;
84
85
86
+ scope . dispatchEvent ( { type : 'sessionstart' } ) ;
87
+
85
88
} else {
86
89
87
90
if ( scope . enabled ) {
@@ -92,6 +95,8 @@ function WebVRManager( renderer ) {
92
95
93
96
animation . stop ( ) ;
94
97
98
+ scope . dispatchEvent ( { type : 'sessionend' } ) ;
99
+
95
100
}
96
101
97
102
}
@@ -416,4 +421,6 @@ function WebVRManager( renderer ) {
416
421
417
422
}
418
423
424
+ Object . assign ( WebVRManager . prototype , EventDispatcher . prototype ) ;
425
+
419
426
export { WebVRManager } ;
Original file line number Diff line number Diff line change 2
2
* @author mrdoob / http://mrdoob.com/
3
3
*/
4
4
5
+ import { EventDispatcher } from '../../core/EventDispatcher.js' ;
5
6
import { Group } from '../../objects/Group.js' ;
6
7
import { Matrix4 } from '../../math/Matrix4.js' ;
7
8
import { Vector4 } from '../../math/Vector4.js' ;
@@ -12,6 +13,8 @@ import { setProjectionFromUnion } from './WebVRUtils.js';
12
13
13
14
function WebXRManager ( renderer ) {
14
15
16
+ var scope = this ;
17
+
15
18
var gl = renderer . context ;
16
19
17
20
var session = null ;
@@ -90,6 +93,8 @@ function WebXRManager( renderer ) {
90
93
renderer . setRenderTarget ( renderer . getRenderTarget ( ) ) ; // Hack #15830
91
94
animation . stop ( ) ;
92
95
96
+ scope . dispatchEvent ( { type : 'sessionend' } ) ;
97
+
93
98
}
94
99
95
100
function onRequestReferenceSpace ( value ) {
@@ -99,6 +104,8 @@ function WebXRManager( renderer ) {
99
104
animation . setContext ( session ) ;
100
105
animation . start ( ) ;
101
106
107
+ scope . dispatchEvent ( { type : 'sessionstart' } ) ;
108
+
102
109
}
103
110
104
111
this . setFramebufferScaleFactor = function ( value ) {
@@ -321,4 +328,6 @@ function WebXRManager( renderer ) {
321
328
322
329
}
323
330
331
+ Object . assign ( WebXRManager . prototype , EventDispatcher . prototype ) ;
332
+
324
333
export { WebXRManager } ;
You can’t perform that action at this time.
0 commit comments