Added forced generation of normals with extra flag.

This commit is contained in:
Sebastian Maisch
2018-06-01 17:32:02 +02:00
parent c6eda67296
commit f15dcf7663
5 changed files with 25 additions and 7 deletions

View File

@@ -74,6 +74,7 @@ GenFaceNormalsProcess::~GenFaceNormalsProcess()
// Returns whether the processing step is present in the given flag field.
bool GenFaceNormalsProcess::IsActive( unsigned int pFlags) const
{
force_ = (pFlags & aiProcess_ForceGenNormals) != 0;
return (pFlags & aiProcess_GenNormals) != 0;
}
@@ -106,8 +107,8 @@ void GenFaceNormalsProcess::Execute( aiScene* pScene)
bool GenFaceNormalsProcess::GenMeshFaceNormals (aiMesh* pMesh)
{
if (NULL != pMesh->mNormals) {
// return false;
delete[] pMesh->mNormals;
if (force_) delete[] pMesh->mNormals;
else return false;
}
// If the mesh consists of lines and/or points but not of