Scripts and Barycenters
Posted: 22.11.2005, 18:49
It would seem that Barycenters do not follow the general hierarchy that other objects use in Celestia - a star orbiting a Barycenter is not a 'child' of the Barycenter. Whereas a planet orbiting a star is a 'child' of the star, and a moon orbiting a planet is a 'child' of the planet.
Aside from the general inconsistency of implementation, this causes problems for celx script-writers since it seems there's no obvious way to use barycenters in a script. For example, I wanted to write a script where the user selected a barycenter and then activated the script that would take the observer to a distance from the barycenter where the stars orbiting it fit exactly inside the field of view. But without the ability to find the children of the barycenter, this (apparently) becomes impossible.
Is there any way to get around this problem or correct this implementation inconsistency? Probably the easiest way would be to add something to Celestia's code that looked for "OrbitBarycenter" in the stc and if it found it assigned that Barycenter as the parent of the star? Otherwise the only way to correct this would be to change how barycenters are declared which would be somewhat problematic I'd guess.
Aside from the general inconsistency of implementation, this causes problems for celx script-writers since it seems there's no obvious way to use barycenters in a script. For example, I wanted to write a script where the user selected a barycenter and then activated the script that would take the observer to a distance from the barycenter where the stars orbiting it fit exactly inside the field of view. But without the ability to find the children of the barycenter, this (apparently) becomes impossible.
Is there any way to get around this problem or correct this implementation inconsistency? Probably the easiest way would be to add something to Celestia's code that looked for "OrbitBarycenter" in the stc and if it found it assigned that Barycenter as the parent of the star? Otherwise the only way to correct this would be to change how barycenters are declared which would be somewhat problematic I'd guess.