Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
8aa5b832
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8aa5b832
编写于
12月 14, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
6acfc12d
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
268 addition
and
356 deletion
+268
-356
build/three.js
build/three.js
+64
-108
build/three.min.js
build/three.min.js
+140
-140
build/three.modules.js
build/three.modules.js
+64
-108
未找到文件。
build/three.js
浏览文件 @
8aa5b832
...
@@ -124,13 +124,7 @@
...
@@ -124,13 +124,7 @@
var listeners = this._listeners;
var listeners = this._listeners;
if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) {
return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;
return true;
}
return false;
},
},
...
@@ -6040,7 +6034,7 @@
...
@@ -6040,7 +6034,7 @@
emissive : { value: new Color( 0x000000 ) },
emissive : { value: new Color( 0x000000 ) },
roughness: { value: 0.5 },
roughness: { value: 0.5 },
metalness: { value: 0 },
metalness: { value: 0 },
envMapIntensity : { value: 1 }
,
// temporary
envMapIntensity : { value: 1 } // temporary
}
}
),
),
...
@@ -6291,27 +6285,15 @@
...
@@ -6291,27 +6285,15 @@
containsPoint: function ( point ) {
containsPoint: function ( point ) {
if ( point.x < this.min.x || point.x > this.max.x ||
return point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ) {
point.y < this.min.y || point.y > this.max.y ? false : true;
return false;
}
return true;
},
},
containsBox: function ( box ) {
containsBox: function ( box ) {
if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
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.y <= box.min.y && box.max.y <= this.max.y;
return true;
}
return false;
},
},
...
@@ -6332,15 +6314,8 @@
...
@@ -6332,15 +6314,8 @@
intersectsBox: function ( box ) {
intersectsBox: function ( box ) {
// using 6 splitting planes to rule out intersections.
// using 6 splitting planes to rule out intersections.
return box.max.x < this.min.x || box.min.x > this.max.x ||
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 ? false : true;
box.max.y < this.min.y || box.min.y > this.max.y ) {
return false;
}
return true;
},
},
...
@@ -7981,29 +7956,17 @@
...
@@ -7981,29 +7956,17 @@
containsPoint: function ( point ) {
containsPoint: function ( point ) {
if (
point.x < this.min.x || point.x > this.max.x ||
return
point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ||
point.y < this.min.y || point.y > this.max.y ||
point.z < this.min.z || point.z > this.max.z ) {
point.z < this.min.z || point.z > this.max.z ? false : true;
return false;
}
return true;
},
},
containsBox: function ( box ) {
containsBox: function ( box ) {
if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
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.y <= box.min.y && box.max.y <= this.max.y &&
( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) {
this.min.z <= box.min.z && box.max.z <= this.max.z;
return true;
}
return false;
},
},
...
@@ -8025,16 +7988,9 @@
...
@@ -8025,16 +7988,9 @@
intersectsBox: function ( box ) {
intersectsBox: function ( box ) {
// using 6 splitting planes to rule out intersections.
// using 6 splitting planes to rule out intersections.
return box.max.x < this.min.x || box.min.x > this.max.x ||
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.y < this.min.y || box.min.y > this.max.y ||
box.max.z < this.min.z || box.min.z > this.max.z ) {
box.max.z < this.min.z || box.min.z > this.max.z ? false : true;
return false;
}
return true;
},
},
...
@@ -12236,7 +12192,7 @@
...
@@ -12236,7 +12192,7 @@
var group;
var group;
var groups = [];
var groups = [];
var materialIndex;
var materialIndex
= undefined
;
var faces = geometry.faces;
var faces = geometry.faces;
...
@@ -16158,7 +16114,7 @@
...
@@ -16158,7 +16114,7 @@
( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ? '#extension GL_OES_standard_derivatives : enable' : '',
( 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.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.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' );
return chunks.filter( filterEmptyLine ).join( '\n' );
...
@@ -17502,10 +17458,8 @@
...
@@ -17502,10 +17458,8 @@
function textureNeedsPowerOfTwo( texture ) {
function textureNeedsPowerOfTwo( texture ) {
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) return true;
return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) ||
if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) return true;
( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter );
return false;
}
}
...
@@ -17674,8 +17628,8 @@
...
@@ -17674,8 +17628,8 @@
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
var isCompressed = (
texture && texture.isCompressedTexture
);
var isCompressed = (
texture && texture.isCompressedTexture
);
var isDataTexture = (
texture.image[ 0 ] && texture.image[ 0 ].isDataTexture
);
var isDataTexture = (
texture.image[ 0 ] && texture.image[ 0 ].isDataTexture
);
var cubeImage = [];
var cubeImage = [];
...
@@ -30020,7 +29974,7 @@
...
@@ -30020,7 +29974,7 @@
constructor: AmbientLight,
constructor: AmbientLight,
isAmbientLight: true
,
isAmbientLight: true
} );
} );
...
@@ -30676,28 +30630,28 @@
...
@@ -30676,28 +30630,28 @@
DefaultInterpolation: InterpolateLinear,
DefaultInterpolation: InterpolateLinear,
InterpolantFactoryMethodDiscrete: function( result ) {
InterpolantFactoryMethodDiscrete: function
( result ) {
return new DiscreteInterpolant(
return new DiscreteInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
InterpolantFactoryMethodLinear: function( result ) {
InterpolantFactoryMethodLinear: function
( result ) {
return new LinearInterpolant(
return new LinearInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
InterpolantFactoryMethodSmooth: function( result ) {
InterpolantFactoryMethodSmooth: function
( result ) {
return new CubicInterpolant(
return new CubicInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
setInterpolation: function( interpolation ) {
setInterpolation: function
( interpolation ) {
var factoryMethod;
var factoryMethod;
...
@@ -30752,7 +30706,7 @@
...
@@ -30752,7 +30706,7 @@
},
},
getInterpolation: function() {
getInterpolation: function
() {
switch ( this.createInterpolant ) {
switch ( this.createInterpolant ) {
...
@@ -30772,20 +30726,20 @@
...
@@ -30772,20 +30726,20 @@
},
},
getValueSize: function() {
getValueSize: function
() {
return this.values.length / this.times.length;
return this.values.length / this.times.length;
},
},
// move all keyframes either forwards or backwards in time
// 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;
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;
times[ i ] += timeOffset;
...
@@ -30798,13 +30752,13 @@
...
@@ -30798,13 +30752,13 @@
},
},
// scale all keyframe times by a factor (useful for frame <-> seconds conversions)
// 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;
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;
times[ i ] *= timeScale;
...
@@ -30818,7 +30772,7 @@
...
@@ -30818,7 +30772,7 @@
// removes keyframes before and after animation without changing any values within the range [startTime, endTime].
// 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
// 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,
var times = this.times,
nKeys = times.length,
nKeys = times.length,
...
@@ -30826,14 +30780,14 @@
...
@@ -30826,14 +30780,14 @@
to = nKeys - 1;
to = nKeys - 1;
while ( from !== nKeys && times[ from ] < startTime ) ++ from;
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
++ to; // inclusive -> exclusive bound
if( from !== 0 || to !== nKeys ) {
if
( from !== 0 || to !== nKeys ) {
// empty tracks are forbidden, so keep at least one keyframe
// 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();
var stride = this.getValueSize();
this.times = AnimationUtils.arraySlice( times, from, to );
this.times = AnimationUtils.arraySlice( times, from, to );
...
@@ -30847,7 +30801,7 @@
...
@@ -30847,7 +30801,7 @@
},
},
// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
validate: function() {
validate: function
() {
var valid = true;
var valid = true;
...
@@ -30864,7 +30818,7 @@
...
@@ -30864,7 +30818,7 @@
nKeys = times.length;
nKeys = times.length;
if( nKeys === 0 ) {
if
( nKeys === 0 ) {
console.error( "track is empty", this );
console.error( "track is empty", this );
valid = false;
valid = false;
...
@@ -30873,7 +30827,7 @@
...
@@ -30873,7 +30827,7 @@
var prevTime = null;
var prevTime = null;
for( var i = 0; i !== nKeys; i ++ ) {
for
( var i = 0; i !== nKeys; i ++ ) {
var currTime = times[ i ];
var currTime = times[ i ];
...
@@ -30885,7 +30839,7 @@
...
@@ -30885,7 +30839,7 @@
}
}
if( prevTime !== null && prevTime > currTime ) {
if
( prevTime !== null && prevTime > currTime ) {
console.error( "out of order keys", this, i, currTime, prevTime );
console.error( "out of order keys", this, i, currTime, prevTime );
valid = false;
valid = false;
...
@@ -30925,7 +30879,7 @@
...
@@ -30925,7 +30879,7 @@
// removes equivalent sequential keys as common in morph target sequences
// 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)
// (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,
var times = this.times,
values = this.values,
values = this.values,
...
@@ -30936,7 +30890,7 @@
...
@@ -30936,7 +30890,7 @@
writeIndex = 1,
writeIndex = 1,
lastIndex = times.length - 1;
lastIndex = times.length - 1;
for( var i = 1; i < lastIndex; ++ i ) {
for
( var i = 1; i < lastIndex; ++ i ) {
var keep = false;
var keep = false;
...
@@ -31173,7 +31127,7 @@
...
@@ -31173,7 +31127,7 @@
constructor: NumberKeyframeTrack,
constructor: NumberKeyframeTrack,
ValueTypeName: 'number'
,
ValueTypeName: 'number'
// ValueBufferType is inherited
// ValueBufferType is inherited
...
@@ -31465,8 +31419,7 @@
...
@@ -31465,8 +31419,7 @@
var track = this.tracks[ i ];
var track = this.tracks[ i ];
duration = Math.max(
duration = Math.max( duration, track.times[ track.times.length - 1 ] );
duration, track.times[ track.times.length - 1 ] );
}
}
...
@@ -31730,8 +31683,7 @@
...
@@ -31730,8 +31683,7 @@
var times = [];
var times = [];
var values = [];
var values = [];
for ( var m = 0;
for ( var m = 0; m !== animationKeys[k].morphTargets.length; ++ m ) {
m !== animationKeys[k].morphTargets.length; ++ m ) {
var animationKey = animationKeys[k];
var animationKey = animationKeys[k];
...
@@ -31740,8 +31692,7 @@
...
@@ -31740,8 +31692,7 @@
}
}
tracks.push( new NumberKeyframeTrack(
tracks.push( new NumberKeyframeTrack('.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
'.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
}
}
...
@@ -36047,14 +35998,18 @@
...
@@ -36047,14 +35998,18 @@
switch ( typeName ) {
switch ( typeName ) {
case 'quaternion': mixFunction = this._slerp; break;
case 'quaternion':
mixFunction = this._slerp;
break;
case 'string':
case 'string':
case 'bool':
case 'bool':
bufferType = Array;
mixFunction = this._select;
break;
bufferType = Array, mixFunction = this._select; break;
default:
mixFunction = this._lerp;
default: mixFunction = this._lerp;
}
}
...
@@ -36972,7 +36927,8 @@
...
@@ -36972,7 +36927,8 @@
var object = arguments[ i ],
var object = arguments[ i ],
uuid = object.uuid,
uuid = object.uuid,
index = indicesByUUID[ uuid ];
index = indicesByUUID[ uuid ],
knownObject = undefined;
if ( index === undefined ) {
if ( index === undefined ) {
...
@@ -36994,7 +36950,7 @@
...
@@ -36994,7 +36950,7 @@
} else if ( index < nCachedObjects ) {
} else if ( index < nCachedObjects ) {
var
knownObject = objects[ index ];
knownObject = objects[ index ];
// move existing object to the ACTIVE region
// move existing object to the ACTIVE region
...
@@ -37525,7 +37481,7 @@
...
@@ -37525,7 +37481,7 @@
if ( interpolant === null ) {
if ( interpolant === null ) {
interpolant = mixer._lendControlInterpolant()
,
interpolant = mixer._lendControlInterpolant()
;
this._timeScaleInterpolant = interpolant;
this._timeScaleInterpolant = interpolant;
}
}
...
@@ -37725,7 +37681,7 @@
...
@@ -37725,7 +37681,7 @@
if ( loopCount === -1 ) {
if ( loopCount === -1 ) {
// just started
// just started
this.loopCount = 0;
this.
_
loopCount = 0;
this._setEndings( true, true, false );
this._setEndings( true, true, false );
}
}
...
@@ -37888,7 +37844,7 @@
...
@@ -37888,7 +37844,7 @@
if ( interpolant === null ) {
if ( interpolant === null ) {
interpolant = mixer._lendControlInterpolant()
,
interpolant = mixer._lendControlInterpolant()
;
this._weightInterpolant = interpolant;
this._weightInterpolant = interpolant;
}
}
...
...
build/three.min.js
浏览文件 @
8aa5b832
此差异已折叠。
点击以展开。
build/three.modules.js
浏览文件 @
8aa5b832
...
@@ -118,13 +118,7 @@ Object.assign( EventDispatcher.prototype, {
...
@@ -118,13 +118,7 @@ Object.assign( EventDispatcher.prototype, {
var listeners = this._listeners;
var listeners = this._listeners;
if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) {
return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;
return true;
}
return false;
},
},
...
@@ -6034,7 +6028,7 @@ var ShaderLib = {
...
@@ -6034,7 +6028,7 @@ var ShaderLib = {
emissive : { value: new Color( 0x000000 ) },
emissive : { value: new Color( 0x000000 ) },
roughness: { value: 0.5 },
roughness: { value: 0.5 },
metalness: { value: 0 },
metalness: { value: 0 },
envMapIntensity : { value: 1 }
,
// temporary
envMapIntensity : { value: 1 } // temporary
}
}
),
),
...
@@ -6285,27 +6279,15 @@ Box2.prototype = {
...
@@ -6285,27 +6279,15 @@ Box2.prototype = {
containsPoint: function ( point ) {
containsPoint: function ( point ) {
if ( point.x < this.min.x || point.x > this.max.x ||
return point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ) {
point.y < this.min.y || point.y > this.max.y ? false : true;
return false;
}
return true;
},
},
containsBox: function ( box ) {
containsBox: function ( box ) {
if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
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.y <= box.min.y && box.max.y <= this.max.y;
return true;
}
return false;
},
},
...
@@ -6326,15 +6308,8 @@ Box2.prototype = {
...
@@ -6326,15 +6308,8 @@ Box2.prototype = {
intersectsBox: function ( box ) {
intersectsBox: function ( box ) {
// using 6 splitting planes to rule out intersections.
// using 6 splitting planes to rule out intersections.
return box.max.x < this.min.x || box.min.x > this.max.x ||
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 ? false : true;
box.max.y < this.min.y || box.min.y > this.max.y ) {
return false;
}
return true;
},
},
...
@@ -7975,29 +7950,17 @@ Box3.prototype = {
...
@@ -7975,29 +7950,17 @@ Box3.prototype = {
containsPoint: function ( point ) {
containsPoint: function ( point ) {
if (
point.x < this.min.x || point.x > this.max.x ||
return
point.x < this.min.x || point.x > this.max.x ||
point.y < this.min.y || point.y > this.max.y ||
point.y < this.min.y || point.y > this.max.y ||
point.z < this.min.z || point.z > this.max.z ) {
point.z < this.min.z || point.z > this.max.z ? false : true;
return false;
}
return true;
},
},
containsBox: function ( box ) {
containsBox: function ( box ) {
if ( ( this.min.x <= box.min.x ) && ( box.max.x <= this.max.x ) &&
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.y <= box.min.y && box.max.y <= this.max.y &&
( this.min.z <= box.min.z ) && ( box.max.z <= this.max.z ) ) {
this.min.z <= box.min.z && box.max.z <= this.max.z;
return true;
}
return false;
},
},
...
@@ -8019,16 +7982,9 @@ Box3.prototype = {
...
@@ -8019,16 +7982,9 @@ Box3.prototype = {
intersectsBox: function ( box ) {
intersectsBox: function ( box ) {
// using 6 splitting planes to rule out intersections.
// using 6 splitting planes to rule out intersections.
return box.max.x < this.min.x || box.min.x > this.max.x ||
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.y < this.min.y || box.min.y > this.max.y ||
box.max.z < this.min.z || box.min.z > this.max.z ) {
box.max.z < this.min.z || box.min.z > this.max.z ? false : true;
return false;
}
return true;
},
},
...
@@ -12230,7 +12186,7 @@ Object.assign( DirectGeometry.prototype, {
...
@@ -12230,7 +12186,7 @@ Object.assign( DirectGeometry.prototype, {
var group;
var group;
var groups = [];
var groups = [];
var materialIndex;
var materialIndex
= undefined
;
var faces = geometry.faces;
var faces = geometry.faces;
...
@@ -16152,7 +16108,7 @@ function generateExtensions( extensions, parameters, rendererExtensions ) {
...
@@ -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.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.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.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' );
return chunks.filter( filterEmptyLine ).join( '\n' );
...
@@ -17496,10 +17452,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
...
@@ -17496,10 +17452,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
function textureNeedsPowerOfTwo( texture ) {
function textureNeedsPowerOfTwo( texture ) {
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) return true;
return ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) ||
if ( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) return true;
( texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter );
return false;
}
}
...
@@ -17668,8 +17622,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
...
@@ -17668,8 +17622,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, paramT
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );
var isCompressed = (
texture && texture.isCompressedTexture
);
var isCompressed = (
texture && texture.isCompressedTexture
);
var isDataTexture = (
texture.image[ 0 ] && texture.image[ 0 ].isDataTexture
);
var isDataTexture = (
texture.image[ 0 ] && texture.image[ 0 ].isDataTexture
);
var cubeImage = [];
var cubeImage = [];
...
@@ -30014,7 +29968,7 @@ AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {
...
@@ -30014,7 +29968,7 @@ AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), {
constructor: AmbientLight,
constructor: AmbientLight,
isAmbientLight: true
,
isAmbientLight: true
} );
} );
...
@@ -30670,28 +30624,28 @@ KeyframeTrackPrototype = {
...
@@ -30670,28 +30624,28 @@ KeyframeTrackPrototype = {
DefaultInterpolation: InterpolateLinear,
DefaultInterpolation: InterpolateLinear,
InterpolantFactoryMethodDiscrete: function( result ) {
InterpolantFactoryMethodDiscrete: function
( result ) {
return new DiscreteInterpolant(
return new DiscreteInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
InterpolantFactoryMethodLinear: function( result ) {
InterpolantFactoryMethodLinear: function
( result ) {
return new LinearInterpolant(
return new LinearInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
InterpolantFactoryMethodSmooth: function( result ) {
InterpolantFactoryMethodSmooth: function
( result ) {
return new CubicInterpolant(
return new CubicInterpolant(
this.times, this.values, this.getValueSize(), result );
this.times, this.values, this.getValueSize(), result );
},
},
setInterpolation: function( interpolation ) {
setInterpolation: function
( interpolation ) {
var factoryMethod;
var factoryMethod;
...
@@ -30746,7 +30700,7 @@ KeyframeTrackPrototype = {
...
@@ -30746,7 +30700,7 @@ KeyframeTrackPrototype = {
},
},
getInterpolation: function() {
getInterpolation: function
() {
switch ( this.createInterpolant ) {
switch ( this.createInterpolant ) {
...
@@ -30766,20 +30720,20 @@ KeyframeTrackPrototype = {
...
@@ -30766,20 +30720,20 @@ KeyframeTrackPrototype = {
},
},
getValueSize: function() {
getValueSize: function
() {
return this.values.length / this.times.length;
return this.values.length / this.times.length;
},
},
// move all keyframes either forwards or backwards in time
// 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;
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;
times[ i ] += timeOffset;
...
@@ -30792,13 +30746,13 @@ KeyframeTrackPrototype = {
...
@@ -30792,13 +30746,13 @@ KeyframeTrackPrototype = {
},
},
// scale all keyframe times by a factor (useful for frame <-> seconds conversions)
// 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;
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;
times[ i ] *= timeScale;
...
@@ -30812,7 +30766,7 @@ KeyframeTrackPrototype = {
...
@@ -30812,7 +30766,7 @@ KeyframeTrackPrototype = {
// removes keyframes before and after animation without changing any values within the range [startTime, endTime].
// 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
// 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,
var times = this.times,
nKeys = times.length,
nKeys = times.length,
...
@@ -30820,14 +30774,14 @@ KeyframeTrackPrototype = {
...
@@ -30820,14 +30774,14 @@ KeyframeTrackPrototype = {
to = nKeys - 1;
to = nKeys - 1;
while ( from !== nKeys && times[ from ] < startTime ) ++ from;
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
++ to; // inclusive -> exclusive bound
if( from !== 0 || to !== nKeys ) {
if
( from !== 0 || to !== nKeys ) {
// empty tracks are forbidden, so keep at least one keyframe
// 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();
var stride = this.getValueSize();
this.times = AnimationUtils.arraySlice( times, from, to );
this.times = AnimationUtils.arraySlice( times, from, to );
...
@@ -30841,7 +30795,7 @@ KeyframeTrackPrototype = {
...
@@ -30841,7 +30795,7 @@ KeyframeTrackPrototype = {
},
},
// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
validate: function() {
validate: function
() {
var valid = true;
var valid = true;
...
@@ -30858,7 +30812,7 @@ KeyframeTrackPrototype = {
...
@@ -30858,7 +30812,7 @@ KeyframeTrackPrototype = {
nKeys = times.length;
nKeys = times.length;
if( nKeys === 0 ) {
if
( nKeys === 0 ) {
console.error( "track is empty", this );
console.error( "track is empty", this );
valid = false;
valid = false;
...
@@ -30867,7 +30821,7 @@ KeyframeTrackPrototype = {
...
@@ -30867,7 +30821,7 @@ KeyframeTrackPrototype = {
var prevTime = null;
var prevTime = null;
for( var i = 0; i !== nKeys; i ++ ) {
for
( var i = 0; i !== nKeys; i ++ ) {
var currTime = times[ i ];
var currTime = times[ i ];
...
@@ -30879,7 +30833,7 @@ KeyframeTrackPrototype = {
...
@@ -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 );
console.error( "out of order keys", this, i, currTime, prevTime );
valid = false;
valid = false;
...
@@ -30919,7 +30873,7 @@ KeyframeTrackPrototype = {
...
@@ -30919,7 +30873,7 @@ KeyframeTrackPrototype = {
// removes equivalent sequential keys as common in morph target sequences
// 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)
// (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,
var times = this.times,
values = this.values,
values = this.values,
...
@@ -30930,7 +30884,7 @@ KeyframeTrackPrototype = {
...
@@ -30930,7 +30884,7 @@ KeyframeTrackPrototype = {
writeIndex = 1,
writeIndex = 1,
lastIndex = times.length - 1;
lastIndex = times.length - 1;
for( var i = 1; i < lastIndex; ++ i ) {
for
( var i = 1; i < lastIndex; ++ i ) {
var keep = false;
var keep = false;
...
@@ -31167,7 +31121,7 @@ NumberKeyframeTrack.prototype =
...
@@ -31167,7 +31121,7 @@ NumberKeyframeTrack.prototype =
constructor: NumberKeyframeTrack,
constructor: NumberKeyframeTrack,
ValueTypeName: 'number'
,
ValueTypeName: 'number'
// ValueBufferType is inherited
// ValueBufferType is inherited
...
@@ -31459,8 +31413,7 @@ AnimationClip.prototype = {
...
@@ -31459,8 +31413,7 @@ AnimationClip.prototype = {
var track = this.tracks[ i ];
var track = this.tracks[ i ];
duration = Math.max(
duration = Math.max( duration, track.times[ track.times.length - 1 ] );
duration, track.times[ track.times.length - 1 ] );
}
}
...
@@ -31724,8 +31677,7 @@ Object.assign( AnimationClip, {
...
@@ -31724,8 +31677,7 @@ Object.assign( AnimationClip, {
var times = [];
var times = [];
var values = [];
var values = [];
for ( var m = 0;
for ( var m = 0; m !== animationKeys[k].morphTargets.length; ++ m ) {
m !== animationKeys[k].morphTargets.length; ++ m ) {
var animationKey = animationKeys[k];
var animationKey = animationKeys[k];
...
@@ -31734,8 +31686,7 @@ Object.assign( AnimationClip, {
...
@@ -31734,8 +31686,7 @@ Object.assign( AnimationClip, {
}
}
tracks.push( new NumberKeyframeTrack(
tracks.push( new NumberKeyframeTrack('.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
'.morphTargetInfluence[' + morphTargetName + ']', times, values ) );
}
}
...
@@ -36041,14 +35992,18 @@ function PropertyMixer( binding, typeName, valueSize ) {
...
@@ -36041,14 +35992,18 @@ function PropertyMixer( binding, typeName, valueSize ) {
switch ( typeName ) {
switch ( typeName ) {
case 'quaternion': mixFunction = this._slerp; break;
case 'quaternion':
mixFunction = this._slerp;
break;
case 'string':
case 'string':
case 'bool':
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 = {
...
@@ -36966,7 +36921,8 @@ AnimationObjectGroup.prototype = {
var object = arguments[ i ],
var object = arguments[ i ],
uuid = object.uuid,
uuid = object.uuid,
index = indicesByUUID[ uuid ];
index = indicesByUUID[ uuid ],
knownObject = undefined;
if ( index === undefined ) {
if ( index === undefined ) {
...
@@ -36988,7 +36944,7 @@ AnimationObjectGroup.prototype = {
...
@@ -36988,7 +36944,7 @@ AnimationObjectGroup.prototype = {
} else if ( index < nCachedObjects ) {
} else if ( index < nCachedObjects ) {
var
knownObject = objects[ index ];
knownObject = objects[ index ];
// move existing object to the ACTIVE region
// move existing object to the ACTIVE region
...
@@ -37519,7 +37475,7 @@ AnimationAction.prototype = {
...
@@ -37519,7 +37475,7 @@ AnimationAction.prototype = {
if ( interpolant === null ) {
if ( interpolant === null ) {
interpolant = mixer._lendControlInterpolant()
,
interpolant = mixer._lendControlInterpolant()
;
this._timeScaleInterpolant = interpolant;
this._timeScaleInterpolant = interpolant;
}
}
...
@@ -37719,7 +37675,7 @@ AnimationAction.prototype = {
...
@@ -37719,7 +37675,7 @@ AnimationAction.prototype = {
if ( loopCount === -1 ) {
if ( loopCount === -1 ) {
// just started
// just started
this.loopCount = 0;
this.
_
loopCount = 0;
this._setEndings( true, true, false );
this._setEndings( true, true, false );
}
}
...
@@ -37882,7 +37838,7 @@ AnimationAction.prototype = {
...
@@ -37882,7 +37838,7 @@ AnimationAction.prototype = {
if ( interpolant === null ) {
if ( interpolant === null ) {
interpolant = mixer._lendControlInterpolant()
,
interpolant = mixer._lendControlInterpolant()
;
this._weightInterpolant = interpolant;
this._weightInterpolant = interpolant;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录