CalcTangentsProcess.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /** @file Defines a post processing step to calculate tangents and bitangents on all imported meshes.*/
  2. #ifndef AI_CALCTANGENTSPROCESS_H_INC
  3. #define AI_CALCTANGENTSPROCESS_H_INC
  4. #include "BaseProcess.h"
  5. struct aiMesh;
  6. namespace Assimp
  7. {
  8. // ---------------------------------------------------------------------------
  9. /** The CalcTangentsProcess calculates the tangent and bitangent for any vertex
  10. * of all meshes. It is expected to be run before the JoinVerticesProcess runs
  11. * because the joining of vertices also considers tangents and bitangents for uniqueness.
  12. */
  13. class CalcTangentsProcess : public BaseProcess
  14. {
  15. friend class Importer;
  16. protected:
  17. /** Constructor to be privately used by Importer */
  18. CalcTangentsProcess();
  19. /** Destructor, private as well */
  20. ~CalcTangentsProcess();
  21. public:
  22. // -------------------------------------------------------------------
  23. /** Returns whether the processing step is present in the given flag field.
  24. * @param pFlags The processing flags the importer was called with. A bitwise
  25. * combination of #aiPostProcessSteps.
  26. * @return true if the process is present in this flag fields, false if not.
  27. */
  28. bool IsActive( unsigned int pFlags) const;
  29. // -------------------------------------------------------------------
  30. /** Executes the post processing step on the given imported data.
  31. * At the moment a process is not supposed to fail.
  32. * @param pScene The imported data to work at.
  33. */
  34. void Execute( aiScene* pScene);
  35. protected:
  36. // -------------------------------------------------------------------
  37. /** Calculates tangents and bitangents for the given mesh
  38. * @param pMesh The mesh to process.
  39. */
  40. void ProcessMesh( aiMesh* pMesh);
  41. };
  42. } // end of namespace Assimp
  43. #endif // AI_CALCTANGENTSPROCESS_H_INC