Planet.cpp   Planet.cpp 
skipping to change at line 654 skipping to change at line 654
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
drawSphere(sPainter, screenSz); drawSphere(sPainter, screenSz);
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
rings->draw(sPainter,mat,screenSz); rings->draw(sPainter,mat,screenSz);
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
core->setClippingPlanes(n,f); // Restore old clippi ng planes core->setClippingPlanes(n,f); // Restore old clippi ng planes
} }
else else
{ {
SolarSystem* ssm = (SolarSystem*)GETSTELMODULE("Sola rSystem"); SolarSystem* ssm = GETSTELMODULE(SolarSystem);
if (this==ssm->getMoon() && nav->getHomePlanet()==ss m->getEarth() && ssm->nearLunarEclipse()) if (this==ssm->getMoon() && nav->getHomePlanet()==ss m->getEarth() && ssm->nearLunarEclipse())
{ {
// Draw earth shadow over moon using stencil buffer if appropriate // Draw earth shadow over moon using stencil buffer if appropriate
// This effect curently only looks right fro m earth viewpoint // This effect curently only looks right fro m earth viewpoint
// TODO: moon magnitude label during eclipse isn't accurate... // TODO: moon magnitude label during eclipse isn't accurate...
glClearStencil(0x0); glClearStencil(0x0);
glClear(GL_STENCIL_BUFFER_BIT); glClear(GL_STENCIL_BUFFER_BIT);
glStencilFunc(GL_ALWAYS, 0x1, 0x1); glStencilFunc(GL_ALWAYS, 0x1, 0x1);
glStencilOp(GL_ZERO, GL_REPLACE, GL_REPLACE) ; glStencilOp(GL_ZERO, GL_REPLACE, GL_REPLACE) ;
glEnable(GL_STENCIL_TEST); glEnable(GL_STENCIL_TEST);
skipping to change at line 721 skipping to change at line 721
// perhaps some openGl strangeness, or confusing sin/cos. // perhaps some openGl strangeness, or confusing sin/cos.
painter->sSphere(radius*sphereScale, oneMinusOblateness, nb_facet, n b_facet); painter->sSphere(radius*sphereScale, oneMinusOblateness, nb_facet, n b_facet);
glShadeModel(GL_FLAT); glShadeModel(GL_FLAT);
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
} }
// draws earth shadow overlapping the moon using stencil buffer // draws earth shadow overlapping the moon using stencil buffer
// umbra and penumbra are sized separately for accuracy // umbra and penumbra are sized separately for accuracy
void Planet::drawEarthShadow(StelCore* core) void Planet::drawEarthShadow(StelCore* core)
{ {
SolarSystem* ssm = (SolarSystem*)GETSTELMODULE("SolarSystem"); SolarSystem* ssm = GETSTELMODULE(SolarSystem);
Vec3d e = ssm->getEarth()->getEclipticPos(); Vec3d e = ssm->getEarth()->getEclipticPos();
Vec3d m = ssm->getMoon()->getEclipticPos(); // relative to earth Vec3d m = ssm->getMoon()->getEclipticPos(); // relative to earth
Vec3d mh = ssm->getMoon()->getHeliocentricEclipticPos(); // relativ e to sun Vec3d mh = ssm->getMoon()->getHeliocentricEclipticPos(); // relativ e to sun
float mscale = ssm->getMoon()->getSphereScale(); float mscale = ssm->getMoon()->getSphereScale();
// shadow location at earth + moon distance along earth vector from sun // shadow location at earth + moon distance along earth vector from sun
Vec3d en = e; Vec3d en = e;
en.normalize(); en.normalize();
Vec3d shadow = en * (e.length() + m.length()); Vec3d shadow = en * (e.length() + m.length());
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/