Fix for MergeGeometryVsiitor bug. Restructured the processing the merge geometry list to avoid missing geometries that aren't binned along with other geometries.

This commit is contained in:
Robert Osfield 2018-04-02 11:44:03 +01:00
parent 589905fc38
commit 2946ea0759

View File

@ -1956,12 +1956,13 @@ bool Optimizer::MergeGeometryVisitor::mergeGroup(osg::Group& group)
++mitr)
{
DuplicateList& duplicateList = *mitr;
if (duplicateList.size()>1)
if (!duplicateList.empty())
{
osg::ref_ptr<osg::Geometry> lhs = duplicateList.front();
DuplicateList::iterator ditr = duplicateList.begin();
osg::ref_ptr<osg::Geometry> lhs = *ditr++;
group.addChild(lhs.get());
for(DuplicateList::iterator ditr = duplicateList.begin()+1;
for(;
ditr != duplicateList.end();
++ditr)
{