Browse Source

Update MD3Loader.cpp

Giuseppe Barbieri 7 years ago
parent
commit
42c1c733b9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      code/MD3Loader.cpp

+ 3 - 3
code/MD3Loader.cpp

@@ -1018,11 +1018,11 @@ void MD3Importer::InternReadFile( const std::string& pFile,
 
 
                 // Convert the normal vector to uncompressed float3 format
                 // Convert the normal vector to uncompressed float3 format
                 aiVector3D& nor = pcMesh->mNormals[iCurrent];
                 aiVector3D& nor = pcMesh->mNormals[iCurrent];
-                LatLngNormalToVec3(pcVertices[pcTriangles->INDEXES[c]].NORMAL,(ai_real*)&nor);
+                LatLngNormalToVec3(pcVertices[index].NORMAL,(ai_real*)&nor);
 
 
                 // Read texture coordinates
                 // Read texture coordinates
-                pcMesh->mTextureCoords[0][iCurrent].x = pcUVs[ pcTriangles->INDEXES[c]].U;
-                pcMesh->mTextureCoords[0][iCurrent].y = 1.0f-pcUVs[ pcTriangles->INDEXES[c]].V;
+                pcMesh->mTextureCoords[0][iCurrent].x = pcUVs[index].U;
+                pcMesh->mTextureCoords[0][iCurrent].y = 1.0f-pcUVs[index].V;
             }
             }
             // Flip face order if necessary
             // Flip face order if necessary
             if (!shader || shader->cull == Q3Shader::CULL_CW) {
             if (!shader || shader->cull == Q3Shader::CULL_CW) {