* $Id$
* (Log is kept at end of this file)
**************************************************************************/
-#include <Flight/flight.h>
+
+#include <FDM/flight.hxx>
#include <string.h>
#include "moon.hxx"
-#include <Debug/fg_debug.h>
+#include <Debug/logstream.hxx>
#include <Objects/texload.h>
+
+#ifdef __BORLANDC__
+# define exception c_exception
+#endif
+#include <math.h>
+
static GLuint moon_texid;
static GLubyte *moon_texbuf;
string tpath, fg_tpath;
int width, height;
- fgPrintf( FG_GENERAL, FG_INFO, "Initializing Moon Texture\n");
+ FG_LOG( FG_GENERAL, FG_INFO, "Initializing Moon Texture");
#ifdef GL_VERSION_1_1
xglGenTextures(1, &moon_texid);
xglBindTexture(GL_TEXTURE_2D, moon_texid);
if ( (moon_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height))
== NULL )
{
- fgPrintf( FG_GENERAL, FG_EXIT,
- "Error in loading moon texture %s\n", tpath );
- exit(1);
+ FG_LOG( FG_GENERAL, FG_ALERT,
+ "Error in loading moon texture " << tpath );
+ exit(-1);
}
}
geoRa, geoDec;
fgAIRCRAFT *air;
- fgFLIGHT *f;
+ FGState *f;
air = ¤t_aircraft;
- f = air->flight;
+ f = air->fdm_state;
updateOrbElements(t);
actTime = fgCalcActTime(t);
r += (-0.58 * cos(M - 2*D)
-0.46 * cos(2*D)
);
- fgPrintf(FG_GENERAL, FG_INFO, "Running moon update\n");
+ FG_LOG(FG_GENERAL, FG_INFO, "Running moon update");
xg = r * cos(lonecl) * cos(latecl);
yg = r * sin(lonecl) * cos(latecl);
zg = r * sin(latecl);
// First calculates 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);
- gclat = FG_Latitude - 0.003358 * sin (2 * DEG_TO_RAD * FG_Latitude);
- rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * FG_Latitude);
+ gclat = f->get_Latitude() - 0.003358 *
+ sin (2 * DEG_TO_RAD * f->get_Latitude() );
+ rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * f->get_Latitude());
if (geoRa < 0)
geoRa += (2*FG_PI);
xglRotatef(((RAD_TO_DEG * ra)- 90.0), 0.0, 0.0, 1.0);
xglRotatef((RAD_TO_DEG * dec), 1.0, 0.0, 0.0);
- fgPrintf( FG_GENERAL, FG_INFO,
- "Ra = (%f), Dec= (%f)", (RAD_TO_DEG *ra), (RAD_TO_DEG *dec) );
+ FG_LOG( FG_GENERAL, FG_INFO,
+ "Ra = (" << (RAD_TO_DEG *ra)
+ << "), Dec= (" << (RAD_TO_DEG *dec) << ")" );
xglTranslatef(0.0, 58600.0, 0.0);
Object = gluNewQuadric();
gluQuadricTexture( Object, GL_TRUE );