Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invliad distance to planet calculation #1998

Open
375gnu opened this issue Dec 3, 2023 · 0 comments
Open

Invliad distance to planet calculation #1998

375gnu opened this issue Dec 3, 2023 · 0 comments

Comments

@375gnu
Copy link
Member

375gnu commented Dec 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant