]> git.mxchange.org Git - flightgear.git/commitdiff
Added some debugging messages (mostly now commented out) to try to track down
authorcurt <curt>
Mon, 19 Apr 1999 20:17:45 +0000 (20:17 +0000)
committercurt <curt>
Mon, 19 Apr 1999 20:17:45 +0000 (20:17 +0000)
a moon display bug.  Turned out to be a problem with calculating lst in
fg_time.cxx

Simulator/Astro/moon.cxx
Simulator/Astro/solarsystem.cxx

index 970328a2342fe59828b39c7fa1f1f82937bb40ae..6c3e91bdebdca19da144a35b92b445d7dad8cb4c 100644 (file)
@@ -267,6 +267,11 @@ void Moon::updatePosition(FGTime *t, Star *ourSun)
   geoRa  = atan2(ye, xe);
   geoDec = atan2(ze, sqrt(xe*xe + ye*ye));
 
+  /* FG_LOG( FG_GENERAL, FG_INFO, 
+         "(geocentric) geoRa = (" << (RAD_TO_DEG * geoRa) 
+         << "), geoDec= (" << (RAD_TO_DEG * geoDec) << ")" ); */
+
+
   // Given the moon's geocentric ra and dec, calculate its 
   // topocentric ra and dec. i.e. the position as seen from the
   // surface of the earth, instead of the center of the earth
@@ -274,16 +279,32 @@ void Moon::updatePosition(FGTime *t, Star *ourSun)
   // First calculate the moon's parrallax, that is, the apparent size of the 
   // (equatorial) radius of the earth, as seen from the moon 
   mpar = asin ( 1 / r);
+  // FG_LOG( FG_GENERAL, FG_INFO, "r = " << r << " mpar = " << mpar );
+  // FG_LOG( FG_GENERAL, FG_INFO, "lat = " << f->get_Latitude() );
+
   gclat = f->get_Latitude() - 0.003358 * 
       sin (2 * DEG_TO_RAD * f->get_Latitude() );
+  // FG_LOG( FG_GENERAL, FG_INFO, "gclat = " << gclat );
+
   rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * f->get_Latitude());
+  // FG_LOG( FG_GENERAL, FG_INFO, "rho = " << rho );
+  
   if (geoRa < 0)
     geoRa += (2*FG_PI);
   
   HA = t->getLst() - (3.8197186 * geoRa);
+  /* FG_LOG( FG_GENERAL, FG_INFO, "t->getLst() = " << t->getLst() 
+         << " HA = " << HA ); */
+
   g = atan (tan(gclat) / cos ((HA / 3.8197186)));
+  // FG_LOG( FG_GENERAL, FG_INFO, "g = " << g );
+
   rightAscension = geoRa - mpar * rho * cos(gclat) * sin(HA) / cos (geoDec);
   declination = geoDec - mpar * rho * sin (gclat) * sin (g - geoDec) / sin(g);
+
+  /* FG_LOG( FG_GENERAL, FG_INFO, 
+         "Ra = (" << (RAD_TO_DEG *rightAscension) 
+         << "), Dec= (" << (RAD_TO_DEG *declination) << ")" ); */
 }
 
 
@@ -313,6 +334,8 @@ void Moon::newImage()
   
   if( moon_angle*RAD_TO_DEG < 100 ) 
     {
+      FG_LOG( FG_ASTRO, FG_INFO, "Generating Moon Image" );
+
       /*
       x_2 = moon_angle * moon_angle;
       x_4 = x_2 * x_2;
index d721472656b8988b676b156bcb56cdb2b1944e02..dee40dce3a798b9c5670ff85f793f987c5135971 100644 (file)
@@ -105,10 +105,8 @@ void SolarSystem::rebuild()
   //GLfloat ambient;
   //GLfloat amb[4];
   
-  
   glDisable(GL_LIGHTING);
 
-
   // Step 1: update all the positions
   ourSun->updatePosition(t);
   earthsMoon->updatePosition(t, ourSun);
@@ -129,6 +127,8 @@ void SolarSystem::rebuild()
 
   displayList = xglGenLists(1);
 
+  FG_LOG( FG_ASTRO, FG_INFO, "Rebuilding astro display list" );
+
   // Step 2: rebuild the display list
   xglNewList( displayList, GL_COMPILE);
   {