check if texCoords defined before looping through all coordinates

This commit is contained in:
Jeff Nusz 2017-01-24 16:54:03 -08:00
parent c2449397d3
commit 554909a156

View File

@ -175,14 +175,14 @@ THREE.DRACOLoader.prototype = {
} }
} }
for (let i = 0; i < numTextureCoordinates; i += 2) { // Add texture coordinates.
// Add texture coordinates. if (texCoordAttId != -1) {
if (texCoordAttId != -1) { for (let i = 0; i < numTextureCoordinates; i += 2) {
geometryBuffer.uvs.push( geometryBuffer.uvs.push(
textCoordAttributeData.GetValue(i), textCoordAttributeData.GetValue(i),
textCoordAttributeData.GetValue(i + 1)); textCoordAttributeData.GetValue(i + 1));
}
} }
}
DracoModule.destroy(posAttributeData); DracoModule.destroy(posAttributeData);
if (colorAttId != -1) if (colorAttId != -1)