Skip to content

Commit

Permalink
Merge pull request #12 from mrdoob/dev
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Temdog007 authored May 14, 2019
2 parents 976f1b6 + 3fc814c commit fa398a1
Show file tree
Hide file tree
Showing 58 changed files with 1,882 additions and 2,543 deletions.
87 changes: 50 additions & 37 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -21971,6 +21971,7 @@

function WebVRManager( renderer ) {

var renderWidth, renderHeight;
var scope = this;

var device = null;
Expand Down Expand Up @@ -21998,11 +21999,11 @@
var tempPosition = new Vector3();

var cameraL = new PerspectiveCamera();
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
cameraL.viewport = new Vector4();
cameraL.layers.enable( 1 );

var cameraR = new PerspectiveCamera();
cameraR.bounds = new Vector4( 0.5, 0.0, 0.5, 1.0 );
cameraR.viewport = new Vector4();
cameraR.layers.enable( 2 );

var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
Expand All @@ -22024,14 +22025,17 @@
if ( isPresenting() ) {

var eyeParameters = device.getEyeParameters( 'left' );
var renderWidth = eyeParameters.renderWidth * framebufferScaleFactor;
var renderHeight = eyeParameters.renderHeight * framebufferScaleFactor;
renderWidth = eyeParameters.renderWidth * framebufferScaleFactor;
renderHeight = eyeParameters.renderHeight * framebufferScaleFactor;

currentPixelRatio = renderer.getPixelRatio();
renderer.getSize( currentSize );

renderer.setDrawingBufferSize( renderWidth * 2, renderHeight, 1 );

cameraL.viewport.set( 0, 0, renderWidth, renderHeight );
cameraR.viewport.set( renderWidth, 0, renderWidth, renderHeight );

animation.start();

} else {
Expand Down Expand Up @@ -22132,6 +22136,16 @@

}

function updateViewportFromBounds( viewport, bounds ) {

if ( bounds !== null && bounds.length === 4 ) {

viewport.set( bounds[ 0 ] * renderWidth, bounds[ 1 ] * renderHeight, bounds[ 2 ] * renderWidth, bounds[ 3 ] * renderHeight );

}

}

//

this.enabled = false;
Expand Down Expand Up @@ -22299,17 +22313,8 @@

var layer = layers[ 0 ];

if ( layer.leftBounds !== null && layer.leftBounds.length === 4 ) {

cameraL.bounds.fromArray( layer.leftBounds );

}

if ( layer.rightBounds !== null && layer.rightBounds.length === 4 ) {

cameraR.bounds.fromArray( layer.rightBounds );

}
updateViewportFromBounds( cameraL.viewport, layer.leftBounds );
updateViewportFromBounds( cameraR.viewport, layer.rightBounds );

}

Expand Down Expand Up @@ -22703,7 +22708,7 @@
* Enables error checking and reporting when shader programs are being compiled
* @type {boolean}
*/
checkShaderErrors: false
checkShaderErrors: true
};

// clearing
Expand Down Expand Up @@ -23998,22 +24003,7 @@

if ( object.layers.test( camera2.layers ) ) {

if ( 'viewport' in camera2 ) { // XR

state.viewport( _currentViewport.copy( camera2.viewport ) );

} else {

var bounds = camera2.bounds;

var x = bounds.x * _width;
var y = bounds.y * _height;
var width = bounds.z * _width;
var height = bounds.w * _height;

state.viewport( _currentViewport.set( x, y, width, height ).multiplyScalar( _pixelRatio ) );

}
state.viewport( _currentViewport.copy( camera2.viewport ) );

currentRenderState.setupLights( camera2 );

Expand Down Expand Up @@ -38035,8 +38025,17 @@

}

// Merges multi-byte utf-8 characters.
return decodeURIComponent( escape( s ) );
try {

// merges multi-byte utf-8 characters.

return decodeURIComponent( escape( s ) );

} catch ( e ) { // see #16358

return s;

}

},

Expand Down Expand Up @@ -43244,11 +43243,19 @@

time = 0;

} else break handle_stop;
} else {

this.time = time;

break handle_stop;

}

if ( this.clampWhenFinished ) this.paused = true;
else this.enabled = false;

this.time = time;

this._mixer.dispatchEvent( {
type: 'finished', action: this,
direction: deltaTime < 0 ? - 1 : 1
Expand Down Expand Up @@ -43300,6 +43307,8 @@

time = deltaTime > 0 ? duration : 0;

this.time = time;

this._mixer.dispatchEvent( {
type: 'finished', action: this,
direction: deltaTime > 0 ? 1 : - 1
Expand All @@ -43324,26 +43333,30 @@

this._loopCount = loopCount;

this.time = time;

this._mixer.dispatchEvent( {
type: 'loop', action: this, loopDelta: loopDelta
} );

}

} else {

this.time = time;

}

if ( pingPong && ( loopCount & 1 ) === 1 ) {

// invert time for the "pong round"

this.time = time;
return duration - time;

}

}

this.time = time;
return time;

},
Expand Down
1,299 changes: 649 additions & 650 deletions build/three.min.js

Large diffs are not rendered by default.

