Browse Source

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

Mr.doob 11 years ago
parent
commit
ff9aee886d
1 changed files with 9 additions and 1 deletions
  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
 			}
 
 		}