X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fbucket%2Fnewbucket.hxx;h=56333c4d670e4b985529fa289be32fec6fe77a2b;hb=85e58b4a49d3c3b74afed3c766b47b65a6a95a66;hp=6e9bdd24329c5cd3247c45f98e2969ec207231ee;hpb=d219c5c4c613e4f36d8ff1ce8af674fc96dcb543;p=simgear.git diff --git a/simgear/bucket/newbucket.hxx b/simgear/bucket/newbucket.hxx index 6e9bdd24..56333c4d 100644 --- a/simgear/bucket/newbucket.hxx +++ b/simgear/bucket/newbucket.hxx @@ -24,6 +24,11 @@ /** \file newbucket.hxx * A class and associated utiltity functions to manage world scenery tiling. + * + * Tile borders are aligned along circles of latitude and longitude. + * All tiles are 1/8 degree of latitude high and their width in degrees + * longitude depends on their latitude, adjusted in such a way that + * all tiles cover about the same amount of area of the earth surface. */ #ifndef _NEWBUCKET_HXX @@ -95,7 +100,6 @@ static double sg_bucket_span( double l ) { class SGBucket { private: - double cx, cy; // centerpoint (lon, lat) in degrees of bucket short lon; // longitude index (-180 to 179) short lat; // latitude index (-90 to 89) char x; // x subdivision (0 to 7) @@ -212,9 +216,9 @@ public: double span = sg_bucket_span( lat + y / 8.0 + SG_HALF_BUCKET_SPAN ); if ( span >= 1.0 ) { - return lon + span / 2.0; + return lon + get_width() / 2.0; } else { - return lon + x * span + span / 2.0; + return lon + x * span + get_width() / 2.0; } } @@ -330,7 +334,7 @@ void sgBucketDiff( const SGBucket& b1, const SGBucket& b2, int *dx, int *dy ); inline std::ostream& operator<< ( std::ostream& out, const SGBucket& b ) { - return out << b.lon << ":" << b.x << ", " << b.lat << ":" << b.y; + return out << b.lon << ":" << (int)b.x << ", " << b.lat << ":" << (int)b.y; }