1
0
Fork 0

Fix a boundary size bug. All boundaries with < 2 nodes are discarded now

This commit is contained in:
Christian Schmitt 2011-10-08 11:25:25 +02:00
parent 8ebbb39893
commit 33c92f60f6

View file

@ -77,14 +77,17 @@ void ClosedPoly::CreateConvexHull( void )
Point3D p; Point3D p;
int i; int i;
for (i=0; i<boundary->size(); i++) if (boundary->size() > 2){
{ for (i=0; i<boundary->size(); i++)
p = boundary->at(i)->GetLoc(); {
nodes.push_back( p );
}
convexHull = convex_hull( nodes ); p = boundary->at(i)->GetLoc();
hull = convexHull.get_contour(0); nodes.push_back( p );
}
convexHull = convex_hull( nodes );
hull = convexHull.get_contour(0);
} else
SG_LOG(SG_GENERAL, SG_ALERT, "Boundary size too small: " << boundary->size() << ". Ignoring..." );
} }
int ClosedPoly::CloseCurContour() int ClosedPoly::CloseCurContour()
@ -589,8 +592,13 @@ int ClosedPoly::BuildBtg( float alt_m, superpoly_list* rwy_polys, texparams_list
case 3: case 3:
material = "grass_rwy"; material = "grass_rwy";
break; break;
// TODO Differentiate more here:
case 4: case 4:
case 5:
case 12:
case 13:
case 14:
case 15:
material = "grass_rwy"; material = "grass_rwy";
break; break;