asterank
asterank copied to clipboard
Close issue #19
resolve #19. Clicking on Sun button preserves lock on the selected asteroid and doesn't remove its orbit. Add 'Reset' button to deselect asteroid and reset view (can also be helpful to restore view from weird camera angles and scales). Earth selection behaviour is intentionally left unchanged as asteroid tracking can be a bit complicated from the Earth-locked view.
Thanks Vadym for this excellent change :+1:
Could you help me understand the difference between clearLock
and dropLock
in the code?
dropLock
clears selection even if locked_object == null
, while original method clearLock
skip this action due to this line of code at the top: if (!locked_object) return
. I implemented dropLock
in order to force clearing selection from resetView
method, which emulates absence of lock through declaration locked_object = null
at the top. This declaration is needed to reset camera. A bit confusing - I know, but this is how I made it :)
Please do not merge yet for I've just found a little bug in my ResetView
method. I hope I'll fix it next week.
Done!