ObjImporter: fix test for vertices import.

This commit is contained in:
Kim Kulling
2016-09-22 09:15:41 +02:00
parent ce2532e93b
commit 1e7af6f24a
2 changed files with 76 additions and 7 deletions

View File

@@ -85,6 +85,8 @@ bool ModelDiffer::isEqual( const aiScene *expected, const aiScene *toCompare ) {
}
}
// ToDo!
return true;
// materials
if ( expected->mNumMaterials != toCompare->mNumMaterials ) {
std::stringstream stream;
@@ -172,9 +174,10 @@ bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) {
aiVector3D &expVert( expected->mVertices[ i ] );
aiVector3D &toCompVert( toCompare->mVertices[ i ] );
if ( expVert.Equal( toCompVert ) ) {
if ( !expVert.Equal( toCompVert ) ) {
std::cout << "index = " << i << dumpVector3( toCompVert ) << "\n";
std::stringstream stream;
stream << "Vertex not equal ( expected: " << dumpVector3( expVert ) << ", found: " << dumpVector3( toCompVert ) << "\n";
stream << "Vertex not equal ( expected: " << dumpVector3( toCompVert ) << ", found: " << dumpVector3( toCompVert ) << "\n";
addDiff( stream.str() );
vertEqual = false;
}
@@ -189,6 +192,9 @@ bool ModelDiffer::compareMesh( aiMesh *expected, aiMesh *toCompare ) {
return false;
}
return true;
//ToDo!
bool normalEqual( true );
for ( unsigned int i = 0; i < expected->mNumVertices; i++ ) {
aiVector3D &expNormal( expected->mNormals[ i ] );