Added [Sub]Mesh::GetTriangleCount()

Former-commit-id: e365bd3aa57d487186a0be5cde1d5b0ba78d740c
This commit is contained in:
Lynix
2013-04-01 14:33:10 +02:00
parent a951736338
commit 2f72939ad0
4 changed files with 49 additions and 0 deletions

View File

@@ -472,6 +472,23 @@ int NzMesh::GetSubMeshIndex(const NzString& identifier) const
return it->second;
}
unsigned int NzMesh::GetTriangleCount() const
{
#if NAZARA_UTILITY_SAFE
if (!m_impl)
{
NazaraError("Mesh not created");
return 0;
}
#endif
unsigned int triangleCount = 0;
for (NzSubMesh* subMesh : m_impl->subMeshes)
triangleCount += subMesh->GetTriangleCount();
return triangleCount;
}
unsigned int NzMesh::GetVertexCount() const
{
#if NAZARA_UTILITY_SAFE