87 changes: 50 additions & 37 deletions build/three.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21965,6 +21965,7 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {

function WebVRManager( renderer ) {

var renderWidth, renderHeight;
var scope = this;

var device = null;
Expand Down Expand Up @@ -21992,11 +21993,11 @@ function WebVRManager( renderer ) {
var tempPosition = new Vector3();

var cameraL = new PerspectiveCamera();
cameraL.bounds = new Vector4( 0.0, 0.0, 0.5, 1.0 );
cameraL.viewport = new Vector4();
cameraL.layers.enable( 1 );

var cameraR = new PerspectiveCamera();
cameraR.bounds = new Vector4( 0.5, 0.0, 0.5, 1.0 );
cameraR.viewport = new Vector4();
cameraR.layers.enable( 2 );

var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
Expand All @@ -22018,14 +22019,17 @@ function WebVRManager( renderer ) {
if ( isPresenting() ) {

var eyeParameters = device.getEyeParameters( 'left' );
var renderWidth = eyeParameters.renderWidth * framebufferScaleFactor;
var renderHeight = eyeParameters.renderHeight * framebufferScaleFactor;
renderWidth = eyeParameters.renderWidth * framebufferScaleFactor;
renderHeight = eyeParameters.renderHeight * framebufferScaleFactor;

currentPixelRatio = renderer.getPixelRatio();
renderer.getSize( currentSize );

renderer.setDrawingBufferSize( renderWidth * 2, renderHeight, 1 );

cameraL.viewport.set( 0, 0, renderWidth, renderHeight );
cameraR.viewport.set( renderWidth, 0, renderWidth, renderHeight );

animation.start();

} else {
Expand Down Expand Up @@ -22126,6 +22130,16 @@ function WebVRManager( renderer ) {

}

function updateViewportFromBounds( viewport, bounds ) {

if ( bounds !== null && bounds.length === 4 ) {

viewport.set( bounds[ 0 ] * renderWidth, bounds[ 1 ] * renderHeight, bounds[ 2 ] * renderWidth, bounds[ 3 ] * renderHeight );

}

}

//

this.enabled = false;
Expand Down Expand Up @@ -22293,17 +22307,8 @@ function WebVRManager( renderer ) {

var layer = layers[ 0 ];

if ( layer.leftBounds !== null && layer.leftBounds.length === 4 ) {

cameraL.bounds.fromArray( layer.leftBounds );

}

if ( layer.rightBounds !== null && layer.rightBounds.length === 4 ) {

cameraR.bounds.fromArray( layer.rightBounds );

}
updateViewportFromBounds( cameraL.viewport, layer.leftBounds );
updateViewportFromBounds( cameraR.viewport, layer.rightBounds );

}

Expand Down Expand Up @@ -22697,7 +22702,7 @@ function WebGLRenderer( parameters ) {
* Enables error checking and reporting when shader programs are being compiled
* @type {boolean}
*/
checkShaderErrors: false
checkShaderErrors: true
};

// clearing
Expand Down Expand Up @@ -23992,22 +23997,7 @@ function WebGLRenderer( parameters ) {

if ( object.layers.test( camera2.layers ) ) {

if ( 'viewport' in camera2 ) { // XR

state.viewport( _currentViewport.copy( camera2.viewport ) );

} else {

var bounds = camera2.bounds;

var x = bounds.x * _width;
var y = bounds.y * _height;
var width = bounds.z * _width;
var height = bounds.w * _height;

state.viewport( _currentViewport.set( x, y, width, height ).multiplyScalar( _pixelRatio ) );

}
state.viewport( _currentViewport.copy( camera2.viewport ) );

currentRenderState.setupLights( camera2 );

Expand Down Expand Up @@ -38029,8 +38019,17 @@ var LoaderUtils = {

}

// Merges multi-byte utf-8 characters.
return decodeURIComponent( escape( s ) );
try {

// merges multi-byte utf-8 characters.

return decodeURIComponent( escape( s ) );

} catch ( e ) { // see #16358

return s;

}

},

Expand Down Expand Up @@ -43238,11 +43237,19 @@ Object.assign( AnimationAction.prototype, {

time = 0;

} else break handle_stop;
} else {

this.time = time;

break handle_stop;

}

if ( this.clampWhenFinished ) this.paused = true;
else this.enabled = false;

this.time = time;

this._mixer.dispatchEvent( {
type: 'finished', action: this,
direction: deltaTime < 0 ? - 1 : 1
Expand Down Expand Up @@ -43294,6 +43301,8 @@ Object.assign( AnimationAction.prototype, {

time = deltaTime > 0 ? duration : 0;

this.time = time;

this._mixer.dispatchEvent( {
type: 'finished', action: this,
direction: deltaTime > 0 ? 1 : - 1
Expand All @@ -43318,26 +43327,30 @@ Object.assign( AnimationAction.prototype, {

this._loopCount = loopCount;

this.time = time;

this._mixer.dispatchEvent( {
type: 'loop', action: this, loopDelta: loopDelta
} );

}

} else {

this.time = time;

}

if ( pingPong && ( loopCount & 1 ) === 1 ) {

// invert time for the "pong round"

this.time = time;
return duration - time;

}

}

this.time = time;
return time;

},
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ <h3>[method:null renderBufferImmediate]( [param:Object3D object], [param:shaderp

<h3>[method:null setAnimationLoop]( [param:Function callback] )</h3>
<p>[page:Function callback] — The function will be called every available frame. If `null` is passed it will stop any already ongoing animation.</p>
<p>A build in function that can be used instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. For WebVR projects this function must be used.</p>
<p>A built in function that can be used instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. For WebVR projects this function must be used.</p>

<h3>[method:null setClearAlpha]( [param:Float alpha] )</h3>
<p>Sets the clear alpha. Valid input is a float between *0.0* and *1.0*.</p>
Expand Down
Loading

0 comments on commit fa398a1

Please sign in to comment.