Hi Pjotr,
I have merged and checked into svn/trunk your changes, with a few
little additions to make the code a bit clearer for those who later
attempt to read the code, the changes now are:
$ svn diff
Index: MeshOptimizers.cpp
===================================================================
--- MeshOptimizers.cpp (revision 13560)
+++ MeshOptimizers.cpp (working copy)
@@ -275,6 +275,9 @@
// nothing to index
if (!numSurfacePrimitives || !numNonIndexedPrimitives) return;
+ // duplicate shared arrays as it isn't safe to rearrange vertices
when arrays are shared.
+ if (geom.containsSharedArrays()) geom.duplicateSharedArrays();
+
// compute duplicate vertices
typedef std::vector<unsigned int> IndexList;
unsigned int numVertices = geom.getVertexArray()->getNumElements();
@@ -1139,6 +1142,10 @@
return;
ps->accept(vr);
}
+
+ // duplicate shared arrays as it isn't safe to rearrange vertices
when arrays are shared.
+ if (geom.containsSharedArrays()) geom.duplicateSharedArrays();
+
Remapper remapper(vr.remap);
gatherer.accept(remapper);
for (Geometry::PrimitiveSetList::iterator itr = primSets.begin(),
Cheeers,
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org