- Joined
- Jun 6, 2012
- Messages
- 283
- Reaction score
- 65
- Points
- 28
- Location
- Sydney, Australia, Earth, Sol
- Website
- www.orbithangar.com
Hi All,
Hopefully a quick question here:
I have a function which returns true if a vessel is currently in sunlight.... sort of... Essentially I am calculating if the local reference body is obscuring the sun, this is simple enough. However the issue arises if my vessel is say orbiting one of Jupiter's moons for example. Obviously the local reference body will be whichever moon I am orbiting, but the sun may still be obscured by Jupiter. I could iterate through each body in the solar system one-by-one, but I am really not keen to do this, especially since I will probably be calling this function each time step, and that starts to get pretty expensive.
Does anyone have any suggetsions how to go about this? If the only realistic way is to iterate though each body I think I'll just say the local reference body is good enough!
Thanks all!
MrMartian
Hopefully a quick question here:
I have a function which returns true if a vessel is currently in sunlight.... sort of... Essentially I am calculating if the local reference body is obscuring the sun, this is simple enough. However the issue arises if my vessel is say orbiting one of Jupiter's moons for example. Obviously the local reference body will be whichever moon I am orbiting, but the sun may still be obscured by Jupiter. I could iterate through each body in the solar system one-by-one, but I am really not keen to do this, especially since I will probably be calling this function each time step, and that starts to get pretty expensive.
Does anyone have any suggetsions how to go about this? If the only realistic way is to iterate though each body I think I'll just say the local reference body is good enough!
Thanks all!
MrMartian