浏览代码

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 年之前
父节点
当前提交
12d407c974
共有 1 个文件被更改,包括 1 次插入1 次删除
  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 ];
 	
 	// Allocate buffer for normal vectors
-	if ( !pModel->m_Normals.empty() )
+	if ( !pModel->m_Normals.empty() && pObjMesh->m_hasNormals )
 		pMesh->mNormals = new aiVector3D[ pMesh->mNumVertices ];
 	
 	// Allocate buffer for texture coordinates