Browse Source

Updated Objectoader.parseObject

-changed the way of iterating over data.children array
LebedenkoN 8 years ago
parent
commit
337d786c64
1 changed files with 4 additions and 5 deletions
  1. 4 5
      src/loaders/ObjectLoader.js

+ 4 - 5
src/loaders/ObjectLoader.js

@@ -765,11 +765,10 @@ Object.assign( ObjectLoader.prototype, {
 
 			if ( data.children !== undefined ) {
 
-				for ( var child in data.children ) {
-
-					object.add( this.parseObject( data.children[ child ], geometries, materials ) );
-
-				}
+				var that = this;
+				data.children.forEach(function(index, child){
+					object.add( that.parseObject( data.children[ child ], geometries, materials ) );
+				});
 
 			}