Browse Source

normal per mesh, (not the whole scene)

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@158 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
cgmelt 17 năm trước cách đây
mục cha
commit
12d407c974
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      code/ObjFileImporter.cpp

+ 1 - 1
code/ObjFileImporter.cpp

@@ -322,7 +322,7 @@ void ObjFileImporter::createVertexArray(const ObjFile::Model* pModel,
 	pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ];
 	pMesh->mVertices = new aiVector3D[ pMesh->mNumVertices ];
 	
 	
 	// Allocate buffer for normal vectors
 	// Allocate buffer for normal vectors
-	if ( !pModel->m_Normals.empty() )
+	if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals )
 		pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
 		pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
 	
 	
 	// Allocate buffer for texture coordinates
 	// Allocate buffer for texture coordinates