Ron Jensen: Fix stopway length and order and create proper stopway texture.
Thanks, Ron.
This commit is contained in:
parent
61ac48f3e5
commit
69eb4be737
2 changed files with 50 additions and 25 deletions
|
@ -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, -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
|
||||
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);
|
||||
|
||||
|
|
|
@ -103,34 +103,59 @@ void gen_runway_stopway( const TGRunway& rwy_info,
|
|||
texparams_list *texparams,
|
||||
TGPolygon* accum ) {
|
||||
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) {
|
||||
/* 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,
|
||||
runway_a,
|
||||
- rwy_info.stopway1 / length, 0,
|
||||
runway_b,
|
||||
- end1_pct, -start1_pct,
|
||||
0.0, 1.0,
|
||||
0.0, 1.0, 0.0, 1.0,
|
||||
rwy_info.heading,
|
||||
0.0, 1.0, 0.0, 1.0, //last number is lengthwise
|
||||
rwy_info.heading + 180.0,
|
||||
prefix,
|
||||
"tiedown",
|
||||
"stopway",
|
||||
rwy_polys,
|
||||
texparams,
|
||||
accum);
|
||||
}
|
||||
}
|
||||
if (rwy_info.stopway2 > 0.0) {
|
||||
/* 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,
|
||||
runway_b,
|
||||
- rwy_info.stopway2 / length, 0,
|
||||
runway_a,
|
||||
- end2_pct, -start2_pct,
|
||||
0.0, 1.0,
|
||||
0.0, 1.0, 0.0, 1.0,
|
||||
rwy_info.heading + 180.0,
|
||||
rwy_info.heading,
|
||||
prefix,
|
||||
"tiedown",
|
||||
"stopway",
|
||||
rwy_polys,
|
||||
texparams,
|
||||
accum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// generate a section of runway
|
||||
|
|
Loading…
Reference in a new issue