Fix a boundary size bug. All boundaries with < 2 nodes are discarded now
This commit is contained in:
parent
8ebbb39893
commit
33c92f60f6
1 changed files with 16 additions and 8 deletions
|
@ -77,14 +77,17 @@ void ClosedPoly::CreateConvexHull( void )
|
||||||
Point3D p;
|
Point3D p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (boundary->size() > 2){
|
||||||
for (i=0; i<boundary->size(); i++)
|
for (i=0; i<boundary->size(); i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
p = boundary->at(i)->GetLoc();
|
p = boundary->at(i)->GetLoc();
|
||||||
nodes.push_back( p );
|
nodes.push_back( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
convexHull = convex_hull( nodes );
|
convexHull = convex_hull( nodes );
|
||||||
hull = convexHull.get_contour(0);
|
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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue