Cleaning up decimation.

This commit is contained in:
David Williams
2007-09-28 10:59:26 +00:00
parent 2f79e76ea5
commit 52a1044703
3 changed files with 23 additions and 90 deletions

View File

@ -359,7 +359,7 @@ namespace Ogre
std::vector<SurfaceVertex> vertexData;
std::vector<uint> indexData;
iterSurfacePatch->second.getVertexAndIndexData(vertexData, indexData);
triangleCounter += iterSurfacePatch->second.m_listTriangles.size();
triangleCounter += iterSurfacePatch->second.getNoOfTriangles();
std::map<uchar,SurfacePatchRenderable*>::iterator iterSurface = m_mapSurfaces[regionX][regionY][regionZ].find(iterSurfacePatch->first);
if(iterSurface == m_mapSurfaces[regionX][regionY][regionZ].end())
@ -781,8 +781,8 @@ namespace Ogre
for(std::map<uchar, SurfacePatch>::iterator iterPatch = result.begin(); iterPatch != result.end(); ++iterPatch)
{
SurfaceVertexIterator iterSurfaceVertex = iterPatch->second.m_listVertices.begin();
while(iterSurfaceVertex != iterPatch->second.m_listVertices.end())
SurfaceVertexIterator iterSurfaceVertex = iterPatch->second.getVerticesBegin();
while(iterSurfaceVertex != iterPatch->second.getVerticesEnd())
{
Vector3 tempNormal = computeNormal((iterSurfaceVertex->getPosition() + offset).toOgreVector3()/2.0f, CENTRAL_DIFFERENCE);
iterSurfaceVertex->setNormal(tempNormal);