Added handling of null dynamic_cast.
This commit is contained in:
parent
576a265095
commit
a469d60ed2
@ -61,6 +61,8 @@ void TriangleStripVisitor::mergeTrianglesStrip(osg::Geometry& geometry)
|
|||||||
else if (ps->getType() == osg::PrimitiveSet::DrawArraysPrimitiveType) {
|
else if (ps->getType() == osg::PrimitiveSet::DrawArraysPrimitiveType) {
|
||||||
// trip strip can generate drawarray of 5 elements we want to merge them too
|
// trip strip can generate drawarray of 5 elements we want to merge them too
|
||||||
osg::DrawArrays* da = dynamic_cast<osg::DrawArrays*> (ps);
|
osg::DrawArrays* da = dynamic_cast<osg::DrawArrays*> (ps);
|
||||||
|
if (da)
|
||||||
|
{
|
||||||
// if connection needed insert degenerate triangles
|
// if connection needed insert degenerate triangles
|
||||||
if (ndw->getNumIndices() != 0 && ndw->back() != da->getFirst()) {
|
if (ndw->getNumIndices() != 0 && ndw->back() != da->getFirst()) {
|
||||||
// duplicate last vertex
|
// duplicate last vertex
|
||||||
@ -80,6 +82,7 @@ void TriangleStripVisitor::mergeTrianglesStrip(osg::Geometry& geometry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = geometry.getNumPrimitiveSets() - 1 ; i >= 0 ; -- i) {
|
for (int i = geometry.getNumPrimitiveSets() - 1 ; i >= 0 ; -- i) {
|
||||||
osg::PrimitiveSet* ps = geometry.getPrimitiveSet(i);
|
osg::PrimitiveSet* ps = geometry.getPrimitiveSet(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user