Update MD3Loader.cpp

This commit is contained in:
Giuseppe Barbieri
2017-12-01 15:20:50 +01:00
committed by GitHub
parent 77b0aa4f4b
commit 42c1c733b9

View File

@@ -1018,11 +1018,11 @@ void MD3Importer::InternReadFile( const std::string& pFile,
// Convert the normal vector to uncompressed float3 format
aiVector3D& nor = pcMesh->mNormals[iCurrent];
LatLngNormalToVec3(pcVertices[pcTriangles->INDEXES[c]].NORMAL,(ai_real*)&nor);
LatLngNormalToVec3(pcVertices[index].NORMAL,(ai_real*)&nor);
// 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
if (!shader || shader->cull == Q3Shader::CULL_CW) {