소스 검색

BufferGeometryExporter: Convert TypeArray to Array in a less clever (thus safer) way.

Mr.doob 12 년 전
부모
커밋
ff9aee886d
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      examples/js/exporters/BufferGeometryExporter.js

+ 9 - 1
examples/js/exporters/BufferGeometryExporter.js

@@ -28,10 +28,18 @@ THREE.BufferGeometryExporter.prototype = {
 
 			var attribute = attributes[ key ];
 
+			var array = [], typeArray = attribute.array;
+
+			for ( var i = 0, l = typeArray.length; i < l; i ++ ) {
+
+				array[ i ] = typeArray[ i ];
+
+			}
+
 			output.attributes[ key ] = {
 				itemSize: attribute.itemSize,
 				type: attribute.array.constructor.name,
-				array: Array.apply( [], attribute.array )
+				array: array
 			}
 
 		}