Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

Invliad distance to planet calculation

Open 375gnu opened this issue 1 year ago • 0 comments

Describe the bug

void
displayPlanetInfo(Overlay& overlay,
                  int detail,
                  Body& body,
                  double t,
                  const Eigen::Vector3d& viewVec,
                  const HudSettings& hudSettings)
{
    double distanceKm = viewVec.norm();
    double distance = distanceKm - body.getRadius();

So this calculation assumes that the planet is a sphere. When close to the surface of oblate bodies this can give negative values. We should take into account actual semiaxes.

375gnu avatar Dec 03 '23 14:12 375gnu