Planet.cpp   Planet.cpp 
skipping to change at line 59 skipping to change at line 59
StelTextureSP Planet::hintCircleTex; StelTextureSP Planet::hintCircleTex;
StelTextureSP Planet::texEarthShadow; StelTextureSP Planet::texEarthShadow;
QOpenGLShaderProgram* Planet::planetShaderProgram=NULL; QOpenGLShaderProgram* Planet::planetShaderProgram=NULL;
Planet::PlanetShaderVars Planet::planetShaderVars; Planet::PlanetShaderVars Planet::planetShaderVars;
QOpenGLShaderProgram* Planet::ringPlanetShaderProgram=NULL; QOpenGLShaderProgram* Planet::ringPlanetShaderProgram=NULL;
Planet::RingPlanetShaderVars Planet::ringPlanetShaderVars; Planet::RingPlanetShaderVars Planet::ringPlanetShaderVars;
QOpenGLShaderProgram* Planet::moonShaderProgram=NULL; QOpenGLShaderProgram* Planet::moonShaderProgram=NULL;
Planet::MoonShaderVars Planet::moonShaderVars; Planet::MoonShaderVars Planet::moonShaderVars;
QMap<Planet::PlanetType, QString> Planet::pTypeMap;
QMap<Planet::ApparentMagnitudeAlgorithm, QString> Planet::vMagAlgorithmMap;
Planet::Planet(const QString& englishName, Planet::Planet(const QString& englishName,
int flagLighting, int flagLighting,
double radius, double radius,
double oblateness, double oblateness,
Vec3f color, Vec3f color,
float albedo, float albedo,
const QString& atexMapName, const QString& atexMapName,
const QString& anormalMapName, const QString& anormalMapName,
posFuncType coordFunc, posFuncType coordFunc,
void* auserDataPtr, void* auserDataPtr,
skipping to change at line 104 skipping to change at line 107
normalMapName = anormalMapName; normalMapName = anormalMapName;
lastOrbitJD =0; lastOrbitJD =0;
deltaJD = StelCore::JD_SECOND; deltaJD = StelCore::JD_SECOND;
orbitCached = 0; orbitCached = 0;
closeOrbit = acloseOrbit; closeOrbit = acloseOrbit;
deltaOrbitJD = 0; deltaOrbitJD = 0;
distance = 0; distance = 0;
// Initialize pType with the key found in pTypeMap, or mark planet t ype as undefined. // Initialize pType with the key found in pTypeMap, or mark planet t ype as undefined.
// The latter condition should obviously never happen. // The latter condition should obviously never happen.
pType=pTypeMap.key(pTypeStr, Planet::isUNDEFINED); pType = pTypeMap.key(pTypeStr, Planet::isUNDEFINED);
vMagAlgorithm = Planet::UndefinedAlgorithm;
eclipticPos=Vec3d(0.,0.,0.); eclipticPos = Vec3d(0.,0.,0.);
rotLocalToParent = Mat4d::identity(); rotLocalToParent = Mat4d::identity();
texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT)); texMap = StelApp::getInstance().getTextureManager().createTextureThr ead(StelFileMgr::getInstallationDir()+"/textures/"+texMapName, StelTexture: :StelTextureParams(true, GL_LINEAR, GL_REPEAT));
normalMap = StelApp::getInstance().getTextureManager().createTexture Thread(StelFileMgr::getInstallationDir()+"/textures/"+normalMapName, StelTe xture::StelTextureParams(true, GL_LINEAR, GL_REPEAT)); normalMap = StelApp::getInstance().getTextureManager().createTexture Thread(StelFileMgr::getInstallationDir()+"/textures/"+normalMapName, StelTe xture::StelTextureParams(true, GL_LINEAR, GL_REPEAT));
nameI18 = englishName; nameI18 = englishName;
nativeName = "";
if (englishName!="Pluto") if (englishName!="Pluto")
{ {
deltaJD = 0.001*StelCore::JD_SECOND; deltaJD = 0.001*StelCore::JD_SECOND;
} }
flagLabels = true; flagLabels = true;
flagNativeName = true;
flagTranslatedName = true;
} }
QMap<Planet::PlanetType, QString> Planet::pTypeMap;
// called in SolarSystem::init() before first planet is created. Loads pTyp eMap. // called in SolarSystem::init() before first planet is created. Loads pTyp eMap.
void Planet::init() void Planet::init()
{ {
if (pTypeMap.count() > 0 ) if (pTypeMap.count() > 0 )
{ {
// This should never happen. But it's uncritical. // This should never happen. But it's uncritical.
qDebug() << "Planet::init(): Non-empty static map. This is a programming error, but we can fix that."; qDebug() << "Planet::init(): Non-empty static map. This is a programming error, but we can fix that.";
pTypeMap.clear(); pTypeMap.clear();
} }
pTypeMap.insert(Planet::isStar, "star"); pTypeMap.insert(Planet::isStar, "star");
pTypeMap.insert(Planet::isPlanet, "planet"); pTypeMap.insert(Planet::isPlanet, "planet");
pTypeMap.insert(Planet::isMoon, "moon"); pTypeMap.insert(Planet::isMoon, "moon");
pTypeMap.insert(Planet::isAsteroid, "asteroid"); pTypeMap.insert(Planet::isAsteroid, "asteroid");
pTypeMap.insert(Planet::isPlutoid, "plutoid"); pTypeMap.insert(Planet::isPlutino, "plutino");
pTypeMap.insert(Planet::isComet, "comet"); pTypeMap.insert(Planet::isComet, "comet");
pTypeMap.insert(Planet::isUNDEFINED, "UNDEFINED"); // something must pTypeMap.insert(Planet::isDwarfPlanet, "dwarf planet");
be broken before we ever see this! pTypeMap.insert(Planet::isCubewano, "cubewano");
pTypeMap.insert(Planet::isSDO, "scattered disc object");
pTypeMap.insert(Planet::isOCO, "Oort cloud object");
pTypeMap.insert(Planet::isUNDEFINED, "UNDEFINED"); // something m
ust be broken before we ever see this!
if (vMagAlgorithmMap.count() > 0)
{
qDebug() << "Planet::init(): Non-empty static map. This is a
programming error, but we can fix that.";
vMagAlgorithmMap.clear();
}
vMagAlgorithmMap.insert(Planet::Planesas, "planesas");
vMagAlgorithmMap.insert(Planet::Mueller, "mueller");
vMagAlgorithmMap.insert(Planet::Harris, "harris");
vMagAlgorithmMap.insert(Planet::UndefinedAlgorithm, "");
} }
Planet::~Planet() Planet::~Planet()
{ {
if (rings) if (rings)
delete rings; delete rings;
} }
void Planet::translateName(const StelTranslator& trans) void Planet::translateName(const StelTranslator& trans)
{ {
nameI18 = trans.qtranslate(englishName); if (!nativeName.isEmpty() && getFlagNativeName())
{
if (getFlagTranslatedName())
nameI18 = trans.qtranslate(nativeName);
else
nameI18 = nativeName;
}
else
{
if (getFlagTranslatedName())
nameI18 = trans.qtranslate(englishName);
else
nameI18 = englishName;
}
}
QString Planet::getEnglishName() const
{
return englishName;
}
QString Planet::getNameI18n() const
{
return nameI18;
} }
// Return the information string "ready to print" :) // Return the information string "ready to print" :)
QString Planet::getInfoString(const StelCore* core, const InfoStringGroup& flags) const QString Planet::getInfoString(const StelCore* core, const InfoStringGroup& flags) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
if (flags&Name) if (flags&Name)
{ {
oss << "<h2>" << q_(englishName); // UI translation can dif fer from sky translation oss << "<h2>" << getNameI18n(); // UI translation can diffe r from sky translation
oss.setRealNumberNotation(QTextStream::FixedNotation); oss.setRealNumberNotation(QTextStream::FixedNotation);
oss.setRealNumberPrecision(1); oss.setRealNumberPrecision(1);
if (sphereScale != 1.f) if (sphereScale != 1.f)
oss << QString::fromUtf8(" (\xC3\x97") << sphereScal e << ")"; oss << QString::fromUtf8(" (\xC3\x97") << sphereScal e << ")";
oss << "</h2>"; oss << "</h2>";
} }
if (flags&ObjectType) if (flags&ObjectType && getPlanetType()!=isUNDEFINED)
{ {
oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />"; oss << q_("Type: <b>%1</b>").arg(q_(getPlanetTypeString())) << "<br />";
} }
if (flags&Magnitude) if (flags&Magnitude)
{ {
if (core->getSkyDrawer()->getFlagHasAtmosphere()) if (core->getSkyDrawer()->getFlagHasAtmosphere())
oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b> )").arg(QString::number(getVMagnitude(core), 'f', 2), oss << q_("Magnitude: <b>%1</b> (extincted to: <b>%2</b> )").arg(QString::number(getVMagnitude(core), 'f', 2),
QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br >"; QString::number(getVMagnitudeWithExtinction(core), 'f', 2)) << "<br >";
else else
skipping to change at line 240 skipping to change at line 282
} }
double siderealPeriod = getSiderealPeriod(); double siderealPeriod = getSiderealPeriod();
double siderealDay = getSiderealDay(); double siderealDay = getSiderealDay();
if (flags&Extra) if (flags&Extra)
{ {
if (siderealPeriod>0) if (siderealPeriod>0)
{ {
// TRANSLATORS: Sidereal (orbital) period for solar system bodies in days and in Julian years (symbol: a) // TRANSLATORS: Sidereal (orbital) period for solar system bodies in days and in Julian years (symbol: a)
oss << q_("Sidereal period: %1 days (%2 a)").arg(QSt ring::number(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/36 5.25, 'f', 3)) << "<br>"; oss << q_("Sidereal period: %1 days (%2 a)").arg(QSt ring::number(siderealPeriod, 'f', 2)).arg(QString::number(siderealPeriod/36 5.25, 'f', 3)) << "<br>";
if (std::abs(siderealDay)>0) if (qAbs(siderealDay)>0)
{
oss << q_("Sidereal day: %1").arg(StelUtils:
:hoursToHmsStr(qAbs(siderealDay*24))) << "<br>";
oss << q_("Mean solar day: %1").arg(StelUtil
s::hoursToHmsStr(qAbs(getMeanSolarDay()*24))) << "<br>";
}
else if (re.period==0.)
{ {
oss << q_("Sidereal day: %1").arg(StelUtils: oss << q_("The period of rotation is chaotic
:hoursToHmsStr(std::abs(siderealDay*24))) << "<br>"; ") << "<br>";
oss << q_("Mean solar day: %1").arg(StelUtil
s::hoursToHmsStr(std::abs(getMeanSolarDay()*24))) << "<br>";
} }
} }
if (englishName.compare("Sun")!=0) if (englishName.compare("Sun")!=0)
{ {
const Vec3d& observerHelioPos = core->getObserverHel iocentricEclipticPos(); const Vec3d& observerHelioPos = core->getObserverHel iocentricEclipticPos();
oss << QString(q_("Phase Angle: %1")).arg(StelUtils: :radToDmsStr(getPhaseAngle(observerHelioPos))) << "<br>"; oss << QString(q_("Phase Angle: %1")).arg(StelUtils: :radToDmsStr(getPhaseAngle(observerHelioPos))) << "<br>";
oss << QString(q_("Elongation: %1")).arg(StelUtils:: radToDmsStr(getElongation(observerHelioPos))) << "<br>"; oss << QString(q_("Elongation: %1")).arg(StelUtils:: radToDmsStr(getElongation(observerHelioPos))) << "<br>";
oss << QString(q_("Phase: %1")).arg(getPhase(observe rHelioPos), 0, 'f', 2) << "<br>"; oss << QString(q_("Phase: %1")).arg(getPhase(observe rHelioPos), 0, 'f', 2) << "<br>";
oss << QString(q_("Illuminated: %1%")).arg(getPhase( observerHelioPos) * 100, 0, 'f', 1) << "<br>"; oss << QString(q_("Illuminated: %1%")).arg(getPhase( observerHelioPos) * 100, 0, 'f', 1) << "<br>";
} }
skipping to change at line 267 skipping to change at line 313
return str; return str;
} }
//! Get sky label (sky translation) //! Get sky label (sky translation)
QString Planet::getSkyLabel(const StelCore*) const QString Planet::getSkyLabel(const StelCore*) const
{ {
QString str; QString str;
QTextStream oss(&str); QTextStream oss(&str);
oss.setRealNumberPrecision(2); oss.setRealNumberPrecision(2);
oss << nameI18; oss << getNameI18n();
if (sphereScale != 1.f) if (sphereScale != 1.f)
{ {
oss << QString::fromUtf8(" (\xC3\x97") << sphereScale << ")" ; oss << QString::fromUtf8(" (\xC3\x97") << sphereScale << ")" ;
} }
return str; return str;
} }
float Planet::getSelectPriority(const StelCore* core) const float Planet::getSelectPriority(const StelCore* core) const
{ {
skipping to change at line 399 skipping to change at line 445
res.append(planet.data()); res.append(planet.data());
} }
if (willCastShadow(this, parent.data())) if (willCastShadow(this, parent.data()))
res.append(parent.data()); res.append(parent.data());
return res; return res;
} }
void Planet::computePosition(const double dateJD) void Planet::computePosition(const double dateJD)
{ {
// Make sure the parent position is computed for the dateJD, otherwi
se
// getHeliocentricPos() would return incorect values.
if (parent)
parent->computePositionWithoutOrbits(dateJD);
if (orbitFader.getInterstate()>0.000001 && deltaOrbitJD > 0 && (fabs (lastOrbitJD-dateJD)>deltaOrbitJD || !orbitCached)) if (orbitFader.getInterstate()>0.000001 && deltaOrbitJD > 0 && (fabs (lastOrbitJD-dateJD)>deltaOrbitJD || !orbitCached))
{ {
double calc_date; double calc_date;
// int delta_points = (int)(0.5 + (date - lastOrbitJD)/date_ increment); // int delta_points = (int)(0.5 + (date - lastOrbitJD)/date_ increment);
int delta_points; int delta_points;
if( dateJD > lastOrbitJD ) if( dateJD > lastOrbitJD )
{ {
delta_points = (int)(0.5 + (dateJD - lastOrbitJD)/de ltaOrbitJD); delta_points = (int)(0.5 + (dateJD - lastOrbitJD)/de ltaOrbitJD);
} }
else else
{ {
delta_points = (int)(-0.5 + (dateJD - lastOrbitJD)/d eltaOrbitJD); delta_points = (int)(-0.5 + (dateJD - lastOrbitJD)/d eltaOrbitJD);
} }
double new_date = lastOrbitJD + delta_points*deltaOrbitJD; double new_date = lastOrbitJD + delta_points*deltaOrbitJD;
// qDebug( "Updating orbit coordinates for %s (delta %f) (%d points)\n", name.c_str(), deltaOrbitJD, delta_points); // qDebug( "Updating orbit coordinates for %s (delta %f) (%d points)\n", getEnglishName().toUtf8().data(), deltaOrbitJD, delta_points);
if( delta_points > 0 && delta_points < ORBIT_SEGMENTS && orb itCached) if( delta_points > 0 && delta_points < ORBIT_SEGMENTS && orb itCached)
{ {
for( int d=0; d<ORBIT_SEGMENTS; d++ ) for( int d=0; d<ORBIT_SEGMENTS; d++ )
{ {
if(d + delta_points >= ORBIT_SEGMENTS ) if(d + delta_points >= ORBIT_SEGMENTS )
{ {
// calculate new points // calculate new points
calc_date = new_date + (d-ORBIT_SEGM ENTS/2)*deltaOrbitJD; calc_date = new_date + (d-ORBIT_SEGM ENTS/2)*deltaOrbitJD;
skipping to change at line 567 skipping to change at line 617
// Compute the z rotation to use from equatorial to geographic coordinates // Compute the z rotation to use from equatorial to geographic coordinates
double Planet::getSiderealTime(double jd) const double Planet::getSiderealTime(double jd) const
{ {
if (englishName=="Earth") if (englishName=="Earth")
{ {
return get_apparent_sidereal_time(jd); return get_apparent_sidereal_time(jd);
} }
double t = jd - re.epoch; double t = jd - re.epoch;
double rotations = t / (double) re.period; // oops... avoid division by zero (typical case for moons with chaot
ic period of rotation)
double rotations = 1.f; // NOTE: Maybe 1e-3 will be better?
if (re.period!=0.) // OK, it's not a moon with chaotic period of rot
ation :)
{
rotations = t / (double) re.period;
}
double wholeRotations = floor(rotations); double wholeRotations = floor(rotations);
double remainder = rotations - wholeRotations; double remainder = rotations - wholeRotations;
// TODO: This block need rewrite // TODO: This block need rewrite
if (englishName=="Jupiter") if (englishName=="Jupiter")
{ {
// use semi-empirical coefficient for GRS drift // use semi-empirical coefficient for GRS drift
return remainder * 360. + re.offset - 0.2483 * std::abs(jd - 2456172); return remainder * 360. + re.offset - 0.2483 * qAbs(jd - 245 6172);
} }
else else
return remainder * 360. + re.offset; return remainder * 360. + re.offset;
} }
double Planet::getMeanSolarDay() const double Planet::getMeanSolarDay() const
{ {
double msd = 0.; double msd = 0.;
if (englishName=="Sun") if (englishName=="Sun")
return msd; return msd;
double sday = getSiderealDay(); double sday = getSiderealDay();
double coeff = std::abs(sday/getSiderealPeriod()); double coeff = qAbs(sday/getSiderealPeriod());
float sign = 1; float sign = 1;
// planets with retrograde rotation // planets with retrograde rotation
if (englishName=="Venus" || englishName=="Uranus" || englishName=="P luto") if (englishName=="Venus" || englishName=="Uranus" || englishName=="P luto")
sign = -1; sign = -1;
if (pType==Planet::isMoon) if (pType==Planet::isMoon)
{ {
// duration of mean solar day on moon are same as synodic mo nth on this moon // duration of mean solar day on moon are same as synodic mo nth on this moon
double a = parent->getSiderealPeriod()/sday; double a = parent->getSiderealPeriod()/sday;
msd = sday*(a/(a-1)); msd = sday*(a/(a-1));
skipping to change at line 666 skipping to change at line 721
p = p->parent; p = p->parent;
} }
} }
} }
// Compute the distance to the given position in heliocentric coordinate (i n AU) // Compute the distance to the given position in heliocentric coordinate (i n AU)
// This is called by SolarSystem::draw() // This is called by SolarSystem::draw()
double Planet::computeDistance(const Vec3d& obsHelioPos) double Planet::computeDistance(const Vec3d& obsHelioPos)
{ {
distance = (obsHelioPos-getHeliocentricEclipticPos()).length(); distance = (obsHelioPos-getHeliocentricEclipticPos()).length();
// GZ: improve fps by juggling updates for asteroids. They must be f ast if close to observer, but can be slow if further away. // improve fps by juggling updates for asteroids. They must be fast if close to observer, but can be slow if further away.
if (pType == Planet::isAsteroid) if (pType == Planet::isAsteroid)
deltaJD=distance*StelCore::JD_SECOND; deltaJD=distance*StelCore::JD_SECOND;
return distance; return distance;
} }
// Get the phase angle (radians) for an observer at pos obsPos in heliocent ric coordinates (dist in AU) // Get the phase angle (radians) for an observer at pos obsPos in heliocent ric coordinates (dist in AU)
double Planet::getPhaseAngle(const Vec3d& obsPos) const double Planet::getPhaseAngle(const Vec3d& obsPos) const
{ {
const double observerRq = obsPos.lengthSquared(); const double observerRq = obsPos.lengthSquared();
const Vec3d& planetHelioPos = getHeliocentricEclipticPos(); const Vec3d& planetHelioPos = getHeliocentricEclipticPos();
skipping to change at line 690 skipping to change at line 745
} }
// Get the planet phase for an observer at pos obsPos in heliocentric coord inates (in AU) // Get the planet phase for an observer at pos obsPos in heliocentric coord inates (in AU)
float Planet::getPhase(const Vec3d& obsPos) const float Planet::getPhase(const Vec3d& obsPos) const
{ {
const double observerRq = obsPos.lengthSquared(); const double observerRq = obsPos.lengthSquared();
const Vec3d& planetHelioPos = getHeliocentricEclipticPos(); const Vec3d& planetHelioPos = getHeliocentricEclipticPos();
const double planetRq = planetHelioPos.lengthSquared(); const double planetRq = planetHelioPos.lengthSquared();
const double observerPlanetRq = (obsPos - planetHelioPos).lengthSqua red(); const double observerPlanetRq = (obsPos - planetHelioPos).lengthSqua red();
const double cos_chi = (observerPlanetRq + planetRq - observerRq)/(2 .0*sqrt(observerPlanetRq*planetRq)); const double cos_chi = (observerPlanetRq + planetRq - observerRq)/(2 .0*sqrt(observerPlanetRq*planetRq));
return 0.5f * std::abs(1.f + cos_chi); return 0.5f * qAbs(1.f + cos_chi);
} }
// Get the elongation angle (radians) for an observer at pos obsPos in heli ocentric coordinates (dist in AU) // Get the elongation angle (radians) for an observer at pos obsPos in heli ocentric coordinates (dist in AU)
double Planet::getElongation(const Vec3d& obsPos) const double Planet::getElongation(const Vec3d& obsPos) const
{ {
const double observerRq = obsPos.lengthSquared(); const double observerRq = obsPos.lengthSquared();
const Vec3d& planetHelioPos = getHeliocentricEclipticPos(); const Vec3d& planetHelioPos = getHeliocentricEclipticPos();
const double planetRq = planetHelioPos.lengthSquared(); const double planetRq = planetHelioPos.lengthSquared();
const double observerPlanetRq = (obsPos - planetHelioPos).lengthSqua red(); const double observerPlanetRq = (obsPos - planetHelioPos).lengthSqua red();
return std::acos((observerPlanetRq + observerRq - planetRq)/(2.0*sq rt(observerPlanetRq*observerRq))); return std::acos((observerPlanetRq + observerRq - planetRq)/(2.0*sq rt(observerPlanetRq*observerRq)));
skipping to change at line 742 skipping to change at line 797
const double sun_radius = parent->parent->radius; const double sun_radius = parent->parent->radius;
const double sun_minus_parent_radius = sun_radius - parent->radius; const double sun_minus_parent_radius = sun_radius - parent->radius;
const double quot = pos_times_parent_pos/parent_Rq; const double quot = pos_times_parent_pos/parent_Rq;
// Compute d = distance from satellite center to bor der of inner shadow. // Compute d = distance from satellite center to bor der of inner shadow.
// d>0 means inside the shadow cone. // d>0 means inside the shadow cone.
double d = sun_radius - sun_minus_parent_radius*quot - std::sqrt((1.-sun_minus_parent_radius/sqrt(parent_Rq)) * (planetRq-pos_t imes_parent_pos*quot)); double d = sun_radius - sun_minus_parent_radius*quot - std::sqrt((1.-sun_minus_parent_radius/sqrt(parent_Rq)) * (planetRq-pos_t imes_parent_pos*quot));
if (d>=radius) if (d>=radius)
{ {
// The satellite is totally inside the inner shadow. // The satellite is totally inside the inner shadow.
shadowFactor = 1e-9; if (englishName=="Moon")
{
// Fit a more realistic magnitude fo
r the Moon case.
// I used some empirical data for fi
tting. --AW
// TODO: This factor should be impro
ved!
shadowFactor = 2.718e-5;
}
else
shadowFactor = 1e-9;
} }
else if (d>-radius) else if (d>-radius)
{ {
// The satellite is partly inside the inner shadow, // The satellite is partly inside the inner shadow,
// compute a fantasy value for the magnitude : // compute a fantasy value for the magnitude :
d /= radius; d /= radius;
shadowFactor = (0.5 - (std::asin(d)+d*std::s qrt(1.0-d*d))/M_PI); shadowFactor = (0.5 - (std::asin(d)+d*std::s qrt(1.0-d*d))/M_PI);
} }
} }
} }
// Use empirical formulae for main planets when seen from earth // Use empirical formulae for main planets when seen from earth
if (core->getCurrentLocation().planetName=="Earth") if (core->getCurrentLocation().planetName=="Earth")
{ {
const double phaseDeg=phase*180./M_PI; const double phaseDeg=phase*180./M_PI;
const double d = 5. * log10(sqrt(observerPlanetRq*planetRq)) ; const double d = 5. * log10(sqrt(observerPlanetRq*planetRq)) ;
//double f1 = phaseDeg/100.;
/*
// Algorithm provided by Pere Planesas (Observatorio Astrono
mico Nacional)
if (englishName=="Mercury")
{
if ( phaseDeg > 150. ) f1 = 1.5;
return -0.36 + d + 3.8*f1 - 2.73*f1*f1 + 2*f1*f1*f1;
}
if (englishName=="Venus")
return -4.29 + d + 0.09*f1 + 2.39*f1*f1 - 0.65*f1*f1
*f1;
if (englishName=="Mars")
return -1.52 + d + 0.016*phaseDeg;
if (englishName=="Jupiter")
return -9.25 + d + 0.005*phaseDeg;
if (englishName=="Saturn")
{
// TODO re-add rings computation
// double rings = -2.6*sinx + 1.25*sinx*sinx;
return -8.88 + d + 0.044*phaseDeg;// + rings;
}
if (englishName=="Uranus")
return -7.19 + d + 0.0028*phaseDeg;
if (englishName=="Neptune")
return -6.87 + d;
if (englishName=="Pluto")
return -1.01 + d + 0.041*phaseDeg;
*/
// GZ: I prefer the values given by Meeus, Astronomical Algo rithms (1992). // GZ: I prefer the values given by Meeus, Astronomical Algo rithms (1992).
// There are two solutions: // There are two solutions:
// (1) G. Mueller, based on visual observations 1877-91. [Ex pl.Suppl.1961] // (1) G. Mueller, based on visual observations 1877-91. [Ex pl.Suppl.1961]
// (2) Astronomical Almanac 1984 and later. These give V (in strumental) magnitudes. // (2) Astronomical Almanac 1984 and later. These give V (in strumental) magnitudes.
// The structure is almost identical, just the numbers are d ifferent! // The structure is almost identical, just the numbers are d ifferent!
// I activate (1) for now, because we want to simulate the e ye's impression. (Esp. Venus!) // I activate (1) for now, because we want to simulate the e ye's impression. (Esp. Venus!)
// (1) // AW: (2) activated by default
if (englishName=="Mercury")
{ switch (core->getCurrentPlanet()->getApparentMagnitudeAlgori
double ph50=phaseDeg-50.0; thm())
return 1.16 + d + 0.02838*ph50 + 0.0001023*ph50*ph50 {
; case Planesas:
} {
if (englishName=="Venus") // Algorithm provided by Pere Planesas (Obse
return -4.0 + d + 0.01322*phaseDeg + 0.0000004247*ph rvatorio Astronomico Nacional)
aseDeg*phaseDeg*phaseDeg; double f1 = phaseDeg/100.;
if (englishName=="Mars")
return -1.3 + d + 0.01486*phaseDeg; if (englishName=="Mercury")
if (englishName=="Jupiter") {
return -8.93 + d; if ( phaseDeg > 150. ) f1 = 1.5;
if (englishName=="Saturn") return -0.36 + d + 3.8*f1 - 2.73*f1*
{ f1 + 2*f1*f1*f1;
// add rings computation }
// GZ: implemented from Meeus, Astr.Alg.1992 if (englishName=="Venus")
const double jd=core->getJDay(); return -4.29 + d + 0.09*f1 + 2.39*f1
const double T=(jd-2451545.0)/36525.0; *f1 - 0.65*f1*f1*f1;
const double i=((0.000004*T-0.012998)*T+28.075216)*M if (englishName=="Mars")
_PI/180.0; return -1.52 + d + 0.016*phaseDeg;
const double Omega=((0.000412*T+1.394681)*T+169.5084 if (englishName=="Jupiter")
70)*M_PI/180.0; return -9.25 + d + 0.005*phaseDeg;
SolarSystem *ssystem=GETSTELMODULE(SolarSystem); if (englishName=="Saturn")
const Vec3d saturnEarth=getHeliocentricEclipticPos() {
- ssystem->getEarth()->getHeliocentricEclipticPos(); // add rings computation
double lambda=atan2(saturnEarth[1], saturnEarth[0]); // implemented from Meeus, Astr.Alg.
double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 1992
]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1])); const double jd=core->getJDay();
const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) const double T=(jd-2451545.0)/36525.
-cos(i)*sin(beta); 0;
double rings = -2.6*fabs(sinB) + 1.25*sinB*sinB; // const double i=((0.000004*T-0.012998
sinx=sinB, saturnicentric latitude of earth. longish, see Meeus. )*T+28.075216)*M_PI/180.0;
return -8.68 + d + 0.044*phaseDeg + rings; const double Omega=((0.000412*T+1.39
} 4681)*T+169.508470)*M_PI/180.0;
if (englishName=="Uranus") static SolarSystem *ssystem=GETSTELM
return -6.85 + d; ODULE(SolarSystem);
if (englishName=="Neptune") const Vec3d saturnEarth=getHeliocent
return -7.05 + d; ricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos();
if (englishName=="Pluto") double lambda=atan2(saturnEarth[1],
return -1.0 + d; saturnEarth[0]);
/* double beta=atan2(saturnEarth[2], sq
// (2) rt(saturnEarth[0]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1]));
if (englishName=="Mercury") const double sinx=sin(i)*cos(beta)*s
return 0.42 + d + .038*phaseDeg - 0.000273*phaseDeg* in(lambda-Omega)-cos(i)*sin(beta);
phaseDeg + 0.000002*phaseDeg*phaseDeg*phaseDeg; double rings = -2.6*sinx + 1.25*sinx
if (englishName=="Venus") *sinx;
return -4.40 + d + 0.0009*phaseDeg + 0.000239*phaseD return -8.88 + d + 0.044*phaseDeg +
eg*phaseDeg - 0.00000065*phaseDeg*phaseDeg*phaseDeg; rings;
if (englishName=="Mars") }
return -1.52 + d + 0.016*phaseDeg; if (englishName=="Uranus")
if (englishName=="Jupiter") return -7.19 + d + 0.0028*phaseDeg;
return -9.40 + d + 0.005*phaseDeg; if (englishName=="Neptune")
if (englishName=="Saturn") return -6.87 + d;
{ if (englishName=="Pluto")
// add rings computation return -1.01 + d + 0.041*phaseDeg;
// GZ: implemented from Meeus, Astr.Alg.1992
const double jd=core->getJDay(); break;
const double T=(jd-2451545.0)/36525.0; }
const double i=((0.000004*T-0.012998)*T+28.075216)*M case Mueller:
_PI/180.0; {
const double Omega=((0.000412*T+1.394681)*T+169.5084 // (1)
70)*M_PI/180.0; if (englishName=="Mercury")
static SolarSystem *ssystem=GETSTELMODULE(SolarSyste {
m); double ph50=phaseDeg-50.0;
const Vec3d saturnEarth=getHeliocentricEclipticPos() return 1.16 + d + 0.02838*ph50 + 0.0
- ssystem->getEarth()->getHeliocentricEclipticPos(); 001023*ph50*ph50;
double lambda=atan2(saturnEarth[1], saturnEarth[0]); }
double beta=atan2(saturnEarth[2], sqrt(saturnEarth[0 if (englishName=="Venus")
]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1])); return -4.0 + d + 0.01322*phaseDeg +
const double sinB=sin(i)*cos(beta)*sin(lambda-Omega) 0.0000004247*phaseDeg*phaseDeg*phaseDeg;
-cos(i)*sin(beta); if (englishName=="Mars")
double rings = -2.6*fabs(sinB) + 1.25*sinB*sinB; // return -1.3 + d + 0.01486*phaseDeg;
sinx=sinB, saturnicentric latitude of earth. longish, see Meeus. if (englishName=="Jupiter")
return -8.88 + d + 0.044*phaseDeg + rings; return -8.93 + d;
} if (englishName=="Saturn")
if (englishName=="Uranus") {
return -7.19f + d; // add rings computation
if (englishName=="Neptune") // implemented from Meeus, Astr.Alg.
return -6.87f + d; 1992
if (englishName=="Pluto") const double jd=core->getJDay();
return -1.00f + d; const double T=(jd-2451545.0)/36525.
*/ 0;
// TODO: decide which set of formulae is best? const double i=((0.000004*T-0.012998
)*T+28.075216)*M_PI/180.0;
const double Omega=((0.000412*T+1.39
4681)*T+169.508470)*M_PI/180.0;
SolarSystem *ssystem=GETSTELMODULE(S
olarSystem);
const Vec3d saturnEarth=getHeliocent
ricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos();
double lambda=atan2(saturnEarth[1],
saturnEarth[0]);
double beta=atan2(saturnEarth[2], sq
rt(saturnEarth[0]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1]));
const double sinB=sin(i)*cos(beta)*s
in(lambda-Omega)-cos(i)*sin(beta);
double rings = -2.6*fabs(sinB) + 1.2
5*sinB*sinB; // sinx=sinB, saturnicentric latitude of earth. longish, see M
eeus.
return -8.68 + d + 0.044*phaseDeg +
rings;
}
if (englishName=="Uranus")
return -6.85 + d;
if (englishName=="Neptune")
return -7.05 + d;
if (englishName=="Pluto")
return -1.0 + d;
break;
}
case Harris:
case UndefinedAlgorithm: // activated by defa
ult
{
// (2)
if (englishName=="Mercury")
return 0.42 + d + .038*phaseDeg - 0.
000273*phaseDeg*phaseDeg + 0.000002*phaseDeg*phaseDeg*phaseDeg;
if (englishName=="Venus")
return -4.40 + d + 0.0009*phaseDeg +
0.000239*phaseDeg*phaseDeg - 0.00000065*phaseDeg*phaseDeg*phaseDeg;
if (englishName=="Mars")
return -1.52 + d + 0.016*phaseDeg;
if (englishName=="Jupiter")
return -9.40 + d + 0.005*phaseDeg;
if (englishName=="Saturn")
{
// add rings computation
// implemented from Meeus, Astr.Alg.
1992
const double jd=core->getJDay();
const double T=(jd-2451545.0)/36525.
0;
const double i=((0.000004*T-0.012998
)*T+28.075216)*M_PI/180.0;
const double Omega=((0.000412*T+1.39
4681)*T+169.508470)*M_PI/180.0;
static SolarSystem *ssystem=GETSTELM
ODULE(SolarSystem);
const Vec3d saturnEarth=getHeliocent
ricEclipticPos() - ssystem->getEarth()->getHeliocentricEclipticPos();
double lambda=atan2(saturnEarth[1],
saturnEarth[0]);
double beta=atan2(saturnEarth[2], sq
rt(saturnEarth[0]*saturnEarth[0]+saturnEarth[1]*saturnEarth[1]));
const double sinB=sin(i)*cos(beta)*s
in(lambda-Omega)-cos(i)*sin(beta);
double rings = -2.6*fabs(sinB) + 1.2
5*sinB*sinB; // sinx=sinB, saturnicentric latitude of earth. longish, see M
eeus.
return -8.88 + d + 0.044*phaseDeg +
rings;
}
if (englishName=="Uranus")
return -7.19f + d;
if (englishName=="Neptune")
return -6.87f + d;
if (englishName=="Pluto")
return -1.00f + d;
break;
}
}
} }
// This formula seems to give wrong results // This formula seems to give wrong results
const double p = (1.0 - phase/M_PI) * cos_chi + std::sqrt(1.0 - cos_ chi*cos_chi) / M_PI; const double p = (1.0 - phase/M_PI) * cos_chi + std::sqrt(1.0 - cos_ chi*cos_chi) / M_PI;
double F = 2.0 * albedo * radius * radius * p / (3.0*observerPlanetR q*planetRq) * shadowFactor; double F = 2.0 * albedo * radius * radius * p / (3.0*observerPlanetR q*planetRq) * shadowFactor;
return -26.73 - 2.5 * std::log10(F); return -26.73 - 2.5 * std::log10(F);
} }
double Planet::getAngularSize(const StelCore* core) const double Planet::getAngularSize(const StelCore* core) const
{ {
skipping to change at line 887 skipping to change at line 977
double Planet::getSpheroidAngularSize(const StelCore* core) const double Planet::getSpheroidAngularSize(const StelCore* core) const
{ {
return std::atan2(radius*sphereScale,getJ2000EquatorialPos(core).len gth()) * 180./M_PI; return std::atan2(radius*sphereScale,getJ2000EquatorialPos(core).len gth()) * 180./M_PI;
} }
// Draw the Planet and all the related infos : name, circle etc.. // Draw the Planet and all the related infos : name, circle etc..
void Planet::draw(StelCore* core, float maxMagLabels, const QFont& planetNa meFont) void Planet::draw(StelCore* core, float maxMagLabels, const QFont& planetNa meFont)
{ {
if (hidden) if (hidden)
return; return;
// GZ: Try to improve speed for minor planets: test if visible at al l. // Try to improve speed for minor planets: test if visible at all.
// For a full catalog of NEAs (11000 objects), with this and resetti ng deltaJD according to distance, rendering time went 4.5fps->12fps. // For a full catalog of NEAs (11000 objects), with this and resetti ng deltaJD according to distance, rendering time went 4.5fps->12fps.
// AW: Apply this rule to asteroids only // TBD: Note that taking away the asteroids at this stage breaks dim
// Note that taking away the asteroids at this stage breaks dim-aste -asteroid occultation of stars!
roid occultation of stars! // Maybe make another configurable flag for those interested?
if (((getVMagnitude(core)-1.0f) > core->getSkyDrawer()->getLimitMagn // Problematic: Early-out here of course disables the wanted hint ci
itude()) && pType==Planet::isAsteroid) rcles for dim asteroids.
// The line makes hints for asteroids 5 magnitudes below sky limitin
g magnitude visible.
// If asteroid is too faint to be seen, don't bother rendering. (Mas
sive speedup if people have hundreds of orbital elements!)
if (((getVMagnitude(core)-5.0f) > core->getSkyDrawer()->getLimitMagn
itude()) && pType==Planet::isAsteroid)
{ {
return; return;
} }
Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent; Mat4d mat = Mat4d::translation(eclipticPos) * rotLocalToParent;
PlanetP p = parent; PlanetP p = parent;
while (p && p->parent) while (p && p->parent)
{ {
mat = Mat4d::translation(p->eclipticPos) * mat * p->rotLocal ToParent; mat = Mat4d::translation(p->eclipticPos) * mat * p->rotLocal ToParent;
p = p->parent; p = p->parent;
skipping to change at line 1081 skipping to change at line 1174
" lowp float ringAlpha = texture2D(ringS, vec2(ring_radius, 0.5)).w;\n" " lowp float ringAlpha = texture2D(ringS, vec2(ring_radius, 0.5)).w;\n"
" final_illumination = 1.0 - ringAlpha;\n " " final_illumination = 1.0 - ringAlpha;\n "
" }\n" " }\n"
" }\n" " }\n"
" }\n" " }\n"
"#endif\n" "#endif\n"
"\n" "\n"
" highp float sunRadius = sunInfo.w;\n" " highp float sunRadius = sunInfo.w;\n"
" highp float L = length(sunPosition - P);\n" " highp float L = length(sunPosition - P);\n"
" highp float R = asin(sunRadius / L);\n" " highp float R = asin(sunRadius / L);\n"
" for (int i = 0; i < shadowCount; ++i)\n" " for (int i = 0; i < 4; ++i)\n"
" {\n" " {\n"
" highp vec3 satellitePosition = shadowData[i].xy " if (shadowCount>i)\n"
z;\n"
" highp float satelliteRadius = shadowData[i].w;\
n"
" highp float l = length(satellitePosition - P);\
n"
" highp float r = asin(satelliteRadius / l);\n"
" highp float d = acos(min(1.0, dot(normalize(sun
Position - P), normalize(satellitePosition - P))));\n"
"\n"
" mediump float illumination = 1.0;\n"
" if(d >= R + r)\n"
" {\n"
" // distance too far\n"
" illumination = 1.0;\n"
" }\n"
" else if(r >= R + d)\n"
" {\n" " {\n"
" // umbra\n" " highp vec3 satellitePosition = shadowData[0
].xyz;\n"
" highp float satelliteRadius = shadowData[0]
.w;\n"
" highp float l = length(satellitePosition -
P);\n"
" highp float r = asin(satelliteRadius / l);\
n"
" highp float d = acos(min(1.0, dot(normalize
(sunPosition - P), normalize(satellitePosition - P))));\n"
"\n"
" mediump float illumination = 1.0;\n"
" if(d >= R + r)\n"
" {\n"
" // distance too far\n"
" illumination = 1.0;\n"
" }\n"
" else if(r >= R + d)\n"
" {\n"
" // umbra\n"
"#ifdef IS_MOON\n" "#ifdef IS_MOON\n"
" illumination = d / (r - R) * 0.6;\n" " illumination = d / (r - R) * 0.6;\n"
"#else\n" "#else\n"
" illumination = 0.0;\n" " illumination = 0.0;\n"
"#endif\n" "#endif\n"
" }\n" " }\n"
" else if(d + r <= R)\n" " else if(d + r <= R)\n"
" {\n" " {\n"
" // penumbra completely inside\n" " // penumbra completely inside\n"
" illumination = 1.0 - r * r / (R * R);\n" " illumination = 1.0 - r * r / (R * R);\n
" }\n" "
" else\n" " }\n"
" {\n" " else\n"
" // penumbra partially inside\n" " {\n"
" // penumbra partially inside\n"
"#ifdef IS_MOON\n" "#ifdef IS_MOON\n"
" illumination = ((d - abs(R-r)) / (R + r - a bs(R-r))) * 0.4 + 0.6;\n" " illumination = ((d - abs(R-r)) / (R + r - abs(R-r))) * 0.4 + 0.6;\n"
"#else\n" "#else\n"
" mediump float x = (R * R + d * d - r * r) / " mediump float x = (R * R + d * d - r *
(2.0 * d);\n" r) / (2.0 * d);\n"
" mediump float alpha = acos(x / R);\n" " mediump float alpha = acos(x / R);\n"
" mediump float beta = acos((d - x) / r);\n" " mediump float beta = acos((d - x) / r);
" mediump float AR = R * R * (alpha - 0.5 * s \n"
in(2.0 * alpha));\n" " mediump float AR = R * R * (alpha - 0.5
" mediump float Ar = r * r * (beta - 0.5 * si * sin(2.0 * alpha));\n"
n(2.0 * beta));\n" " mediump float Ar = r * r * (beta - 0.5
" mediump float AS = R * R * 2.0 * 1.57079633 * sin(2.0 * beta));\n"
;\n" " mediump float AS = R * R * 2.0 * 1.5707
" illumination = 1.0 - (AR + Ar) / AS;\n" 9633;\n"
" illumination = 1.0 - (AR + Ar) / AS;\n"
"#endif\n" "#endif\n"
" }\n"
" final_illumination = min(illumination, fina
l_illumination);\n"
" }\n" " }\n"
"\n"
" final_illumination = min(illumination, final_il
lumination);\n"
" }\n" " }\n"
" }\n" " }\n"
"\n" "\n"
"#ifdef IS_MOON\n" "#ifdef IS_MOON\n"
" mediump vec3 normal = texture2D(normalMap, texc).rgb-ve c3(0.5, 0.5, 0);\n" " highp vec3 normal = texture2D(normalMap, texc).rgb-vec3 (0.5, 0.5, 0);\n"
" normal = normalize(normalX*normal.x+normalY*normal.y+no rmalZ*normal.z);\n" " normal = normalize(normalX*normal.x+normalY*normal.y+no rmalZ*normal.z);\n"
" // normal now contains the real surface normal taking n ormal map into account\n" " // normal now contains the real surface normal taking n ormal map into account\n"
" // Use an Oren-Nayar model for rough surfaces\n" " // Use an Oren-Nayar model for rough surfaces\n"
" // Ref: http://content.gpwiki.org/index.php/D3DBook:(Li ghting)_Oren-Nayar\n" " // Ref: http://content.gpwiki.org/index.php/D3DBook:(Li ghting)_Oren-Nayar\n"
" highp float cosAngleLightNormal = dot(normal, lightDire ction);\n" " highp float cosAngleLightNormal = dot(normal, lightDire ction);\n"
" highp float cosAngleEyeNormal = dot(normal, eyeDirectio n);\n" " highp float cosAngleEyeNormal = dot(normal, eyeDirectio n);\n"
" mediump float angleLightNormal = acos(cosAngleLightNorm al);\n" " mediump float angleLightNormal = acos(cosAngleLightNorm al);\n"
" mediump float angleEyeNormal = acos(cosAngleEyeNormal); \n" " mediump float angleEyeNormal = acos(cosAngleEyeNormal); \n"
" mediump float alpha = max(angleEyeNormal, angleLightNor mal);\n" " mediump float alpha = max(angleEyeNormal, angleLightNor mal);\n"
" mediump float beta = min(angleEyeNormal, angleLightNorm al);\n" " mediump float beta = min(angleEyeNormal, angleLightNorm al);\n"
" mediump float gamma = dot(eyeDirection - normal * cosAn gleEyeNormal, lightDirection - normal * cosAngleLightNormal);\n" " mediump float gamma = dot(eyeDirection - normal * cosAn gleEyeNormal, lightDirection - normal * cosAngleLightNormal);\n"
" mediump float roughness = 1.;\n" " mediump float roughness = 1.0;\n"
" mediump float roughnessSquared = roughness * roughness; \n" " mediump float roughnessSquared = roughness * roughness; \n"
" mediump float A = 1.0 - 0.5 * (roughnessSquared / (roug hnessSquared + 0.57));\n" " mediump float A = 1.0 - 0.5 * (roughnessSquared / (roug hnessSquared + 0.57));\n"
" mediump float B = 0.45 * (roughnessSquared / (roughness Squared + 0.09));\n" " mediump float B = 0.45 * (roughnessSquared / (roughness Squared + 0.09));\n"
" mediump float C = sin(alpha) * tan(beta);\n" " mediump float C = sin(alpha) * tan(beta);\n"
" lum = max(0.0, cosAngleLightNormal) * (A + B * max(0.0, gamma) * C) * 2.;\n" " lum = max(0.0, cosAngleLightNormal) * (A + B * max(0.0, gamma) * C) * 1.5;\n"
"#endif\n" "#endif\n"
" mediump vec4 litColor = vec4(lum * final_illumination * diffuseLight + ambientLight, 1.0);\n" " mediump vec4 litColor = vec4(lum * final_illumination * diffuseLight + ambientLight, 2.0);\n"
"#ifdef IS_MOON\n" "#ifdef IS_MOON\n"
" if(final_illumination < 0.99)\n" " if(final_illumination < 0.99)\n"
" {\n" " {\n"
" lowp vec4 shadowColor = texture2D(earthShadow, vec2 (final_illumination, 0.5));\n" " lowp vec4 shadowColor = texture2D(earthShadow, vec2 (final_illumination, 0.5));\n"
" gl_FragColor = mix(texture2D(tex, texc) * litColor, shadowColor, shadowColor.a);\n" " gl_FragColor = mix(texture2D(tex, texc) * litColor, shadowColor, shadowColor.a);\n"
" }\n" " }\n"
" else\n" " else\n"
"#endif\n" "#endif\n"
" {\n" " {\n"
" gl_FragColor = texture2D(tex, texc) * litColor;\n" " gl_FragColor = texture2D(tex, texc) * litColor;\n"
skipping to change at line 1228 skipping to change at line 1323
moonShaderVars.initLocations(moonShaderProgram); moonShaderVars.initLocations(moonShaderProgram);
GL(moonShaderVars.earthShadow = moonShaderProgram->uniformLocation(" earthShadow")); GL(moonShaderVars.earthShadow = moonShaderProgram->uniformLocation(" earthShadow"));
GL(moonShaderVars.normalMap = moonShaderProgram->uniformLocation("no rmalMap")); GL(moonShaderVars.normalMap = moonShaderProgram->uniformLocation("no rmalMap"));
GL(moonShaderProgram->release()); GL(moonShaderProgram->release());
} }
void Planet::deinitShader() void Planet::deinitShader()
{ {
delete planetShaderProgram; delete planetShaderProgram;
planetShaderProgram = NULL; planetShaderProgram = NULL;
delete ringPlanetShaderProgram;
ringPlanetShaderProgram = NULL;
delete moonShaderProgram;
moonShaderProgram = NULL;
} }
void Planet::draw3dModel(StelCore* core, StelProjector::ModelViewTranformP transfo, float screenSz, bool drawOnlyRing) void Planet::draw3dModel(StelCore* core, StelProjector::ModelViewTranformP transfo, float screenSz, bool drawOnlyRing)
{ {
// This is the main method drawing a planet 3d model // This is the main method drawing a planet 3d model
// Some work has to be done on this method to make the rendering nic er // Some work has to be done on this method to make the rendering nic er
SolarSystem* ssm = GETSTELMODULE(SolarSystem); SolarSystem* ssm = GETSTELMODULE(SolarSystem);
if (screenSz>1.) if (screenSz>1.)
{ {
skipping to change at line 1702 skipping to change at line 1801
} }
sPainter.enableClientStates(false); sPainter.enableClientStates(false);
} }
void Planet::update(int deltaTime) void Planet::update(int deltaTime)
{ {
hintFader.update(deltaTime); hintFader.update(deltaTime);
labelsFader.update(deltaTime); labelsFader.update(deltaTime);
orbitFader.update(deltaTime); orbitFader.update(deltaTime);
} }
void Planet::setApparentMagnitudeAlgorithm(QString algorithm)
{
vMagAlgorithm = vMagAlgorithmMap.key(algorithm.toLower(), Planet::Un
definedAlgorithm);
}
 End of changes. 42 change blocks. 
197 lines changed or deleted 335 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/