From c158d4bfd26ef983caf85d41e762c9e7053d1ca5 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 25 Oct 1997 03:24:21 +0000 Subject: [PATCH] Incorporated sun, moon, and star positioning code contributed by Durk Talsma. --- Main/Makefile | 9 +++++++++ Main/depend | 6 ++++-- Main/fg_init.c | 15 +++++++++++++-- Scenery/moon.h | 9 ++++++--- Scenery/scenery.c | 12 ++++++++---- Simulator/make.inc | 27 +++++++++++++++------------ 6 files changed, 55 insertions(+), 23 deletions(-) diff --git a/Main/Makefile b/Main/Makefile index 98451a635..6d5bde306 100644 --- a/Main/Makefile +++ b/Main/Makefile @@ -70,9 +70,18 @@ GLUTkey.o: GLTKkey.o: $(CC) $(CFLAGS) -c GLTKkey.c -o $@ +fg_init.o: + $(CC) $(CFLAGS) -c fg_init.c -o $@ + +views.o: + $(CC) $(CFLAGS) -c views.c -o $@ + #--------------------------------------------------------------------------- # $Log$ +# Revision 1.34 1997/10/25 03:24:21 curt +# Incorporated sun, moon, and star positioning code contributed by Durk Talsma. +# # Revision 1.33 1997/09/04 02:17:35 curt # Shufflin' stuff. # diff --git a/Main/depend b/Main/depend index 33d6d38e5..b9a10004b 100644 --- a/Main/depend +++ b/Main/depend @@ -26,9 +26,11 @@ fg_init.o: fg_init.c fg_init.h views.h ../types.h ../Flight/flight.h \ ../Cockpit/hud.h ../Cockpit/../Aircraft/aircraft.h \ ../Cockpit/../Flight/flight.h ../Cockpit/../Controls/controls.h \ ../Joystick/joystick.h ../Math/fg_random.h ../Scenery/mesh.h \ + ../Scenery/moon.h ../Scenery/orbits.h ../Scenery/../Time/fg_time.h \ + ../Scenery/../Time/../types.h ../Scenery/../Time/../Flight/flight.h \ ../Scenery/scenery.h ../Scenery/../types.h ../Scenery/stars.h \ - ../Time/fg_time.h ../Time/../types.h ../Time/../Flight/flight.h \ - ../Time/sunpos.h ../Weather/weather.h + ../Time/fg_time.h ../Time/sunpos.h ../Time/../types.h \ + ../Weather/weather.h views.o: views.c views.h ../types.h ../Flight/flight.h \ ../Flight/Slew/slew.h ../Flight/LaRCsim/ls_interface.h \ ../Flight/LaRCsim/../flight.h ../Math/mat3.h ../constants.h \ diff --git a/Main/fg_init.c b/Main/fg_init.c index 1b7950e85..6d16f99e1 100644 --- a/Main/fg_init.c +++ b/Main/fg_init.c @@ -38,6 +38,8 @@ #include "../Joystick/joystick.h" #include "../Math/fg_random.h" #include "../Scenery/mesh.h" +#include "../Scenery/moon.h" +#include "../Scenery/orbits.h" #include "../Scenery/scenery.h" #include "../Scenery/stars.h" #include "../Time/fg_time.h" @@ -174,6 +176,12 @@ void fgInitSubsystems( void ) { exit( 1 ); } + /* Initialize the orbital elements of sun, moon and mayor planets */ + fgSolarSystemInit(*t); + + /* Intialize the moon's position */ + fgMoonInit(); + /* Initialize the Stars subsystem */ fgStarsInit(); @@ -216,9 +224,12 @@ void fgInitSubsystems( void ) { /* $Log$ -/* Revision 1.9 1997/09/23 00:29:39 curt -/* Tweaks to get things to compile with gcc-win32. +/* Revision 1.10 1997/10/25 03:24:23 curt +/* Incorporated sun, moon, and star positioning code contributed by Durk Talsma. /* + * Revision 1.9 1997/09/23 00:29:39 curt + * Tweaks to get things to compile with gcc-win32. + * * Revision 1.8 1997/09/22 14:44:20 curt * Continuing to try to align stars correctly. * diff --git a/Scenery/moon.h b/Scenery/moon.h index c43f6dcaf..b23ae4e3b 100644 --- a/Scenery/moon.h +++ b/Scenery/moon.h @@ -35,8 +35,8 @@ void fgMoonInit(); /* Draw the Stars */ - void fgMoonRender(); + struct CelestialCoord fgCalculateMoon(struct OrbElements Params, struct OrbElements sunParams, struct fgTIME t); @@ -48,7 +48,10 @@ extern struct OrbElements pltOrbElements[9]; /* $Log$ -/* Revision 1.1 1997/10/25 03:16:09 curt -/* Initial revision of code contributed by Durk Talsma. +/* Revision 1.2 1997/10/25 03:24:23 curt +/* Incorporated sun, moon, and star positioning code contributed by Durk Talsma. /* + * Revision 1.1 1997/10/25 03:16:09 curt + * Initial revision of code contributed by Durk Talsma. + * */ diff --git a/Scenery/scenery.c b/Scenery/scenery.c index c70a5b6cd..c5a354f2b 100644 --- a/Scenery/scenery.c +++ b/Scenery/scenery.c @@ -34,8 +34,9 @@ #include "../general.h" -#include "scenery.h" +#include "moon.h" #include "parsevrml.h" +#include "scenery.h" #include "stars.h" @@ -89,10 +90,13 @@ void fgSceneryRender() { /* $Log$ -/* Revision 1.20 1997/10/25 03:18:27 curt -/* Incorporated sun, moon, and planet position and rendering code contributed -/* by Durk Talsma. +/* Revision 1.21 1997/10/25 03:24:24 curt +/* Incorporated sun, moon, and star positioning code contributed by Durk Talsma. /* + * Revision 1.20 1997/10/25 03:18:27 curt + * Incorporated sun, moon, and planet position and rendering code contributed + * by Durk Talsma. + * * Revision 1.19 1997/09/05 14:17:30 curt * More tweaking with stars. * diff --git a/Simulator/make.inc b/Simulator/make.inc index 5adadbaca..c2ec5c9a7 100644 --- a/Simulator/make.inc +++ b/Simulator/make.inc @@ -98,28 +98,31 @@ GLOBAL_CFLAGS = -g -Wall -DVERSION=\"$(VERSION)\" #--------------------------------------------------------------------------- # Linux/Mesa with the GLUT toolkit # -# INTERFACE_FLAGS = -DGLUT -# INTERFACE_LIBS = -lglut -# INTERFACE_FILES = GLUTmain.c GLUTkey.c -# MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL -# X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -# GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS) -# FG_CFLAGS = $(GLOBAL_CFLAGS) +INTERFACE_FLAGS = -DGLUT +INTERFACE_LIBS = -lglut +INTERFACE_FILES = GLUTmain.c GLUTkey.c +MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL +X11_LIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 +GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS) +FG_CFLAGS = $(GLOBAL_CFLAGS) #--------------------------------------------------------------------------- #--------------------------------------------------------------------------- # Cygnus Win32 (gcc based) with a static version of the GLUT toolkit # -INTERFACE_FLAGS = -DGLUT -INTERFACE_LIBS = ../Win32/libglut.a -INTERFACE_FILES = GLUTmain.c GLUTkey.c -GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32 -FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND +# INTERFACE_FLAGS = -DGLUT +# INTERFACE_LIBS = ../Win32/libglut.a +# INTERFACE_FILES = GLUTmain.c GLUTkey.c +# GRAPHICS_LIBS = -lglu32 -lopengl32 -luser32 -lgdi32 +# FG_CFLAGS = $(GLOBAL_CFLAGS) -DWIN32 -DUSE_RAND #--------------------------------------------------------------------------- #--------------------------------------------------------------------------- # $Log$ +# Revision 1.16 1997/10/25 03:24:21 curt +# Incorporated sun, moon, and star positioning code contributed by Durk Talsma. +# # Revision 1.15 1997/09/23 00:29:27 curt # Tweaks to get things to compile with gcc-win32. # -- 2.39.2