From Aurélien Chatelain, "the smoothing visitor did not handle shared arrays. It may leads to bad geometry arrays when a shared array is involved in the scene.

This submission adds shared array duplication (and moves the SharedArrayOptimizer declaration in MeshOptimizer to make it callable from the SmoothingVisitor)."

Submitted by Marc Helbling.
Edited by Robet Osfield to retain the usual OSG coding style.




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14639 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-12-24 10:55:49 +00:00
parent 2870c12b03
commit a331680cec
3 changed files with 77 additions and 54 deletions

View File

@@ -111,5 +111,15 @@ public:
void optimizeOrder();
void optimizeOrder(osg::Geometry& geom);
};
class OSGUTIL_EXPORT SharedArrayOptimizer
{
public:
void findDuplicatedUVs(const osg::Geometry& geometry);
void deduplicateUVs(osg::Geometry& geometry);
protected:
std::map<unsigned int, unsigned int> _deduplicateUvs;
}; // SharedArrayOptimizer
}
#endif