From f730438f215982ddccd03d23135aa391fb3c3328 Mon Sep 17 00:00:00 2001 From: David Williams Date: Fri, 5 Oct 2007 00:47:11 +0000 Subject: [PATCH] Pressing 't' now toggles wireframe mode. --- source/PolyVoxSceneManager.cpp | 6 +++--- source/SurfacePatch.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index 9e31b829..960ff06b 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -722,11 +722,11 @@ namespace Ogre } uint noOfRemovedVertices = 0; - //do + do { - //noOfRemovedVertices = iterPatch->second.decimate(); + noOfRemovedVertices = iterPatch->second.decimate(); } - //while(noOfRemovedVertices > 10); //We don't worry about the last few vertices - it's not worth the overhead of calling the function. + while(noOfRemovedVertices > 10); //We don't worry about the last few vertices - it's not worth the overhead of calling the function. } //LogManager::getSingleton().logMessage("Finished Generating Mesh Data"); diff --git a/source/SurfacePatch.cpp b/source/SurfacePatch.cpp index 84c0b07d..a24bbfa6 100644 --- a/source/SurfacePatch.cpp +++ b/source/SurfacePatch.cpp @@ -137,6 +137,7 @@ namespace Ogre bool allXMatch = true; bool allYMatch = true; bool allZMatch = true; + bool allAlphaMatch = true; bool allNormalsMatch = true; bool twoEdgesMatch = true; @@ -154,6 +155,10 @@ namespace Ogre { allZMatch = false; } + if((*connectedIter)->getAlpha() != vertexIter->getAlpha()) + { + allAlphaMatch = false; + } if((*connectedIter)->getNormal().dotProduct(vertexIter->getNormal()) < 0.99) { return false; @@ -173,6 +178,7 @@ namespace Ogre } return (allXMatch || allYMatch || allZMatch) + && (allAlphaMatch) && (twoEdgesMatch); }