1
0
Fork 0

Ron Jensen: Fix stopway length and order and create proper stopway texture.

Thanks, Ron.
This commit is contained in:
Ralf Gerlich 2010-01-11 20:25:52 +01:00
parent 61ac48f3e5
commit 69eb4be737
2 changed files with 50 additions and 25 deletions

View file

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

View file

@ -103,34 +103,59 @@ void gen_runway_stopway( const TGRunway& rwy_info,
texparams_list *texparams, texparams_list *texparams,
TGPolygon* accum ) { TGPolygon* accum ) {
const float length = rwy_info.length / 2.0 + 2.0; const float length = rwy_info.length / 2.0 + 2.0;
double start1_pct = 0.0;
double start2_pct = 0.0;
double end1_pct = 0.0;
double end2_pct = 0.0;
double part_len = 0.0;
int count=0;
int i=0;
if (rwy_info.stopway1 > 0.0) { if (rwy_info.stopway1 > 0.0) {
/* Generate approach end stopway */ /* Generate approach end stopway */
count = (int) (rwy_info.stopway1 * 2.0/ rwy_info.width);
if(count < 1) count = 1;
part_len = rwy_info.stopway1 / (double) count;
for(i=0;i<count;i++)
{
start1_pct=end1_pct;
end1_pct = start1_pct + ( part_len / length );
gen_runway_section( rwy_info, gen_runway_section( rwy_info,
runway_a, runway_b,
- rwy_info.stopway1 / length, 0, - end1_pct, -start1_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, //last number is lengthwise
rwy_info.heading, rwy_info.heading + 180.0,
prefix, prefix,
"tiedown", "stopway",
rwy_polys, rwy_polys,
texparams, texparams,
accum); accum);
} }
}
if (rwy_info.stopway2 > 0.0) { if (rwy_info.stopway2 > 0.0) {
/* Generate reciprocal end stopway */ /* Generate reciprocal end stopway */
count = (int) (rwy_info.stopway2 * 2.0 / rwy_info.width);
if(count < 1) count = 1;
part_len = rwy_info.stopway2 / (double) count;
for(i=0;i<count;i++)
{
start2_pct=end2_pct;
end2_pct = start2_pct + ( part_len / length );
gen_runway_section( rwy_info, gen_runway_section( rwy_info,
runway_b, runway_a,
- rwy_info.stopway2 / length, 0, - end2_pct, -start2_pct,
0.0, 1.0, 0.0, 1.0,
0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
rwy_info.heading + 180.0, rwy_info.heading,
prefix, prefix,
"tiedown", "stopway",
rwy_polys, rwy_polys,
texparams, texparams,
accum); accum);
} }
}
} }
// generate a section of runway // generate a section of runway