|
@@ -118,13 +118,7 @@ Object.assign( EventDispatcher.prototype, {
|
|
|
|
|
|
var listeners = this._listeners;
|
|
|
|
|
|
- if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) {
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -6034,7 +6028,7 @@ var ShaderLib = {
|
|
|
emissive : { value: new Color( 0x000000 ) },
|
|
|
roughness: { value: 0.5 },
|
|
|
metalness: { value: 0 },
|
|
|
- envMapIntensity : { value: 1 }, // temporary
|
|
|
+ envMapIntensity : { value: 1 } // temporary
|
|
|
}
|
|
|
),
|
|
|
|
|
@@ -6285,27 +6279,15 @@ Box2.prototype = {
|
|
|
|
|
|
containsPoint: function ( point ) {
|
|
|
|
|
|
- if ( point.x < this.min.x || point.x > this.max.x ||
|
|
|
- point.y < this.min.y || point.y > this.max.y ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return point.x < this.min.x || point.x > this.max.x ||
|
|
|
+ point.y < this.min.y || point.y > this.max.y ? false : true;
|
|
|
|
|
|
},
|
|
|
|
|
|
containsBox: function ( box ) {
|
|
|
|
|
|
- if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
|
|
|
- ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) ) {
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return this.min.x <= box.min.x && box.max.x <= this.max.x &&
|
|
|
+ this.min.y <= box.min.y && box.max.y <= this.max.y;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -6326,15 +6308,8 @@ Box2.prototype = {
|
|
|
intersectsBox: function ( box ) {
|
|
|
|
|
|
// using 6 splitting planes to rule out intersections.
|
|
|
-
|
|
|
- if ( box.max.x < this.min.x || box.min.x > this.max.x ||
|
|
|
- box.max.y < this.min.y || box.min.y > this.max.y ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return box.max.x < this.min.x || box.min.x > this.max.x ||
|
|
|
+ box.max.y < this.min.y || box.min.y > this.max.y ? false : true;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -7975,29 +7950,17 @@ Box3.prototype = {
|
|
|
|
|
|
containsPoint: function ( point ) {
|
|
|
|
|
|
- if ( point.x < this.min.x || point.x > this.max.x ||
|
|
|
- point.y < this.min.y || point.y > this.max.y ||
|
|
|
- point.z < this.min.z || point.z > this.max.z ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return point.x < this.min.x || point.x > this.max.x ||
|
|
|
+ point.y < this.min.y || point.y > this.max.y ||
|
|
|
+ point.z < this.min.z || point.z > this.max.z ? false : true;
|
|
|
|
|
|
},
|
|
|
|
|
|
containsBox: function ( box ) {
|
|
|
|
|
|
- if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
|
|
|
- ( this.min.y <= box.min.y ) && ( box.max.y <= this.max.y ) &&
|
|
|
- ( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) {
|
|
|
-
|
|
|
- return true;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
+ return this.min.x <= box.min.x && box.max.x <= this.max.x &&
|
|
|
+ this.min.y <= box.min.y && box.max.y <= this.max.y &&
|
|
|
+ this.min.z <= box.min.z && box.max.z <= this.max.z;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -8019,16 +7982,9 @@ Box3.prototype = {
|
|
|
intersectsBox: function ( box ) {
|
|
|
|
|
|
// using 6 splitting planes to rule out intersections.
|
|
|
-
|
|
|
- if ( box.max.x < this.min.x || box.min.x > this.max.x ||
|
|
|
- box.max.y < this.min.y || box.min.y > this.max.y ||
|
|
|
- box.max.z < this.min.z || box.min.z > this.max.z ) {
|
|
|
-
|
|
|
- return false;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
+ return box.max.x < this.min.x || box.min.x > this.max.x ||
|
|
|
+ box.max.y < this.min.y || box.min.y > this.max.y ||
|
|
|
+ box.max.z < this.min.z || box.min.z > this.max.z ? false : true;
|
|
|
|
|
|
},
|
|
|
|
|
@@ -12230,7 +12186,7 @@ Object.assign( DirectGeometry.prototype, {
|
|
|
|
|
|
var group;
|
|
|
var groups = [];
|
|
|
- var materialIndex;
|
|
|
+ var materialIndex = undefined;
|
|
|
|
|
|
var faces = geometry.faces;
|
|
|
|
|
@@ -16152,7 +16108,7 @@ function generateExtensions( extensions, parameters, rendererExtensions ) {
|
|
|
( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '',
|
|
|
( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '',
|
|
|
( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '',
|
|
|
- ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : '',
|
|
|
+ ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ? '#extension GL_EXT_shader_texture_lod : enable' : ''
|
|
|
];
|
|
|
|
|
|
return chunks.filter( filterEmptyLine ).join( '\n' );
|
|
@@ -17496,10 +17452,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
|
|
|
|
|
|
function textureNeedsPowerOfTwo( texture ) {
|
|
|
|
|
|
- if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) return true;
|
|
|
- if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) return true;
|
|
|
-
|
|
|
- return false;
|
|
|
+ return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) ||
|
|
|
+ ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -17668,8 +17622,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
|
|
|
|
|
|
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
|
|
|
|
|
|
- var isCompressed = (texture && texture.isCompressedTexture);
|
|
|
- var isDataTexture = (texture.image[ 0 ] && texture.image[ 0 ].isDataTexture);
|
|
|
+ var isCompressed = ( texture && texture.isCompressedTexture );
|
|
|
+ var isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );
|
|
|
|
|
|
var cubeImage = [];
|
|
|
|
|
@@ -30014,7 +29968,7 @@ AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {
|
|
|
|
|
|
constructor: AmbientLight,
|
|
|
|
|
|
- isAmbientLight: true,
|
|
|
+ isAmbientLight: true
|
|
|
|
|
|
} );
|
|
|
|
|
@@ -30670,28 +30624,28 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
DefaultInterpolation: InterpolateLinear,
|
|
|
|
|
|
- InterpolantFactoryMethodDiscrete: function( result ) {
|
|
|
+ InterpolantFactoryMethodDiscrete: function ( result ) {
|
|
|
|
|
|
return new DiscreteInterpolant(
|
|
|
this.times, this.values, this.getValueSize(), result );
|
|
|
|
|
|
},
|
|
|
|
|
|
- InterpolantFactoryMethodLinear: function( result ) {
|
|
|
+ InterpolantFactoryMethodLinear: function ( result ) {
|
|
|
|
|
|
return new LinearInterpolant(
|
|
|
this.times, this.values, this.getValueSize(), result );
|
|
|
|
|
|
},
|
|
|
|
|
|
- InterpolantFactoryMethodSmooth: function( result ) {
|
|
|
+ InterpolantFactoryMethodSmooth: function ( result ) {
|
|
|
|
|
|
return new CubicInterpolant(
|
|
|
this.times, this.values, this.getValueSize(), result );
|
|
|
|
|
|
},
|
|
|
|
|
|
- setInterpolation: function( interpolation ) {
|
|
|
+ setInterpolation: function ( interpolation ) {
|
|
|
|
|
|
var factoryMethod;
|
|
|
|
|
@@ -30746,7 +30700,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- getInterpolation: function() {
|
|
|
+ getInterpolation: function () {
|
|
|
|
|
|
switch ( this.createInterpolant ) {
|
|
|
|
|
@@ -30766,20 +30720,20 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
},
|
|
|
|
|
|
- getValueSize: function() {
|
|
|
+ getValueSize: function () {
|
|
|
|
|
|
return this.values.length / this.times.length;
|
|
|
|
|
|
},
|
|
|
|
|
|
// move all keyframes either forwards or backwards in time
|
|
|
- shift: function( timeOffset ) {
|
|
|
+ shift: function ( timeOffset ) {
|
|
|
|
|
|
- if( timeOffset !== 0.0 ) {
|
|
|
+ if ( timeOffset !== 0.0 ) {
|
|
|
|
|
|
var times = this.times;
|
|
|
|
|
|
- for( var i = 0, n = times.length; i !== n; ++ i ) {
|
|
|
+ for ( var i = 0, n = times.length; i !== n; ++ i ) {
|
|
|
|
|
|
times[ i ] += timeOffset;
|
|
|
|
|
@@ -30792,13 +30746,13 @@ KeyframeTrackPrototype = {
|
|
|
},
|
|
|
|
|
|
// scale all keyframe times by a factor (useful for frame <-> seconds conversions)
|
|
|
- scale: function( timeScale ) {
|
|
|
+ scale: function ( timeScale ) {
|
|
|
|
|
|
- if( timeScale !== 1.0 ) {
|
|
|
+ if ( timeScale !== 1.0 ) {
|
|
|
|
|
|
var times = this.times;
|
|
|
|
|
|
- for( var i = 0, n = times.length; i !== n; ++ i ) {
|
|
|
+ for ( var i = 0, n = times.length; i !== n; ++ i ) {
|
|
|
|
|
|
times[ i ] *= timeScale;
|
|
|
|
|
@@ -30812,7 +30766,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
// removes keyframes before and after animation without changing any values within the range [startTime, endTime].
|
|
|
// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values
|
|
|
- trim: function( startTime, endTime ) {
|
|
|
+ trim: function ( startTime, endTime ) {
|
|
|
|
|
|
var times = this.times,
|
|
|
nKeys = times.length,
|
|
@@ -30820,14 +30774,14 @@ KeyframeTrackPrototype = {
|
|
|
to = nKeys - 1;
|
|
|
|
|
|
while ( from !== nKeys && times[ from ] < startTime ) ++ from;
|
|
|
- while ( to !== -1 && times[ to ] > endTime ) -- to;
|
|
|
+ while ( to !== - 1 && times[ to ] > endTime ) -- to;
|
|
|
|
|
|
++ to; // inclusive -> exclusive bound
|
|
|
|
|
|
- if( from !== 0 || to !== nKeys ) {
|
|
|
+ if ( from !== 0 || to !== nKeys ) {
|
|
|
|
|
|
// empty tracks are forbidden, so keep at least one keyframe
|
|
|
- if ( from >= to ) to = Math.max( to , 1 ), from = to - 1;
|
|
|
+ if ( from >= to ) to = Math.max( to, 1 ), from = to - 1;
|
|
|
|
|
|
var stride = this.getValueSize();
|
|
|
this.times = AnimationUtils.arraySlice( times, from, to );
|
|
@@ -30841,7 +30795,7 @@ KeyframeTrackPrototype = {
|
|
|
},
|
|
|
|
|
|
// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
|
|
|
- validate: function() {
|
|
|
+ validate: function () {
|
|
|
|
|
|
var valid = true;
|
|
|
|
|
@@ -30858,7 +30812,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
nKeys = times.length;
|
|
|
|
|
|
- if( nKeys === 0 ) {
|
|
|
+ if ( nKeys === 0 ) {
|
|
|
|
|
|
console.error( "track is empty", this );
|
|
|
valid = false;
|
|
@@ -30867,7 +30821,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
var prevTime = null;
|
|
|
|
|
|
- for( var i = 0; i !== nKeys; i ++ ) {
|
|
|
+ for ( var i = 0; i !== nKeys; i ++ ) {
|
|
|
|
|
|
var currTime = times[ i ];
|
|
|
|
|
@@ -30879,7 +30833,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if( prevTime !== null && prevTime > currTime ) {
|
|
|
+ if ( prevTime !== null && prevTime > currTime ) {
|
|
|
|
|
|
console.error( "out of order keys", this, i, currTime, prevTime );
|
|
|
valid = false;
|
|
@@ -30919,7 +30873,7 @@ KeyframeTrackPrototype = {
|
|
|
|
|
|
// removes equivalent sequential keys as common in morph target sequences
|
|
|
// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
|
|
|
- optimize: function() {
|
|
|
+ optimize: function () {
|
|
|
|
|
|
var times = this.times,
|
|
|
values = this.values,
|
|
@@ -30930,7 +30884,7 @@ KeyframeTrackPrototype = {
|
|
|
writeIndex = 1,
|
|
|
lastIndex = times.length - 1;
|
|
|
|
|
|
- for( var i = 1; i < lastIndex; ++ i ) {
|
|
|
+ for ( var i = 1; i < lastIndex; ++ i ) {
|
|
|
|
|
|
var keep = false;
|
|
|
|
|
@@ -31167,7 +31121,7 @@ NumberKeyframeTrack.prototype =
|
|
|
|
|
|
constructor: NumberKeyframeTrack,
|
|
|
|
|
|
- ValueTypeName: 'number',
|
|
|
+ ValueTypeName: 'number'
|
|
|
|
|
|
// ValueBufferType is inherited
|
|
|
|
|
@@ -31459,8 +31413,7 @@ AnimationClip.prototype = {
|
|
|
|
|
|
var track = this.tracks[ i ];
|
|
|
|
|
|
- duration = Math.max(
|
|
|
- duration, track.times[ track.times.length - 1 ] );
|
|
|
+ duration = Math.max( duration, track.times[ track.times.length - 1 ] );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -31724,8 +31677,7 @@ Object.assign( AnimationClip, {
|
|
|
var times = [];
|
|
|
var values = [];
|
|
|
|
|
|
- for ( var m = 0;
|
|
|
- m !== animationKeys[k].morphTargets.length; ++ m ) {
|
|
|
+ for ( var m = 0; m !== animationKeys[k].morphTargets.length; ++ m ) {
|
|
|
|
|
|
var animationKey = animationKeys[k];
|
|
|
|
|
@@ -31734,8 +31686,7 @@ Object.assign( AnimationClip, {
|
|
|
|
|
|
}
|
|
|
|
|
|
- tracks.push( new NumberKeyframeTrack(
|
|
|
- '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
|
|
|
+ tracks.push( new NumberKeyframeTrack('.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -36041,14 +35992,18 @@ function PropertyMixer( binding, typeName, valueSize ) {
|
|
|
|
|
|
switch ( typeName ) {
|
|
|
|
|
|
- case 'quaternion': mixFunction = this._slerp; break;
|
|
|
+ case 'quaternion':
|
|
|
+ mixFunction = this._slerp;
|
|
|
+ break;
|
|
|
|
|
|
case 'string':
|
|
|
case 'bool':
|
|
|
+ bufferType = Array;
|
|
|
+ mixFunction = this._select;
|
|
|
+ break;
|
|
|
|
|
|
- bufferType = Array, mixFunction = this._select; break;
|
|
|
-
|
|
|
- default: mixFunction = this._lerp;
|
|
|
+ default:
|
|
|
+ mixFunction = this._lerp;
|
|
|
|
|
|
}
|
|
|
|
|
@@ -36966,7 +36921,8 @@ AnimationObjectGroup.prototype = {
|
|
|
|
|
|
var object = arguments[ i ],
|
|
|
uuid = object.uuid,
|
|
|
- index = indicesByUUID[ uuid ];
|
|
|
+ index = indicesByUUID[ uuid ],
|
|
|
+ knownObject = undefined;
|
|
|
|
|
|
if ( index === undefined ) {
|
|
|
|
|
@@ -36988,7 +36944,7 @@ AnimationObjectGroup.prototype = {
|
|
|
|
|
|
} else if ( index < nCachedObjects ) {
|
|
|
|
|
|
- var knownObject = objects[ index ];
|
|
|
+ knownObject = objects[ index ];
|
|
|
|
|
|
// move existing object to the ACTIVE region
|
|
|
|
|
@@ -37519,7 +37475,7 @@ AnimationAction.prototype = {
|
|
|
|
|
|
if ( interpolant === null ) {
|
|
|
|
|
|
- interpolant = mixer._lendControlInterpolant(),
|
|
|
+ interpolant = mixer._lendControlInterpolant();
|
|
|
this._timeScaleInterpolant = interpolant;
|
|
|
|
|
|
}
|
|
@@ -37719,7 +37675,7 @@ AnimationAction.prototype = {
|
|
|
if ( loopCount === -1 ) {
|
|
|
// just started
|
|
|
|
|
|
- this.loopCount = 0;
|
|
|
+ this._loopCount = 0;
|
|
|
this._setEndings( true, true, false );
|
|
|
|
|
|
}
|
|
@@ -37882,7 +37838,7 @@ AnimationAction.prototype = {
|
|
|
|
|
|
if ( interpolant === null ) {
|
|
|
|
|
|
- interpolant = mixer._lendControlInterpolant(),
|
|
|
+ interpolant = mixer._lendControlInterpolant();
|
|
|
this._weightInterpolant = interpolant;
|
|
|
|
|
|
}
|