BUGFIX: Correct handling of not stored texture coordinates

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@125 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
kimmi 2008-09-09 22:32:04 +00:00
parent af18307f95
commit d4d9d016d1
2 changed files with 18 additions and 15 deletions

View File

@ -366,6 +366,8 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
// Copy all texture coordinates // Copy all texture coordinates
if ( !pModel->m_TextureCoord.empty() ) if ( !pModel->m_TextureCoord.empty() )
{
if ( !pSourceFace->m_pTexturCoords->empty() )
{ {
const unsigned int tex = pSourceFace->m_pTexturCoords->at( vertexIndex ); const unsigned int tex = pSourceFace->m_pTexturCoords->at( vertexIndex );
ai_assert( tex < pModel->m_TextureCoord.size() ); ai_assert( tex < pModel->m_TextureCoord.size() );
@ -378,6 +380,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
} }
} }
} }
}
ai_assert( pMesh->mNumVertices > newIndex ); ai_assert( pMesh->mNumVertices > newIndex );
pDestFace->mIndices[ vertexIndex ] = newIndex; pDestFace->mIndices[ vertexIndex ] = newIndex;