You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 rivejä
967 B

  1. #include "UnitTestPCH.h"
  2. #include "utGenNormals.h"
  3. CPPUNIT_TEST_SUITE_REGISTRATION (GenNormalsTest);
  4. void GenNormalsTest :: setUp (void)
  5. {
  6. piProcess = new GenVertexNormalsProcess();
  7. pcMesh = new aiMesh();
  8. pcMesh->mPrimitiveTypes = aiPrimitiveType_TRIANGLE;
  9. pcMesh->mNumFaces = 1;
  10. pcMesh->mFaces = new aiFace[1];
  11. pcMesh->mFaces[0].mIndices = new unsigned int[pcMesh->mFaces[0].mNumIndices = 3];
  12. pcMesh->mFaces[0].mIndices[0] = 0;
  13. pcMesh->mFaces[0].mIndices[1] = 1;
  14. pcMesh->mFaces[0].mIndices[2] = 1;
  15. pcMesh->mNumVertices = 3;
  16. pcMesh->mVertices = new aiVector3D[3];
  17. pcMesh->mVertices[0] = aiVector3D(0.0f,1.0f,6.0f);
  18. pcMesh->mVertices[1] = aiVector3D(2.0f,3.0f,1.0f);
  19. pcMesh->mVertices[2] = aiVector3D(3.0f,2.0f,4.0f);
  20. }
  21. void GenNormalsTest :: tearDown (void)
  22. {
  23. delete this->pcMesh;
  24. delete this->piProcess;
  25. }
  26. void GenNormalsTest :: testSimpleTriangle (void)
  27. {
  28. piProcess->GenMeshVertexNormals(pcMesh,0);
  29. CPPUNIT_ASSERT(0 != pcMesh->mNormals);
  30. }