From Paul Martz, "When exporting a DrawArrays PrimitiveSet, the DAE plugin computes an incorrect nbVerticesPerPoly if the first index is not zero. The issue can be reproduced easily with:

osgconv cessna.osg cessna.dae
 
Examination of the resulting .dae file reveals several out-of-range tristrip indices; viewing the .dae file in osgviewer causes a crash when OSG tries to lookup those indices.
 
Attached resolves this issue."
This commit is contained in:
Robert Osfield 2008-05-26 22:34:06 +00:00
parent 804c91c8c1
commit 51dd9676db

View File

@ -587,7 +587,7 @@ bool daeWriter::processGeometry( osg::Geometry *geom, domGeometry *geo, const st
}
unsigned int indexBegin = drawArray->getFirst();
unsigned int nbVerticesPerPoly=indexEnd/p.size();
unsigned int nbVerticesPerPoly=(indexEnd-indexBegin)/p.size();
unsigned int indexPolyEnd = indexBegin+nbVerticesPerPoly;
for( unsigned int iPoly = 0; iPoly < p.size(); ++iPoly )
{