Skip to content

Commit

Permalink
Corrected radar alt offset from wrong position
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunbaratu committed Jul 18, 2019
1 parent 2b2c50c commit baa363f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/kOS/Suffixed/BodyTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,7 @@ public ScalarValue AltitudeFromPosition(Vector position)
/// <returns></returns>
public ScalarValue RadarAltitudeFromPosition(Vector position)
{
Vector3d unityWorldPosition = Shared.Vessel.CoMD + position.ToVector3D();
GeoCoordinates geo = GeoCoordinatesFromPosition(new Vector(unityWorldPosition));
GeoCoordinates geo = GeoCoordinatesFromPosition(position);
ScalarValue terrainHeight = geo.GetTerrainAltitude();
ScalarValue seaAlt = AltitudeFromPosition(position);
if (Body.ocean && terrainHeight < 0)
Expand Down
1 change: 0 additions & 1 deletion src/kOS/Suffixed/BoundsValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public double BottomAltitudeRadar()
{
BodyTarget body = BodyTarget.CreateOrGetExisting(shared.Vessel.mainBody, shared);
Vector bottomInShipRaw = FurthestCorner(new Vector(-shared.Vessel.upAxis));
GeoCoordinates geo = body.GeoCoordinatesFromPosition(bottomInShipRaw);
return body.RadarAltitudeFromPosition(bottomInShipRaw);
}

Expand Down

0 comments on commit baa363f

Please sign in to comment.