Pārlūkot izejas kodu

# Obj: add missing check for empty normals, which caused models with no or partial normal sets to fail in some cases.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1010 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 14 gadi atpakaļ
vecāks
revīzija
799ae75d67
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      code/ObjFileImporter.cpp

+ 1 - 1
code/ObjFileImporter.cpp

@@ -342,7 +342,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
 			pMesh->mVertices[ newIndex ] = pModel->m_Vertices[ vertex ];
 			
 			// Copy all normals 
-			if ( !pSourceFace->m_pNormals->empty() )
+			if ( !pSourceFace->m_pNormals->empty() && !pModel->m_Normals.empty())
 			{
 				const unsigned int normal = pSourceFace->m_pNormals->at( vertexIndex );
 				if (normal >= pModel->m_Normals.size()) {