Hi,
Fenerit wrote:Jo?l has corrected all bugs in my fault code
I fear it is not true
I you click the button when a DSO is selected, it crashes !
It is possible to make it work for DSO too, but I think it is not relevant.
I propose a fix to prevent making measures on galaxies, globulars and so on...
Code: Select all
distance_calc_function[1] = function()
celestia:setrenderflags{markers = true};
refObj = nil
long1 = nil
celestia:unmarkall();
local sel = celestia:getselection()
if not empty(sel) then
if sel:type() == "location" then
sel:mark(StartMarkerColor, StartMarkerSymbol, StartMarkerSize, StartMarkerOpacity, "", false);
local obsposition = obs:getposition()
obs:setposition(sel:getposition())
refObj = sel:getinfo().parent
long1, lat1 = celutil.get_long_lat(obs, refObj)
obs:setposition(obsposition)
else
refObj = sel
end
else
refObj = obs:getframe():getrefobject()
end
if refObj then
if refObj:getinfo().parent or refObj:type() == "star" then
celestia:select(refObj)
obs:follow(refObj)
if not long1 then
long1,lat1 = celutil.get_long_lat(obs, refObj)
end
refObj:mark(CalcMarkerColor, CalcMarkerSymbol, CalcMarkerSize, CalcMarkerOpacity, "", false);
else
refObj = nil
end
end
end;
![Idea :idea:](./images/smilies/icon_idea.gif)
As I am playing with this tool, I think it would be cool if we can have the starting point marker even if it is not a location.
I think it is possible with a fake object.
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)