osgEarth 2.1.1
Defines | Functions

/home/cube/sources/osgearth/src/osgEarth/Locators.cpp File Reference

#include <osgEarth/Locators>
#include <osgEarth/TileKey>
#include <osgEarth/Registry>
#include <osgEarth/Map>
#include <osg/Notify>
Include dependency graph for Locators.cpp:

Go to the source code of this file.

Defines

#define MERC_MAX_LAT   85.084059050110383
#define MERC_MIN_LAT   -85.084059050110383

Functions

static double lonToU (double lon)
static double latToV (double lat)
static void getUV (const GeoExtent &ext, double lon, double lat, double &out_u, double &out_v)

Define Documentation

#define MERC_MAX_LAT   85.084059050110383

Definition at line 159 of file Locators.cpp.

#define MERC_MIN_LAT   -85.084059050110383

Definition at line 160 of file Locators.cpp.


Function Documentation

static void getUV ( const GeoExtent ext,
double  lon,
double  lat,
double &  out_u,
double &  out_v 
) [static]

Definition at line 174 of file Locators.cpp.

{
    out_u = (lon-ext.xMin())/ext.width();

    double vmin = latToV( osg::clampBetween( ext.yMax(), MERC_MIN_LAT, MERC_MAX_LAT ) );
    double vmax = latToV( osg::clampBetween( ext.yMin(), MERC_MIN_LAT, MERC_MAX_LAT ) );
    double vlat = latToV( osg::clampBetween( lat, MERC_MIN_LAT, MERC_MAX_LAT ) );

    out_v = (vlat-vmin)/(vmax-vmin);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static double latToV ( double  lat) [static]

Definition at line 168 of file Locators.cpp.

                   {
    double sin_lat = sin( osg::DegreesToRadians( lat ) );
    return 0.5 - log( (1+sin_lat) / (1-sin_lat) ) / (4*osg::PI);
}

Here is the caller graph for this function:

static double lonToU ( double  lon) [static]

Definition at line 163 of file Locators.cpp.

                   {
    return (lon + 180.0) / 360.0;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines