Ver Fonte

reorderBuffers: call ctor of typed array directly

Update to mrdoob/three.js#5262
dubejf há 11 anos atrás
pai
commit
80d69bf334
1 ficheiros alterados com 1 adições e 7 exclusões
  1. 1 7
      src/core/BufferGeometry.js

+ 1 - 7
src/core/BufferGeometry.js

@@ -834,13 +834,7 @@ THREE.BufferGeometry.prototype = {
 			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 */