Avoid division by zero in assimp_cmd info when scene loading succeeds but contains no meshes
parent
cc346d3e12
commit
b97c26b1d2
|
@ -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;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue