Parcourir la source

Merge pull request #12571 from marcatec/gltf-for-loops

GLTFLoader: Replace for...in with classic for loops on arrays.
Mr.doob il y a 7 ans
Parent
commit
b98f390f71
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      examples/js/loaders/GLTFLoader.js

+ 2 - 2
examples/js/loaders/GLTFLoader.js

@@ -2242,7 +2242,7 @@ THREE.GLTFLoader = ( function () {
 
 		// Nothing in the node definition indicates whether it is a Bone or an
 		// Object3D. Use the skins' joint references to mark bones.
-		for ( var skinIndex in skins ) {
+		for ( var skinIndex =  0; skinIndex < skins.length; skinIndex ++ ) {
 
 			var joints = skins[ skinIndex ].joints;
 
@@ -2259,7 +2259,7 @@ THREE.GLTFLoader = ( function () {
 		// references and rename instances below.
 		//
 		// Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
-		for ( var nodeIndex in nodes ) {
+		for ( var nodeIndex =  0; nodeIndex < nodes.length; nodeIndex ++ ) {
 
 			var nodeDef = nodes[ nodeIndex ];