{"action":"opened","issue":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3398","labels_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3398/labels{/name}","comments_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3398/comments","events_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/3398/events","html_url":"https://github.com/pioneerspacesim/pioneer/issues/3398","id":84443430,"number":3398,"title":"A `DistanceToSurface()` function might be useful.","user":{"login":"impaktor","id":619390,"avatar_url":"https://avatars.githubusercontent.com/u/619390?v=3","gravatar_id":"","url":"https://api.github.com/users/impaktor","html_url":"https://github.com/impaktor","followers_url":"https://api.github.com/users/impaktor/followers","following_url":"https://api.github.com/users/impaktor/following{/other_user}","gists_url":"https://api.github.com/users/impaktor/gists{/gist_id}","starred_url":"https://api.github.com/users/impaktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/impaktor/subscriptions","organizations_url":"https://api.github.com/users/impaktor/orgs","repos_url":"https://api.github.com/users/impaktor/repos","events_url":"https://api.github.com/users/impaktor/events{/privacy}","received_events_url":"https://api.github.com/users/impaktor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Bite-sized","name":"Bite-sized","color":"bfd4f2"},{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/C++%20code","name":"C++ code","color":"eb6420"},{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Feature%20request","name":"Feature request","color":"25c428"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-03T08:53:23Z","updated_at":"2015-06-03T08:53:23Z","closed_at":null,"body":"We have a `DistanceTo()` which is relative the center of the body, but we also could use a `DistanceToSurface()` implemented on the c++ side and exported to Lua, just like `DistanceTo`, for planets that take surface terrain into account, as @laarmen thought it be a good idea, for #3395.\r\n\r\nHint:\r\n- Look at `DistanceTo` in LuaBody.cpp\r\n- Look at the altitude thingy (somewhere), which should prove to be useful.\r\n\r\nPerhaps @cccpxx78 care to have a look at this. Should not be much code, and a single commit, which we can merge quickly."}}