Skip to content

Make min/maxTerrainAltitude match altimeter widget readouts - #75

Open
siimav wants to merge 1 commit into
masterfrom
WhatAMess
Open

Make min/maxTerrainAltitude match altimeter widget readouts#75
siimav wants to merge 1 commit into
masterfrom
WhatAMess

Conversation

@siimav

@siimav siimav commented Jul 25, 2026

Copy link
Copy Markdown

Currently minTerrainAltitude/maxTerrainAltitude checks read Vessel.heightFromTerrain, which comes from a downward physics raycast against the terrain collider. For fast vessels (impactors, low orbits) the collider LOD can't be built under the moving ground track in time, so the raycast misses and KSP silently substitutes the vessel's sea-level altitude. The check then flickers or never passes — even though the in-game altimeter shows the craft is clearly within the desired terrain-altitude band.

This PR changes the behavior to match the stock altimeter's AGL/terrain readout (i.e it's using the Vessel.radarAltitude value).
There are some fundamental differences though:

  • Over oceans it now measures to the water surface instead of the seabed
  • Over below-datum land it under-reports true geometric distance while the craft is above the datum, then matches true distance below the datum.

@github-actions

Copy link
Copy Markdown

Download the artifacts for this pull request:

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

Successfully merging this pull request may close these issues.

1 participant