Moon orbits do not appear unless planet selected
Posted: 01.05.2004, 06:29
Windows version (1.3.1+, not sure about earlier versions).
Want to display only moon orbits but it seems that I cannot do this, without first selecting the parent body of the moon. Then, the parent body orbit is displayed, even though this option (planet orbits) is NOT checked, and also appears as red, since it is the selected object <sigh>.
With Moon Orbits selected, Planet Orbits NOT selected, and Show Orbits active, NO moon orbits are displayed.
Here is the relevant (I think) code from render.cpp. If someone could direct me to a fix, I would be happy to apply it...
Thanks a bunch!
Want to display only moon orbits but it seems that I cannot do this, without first selecting the parent body of the moon. Then, the parent body orbit is displayed, even though this option (planet orbits) is NOT checked, and also appears as red, since it is the selected object <sigh>.
With Moon Orbits selected, Planet Orbits NOT selected, and Show Orbits active, NO moon orbits are displayed.
Here is the relevant (I think) code from render.cpp. If someone could direct me to a fix, I would be happy to apply it...
Code: Select all
void Renderer::renderOrbits(PlanetarySystem* planets,
const Selection& sel,
double t,
const Point3d& observerPos,
const Point3d& center)
{
if (planets == NULL)
return;
double distance = (center - observerPos).length();
// At the solar system scale, we'll handle all calculations in AU
// Not used anymore
// Vec3d opos = (center - Point3d(0.0, 0.0, 0.0)) * astro::kilometersToAU(1.0);
int nBodies = planets->getSystemSize();
for (int i = 0; i < nBodies; i++)
{
Body* body = planets->getBody(i);
// Only show orbits for major bodies or selected objects
if ( (body->getClassification() & orbitMask) != 0 || body == sel.body() )
{
if (body == sel.body())
{
// Highlight the orbit of the selected object in red
glColor4f(1, 0, 0, 1);
}
else
{
switch (body->getClassification())
{
case Body::Moon:
glColor4f(0.0f, 0.2f, 0.5f, 1.0f);
break;
case Body::Asteroid:
glColor4f(0.35f, 0.2f, 0.0f, 1.0f);
break;
case Body::Comet:
glColor4f(0.0f, 0.5f, 0.5f, 1.0f);
break;
case Body::Spacecraft:
glColor4f(0.4f, 0.4f, 0.4f, 1.0f);
break;
case Body::Planet:
default:
glColor4f(0.0f, 0.4f, 1.0f, 1.0f);
break;
}
}
... other orbit drawing code ...
Thanks a bunch!