提交 684e417a 编写于 作者: M Mr.doob

Updated builds.

上级 d04634db
......@@ -8911,26 +8911,7 @@ THREE.BufferAttribute.prototype = {
clone: function () {
var attribute = new THREE.BufferAttribute( null, this.itemSize );
var types = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ];
var sourceArray = this.array;
for ( var i = 0, il = types.length; i < il; i ++ ) {
var type = types[ i ];
if ( sourceArray instanceof type ) {
attribute.array = new type( sourceArray );
break;
}
}
return attribute;
return new THREE.BufferAttribute( new this.array.constructor( this.array ), this.itemSize );
}
......@@ -9835,18 +9816,11 @@ THREE.BufferGeometry.prototype = {
/* Create a copy of all attributes for reordering. */
var sortedAttributes = {};
var types = [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ];
for ( var attr in this.attributes ) {
if ( attr == 'index' )
continue;
var sourceArray = this.attributes[ attr ].array;
for ( var i = 0, il = types.length; i < il; i ++ ) {
var type = types[ i ];
if ( sourceArray instanceof type ) {
sortedAttributes[ attr ] = new type( this.attributes[ attr ].itemSize * vertexCount );
break;
}
}
sortedAttributes[ attr ] = new sourceArray.constructor( this.attributes[ attr ].itemSize * vertexCount );
}
/* Move attribute positions based on the new index map */
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册