Przeglądaj źródła

Merge remote-tracking branch 'ikerr/dev' into dev

Mr.doob 13 lat temu
rodzic
commit
15cafb913d
1 zmienionych plików z 17 dodań i 2 usunięć
  1. 17 2
      src/extras/loaders/ColladaLoader.js

+ 17 - 2
src/extras/loaders/ColladaLoader.js

@@ -2288,7 +2288,12 @@ THREE.ColladaLoader = function () {
 					input = inputs[ k ];
 					source = sources[ input.source ];
 
-					index = p[ i + ( j * maxOffset ) + input.offset ];
+					if ( primitive.vcount ){
+						index = p[ i + j ];
+					} else {
+						index = p[ i + ( j * maxOffset ) + input.offset ];
+					}
+
 					numParams = source.accessor.params.length;
 					idx32 = index * numParams;
 
@@ -2425,7 +2430,11 @@ THREE.ColladaLoader = function () {
 
 			}
 
-			i += maxOffset * vcount;
+			if ( primitive.vcount ){
+				i += vcount;
+			} else {
+				i += maxOffset * vcount;
+			}
 
 		}
 
@@ -2457,6 +2466,12 @@ THREE.ColladaLoader = function () {
 
 				this.inputs[ i ].source = vertices.input[ 'POSITION' ].source;
 
+				for(var key in vertices.input){
+					if(key != 'POSITION'){
+						var input = vertices.input[key];
+						this.inputs.push(input);
+					}
+				}
 			}
 
 		}