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

PlyLoader: fix vertex attribute lookup.

Kim Kulling пре 8 година
родитељ
комит
8478df7dbd
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      code/PlyLoader.cpp

+ 3 - 3
code/PlyLoader.cpp

@@ -513,7 +513,7 @@ void PLYImporter::LoadVertex(const PLY::Element* pcElement, const PLY::ElementIn
       mGeneratedMesh->mMaterialIndex = 0;
     }
 
-    if (mGeneratedMesh->mVertices == NULL)
+    if (mGeneratedMesh->HasPositions() )
     {
       mGeneratedMesh->mNumVertices = pcElement->NumOccur;
       mGeneratedMesh->mVertices = new aiVector3D[mGeneratedMesh->mNumVertices];
@@ -523,14 +523,14 @@ void PLYImporter::LoadVertex(const PLY::Element* pcElement, const PLY::ElementIn
 
     if (haveNormal)
     {
-      if (mGeneratedMesh->mNormals == NULL)
+      if (mGeneratedMesh->HasNormals() )
         mGeneratedMesh->mNormals = new aiVector3D[mGeneratedMesh->mNumVertices];
       mGeneratedMesh->mNormals[pos] = nOut;
     }
 
     if (haveColor)
     {
-      if (mGeneratedMesh->mColors[0] == NULL)
+      if (mGeneratedMesh->HasVertexColors( 0 ) )
         mGeneratedMesh->mColors[0] = new aiColor4D[mGeneratedMesh->mNumVertices];
       mGeneratedMesh->mColors[0][pos] = cOut;
     }