osgUtil: LineSegmentIntersector: don't increment primitive index until after adding intersection

This commit is contained in:
blobfish
2017-05-30 18:46:03 -04:00
parent 47efc55621
commit b52bc2bcd1

View File

@@ -357,15 +357,15 @@ struct IntersectFunctor
// handle triangles
void operator()(const osg::Vec3& v0, const osg::Vec3& v1, const osg::Vec3& v2, bool /*treatVertexDataAsTemporary*/)
{
++_primitiveIndex;
intersect(v0,v1,v2);
++_primitiveIndex;
}
void operator()(const osg::Vec3& v0, const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3, bool /*treatVertexDataAsTemporary*/)
{
++_primitiveIndex;
intersect(v0,v1,v3);
intersect(v1,v2,v3);
++_primitiveIndex;
}
void intersect(const osg::Vec3Array*, int , unsigned int)