Просмотр исходного кода

* TangentBinormalGenerator will replace the tangent buffer if it already exists on the mesh, instead of crashing

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9445 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..om 13 лет назад
Родитель
Сommit
2f2c44d6b1
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      engine/src/core/com/jme3/util/TangentBinormalGenerator.java

+ 2 - 0
engine/src/core/com/jme3/util/TangentBinormalGenerator.java

@@ -611,6 +611,8 @@ public class TangentBinormalGenerator {
             }
             }
         }
         }
         
         
+        // If the model already had a tangent buffer, replace it with the regenerated one
+        mesh.clearBuffer(Type.Tangent); 
         mesh.setBuffer(Type.Tangent, 4, tangents);
         mesh.setBuffer(Type.Tangent, 4, tangents);
 //        if (!approxTangent) mesh.setBuffer(Type.Binormal, 3, binormals);
 //        if (!approxTangent) mesh.setBuffer(Type.Binormal, 3, binormals);
     }
     }