Преглед изворни кода

Merge branch 'master' into slow_xml_load

Kim Kulling пре 6 година
родитељ
комит
cead840a75
1 измењених фајлова са 6 додато и 6 уклоњено
  1. 6 6
      code/FindInstancesProcess.cpp

+ 6 - 6
code/FindInstancesProcess.cpp

@@ -137,6 +137,11 @@ void FindInstancesProcess::Execute( aiScene* pScene)
             aiMesh* inst = pScene->mMeshes[i];
             aiMesh* inst = pScene->mMeshes[i];
             hashes[i] = GetMeshHash(inst);
             hashes[i] = GetMeshHash(inst);
 
 
+            // Find an appropriate epsilon 
+            // to compare position differences against
+            float epsilon = ComputePositionEpsilon(inst);
+            epsilon *= epsilon;
+
             for (int a = i-1; a >= 0; --a) {
             for (int a = i-1; a >= 0; --a) {
                 if (hashes[i] == hashes[a])
                 if (hashes[i] == hashes[a])
                 {
                 {
@@ -154,12 +159,7 @@ void FindInstancesProcess::Execute( aiScene* pScene)
                         orig->mPrimitiveTypes != inst->mPrimitiveTypes)
                         orig->mPrimitiveTypes != inst->mPrimitiveTypes)
                         continue;
                         continue;
 
 
-                    // up to now the meshes are equal. find an appropriate
-                    // epsilon to compare position differences against
-                    float epsilon = ComputePositionEpsilon(inst);
-                    epsilon *= epsilon;
-
-                    // now compare vertex positions, normals,
+                    // up to now the meshes are equal. Now compare vertex positions, normals,
                     // tangents and bitangents using this epsilon.
                     // tangents and bitangents using this epsilon.
                     if (orig->HasPositions()) {
                     if (orig->HasPositions()) {
                         if(!CompareArrays(orig->mVertices,inst->mVertices,orig->mNumVertices,epsilon))
                         if(!CompareArrays(orig->mVertices,inst->mVertices,orig->mNumVertices,epsilon))