Jelajahi Sumber

Fix PlyExporter to support faces with 0 vertices

Dunni 5 tahun lalu
induk
melakukan
52a7be775d
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      code/Ply/PlyExporter.cpp

+ 3 - 2
code/Ply/PlyExporter.cpp

@@ -373,10 +373,11 @@ void PlyExporter::WriteMeshIndices(const aiMesh* m, unsigned int offset)
 {
     for (unsigned int i = 0; i < m->mNumFaces; ++i) {
         const aiFace& f = m->mFaces[i];
-        mOutput << f.mNumIndices << " ";
+        mOutput << f.mNumIndices;
         for(unsigned int c = 0; c < f.mNumIndices; ++c) {
-            mOutput << (f.mIndices[c] + offset) << (c == f.mNumIndices-1 ? endl : " ");
+            mOutput << " " << (f.mIndices[c] + offset);
         }
+        mOutput << endl;
     }
 }