Merge pull request #445 from turol/master

Avoid division by zero in assimp_cmd info when scene loading succeeds bu...
pull/447/head
Alexander Gessler 2015-01-25 21:46:26 +01:00
commit a444bf48a1
1 changed files with 2 additions and 2 deletions

View File

@ -112,12 +112,12 @@ unsigned int CountAnimChannels(const aiScene* scene)
// -----------------------------------------------------------------------------------
unsigned int GetAvgFacePerMesh(const aiScene* scene) {
return static_cast<unsigned int>(CountFaces(scene)/scene->mNumMeshes);
return (scene->mNumMeshes != 0) ? static_cast<unsigned int>(CountFaces(scene)/scene->mNumMeshes) : 0;
}
// -----------------------------------------------------------------------------------
unsigned int GetAvgVertsPerMesh(const aiScene* scene) {
return static_cast<unsigned int>(CountVertices(scene)/scene->mNumMeshes);
return (scene->mNumMeshes != 0) ? static_cast<unsigned int>(CountVertices(scene)/scene->mNumMeshes) : 0;
}
// -----------------------------------------------------------------------------------