From 32204b483f04a224165f90369e4a6fdb710e9da6 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 18 Sep 2007 16:53:18 +0000 Subject: [PATCH] Work on mesh decimation. --- source/PolyVoxSceneManager.cpp | 2 +- source/SurfacePatch.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index 8aa72206..b75fe7d7 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -1010,7 +1010,7 @@ namespace Ogre iterPatch->second.computeNormalsFromVolume(volIter); iterPatch->second.endDefinition(); bool removedVertex = false; - //for(uint ct = 0; ct < 10; ct++) + //for(uint ct = 0; ct < 20; ct++) do { removedVertex = iterPatch->second.decimate3(); diff --git a/source/SurfacePatch.cpp b/source/SurfacePatch.cpp index 8eac6916..8755c3f8 100644 --- a/source/SurfacePatch.cpp +++ b/source/SurfacePatch.cpp @@ -47,7 +47,7 @@ namespace Ogre void SurfacePatch::addTriangle(const SurfaceVertex& v0,const SurfaceVertex& v1,const SurfaceVertex& v2) { - /*if(v0.position.x > 8) + if(v0.position.x > 8) return; if(v0.position.y > 8) return; @@ -58,7 +58,7 @@ namespace Ogre if(v2.position.x > 8) return; if(v2.position.y > 8) - return;*/ + return; //if(m_uTrianglesAdded > 1) return; @@ -532,9 +532,10 @@ namespace Ogre lastAddedEdge->hasTriangle = true; (*secondEdgeIter)->hasTriangle = true; (*endEdgeIter)->hasTriangle = true; - } - didDecimation = true; - break; + + didDecimation = true; + break; + } } //LogManager::getSingleton().logMessage("Fixed = " + StringConverter::toString(fixed) + " Movable = " + StringConverter::toString(movable));