KillNormalsProcess.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /** @file Implementation of the post processing step tokill mesh normals
  2. */
  3. #include "KillNormalsProcess.h"
  4. #include "../include/aiPostProcess.h"
  5. #include "../include/aiMesh.h"
  6. #include "../include/aiScene.h"
  7. using namespace Assimp;
  8. // Constructor to be privately used by Importer
  9. KillNormalsProcess::KillNormalsProcess()
  10. {
  11. }
  12. // Destructor, private as well
  13. KillNormalsProcess::~KillNormalsProcess()
  14. {
  15. // nothing to do here
  16. }
  17. // -------------------------------------------------------------------
  18. // Returns whether the processing step is present in the given flag field.
  19. bool KillNormalsProcess::IsActive( unsigned int pFlags) const
  20. {
  21. return (pFlags & aiProcess_KillNormals) != 0;
  22. }
  23. // -------------------------------------------------------------------
  24. // Executes the post processing step on the given imported data.
  25. void KillNormalsProcess::Execute( aiScene* pScene)
  26. {
  27. for( unsigned int a = 0; a < pScene->mNumMeshes; a++)
  28. this->KillMeshNormals( pScene->mMeshes[a]);
  29. }
  30. // -------------------------------------------------------------------
  31. // Executes the post processing step on the given imported data.
  32. void KillNormalsProcess::KillMeshNormals(aiMesh* pMesh)
  33. {
  34. delete[] pMesh->mNormals;
  35. pMesh->mNormals = NULL;
  36. return;
  37. }