Merge pull request #1606 from elect86/patch-16

Update MD3Loader.cpp, using index
pull/1604/head^2
Kim Kulling 2017-12-02 23:40:58 +01:00 committed by GitHub
commit 75b31377fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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].x = pcUVs[index].U;
pcMesh->mTextureCoords[0][iCurrent].y = 1.0f-pcUVs[ pcTriangles->INDEXES[c]].V; 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) {