Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
1c52d2a2
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,发现更多精彩内容 >>
提交
1c52d2a2
编写于
7月 24, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
091b1f79
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
373 addition
and
370 deletion
+373
-370
build/three.js
build/three.js
+80
-76
build/three.min.js
build/three.min.js
+293
-294
未找到文件。
build/three.js
浏览文件 @
1c52d2a2
...
...
@@ -17563,7 +17563,7 @@ THREE.MorphAnimMesh = function ( geometry, material ) {
this.direction = 1;
this.directionBackwards = false;
this.setFrameRange( 0,
this.
geometry.morphTargets.length - 1 );
this.setFrameRange( 0, geometry.morphTargets.length - 1 );
};
...
...
@@ -17693,12 +17693,13 @@ THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) {
var keyframe = this.startKeyframe + THREE.Math.clamp( Math.floor( this.time / frameTime ), 0, this.length - 1 );
if ( keyframe !== this.currentKeyframe ) {
var influences = this.morphTargetInfluences;
this.morphTargetInfluences[ this.lastKeyframe ] = 0;
this.morphTargetInfluences[ this.currentKeyframe ] = 1;
if ( keyframe !== this.currentKeyframe ) {
this.morphTargetInfluences[ keyframe ] = 0;
influences[ this.lastKeyframe ] = 0;
influences[ this.currentKeyframe ] = 1;
influences[ keyframe ] = 0;
this.lastKeyframe = this.currentKeyframe;
this.currentKeyframe = keyframe;
...
...
@@ -17713,8 +17714,8 @@ THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) {
}
this.morphTargetI
nfluences[ this.currentKeyframe ] = mix;
this.morphTargetI
nfluences[ this.lastKeyframe ] = 1 - mix;
i
nfluences[ this.currentKeyframe ] = mix;
i
nfluences[ this.lastKeyframe ] = 1 - mix;
};
...
...
@@ -19516,6 +19517,8 @@ THREE.WebGLRenderer = function ( parameters ) {
var opaqueImmediateObjects = [];
var transparentImmediateObjects = [];
var morphInfluences = new Float32Array( 8 );
var sprites = [];
var lensFlares = [];
...
...
@@ -19857,6 +19860,12 @@ THREE.WebGLRenderer = function ( parameters ) {
};
this.getContextAttributes = function () {
return _gl.getContextAttributes();
};
this.forceContextLoss = function () {
extensions.get( 'WEBGL_lose_context' ).loseContext();
...
...
@@ -20491,6 +20500,51 @@ THREE.WebGLRenderer = function ( parameters ) {
}
// morph targets
if ( object.morphTargetInfluences !== undefined ) {
var activeInfluences = [];
var morphTargetInfluences = object.morphTargetInfluences;
for ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) {
var influence = morphTargetInfluences[ i ];
activeInfluences.push( [ influence, i ] );
}
activeInfluences.sort( numericalSort );
if ( activeInfluences.length > 8 ) {
activeInfluences.length = 8;
}
for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
var influence = activeInfluences[ i ];
morphInfluences[ i ] = influence[ 0 ];
var attribute = geometry.morphAttributes[ influence[ 1 ] ];
objects.updateAttribute( attribute );
geometry.addAttribute( 'morphTarget' + i, attribute );
}
var uniforms = program.getUniforms();
if ( uniforms.morphTargetInfluences !== null ) {
_gl.uniform1fv( uniforms.morphTargetInfluences, morphInfluences );
}
}
if ( object instanceof THREE.Mesh ) {
renderMesh( material, geometry, object, program, updateBuffers );
...
...
@@ -20940,6 +20994,12 @@ THREE.WebGLRenderer = function ( parameters ) {
// Sorting
function numericalSort ( a, b ) {
return b[ 0 ] - a[ 0 ];
}
function painterSortStable ( a, b ) {
if ( a.object.renderOrder !== b.object.renderOrder ) {
...
...
@@ -23789,8 +23849,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
var objects = {};
var morphInfluences = new Float32Array( 8 );
var geometries = new THREE.WebGLGeometries( gl, properties, info );
//
...
...
@@ -23862,12 +23920,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
};
function numericalSort ( a, b ) {
return b[ 0 ] - a[ 0 ];
}
function updateObject( object ) {
var geometry = geometries.get( object );
...
...
@@ -23878,57 +23930,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
}
// morph targets
if ( object.morphTargetInfluences !== undefined ) {
var activeInfluences = [];
var morphTargetInfluences = object.morphTargetInfluences;
for ( var i = 0, l = morphTargetInfluences.length; i < l; i ++ ) {
var influence = morphTargetInfluences[ i ];
activeInfluences.push( [ influence, i ] );
}
activeInfluences.sort( numericalSort );
if ( activeInfluences.length > 8 ) {
activeInfluences.length = 8;
}
for ( var i = 0, l = activeInfluences.length; i < l; i ++ ) {
morphInfluences[ i ] = activeInfluences[ i ][ 0 ];
var attribute = geometry.morphAttributes[ activeInfluences[ i ][ 1 ] ];
geometry.addAttribute( 'morphTarget' + i, attribute );
}
var material = object.material;
if ( material.program !== undefined ) {
var uniforms = material.program.getUniforms();
if ( uniforms.morphTargetInfluences !== null ) {
gl.uniform1fv( uniforms.morphTargetInfluences, morphInfluences );
}
} else {
console.warn( 'TOFIX: material.program is undefined' );
}
}
//
var attributes = geometry.attributes;
...
...
@@ -23941,7 +23942,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
}
function updateAttribute
( attribute, name ) {
function updateAttribute( attribute, name ) {
var bufferType = ( name === 'index' ) ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER;
...
...
@@ -23961,7 +23962,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
}
function createBuffer
( attributeProperties, data, bufferType ) {
function createBuffer( attributeProperties, data, bufferType ) {
attributeProperties.__webglBuffer = gl.createBuffer();
gl.bindBuffer( bufferType, attributeProperties.__webglBuffer );
...
...
@@ -23982,7 +23983,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
}
function updateBuffer
( attributeProperties, data, bufferType ) {
function updateBuffer( attributeProperties, data, bufferType ) {
gl.bindBuffer( bufferType, attributeProperties.__webglBuffer );
...
...
@@ -24022,9 +24023,9 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
this.update = function ( renderList ) {
for ( var i = 0, ul = renderList.length; i < ul; i++ ) {
for ( var i = 0, ul = renderList.length; i < ul; i
++ ) {
var object = renderList[
i
].object;
var object = renderList[
i
].object;
if ( object.material.visible !== false ) {
...
...
@@ -24036,6 +24037,8 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
};
this.updateAttribute = updateAttribute;
this.clear = function () {
objects = {};
...
...
@@ -24949,7 +24952,6 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
}
_renderer.setMaterialFaces( objectMaterial );
_renderer.renderBufferDirect( shadowCamera, _lights, fog, material, object );
}
...
...
@@ -30902,8 +30904,8 @@ THREE.MorphAnimation.prototype = {
this.currentTime = Math.min( this.currentTime, this.duration );
var
interpolation
= this.duration / this.frames;
var frame = Math.floor( this.currentTime /
interpolation
);
var
frameTime
= this.duration / this.frames;
var frame = Math.floor( this.currentTime /
frameTime
);
var influences = this.mesh.morphTargetInfluences;
...
...
@@ -30918,8 +30920,10 @@ THREE.MorphAnimation.prototype = {
}
influences[ frame ] = ( this.currentTime % interpolation ) / interpolation;
influences[ this.lastFrame ] = 1 - influences[ frame ];
var mix = ( this.currentTime % frameTime ) / frameTime;
influences[ frame ] = mix;
influences[ this.lastFrame ] = 1 - mix;
}
...
...
build/three.min.js
浏览文件 @
1c52d2a2
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录