Fixed check against totaly number of vertices

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14262 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-06-16 16:16:10 +00:00
parent 8d06b9b019
commit c6ab14018a

View File

@ -2008,10 +2008,10 @@ bool Optimizer::MergeGeometryVisitor::mergeGeode(osg::Geode& geode)
unsigned int numVertices(duplicateList.front()->getVertexArray() ? duplicateList.front()->getVertexArray()->getNumElements() : 0);
DuplicateList::iterator eachGeom(duplicateList.begin()+1);
// until all geometries have been checked or _targetMaximumNumberOfVertices is reached
for (;eachGeom!=duplicateList.end(); ++eachGeom)
for(;eachGeom!=duplicateList.end(); ++eachGeom)
{
unsigned int numAddVertices((*eachGeom)->getVertexArray() ? (*eachGeom)->getVertexArray()->getNumElements() : 0);
if (numVertices+numAddVertices<_targetMaximumNumberOfVertices)
if ((numVertices+numAddVertices)>_targetMaximumNumberOfVertices)
{
break;
}