Skip to content

fix terrain for equirectangular projection

Hy Murveit requested to merge murveit/kstars:terrain4 into master

Terrain was broken when using equirectangular projections. https://indilib.org/forum/ekos/9035-new-feature-terrain-backgrounds.html?start=36#76333 https://indilib.org/forum/general/10490-which-projection-do-you-all-use-and-why-pros-and-cons.html#76351

It turns out that EquirectangularProjector, a subclass of Projector, overrides the non-virtual Projector methods used by the terrain renderer, specifically unusablePoint() and fromScreen(). However, the projector type passed in to the terrain renderer is a Projector. So, when terrain calls the unusablePoint() method, it gets Projector::unusablePoint(), not EquirectangularProjector::unusablePoint() and so on. This fixes that by explicitly calling EquirectangularProjector::unusablePoint() and fromScreen() when terrain notices that the projector is an EquirectangularProjector.

Merge request reports