Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
fe245700
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,发现更多精彩内容 >>
提交
fe245700
编写于
7月 15, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
efe234a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
218 addition
and
202 deletion
+218
-202
build/three.js
build/three.js
+77
-62
build/three.min.js
build/three.min.js
+141
-140
未找到文件。
build/three.js
浏览文件 @
fe245700
...
...
@@ -10392,7 +10392,6 @@ THREE.BufferGeometry = function () {
this.morphAttributes = [];
this.drawcalls = [];
this.offsets = this.drawcalls; // backwards compatibility
this.boundingBox = null;
this.boundingSphere = null;
...
...
@@ -10425,6 +10424,13 @@ THREE.BufferGeometry.prototype = {
},
get offsets() {
console.warn( 'THREE.BufferGeometry: .offsets has been renamed to .drawcalls.' );
return this.drawcalls;
},
addDrawCall: function ( start, count, indexOffset ) {
this.drawcalls.push( {
...
...
@@ -10437,6 +10443,12 @@ THREE.BufferGeometry.prototype = {
},
clearDrawCalls: function () {
this.drawcalls = [];
},
applyMatrix: function ( matrix ) {
var position = this.attributes.position;
...
...
@@ -10475,8 +10487,10 @@ THREE.BufferGeometry.prototype = {
copy: function ( geometry ) {
// TODO Clear attributes? Clear drawcalls? Copy morphTargets?
var attributes = geometry.attributes;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
for ( var name in attributes ) {
...
...
@@ -10489,14 +10503,7 @@ THREE.BufferGeometry.prototype = {
for ( var i = 0, il = offsets.length; i < il; i ++ ) {
var offset = offsets[ i ];
this.offsets.push( {
start: offset.start,
index: offset.index,
count: offset.count
} );
this.addDrawCall( offset.start, offset.count, offset.index );
}
...
...
@@ -10927,13 +10934,17 @@ THREE.BufferGeometry.prototype = {
var indices = attributes.index.array;
var offsets = ( this.offsets.length > 0 ? this.offsets : [ { start: 0, count: indices.length, index: 0 } ] );
if ( this.drawcalls.length === 0 ) {
this.addDrawCall( 0, indices.length );
}
for ( var j = 0, jl =
offset
s.length; j < jl; ++ j ) {
for ( var j = 0, jl =
this.drawcall
s.length; j < jl; ++ j ) {
var start =
offset
s[ j ].start;
var count =
offset
s[ j ].count;
var index =
offset
s[ j ].index;
var start =
this.drawcall
s[ j ].start;
var count =
this.drawcall
s[ j ].count;
var index =
this.drawcall
s[ j ].index;
for ( var i = start, il = start + count; i < il; i += 3 ) {
...
...
@@ -11110,7 +11121,7 @@ THREE.BufferGeometry.prototype = {
if ( this.drawcalls.length === 0 ) {
this.addDrawCall( 0, indices.length
, 0
);
this.addDrawCall( 0, indices.length );
}
...
...
@@ -11213,8 +11224,8 @@ THREE.BufferGeometry.prototype = {
var indexPtr = 0;
var vertexPtr = 0;
var
o
ffsets = [ { start:0, count:0, index:0 } ];
var offset =
o
ffsets[ 0 ];
var
tmpO
ffsets = [ { start:0, count:0, index:0 } ];
var offset =
tmpO
ffsets[ 0 ];
var duplicatedVertices = 0;
var newVerticeMaps = 0;
...
...
@@ -11252,7 +11263,7 @@ THREE.BufferGeometry.prototype = {
var faceMax = vertexPtr + newVerticeMaps;
if ( faceMax > ( offset.index + size ) ) {
var new_offset = { start:indexPtr, count:0, index:vertexPtr };
o
ffsets.push( new_offset );
tmpO
ffsets.push( new_offset );
offset = new_offset;
//Re-evaluate reused vertices in light of new offset.
...
...
@@ -11280,19 +11291,24 @@ THREE.BufferGeometry.prototype = {
/* Move all attribute values to map to the new computed indices , also expand the vertex stack to match our new vertexPtr. */
this.reorderBuffers( sortedIndices, revVertexMap, vertexPtr );
this.offsets = offsets; // TODO: Deprecate
this.drawcalls = offsets;
this.clearDrawCalls();
for ( var i = 0; i < tmpOffsets.length; i ++ ) {
var tmpOffset = tmpOffsets[ i ];
this.addDrawCall( tmpOffset.start, tmpOffset.count, tmpOffset.index );
}
/*
var orderTime = Date.now();
console.log("Reorder time: "+(orderTime-s)+"ms");
console.log("Duplicated "+duplicatedVertices+" vertices.");
console.log("Compute Buffers time: "+(Date.now()-s)+"ms");
console.log("Draw
offsets: "+o
ffsets.length);
console.log("Draw
tmpOffsets: "+tmpO
ffsets.length);
*/
return offsets;
},
merge: function ( geometry, offset ) {
...
...
@@ -11429,7 +11445,7 @@ THREE.BufferGeometry.prototype = {
data.data = { attributes: {} };
var attributes = this.attributes;
var offsets = this.
offset
s;
var offsets = this.
drawcall
s;
var boundingSphere = this.boundingSphere;
for ( var key in attributes ) {
...
...
@@ -11476,17 +11492,11 @@ THREE.BufferGeometry.prototype = {
}
for ( var i = 0, il = this.offsets.length; i < il; i ++ ) {
var offset = this.offsets[ i ];
geometry.offsets.push( {
for ( var i = 0, il = this.drawcalls.length; i < il; i ++ ) {
start: offset.start,
index: offset.index,
count: offset.count
var offset = this.drawcalls[ i ];
}
);
geometry.addDrawCall( offset.start, offset.count, offset.index
);
}
...
...
@@ -11548,18 +11558,10 @@ THREE.InstancedBufferGeometry.prototype.clone = function () {
}
for ( var i = 0, il = this.offsets.length; i < il; i++ ) {
var offset = this.offsets[i];
geometry.offsets.push( {
for ( var i = 0, il = this.drawcalls.length; i < il; i++ ) {
start: offset.start,
index: offset.index,
count: offset.count,
instances: offset.instances
} );
var offset = this.drawcalls[i];
geometry.addDrawCall( offset.start, offset.count, offset.index, offset.instances );
}
...
...
@@ -13663,7 +13665,18 @@ THREE.BufferGeometryLoader.prototype = {
if ( offsets !== undefined ) {
geometry.offsets = JSON.parse( JSON.stringify( offsets ) );
var offsetsArray = JSON.parse( JSON.stringify( offsets ) );
for ( var i = 0; i < offsetsArray.length; i ++ ) {
var offset = offsetsArray[i];
var indexStart = offset.start;
var indexCount = offset.count;
var indexOffset = offset.index;
geometry.addDrawcall( indexStart, indexCount, indexOffset );
}
}
...
...
@@ -16294,15 +16307,11 @@ THREE.PointCloud.prototype.raycast = ( function () {
if ( attributes.index !== undefined ) {
var indices = attributes.index.array;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
offsets.push( {
start: 0,
count: indices.length,
index: 0
} );
offsets = [ { start: 0, count: indices.length, index: 0 } ];
}
...
...
@@ -16463,7 +16472,7 @@ THREE.Line.prototype.raycast = ( function () {
var indices = attributes.index.array;
var positions = attributes.position.array;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -16758,7 +16767,7 @@ THREE.Mesh.prototype.raycast = ( function () {
var indices = attributes.index.array;
var positions = attributes.position.array;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20349,7 +20358,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20434,7 +20443,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// non-indexed triangles
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20555,7 +20564,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20612,7 +20621,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
var position = geometry.attributes.position;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20664,7 +20673,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -20721,7 +20730,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
var position = geometry.attributes.position;
var offsets = geometry.
offset
s;
var offsets = geometry.
drawcall
s;
if ( offsets.length === 0 ) {
...
...
@@ -23515,9 +23524,15 @@ THREE.WebGLGeometries = function ( gl, info ) {
geometries[ geometry.id ] = geometry;
} else {
} else if ( geometry instanceof THREE.Geometry ) {
if ( object._bufferGeometry === undefined ) {
object._bufferGeometry = new THREE.BufferGeometry().setFromObject( object );
}
geometries[ geometry.id ] =
new THREE.BufferGeometry().setFromObject( object )
;
geometries[ geometry.id ] =
object._bufferGeometry
;
}
...
...
build/three.min.js
浏览文件 @
fe245700
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录