Whups, fixed a simple bug so you can now fly across the lon = +/-180
boundary without any problems.
This commit is contained in:
parent
d87e7ef7d7
commit
875ea2c872
1 changed files with 8 additions and 1 deletions
|
@ -97,7 +97,14 @@ FGBucket fgBucketOffset( double dlon, double dlat, int dx, int dy ) {
|
|||
double span = bucket_span( clat );
|
||||
|
||||
// walk dx units in the lon direction
|
||||
result.set_bucket( dlon + dx * span, clat );
|
||||
double tmp = dlon + dx * span;
|
||||
while ( tmp < -180.0 ) {
|
||||
tmp += 360.0;
|
||||
}
|
||||
while ( tmp >= 180.0 ) {
|
||||
tmp -= 360.0;
|
||||
}
|
||||
result.set_bucket( tmp, clat );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue