Переглянути джерело

Merge pull request #1868 from EdwardAndrew/issue-1219

Fixed issue#1219. CalcTangentsProcess::ProcessMesh.
Kim Kulling 7 роки тому
батько
коміт
5fbffd394e
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      code/CalcTangentsProcess.cpp

+ 1 - 1
code/CalcTangentsProcess.cpp

@@ -190,7 +190,7 @@ bool CalcTangentsProcess::ProcessMesh( aiMesh* pMesh, unsigned int meshIndex)
         float tx = meshTex[p2].x - meshTex[p0].x, ty = meshTex[p2].y - meshTex[p0].y;
         float tx = meshTex[p2].x - meshTex[p0].x, ty = meshTex[p2].y - meshTex[p0].y;
         float dirCorrection = (tx * sy - ty * sx) < 0.0f ? -1.0f : 1.0f;
         float dirCorrection = (tx * sy - ty * sx) < 0.0f ? -1.0f : 1.0f;
         // when t1, t2, t3 in same position in UV space, just use default UV direction.
         // when t1, t2, t3 in same position in UV space, just use default UV direction.
-        if ( 0 == sx && 0 ==sy && 0 == tx && 0 == ty ) {
+        if (  sx * ty == sy * tx ) {
             sx = 0.0; sy = 1.0;
             sx = 0.0; sy = 1.0;
             tx = 1.0; ty = 0.0;
             tx = 1.0; ty = 0.0;
         }
         }