Merge pull request #1334 from assimp/x_deals_with_lines
X-Importer: make it deal with lines.pull/1337/head
commit
647b59b7fa
|
@ -237,8 +237,9 @@ aiNode* XFileImporter::CreateNodes( aiScene* pScene, aiNode* pParent, const XFil
|
||||||
// Creates the meshes for the given node.
|
// Creates the meshes for the given node.
|
||||||
void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vector<XFile::Mesh*>& pMeshes)
|
void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vector<XFile::Mesh*>& pMeshes)
|
||||||
{
|
{
|
||||||
if( pMeshes.size() == 0)
|
if (pMeshes.empty()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// create a mesh for each mesh-material combination in the source node
|
// create a mesh for each mesh-material combination in the source node
|
||||||
std::vector<aiMesh*> meshes;
|
std::vector<aiMesh*> meshes;
|
||||||
|
|
|
@ -466,15 +466,12 @@ void XFileParser::ParseDataObjectMesh( Mesh* pMesh)
|
||||||
pMesh->mPosFaces.resize( numPosFaces);
|
pMesh->mPosFaces.resize( numPosFaces);
|
||||||
for( unsigned int a = 0; a < numPosFaces; a++)
|
for( unsigned int a = 0; a < numPosFaces; a++)
|
||||||
{
|
{
|
||||||
unsigned int numIndices = ReadInt();
|
|
||||||
if( numIndices < 3) {
|
|
||||||
ThrowException( format() << "Invalid index count " << numIndices << " for face " << a << "." );
|
|
||||||
}
|
|
||||||
|
|
||||||
// read indices
|
// read indices
|
||||||
|
unsigned int numIndices = ReadInt();
|
||||||
Face& face = pMesh->mPosFaces[a];
|
Face& face = pMesh->mPosFaces[a];
|
||||||
for( unsigned int b = 0; b < numIndices; b++)
|
for (unsigned int b = 0; b < numIndices; b++) {
|
||||||
face.mIndices.push_back( ReadInt());
|
face.mIndices.push_back( ReadInt() );
|
||||||
|
}
|
||||||
TestForSeparator();
|
TestForSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue