Introduced Geometry::containsSharedArrays() and Geometry::duplicateSharedArrays() to

support a fix to the osgUtil::Simplifier that couldn't handle shared arrays
This commit is contained in:
Robert Osfield
2008-09-14 10:31:27 +00:00
parent b55ed0c56b
commit d71a6f6cab
3 changed files with 69 additions and 0 deletions

View File

@@ -1413,6 +1413,14 @@ void EdgeCollapse::setGeometry(osg::Geometry* geometry, const Simplifier::IndexL
osg::notify(osg::INFO)<<"EdgeCollapse::setGeometry(..): Removing attribute indices"<<std::endl;
_geometry->copyToAndOptimize(*_geometry);
}
// check to see if vertex attributes indices exists, if so expand them to remove them
if (_geometry->containsSharedArrays())
{
// removing coord indices
osg::notify(osg::INFO)<<"EdgeCollapse::setGeometry(..): Duplicate shared arrays"<<std::endl;
_geometry->duplicateSharedArrays();
}
unsigned int numVertices = geometry->getVertexArray()->getNumElements();