Texturing works
This commit is contained in:
parent
ef486df526
commit
7d729633c1
3 changed files with 26 additions and 4 deletions
|
@ -295,6 +295,7 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
TGPolygon base_poly = tgPolygonDiff( divided_base, accum );
|
||||
|
||||
// do this when generating the polys themselves...
|
||||
#if 0
|
||||
for ( k = 0; k < (int)rwy_polys.size(); ++k )
|
||||
{
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "add nodes/remove dups section = " << k << " " << rwy_polys[k].get_material());
|
||||
|
@ -339,6 +340,7 @@ void Airport::BuildBtg(const string& root, const string_list& elev_src )
|
|||
rwy_polys[k].set_poly( poly );
|
||||
}
|
||||
// END do this when generating polys
|
||||
#endif
|
||||
|
||||
// add segments to polygons to remove any possible "T"
|
||||
// intersections
|
||||
|
|
|
@ -598,7 +598,20 @@ int ClosedPoly::BuildBtg( float alt_m, superpoly_list* rwy_polys, texparams_list
|
|||
string material;
|
||||
int j, k;
|
||||
|
||||
material = "pa_tiedown";
|
||||
switch( surface_type )
|
||||
{
|
||||
case 1:
|
||||
material = "pa_tiedown";
|
||||
break;
|
||||
|
||||
case 2:
|
||||
material = "pc_tiedown";
|
||||
break;
|
||||
|
||||
default:
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "ClosedPoly::BuildBtg: unknown material " << surface_type );
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// verify the poly has been generated
|
||||
if ( pre_tess.contours() )
|
||||
|
@ -622,17 +635,16 @@ int ClosedPoly::BuildBtg( float alt_m, superpoly_list* rwy_polys, texparams_list
|
|||
TGTexParams tp;
|
||||
|
||||
TGPolygon clipped = tgPolygonDiff( pre_tess, *accum );
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "BuildBtg: clipped poly has " << clipped.contours() << " contours");
|
||||
|
||||
TGPolygon split = tgPolygonSplitLongEdges( clipped, 400.0 );
|
||||
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "BuildBtg: split poly has " << split.contours() << " contours");
|
||||
|
||||
|
||||
sp.erase();
|
||||
sp.set_poly( split );
|
||||
sp.set_material( material );
|
||||
sp.set_flag("taxi");
|
||||
|
||||
rwy_polys->push_back( sp );
|
||||
SG_LOG(SG_GENERAL, SG_DEBUG, "clipped = " << clipped.contours());
|
||||
*accum = tgPolygonUnion( pre_tess, *accum );
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <osg/Geometry>
|
||||
#include <osg/Group>
|
||||
|
||||
#include <Geometry/poly_support.hxx>
|
||||
#include <Polygon/polygon.hxx>
|
||||
|
||||
#include "beznode.hxx"
|
||||
|
@ -267,6 +268,13 @@ void Runway::gen_simple_rwy( double alt_m, const string& material, superpoly_lis
|
|||
SG_LOG(SG_GENERAL, SG_DEBUG, " point = " << p);
|
||||
}
|
||||
|
||||
// do this before clipping and generating the base
|
||||
runway_a = remove_dups( runway_a );
|
||||
runway_a = reduce_degeneracy( runway_a );
|
||||
|
||||
runway_b = remove_dups( runway_b );
|
||||
runway_b = reduce_degeneracy( runway_b );
|
||||
|
||||
TGSuperPoly sp;
|
||||
TGTexParams tp;
|
||||
|
||||
|
|
Loading…
Reference in a new issue