Make distance switch distance dependent on globe radius.

This commit is contained in:
kalbl
2016-10-26 23:08:47 +02:00
parent 9117599043
commit b1a3814c37
@@ -118,7 +118,12 @@ namespace globebrowsing {
//_pointGlobe = std::make_shared<PointGlobe>(*this);
_distanceSwitch.addSwitchValue(_chunkedLodGlobe, 5e9);
// This distance will be enough to render the globe as one pixel if the field of
// view is 'fov' radians and the screen resolution is 'res' pixels.
double fov = 2 * M_PI / 6; // 60 degrees
int res = 2880;
double distance = res * _ellipsoid.maximumRadius() / tan(fov / 2);
_distanceSwitch.addSwitchValue(_chunkedLodGlobe, distance);
//_distanceSwitch.addSwitchValue(_pointGlobe, 1e12);
_debugPropertyOwner.setName("Debug");