I've created a new patch that adds some new objects attributes,
similar to the Clickable patch:
http://www.celestiaproject.net/~claurel/celest ... s/objflags
This folder contains a patch file and two test scripts.
The new flags are:
visible - true if the object is visible, false otherwise
visibleAsPoint - true if the object should be visible as a starlike
point when it occupies less than a pixel on screen
orbitColorOverridden - true if a custom orbit color should be used for
the object
The first attribute is accessible via a setvisible script method. The
usage is straightforward. Here's a sample script that toggles the
visibility of Earth:
Code: Select all
earth = celestia:find("Sol/Earth")
earth:setvisible(not earth:visible())
There is no script method for visibleAsPoint (though it's easy to add
if it's necessary for some reason.) This attribute is set
automatically based on the object class. Objects of the new classes
component and surfacefeature (and the existing class invisible) have
this attribute set to false; for all other objects it is true.
Finally, orbitColorOverridden exists so that the default object class
orbit colors may be overridden with custom orbit colors. This is
useful in educational and trajectory visualization applications of
Celestia. In the current version of the patch, the orbit color may
only be set via script, as in this example:
Code: Select all
obj = celestia:find("Sol/Earth")
obj:setorbitcoloroverridden(true)
obj:setorbitcolor(r, g, b)
It may be useful if orbit colors could also be set in ssc files.
--Chris