1
0
Fork 0

Added stopways to runways (closes #2)

This commit is contained in:
Ralf Gerlich 2009-12-18 19:20:03 +01:00
parent 02ec141e6c
commit 1daeb0f99e
7 changed files with 76 additions and 14 deletions

View file

@ -337,10 +337,10 @@ static void build_runway( const TGRunway& rwy_info,
safe_base
= gen_runway_area_w_extend( rwy_info, 0.0, 40.0, 0.0, 0.0, 40.0 );
} else {
base = gen_runway_area_w_extend( rwy_info, 0.0, 20.0, 0.0, 0.0, 20.0 );
base = gen_runway_area_w_extend( rwy_info, 0.0, 20.0, -rwy_info.stopway1, -rwy_info.stopway2, 20.0 );
// also clear a safe area around the runway
safe_base
= gen_runway_area_w_extend( rwy_info, 0.0, 180.0, 0.0, 0.0, 50.0 );
= gen_runway_area_w_extend( rwy_info, 0.0, 180.0, -rwy_info.stopway2, -rwy_info.stopway2, 50.0 );
}
*apt_clearing = tgPolygonUnion(safe_base, *apt_clearing);

View file

@ -94,19 +94,57 @@ void gen_number_block( const TGRunway& rwy_info,
}
}
// generate the runway stopway
void gen_runway_stopway( const TGRunway& rwy_info,
const TGPolygon& runway_a,
const TGPolygon& runway_b,
const string& prefix,
superpoly_list *rwy_polys,
texparams_list *texparams,
TGPolygon* accum ) {
const float length = rwy_info.length / 2.0 + 2.0;
if (rwy_info.stopway1 > 0.0) {
/* Generate approach end stopway */
gen_runway_section( rwy_info,
runway_a,
- rwy_info.stopway1 / length, 0,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading,
prefix,
"tiedown",
rwy_polys,
texparams,
accum);
}
if (rwy_info.stopway2 > 0.0) {
/* Generate reciprocal end stopway */
gen_runway_section( rwy_info,
runway_b,
- rwy_info.stopway2 / length, 0,
0.0, 1.0,
0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0,
prefix,
"tiedown",
rwy_polys,
texparams,
accum);
}
}
// generate a section of runway
void gen_runway_section( const TGRunway& rwy_info,
const TGPolygon& runway,
double startl_pct, double endl_pct,
double startw_pct, double endw_pct,
const TGPolygon& runway,
double startl_pct, double endl_pct,
double startw_pct, double endw_pct,
double minu, double maxu, double minv, double maxv,
double heading,
const string& prefix,
const string& material,
superpoly_list *rwy_polys,
texparams_list *texparams,
TGPolygon *accum ) {
double heading,
const string& prefix,
const string& material,
superpoly_list *rwy_polys,
texparams_list *texparams,
TGPolygon *accum ) {
int j, k;
@ -201,7 +239,7 @@ void gen_runway_section( const TGRunway& rwy_info,
SG_LOG(SG_GENERAL, SG_DEBUG, " point = " << p);
}
}
// Clip the new polygon against what ever has already been created.
TGPolygon clipped = tgPolygonDiff( section, *accum );

View file

@ -41,6 +41,15 @@ void gen_number_block( const TGRunway& rwy_info,
texparams_list *texparams,
TGPolygon *accum );
// generate the runway stopway
void gen_runway_stopway( const TGRunway& rwy_info,
const TGPolygon& runway_a,
const TGPolygon& runway_b,
const string& prefix,
superpoly_list *rwy_polys,
texparams_list *texparams,
TGPolygon* accum );
// generate a section of runway
void gen_runway_section( const TGRunway& rwy_info,
const TGPolygon& runway,

View file

@ -406,4 +406,8 @@ void gen_non_precision_rwy( const TGRunway& rwy_info,
material, "rest",
rwy_polys, texparams, accum );
}
gen_runway_stopway( rwy_info, runway_a, runway_b,
material,
rwy_polys, texparams, accum );
}

View file

@ -608,4 +608,8 @@ void gen_precision_rwy( const TGRunway& rwy_info,
material, "rest",
rwy_polys, texparams, accum );
}
gen_runway_stopway( rwy_info, runway_a, runway_b,
material,
rwy_polys, texparams, accum );
}

View file

@ -130,5 +130,8 @@ void gen_simple_rwy( const TGRunway& rwy_info,
SG_LOG(SG_GENERAL, SG_DEBUG, " point = " << p);
}
}
gen_runway_stopway( rwy_info, runway_a, runway_b,
material,
rwy_polys, texparams, accum );
}

View file

@ -413,6 +413,10 @@ void gen_visual_rwy( const TGRunway& rwy_info,
material, "rest",
rwy_polys, texparams, accum );
}
gen_runway_stopway( rwy_info, runway_a, runway_b,
material,
rwy_polys, texparams, accum );
}