|
3724 | 3724 |
|
3725 | 3725 | this.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
|
3726 | 3726 |
|
| 3727 | + this.texture.image = {}; |
| 3728 | + this.texture.image.width = width; |
| 3729 | + this.texture.image.height = height; |
| 3730 | + |
3727 | 3731 | this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
|
3728 | 3732 | this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
|
3729 | 3733 |
|
|
3746 | 3750 | this.width = width;
|
3747 | 3751 | this.height = height;
|
3748 | 3752 |
|
| 3753 | + this.texture.image.width = width; |
| 3754 | + this.texture.image.height = height; |
| 3755 | + |
3749 | 3756 | this.dispose();
|
3750 | 3757 |
|
3751 | 3758 | }
|
|
20623 | 20630 |
|
20624 | 20631 | _gl.pixelStorei( 37440, texture.flipY );
|
20625 | 20632 |
|
20626 |
| - var isCompressed = ( texture && texture.isCompressedTexture ); |
| 20633 | + var isCompressed = ( texture.image[ 0 ] && texture.image[ 0 ].isCompressedTexture ); |
20627 | 20634 | var isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );
|
20628 | 20635 |
|
20629 | 20636 | var cubeImage = [];
|
|
22080 | 22087 |
|
22081 | 22088 | animation.start();
|
22082 | 22089 |
|
| 22090 | + scope.dispatchEvent( { type: 'sessionstart' } ); |
| 22091 | + |
22083 | 22092 | } else {
|
22084 | 22093 |
|
22085 | 22094 | if ( scope.enabled ) {
|
|
22090 | 22099 |
|
22091 | 22100 | animation.stop();
|
22092 | 22101 |
|
| 22102 | + scope.dispatchEvent( { type: 'sessionend' } ); |
| 22103 | + |
22093 | 22104 | }
|
22094 | 22105 |
|
22095 | 22106 | }
|
@@ -22414,12 +22425,16 @@
|
22414 | 22425 |
|
22415 | 22426 | }
|
22416 | 22427 |
|
| 22428 | + Object.assign( WebVRManager.prototype, EventDispatcher.prototype ); |
| 22429 | + |
22417 | 22430 | /**
|
22418 | 22431 | * @author mrdoob / http://mrdoob.com/
|
22419 | 22432 | */
|
22420 | 22433 |
|
22421 | 22434 | function WebXRManager( renderer ) {
|
22422 | 22435 |
|
| 22436 | + var scope = this; |
| 22437 | + |
22423 | 22438 | var gl = renderer.context;
|
22424 | 22439 |
|
22425 | 22440 | var session = null;
|
|
22496 | 22511 | renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
|
22497 | 22512 | animation.stop();
|
22498 | 22513 |
|
| 22514 | + scope.dispatchEvent( { type: 'sessionend' } ); |
| 22515 | + |
22499 | 22516 | }
|
22500 | 22517 |
|
22501 | 22518 | function onRequestReferenceSpace( value ) {
|
|
22505 | 22522 | animation.setContext( session );
|
22506 | 22523 | animation.start();
|
22507 | 22524 |
|
| 22525 | + scope.dispatchEvent( { type: 'sessionstart' } ); |
| 22526 | + |
22508 | 22527 | }
|
22509 | 22528 |
|
22510 | 22529 | this.setFramebufferScaleFactor = function ( value ) {
|
|
22517 | 22536 |
|
22518 | 22537 | };
|
22519 | 22538 |
|
| 22539 | + this.getSession = function () { |
| 22540 | + |
| 22541 | + return session; |
| 22542 | + |
| 22543 | + }; |
| 22544 | + |
22520 | 22545 | this.setSession = function ( value ) {
|
22521 | 22546 |
|
22522 | 22547 | session = value;
|
|
22719 | 22744 |
|
22720 | 22745 | }
|
22721 | 22746 |
|
| 22747 | + Object.assign( WebXRManager.prototype, EventDispatcher.prototype ); |
| 22748 | + |
22722 | 22749 | /**
|
22723 | 22750 | * @author supereggbert / http://www.paulbrunt.co.uk/
|
22724 | 22751 | * @author mrdoob / http://mrdoob.com/
|
|
0 commit comments