Page 1 of 1

Spacecraft in eclipse

Posted: 11.04.2007, 15:01
by mjoubert
Hi all,

Another thing to verify.

If I use

Code: Select all

"MySpacecraft" "Sol/Earth"
MySpacecraft will be sensitive to earth shadow (dark when behind earth).

But if I use

Code: Select all

"MySpacecraft" "Sol/Earth/SomethingAroundEarth"
MySpacecraft will stay bright, even if it is behind earth.

Is it the expected behaviour? Or there is an inheritance issue?


Mathieu (spacebel)

Posted: 16.04.2007, 18:10
by chris
Celestia only checks for eclipses across one level of the hierarchy. This is a fairly easy thing to fix, however--I can have it working by the end of the week.

--Chris

Posted: 16.04.2007, 23:46
by Cham
Yes, I've experienced that bug many times too. Annoying.

Posted: 17.04.2007, 00:02
by julesstoop
Well, this doesn't seem to be a bug, rather a lack of feature :)

Posted: 17.04.2007, 13:36
by mjoubert
Thanks Chris,

I'll check that in a couple of weeks.

Mathieu (spacebel)

Posted: 17.04.2007, 16:50
by chris
I checked in a fix just now. This is not a complete solution, but it does handle the case where the parent of the parent object is casting a shadow. The code traverses up the hierarchy all the way to the root, so it will work no matter how deep the object is. What is still not handled are objects that are neither siblings nor ancestors, i.e. cousins and aunts/uncles (to carry the family analogy too far . . .) I've created a bug in the SourceForge tracker for this problem and will address it in the future.

--Chris

Posted: 17.04.2007, 17:55
by Cham
Chris,

what do you mean by cousins/aunts/uncles etc ? (or is this supposed to be a joke ?) :?

With the new code correction, what should happen if a body is orbiting a moon located in the shadow of its planet, and the body has a large orbit (so it gets in the light) ? Or if the moon is on the light side while the body orbiting it is in the planet's shadow (case of a large orbit) ? Well, of course, this shouldn't be a problem for most spacecraft addons, but we never know... :?

Posted: 17.04.2007, 19:17
by chris
Cham wrote:Chris,

what do you mean by cousins/aunts/uncles etc ? (or is this supposed to be a joke ?) :?

With the new code correction, what should happen if a body is orbiting a moon located in the shadow of its planet, and the body has a large orbit (so it gets in the light) ? Or if the moon is on the light side while the body orbiting it is in the planet's shadow (case of a large orbit) ? Well, of course, this shouldn't be a problem for most spacecraft addons, but we never know... :?


Both of the cases that you mentioned will work as expected. What I meant by the talk of cousins can be best illustrated with an example object hierarchy. Suppose you have a satellite in orbit around Earth's moon. Prior to my change, the only object that could cast a shadow on the satellite was the Moon. The new code enables the Earth to also cast a shadow on the satellite.

Now, imagine the Earth had a second moon. This moon would not cast a shadow on the satellite. While this situation is somewhat unusual, it's still within the realm of possibility, e.g. Io casting a shadow on a Europa orbiter. Basically, I need to change the eclipse code to operate independently of the object hierarchy. This is a bigger change than I wanted to make right now, so I'm putting off the complete fix until post-1.5.0.

--Chris

Posted: 17.04.2007, 20:14
by Cham
Thanks Chris, this is all very clear now.

The second case (second moon casting a shadow on the first moon's orbiter) is also an interesting situation, but I agree that this could be added later (post 1.5.0).