]> git.mxchange.org Git - flightgear.git/commitdiff
C++-ifying.
authorcurt <curt>
Fri, 16 Oct 1998 23:26:44 +0000 (23:26 +0000)
committercurt <curt>
Fri, 16 Oct 1998 23:26:44 +0000 (23:26 +0000)
41 files changed:
Aircraft/Makefile.am
Aircraft/aircraft.c [deleted file]
Aircraft/aircraft.cxx [new file with mode: 0644]
Aircraft/aircraft.h [deleted file]
Aircraft/aircraft.hxx [new file with mode: 0644]
Airports/genapt.cxx
Astro/moon.cxx
Astro/moon.hxx
Astro/sky.cxx
Astro/sky.hxx
Astro/stars.cxx
Autopilot/autopilot.hxx
Cockpit/cockpit.cxx
Cockpit/hud.cxx
Cockpit/hud.hxx
Cockpit/hud_card.cxx
Cockpit/hud_dnst.cxx
Cockpit/hud_guag.cxx
Cockpit/hud_inst.cxx
Cockpit/hud_labl.cxx
Cockpit/hud_ladr.cxx
Cockpit/hud_scal.cxx
Cockpit/hud_tbi.cxx
Cockpit/panel.cxx
FDM/Makefile.am
FDM/flight.cxx
FDM/flight.hxx
LaRCsim/ls_generic.h
LaRCsim/ls_interface.c
LaRCsim/ls_interface.h
Main/GLUTmain.cxx
Main/fg_init.cxx
Main/views.hxx
Scenery/scenery.cxx
Scenery/scenery.hxx
Slew/Makefile.am
Slew/slew.c [deleted file]
Slew/slew.cxx [new file with mode: 0644]
Slew/slew.h [deleted file]
Slew/slew.hxx [new file with mode: 0644]
Time/fg_time.hxx

index c3e60f0f8cd3904b0a579d2ccce6991ee6e6a928..9620f85e17297d2790ad0b4e92f80ebd55a10275 100644 (file)
@@ -1,5 +1,5 @@
 noinst_LIBRARIES = libAircraft.a
 
-libAircraft_a_SOURCES = aircraft.c aircraft.h
+libAircraft_a_SOURCES = aircraft.cxx aircraft.hxx
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
diff --git a/Aircraft/aircraft.c b/Aircraft/aircraft.c
deleted file mode 100644 (file)
index 0ac3cc3..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/**************************************************************************
- * aircraft.c -- various aircraft routines
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
-
-
-#include <stdio.h>
-
-#include <Aircraft/aircraft.h>
-#include <Debug/fg_debug.h>
-#include <Include/fg_constants.h>
-
-/* This is a record containing all the info for the aircraft currently
-   being operated */
-fgAIRCRAFT current_aircraft;
-
-
-/* Initialize an Aircraft structure */
-void fgAircraftInit( void ) {
-    fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
-
-    current_aircraft.flight   = &cur_flight_params;
-    current_aircraft.controls = &cur_control_params;
-}
-
-
-/* Display various parameters to stdout */
-void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
-    fgFLIGHT *f;
-    fgCONTROLS *c;
-
-    f = a->flight;
-    c = a->controls;
-
-    fgPrintf( FG_FLIGHT, FG_DEBUG,
-             "Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
-             FG_Longitude * 3600.0 * RAD_TO_DEG, 
-             FG_Latitude  * 3600.0 * RAD_TO_DEG,
-             FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
-    fgPrintf( FG_FLIGHT, FG_DEBUG,
-             "Kts = %.0f  Elev = %.2f, Aileron = %.2f, Rudder = %.2f  Power = %.2f\n", 
-             FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
-}
-
-
-/* $Log$
-/* Revision 1.19  1998/04/25 22:06:24  curt
-/* Edited cvs log messages in source files ... bad bad bad!
-/*
- * Revision 1.18  1998/04/18 04:13:56  curt
- * Moved fg_debug.c to it's own library.
- *
- * Revision 1.17  1998/02/12 21:59:31  curt
- * Incorporated code changes contributed by Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.16  1998/02/07 15:29:31  curt
- * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.15  1998/01/27 00:47:46  curt
- * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
- * system and commandline/config file processing code.
- *
- * Revision 1.14  1998/01/19 19:26:56  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.13  1997/12/15 23:54:30  curt
- * Add xgl wrappers for debugging.
- * Generate terrain normals on the fly.
- *
- * Revision 1.12  1997/12/10 22:37:37  curt
- * Prepended "fg" on the name of all global structures that didn't have it yet.
- * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
- *
- * Revision 1.11  1997/09/13 02:00:05  curt
- * Mostly working on stars and generating sidereal time for accurate star
- * placement.
- *
- * Revision 1.10  1997/08/27 03:29:56  curt
- * Changed naming scheme of basic shared structures.
- *
- * Revision 1.9  1997/07/19 22:39:08  curt
- * Moved PI to ../constants.h
- *
- * Revision 1.8  1997/06/25 15:39:45  curt
- * Minor changes to compile with rsxnt/win32.
- *
- * Revision 1.7  1997/06/02 03:01:39  curt
- * Working on views (side, front, back, transitions, etc.)
- *
- * Revision 1.6  1997/05/31 19:16:26  curt
- * Elevator trim added.
- *
- * Revision 1.5  1997/05/30 19:30:14  curt
- * The LaRCsim flight model is starting to look like it is working.
- *
- * Revision 1.4  1997/05/30 03:54:11  curt
- * Made a bit more progress towards integrating the LaRCsim flight model.
- *
- * Revision 1.3  1997/05/29 22:39:56  curt
- * Working on incorporating the LaRCsim flight model.
- *
- * Revision 1.2  1997/05/23 15:40:29  curt
- * Added GNU copyright headers.
- *
- * Revision 1.1  1997/05/16 15:58:24  curt
- * Initial revision.
- *
- */
diff --git a/Aircraft/aircraft.cxx b/Aircraft/aircraft.cxx
new file mode 100644 (file)
index 0000000..bb2f262
--- /dev/null
@@ -0,0 +1,134 @@
+/**************************************************************************
+ * aircraft.c -- various aircraft routines
+ *
+ * Written by Curtis Olson, started May 1997.
+ *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ * (Log is kept at end of this file)
+ **************************************************************************/
+
+
+#include <stdio.h>
+
+#include "aircraft.hxx"
+#include <Debug/fg_debug.h>
+#include <Include/fg_constants.h>
+
+/* This is a record containing all the info for the aircraft currently
+   being operated */
+fgAIRCRAFT current_aircraft;
+
+
+/* Initialize an Aircraft structure */
+void fgAircraftInit( void ) {
+    fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
+
+    current_aircraft.flight   = &cur_flight_params;
+    current_aircraft.controls = &cur_control_params;
+}
+
+
+/* Display various parameters to stdout */
+void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
+    fgFLIGHT *f;
+    fgCONTROLS *c;
+
+    f = a->flight;
+    c = a->controls;
+
+    fgPrintf( FG_FLIGHT, FG_DEBUG,
+             "Pos = (%.2f,%.2f,%.2f)  (Phi,Theta,Psi)=(%.2f,%.2f,%.2f)\n",
+             FG_Longitude * 3600.0 * RAD_TO_DEG, 
+             FG_Latitude  * 3600.0 * RAD_TO_DEG,
+             FG_Altitude, FG_Phi, FG_Theta, FG_Psi);
+    fgPrintf( FG_FLIGHT, FG_DEBUG,
+             "Kts = %.0f  Elev = %.2f, Aileron = %.2f, Rudder = %.2f  Power = %.2f\n", 
+             FG_V_equiv_kts, FG_Elevator, FG_Aileron, FG_Rudder, FG_Throttle[0]);
+}
+
+
+/* $Log$
+/* Revision 1.1  1998/10/16 23:26:47  curt
+/* C++-ifying.
+/*
+ * Revision 1.19  1998/04/25 22:06:24  curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
+ * Revision 1.18  1998/04/18 04:13:56  curt
+ * Moved fg_debug.c to it's own library.
+ *
+ * Revision 1.17  1998/02/12 21:59:31  curt
+ * Incorporated code changes contributed by Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
+ * Revision 1.16  1998/02/07 15:29:31  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
+ * Revision 1.15  1998/01/27 00:47:46  curt
+ * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
+ * system and commandline/config file processing code.
+ *
+ * Revision 1.14  1998/01/19 19:26:56  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.13  1997/12/15 23:54:30  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.12  1997/12/10 22:37:37  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
+ * Revision 1.11  1997/09/13 02:00:05  curt
+ * Mostly working on stars and generating sidereal time for accurate star
+ * placement.
+ *
+ * Revision 1.10  1997/08/27 03:29:56  curt
+ * Changed naming scheme of basic shared structures.
+ *
+ * Revision 1.9  1997/07/19 22:39:08  curt
+ * Moved PI to ../constants.h
+ *
+ * Revision 1.8  1997/06/25 15:39:45  curt
+ * Minor changes to compile with rsxnt/win32.
+ *
+ * Revision 1.7  1997/06/02 03:01:39  curt
+ * Working on views (side, front, back, transitions, etc.)
+ *
+ * Revision 1.6  1997/05/31 19:16:26  curt
+ * Elevator trim added.
+ *
+ * Revision 1.5  1997/05/30 19:30:14  curt
+ * The LaRCsim flight model is starting to look like it is working.
+ *
+ * Revision 1.4  1997/05/30 03:54:11  curt
+ * Made a bit more progress towards integrating the LaRCsim flight model.
+ *
+ * Revision 1.3  1997/05/29 22:39:56  curt
+ * Working on incorporating the LaRCsim flight model.
+ *
+ * Revision 1.2  1997/05/23 15:40:29  curt
+ * Added GNU copyright headers.
+ *
+ * Revision 1.1  1997/05/16 15:58:24  curt
+ * Initial revision.
+ *
+ */
diff --git a/Aircraft/aircraft.h b/Aircraft/aircraft.h
deleted file mode 100644 (file)
index 9f67798..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/**************************************************************************
- * aircraft.h -- define shared aircraft parameters
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
-
-
-#ifndef _AIRCRAFT_H
-#define _AIRCRAFT_H
-
-
-#include <Flight/flight.h>
-#include <Controls/controls.h>
-
-
-#ifdef __cplusplus                                                          
-extern "C" {                            
-#endif                                   
-
-
-/* Define a structure containing all the parameters for an aircraft */
-typedef struct{
-    fgFLIGHT   *flight;
-    fgCONTROLS *controls;
-} fgAIRCRAFT ;
-
-
-/* current_aircraft contains all the parameters of the aircraft
-   currently being operated. */
-extern fgAIRCRAFT current_aircraft;
-
-
-/* Initialize an Aircraft structure */
-void fgAircraftInit( void );
-
-
-/* Display various parameters to stdout */
-void fgAircraftOutputCurrent(fgAIRCRAFT *a);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _AIRCRAFT_H */
-
-
-/* $Log$
-/* Revision 1.12  1998/04/22 13:26:15  curt
-/* C++ - ifing the code a bit.
-/*
- * Revision 1.11  1998/04/21 17:02:27  curt
- * Prepairing for C++ integration.
- *
- * Revision 1.10  1998/02/07 15:29:32  curt
- * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.9  1998/01/22 02:59:23  curt
- * Changed #ifdef FILE_H to #ifdef _FILE_H
- *
- * Revision 1.8  1998/01/19 19:26:57  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.7  1997/12/10 22:37:38  curt
- * Prepended "fg"AIRCRAFT_H */
-
-
-/* $Log$
-/* Revision 1.12  1998/04/22 13:26:15  curt
-/* C++ - ifing the code a bit.
-/*
- * Revision 1.11  1998/04/21 17:02:27  curt
- * Prepairing for C++ integration.
- *
- * Revision 1.10  1998/02/07 15:29:32  curt
- * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.9  1998/01/22 02:59:23  curt
- * Changed #ifdef FILE_H to #ifdef _FILE_H
- *
- * Revision 1.8  1998/01/19 19:26:57  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.7  1997/12/10 22:37:38  curt
- * Prepended "fg" on the name of all global structures that didn't have it yet.
- * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
- *
- * Revision 1.6  1997/09/13 02:00:06  curt
- * Mostly working on stars and generating sidereal time for accurate star
- * placement.
- *
- * Revision 1.5  1997/08/27 03:29:58  curt
- * Changed naming scheme of basic shared structures.
- *
- * Revision 1.4  1997/07/23 21:52:17  curt
- * Put comments around the text after an #endif for increased portability.
- *
- * Revision 1.3  1997/06/21 17:12:42  curt
- * Capitalized subdirectory names.
- *
- * Revision 1.2  1997/05/23 15:40:30  curt
- * Added GNU copyright headers.
- *
- * Revision 1.1  1997/05/16 15:58:25  curt
- * Initial revision.
- *
- */
diff --git a/Aircraft/aircraft.hxx b/Aircraft/aircraft.hxx
new file mode 100644 (file)
index 0000000..22aa00d
--- /dev/null
@@ -0,0 +1,132 @@
+/**************************************************************************
+ * aircraft.h -- define shared aircraft parameters
+ *
+ * Written by Curtis Olson, started May 1997.
+ *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ * (Log is kept at end of this file)
+ **************************************************************************/
+
+
+#ifndef _AIRCRAFT_H
+#define _AIRCRAFT_H
+
+
+#ifndef __cplusplus                                                          
+# error This library requires C++
+#endif                                   
+
+
+#include <Flight/flight.hxx>
+#include <Controls/controls.h>
+
+
+/* Define a structure containing all the parameters for an aircraft */
+typedef struct{
+    fgFLIGHT   *flight;
+    fgCONTROLS *controls;
+} fgAIRCRAFT ;
+
+
+/* current_aircraft contains all the parameters of the aircraft
+   currently being operated. */
+extern fgAIRCRAFT current_aircraft;
+
+
+/* Initialize an Aircraft structure */
+void fgAircraftInit( void );
+
+
+/* Display various parameters to stdout */
+void fgAircraftOutputCurrent(fgAIRCRAFT *a);
+
+
+#endif /* _AIRCRAFT_H */
+
+
+/* $Log$
+/* Revision 1.1  1998/10/16 23:26:49  curt
+/* C++-ifying.
+/*
+ * Revision 1.12  1998/04/22 13:26:15  curt
+ * C++ - ifing the code a bit.
+ *
+ * Revision 1.11  1998/04/21 17:02:27  curt
+ * Prepairing for C++ integration.
+ *
+ * Revision 1.10  1998/02/07 15:29:32  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
+ * Revision 1.9  1998/01/22 02:59:23  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
+ * Revision 1.8  1998/01/19 19:26:57  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.7  1997/12/10 22:37:38  curt
+ * Prepended "fg"AIRCRAFT_H */
+
+
+/* $Log$
+/* Revision 1.1  1998/10/16 23:26:49  curt
+/* C++-ifying.
+/*
+ * Revision 1.12  1998/04/22 13:26:15  curt
+ * C++ - ifing the code a bit.
+ *
+ * Revision 1.11  1998/04/21 17:02:27  curt
+ * Prepairing for C++ integration.
+ *
+ * Revision 1.10  1998/02/07 15:29:32  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
+ * Revision 1.9  1998/01/22 02:59:23  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
+ * Revision 1.8  1998/01/19 19:26:57  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.7  1997/12/10 22:37:38  curt
+ * Prepended "fg" on the name of all global structures that didn't have it yet.
+ * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+ *
+ * Revision 1.6  1997/09/13 02:00:06  curt
+ * Mostly working on stars and generating sidereal time for accurate star
+ * placement.
+ *
+ * Revision 1.5  1997/08/27 03:29:58  curt
+ * Changed naming scheme of basic shared structures.
+ *
+ * Revision 1.4  1997/07/23 21:52:17  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
+ * Revision 1.3  1997/06/21 17:12:42  curt
+ * Capitalized subdirectory names.
+ *
+ * Revision 1.2  1997/05/23 15:40:30  curt
+ * Added GNU copyright headers.
+ *
+ * Revision 1.1  1997/05/16 15:58:25  curt
+ * Initial revision.
+ *
+ */
index e9789faa0d4be99032facec56904677d8429e573..4d62bcf23c4f6dd226e7a6ee5b96b0b8f5a96f69 100644 (file)
@@ -33,7 +33,7 @@ using namespace std;
 
 #include <Debug/fg_debug.h>
 // #include <Include/fg_types.h>
-#include <Math/fg_geodesy.h>
+#include <Math/fg_geodesy.hxx>
 #include <Math/mat3.h>
 #include <Math/point3d.hxx>
 #include <Math/polar3d.hxx>
@@ -62,30 +62,6 @@ static double calc_dist(const Point3D& p1, const Point3D& p2) {
 */
 
 
-// convert a geodetic point lon(radians), lat(radians), elev(meter) to
-// a cartesian point
-static Point3D geod_to_cart(const Point3D& geod) {
-    Point3D cp;
-    Point3D pp;
-    double gc_lon, gc_lat, sl_radius;
-
-    // printf("A geodetic point is (%.2f, %.2f, %.2f)\n", 
-    //        geod[0], geod[1], geod[2]);
-
-    gc_lon = geod.lon();
-    fgGeodToGeoc(geod.lat(), geod.radius(), &sl_radius, &gc_lat);
-
-    // printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon, 
-    //        gc_lat, sl_radius+geod[2]);
-
-    pp.setvals(gc_lon, gc_lat, sl_radius + geod.radius());
-    cp = fgPolarToCart3d(pp);
-    
-    // printf("A cart point is (%.8f, %.8f, %.8f)\n", cp.x, cp.y, cp.z);
-
-    return(cp);
-}
-
 #define FG_APT_BASE_TEX_CONSTANT 2000.0
 
 #ifdef OLD_TEX_COORDS
@@ -196,7 +172,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
 
     // first point on perimeter
     const_iterator current = perimeter.begin();
-    cart = geod_to_cart( *current );
+    cart = fgGeodToCart( *current );
     cart_trans = cart - t->center;
     t->nodes[t->ncount][0] = cart_trans.x();
     t->nodes[t->ncount][1] = cart_trans.y();
@@ -216,7 +192,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
 
     const_iterator last = perimeter.end();
     for ( ; current != last; ++current ) {
-       cart = geod_to_cart( *current );
+       cart = fgGeodToCart( *current );
        cart_trans = cart - t->center;
        t->nodes[t->ncount][0] = cart_trans.x();
        t->nodes[t->ncount][1] = cart_trans.y();
@@ -236,7 +212,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
 
     // last point (first point in perimeter list)
     current = perimeter.begin();
-    cart = geod_to_cart( *current );
+    cart = fgGeodToCart( *current );
     cart_trans = cart - t->center;
     fragment.add_face(center_num, i - 1, 1);
 
@@ -346,6 +322,9 @@ fgAptGenerate(const string& path, fgTILE *tile)
 
 
 // $Log$
+// Revision 1.5  1998/10/16 23:27:14  curt
+// C++-ifying.
+//
 // Revision 1.4  1998/10/16 00:51:46  curt
 // Converted to Point3D class.
 //
index 40dffacc80a9538ba7484d83d91a5709ba92a2b2..bc7425ce4357fc64c4c929f3d77c3afe815079cf 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  * (Log is kept at end of this file)
  **************************************************************************/
-#include <Flight/flight.h>
+#include <Flight/flight.hxx>
 
 #include <string.h>
 #include "moon.hxx"
index 9b70738b3227d0af2fc999b96ff1cfa9bbf60a53..677dcfca189b30c118e29a3a57570482e25f583e 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _MOON_HXX_
 #define _MOON_HXX_
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Include/general.h>
index 414d9bad3520956800d75d4ff3f917e7fdf4b0ca..4e562d21605411ae5e1ebf3455b0952650ea6565 100644 (file)
@@ -1,27 +1,25 @@
-/**************************************************************************
- * sky.c -- model sky with an upside down "bowl"
- *
- * Written by Curtis Olson, started December 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
+// sky.cxx -- model sky with an upside down "bowl"
+//
+// Written by Curtis Olson, started December 1997.
+//
+// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+// (Log is kept at end of this file)
 
 
 #ifdef HAVE_CONFIG_H
@@ -37,9 +35,9 @@
 #include <GL/glut.h>
 #include <XGL/xgl.h>
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
-#include <Flight/flight.h>
+#include <Flight/flight.hxx>
 #include <Include/fg_constants.h>
 #include <Main/views.hxx>
 #include <Math/fg_random.h>
 #include "sky.hxx"
 
 
-/*
-#include <Include/general.h>
-*/
-
-/* in meters of course */
+// in meters of course
 #define CENTER_ELEV   25000.0
 
 #define INNER_RADIUS  50000.0
@@ -79,7 +73,7 @@ static float middle_color[12][4];
 static float outer_color[12][4];
 
 
-/* Calculate the sky structure vertices */
+// Calculate the sky structure vertices
 void fgSkyVerticesInit( void ) {
     float theta;
     int i;
@@ -93,8 +87,8 @@ void fgSkyVerticesInit( void ) {
        inner_vertex[i][1] = sin(theta) * INNER_RADIUS;
        inner_vertex[i][2] = INNER_ELEV;
        
-       /* printf("    %.2f %.2f\n", cos(theta) * INNER_RADIUS, 
-              sin(theta) * INNER_RADIUS); */
+       // printf("    %.2f %.2f\n", cos(theta) * INNER_RADIUS, 
+       //        sin(theta) * INNER_RADIUS);
 
        middle_vertex[i][0] = cos((double)theta) * MIDDLE_RADIUS;
        middle_vertex[i][1] = sin((double)theta) * MIDDLE_RADIUS;
@@ -111,7 +105,7 @@ void fgSkyVerticesInit( void ) {
 }
 
 
-/* (Re)calculate the sky colors at each vertex */
+// (Re)calculate the sky colors at each vertex
 void fgSkyColorsInit( void ) {
     fgLIGHT *l;
     double sun_angle, diff;
@@ -124,13 +118,13 @@ void fgSkyColorsInit( void ) {
     fgPrintf( FG_ASTRO, FG_INFO, 
              "  Generating the sky colors for each vertex.\n" );
 
-    /* setup for the possibility of sunset effects */
+    // setup for the possibility of sunset effects
     sun_angle = l->sun_angle * RAD_TO_DEG;
     // fgPrintf( FG_ASTRO, FG_INFO, 
     //           "  Sun angle in degrees = %.2f\n", sun_angle);
 
     if ( (sun_angle > 80.0) && (sun_angle < 100.0) ) {
-       /* 0.0 - 0.4 */
+       // 0.0 - 0.4
        outer_param[0] = (10.0 - fabs(90.0 - sun_angle)) / 25.0;
        outer_param[1] = (10.0 - fabs(90.0 - sun_angle)) / 35.0;
        outer_param[2] = 0.0;
@@ -153,10 +147,10 @@ void fgSkyColorsInit( void ) {
        outer_diff[0] = outer_diff[1] = outer_diff[2] = 0.0;
        middle_diff[0] = middle_diff[1] = middle_diff[2] = 0.0;
     }
-    /* printf("  outer_red_param = %.2f  outer_red_diff = %.2f\n", 
-          outer_red_param, outer_red_diff); */
+    // printf("  outer_red_param = %.2f  outer_red_diff = %.2f\n", 
+    //        outer_red_param, outer_red_diff);
 
-    /* calculate transition colors between sky and fog */
+    // calculate transition colors between sky and fog
     for ( j = 0; j < 3; j++ ) {
        outer_amt[j] = outer_param[j];
        middle_amt[j] = middle_param[j];
@@ -166,8 +160,8 @@ void fgSkyColorsInit( void ) {
        for ( j = 0; j < 3; j++ ) {
            diff = l->sky_color[j] - l->fog_color[j];
 
-           /* printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
-                  l->sky_color[j], l->fog_color[j], diff); */
+           // printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
+           //        l->sky_color[j], l->fog_color[j], diff);
 
            inner_color[i][j] = l->sky_color[j] - diff * 0.3;
            middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
@@ -210,8 +204,8 @@ void fgSkyColorsInit( void ) {
        for ( j = 0; j < 3; j++ ) {
            diff = l->sky_color[j] - l->fog_color[j];
 
-           /* printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
-                  l->sky_color[j], l->fog_color[j], diff); */
+           // printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
+           //        l->sky_color[j], l->fog_color[j], diff);
 
            inner_color[i][j] = l->sky_color[j] - diff * 0.3;
            middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
@@ -246,19 +240,19 @@ void fgSkyColorsInit( void ) {
 }
 
 
-/* Initialize the sky structure and colors */
+// Initialize the sky structure and colors
 void fgSkyInit( void ) {
     fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n");
 
     fgSkyVerticesInit();
 
-    /* regester fgSkyColorsInit() as an event to be run periodically */
+    // regester fgSkyColorsInit() as an event to be run periodically
     global_events.Register( "fgSkyColorsInit()", fgSkyColorsInit, 
                            fgEVENT::FG_EVENT_READY, 30000);
 }
 
 
-/* Draw the Sky */
+// Draw the Sky
 void fgSkyRender( void ) {
     fgFLIGHT *f;
     fgLIGHT *l;
@@ -273,14 +267,14 @@ void fgSkyRender( void ) {
     l = &cur_light_params;
     v = &current_view;
 
-    /* printf("Rendering the sky.\n"); */
+    // printf("Rendering the sky.\n");
 
     // calculate the proper colors
     for ( i = 0; i < 3; i++ ) {
        diff = l->sky_color[i] - l->adj_fog_color[i];
 
-       /* printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
-          l->sky_color[j], l->adj_fog_color[j], diff); */
+       // printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
+       //        l->sky_color[j], l->adj_fog_color[j], diff);
 
        inner_color[i] = l->sky_color[i] - diff * 0.3;
        middle_color[i] = l->sky_color[i] - diff * 0.9;
@@ -290,21 +284,21 @@ void fgSkyRender( void ) {
 
     xglPushMatrix();
 
-    /* Translate to view position */
+    // Translate to view position
     xglTranslatef( v->cur_zero_elev.x(), 
                   v->cur_zero_elev.y(),
                   v->cur_zero_elev.z() );
-    /* printf("  Translated to %.2f %.2f %.2f\n", 
-          v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z ); */
+    // printf("  Translated to %.2f %.2f %.2f\n", 
+    //        v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z );
 
-    /* Rotate to proper orientation */
-    /* printf("  lon = %.2f  lat = %.2f\n", FG_Longitude * RAD_TO_DEG,
-          FG_Latitude * RAD_TO_DEG); */
+    // Rotate to proper orientation
+    // printf("  lon = %.2f  lat = %.2f\n", FG_Longitude * RAD_TO_DEG,
+    //        FG_Latitude * RAD_TO_DEG);
     xglRotatef( FG_Longitude * RAD_TO_DEG, 0.0, 0.0, 1.0 );
     xglRotatef( 90.0 - FG_Latitude * RAD_TO_DEG, 0.0, 1.0, 0.0 );
     xglRotatef( l->sun_rotation * RAD_TO_DEG, 0.0, 0.0, 1.0 );
 
-    /* Draw inner/center section of sky*/
+    // Draw inner/center section of sky*/
     xglBegin( GL_TRIANGLE_FAN );
     xglColor4fv(l->sky_color);
     xglVertex3f(0.0, 0.0, CENTER_ELEV);
@@ -320,15 +314,15 @@ void fgSkyRender( void ) {
     xglBegin( GL_TRIANGLE_STRIP );
     for ( i = 0; i < 12; i++ ) {
        xglColor4fv( middle_color );
-       /* printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
-              middle_color[i][0], middle_color[i][1], middle_color[i][2], 
-              middle_color[i][3]); */
+       // printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
+       //        middle_color[i][0], middle_color[i][1], middle_color[i][2], 
+       //        middle_color[i][3]);
        // xglColor4f(1.0, 0.0, 0.0, 1.0);
        xglVertex3fv( middle_vertex[i] );
        xglColor4fv( inner_color );
-       /* printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
-              inner_color[i][0], inner_color[i][1], inner_color[i][2], 
-              inner_color[i][3]); */
+       // printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
+       //        inner_color[i][0], inner_color[i][1], inner_color[i][2], 
+       //        inner_color[i][3]);
        // xglColor4f(0.0, 0.0, 1.0, 1.0);
        xglVertex3fv( inner_vertex[i] );
     }
@@ -340,7 +334,7 @@ void fgSkyRender( void ) {
     xglVertex3fv( inner_vertex[0] );
     xglEnd();
 
-    /* Draw the outer ring */
+    // Draw the outer ring
     xglBegin( GL_TRIANGLE_STRIP );
     for ( i = 0; i < 12; i++ ) {
        xglColor4fv( outer_color );
@@ -354,7 +348,7 @@ void fgSkyRender( void ) {
     xglVertex3fv( middle_vertex[0] );
     xglEnd();
 
-    /* Draw the bottom skirt */
+    // Draw the bottom skirt
     xglBegin( GL_TRIANGLE_STRIP );
     xglColor4fv( outer_color );
     for ( i = 0; i < 12; i++ ) {
@@ -369,108 +363,111 @@ void fgSkyRender( void ) {
 }
 
 
-/* $Log$
-/* Revision 1.11  1998/10/16 00:52:19  curt
-/* Converted to Point3D class.
-/*
- * Revision 1.10  1998/08/29 13:07:16  curt
- * Rewrite of event manager thanks to Bernie Bright.
- *
- * Revision 1.9  1998/08/22 01:18:59  curt
- * Minor tweaks to avoid using unitialized memory.
- *
- * Revision 1.8  1998/08/12 21:40:44  curt
- * Sky now tracks adjusted fog color so it blends well with terrain.
- *
- * Revision 1.7  1998/07/22 21:39:21  curt
- * Lower skirt tracks adjusted fog color, not fog color.
- *
- * Revision 1.6  1998/05/23 14:07:14  curt
- * Use new C++ events class.
- *
- * Revision 1.5  1998/04/28 01:19:02  curt
- * Type-ified fgTIME and fgVIEW
- *
- * Revision 1.4  1998/04/26 05:10:01  curt
- * "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
- *
- * Revision 1.3  1998/04/25 22:06:25  curt
- * Edited cvs log messages in source files ... bad bad bad!
- *
- * Revision 1.2  1998/04/24 00:45:03  curt
- * Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
- * Fixed a bug when generating sky colors.
- *
- * Revision 1.1  1998/04/22 13:21:32  curt
- * C++ - ifing the code a bit.
- *
- * Revision 1.9  1998/04/03 21:52:50  curt
- * Converting to Gnu autoconf system.
- *
- * Revision 1.8  1998/03/09 22:47:25  curt
- * Incorporated Durk's updates.
- *
- * Revision 1.7  1998/02/19 13:05:49  curt
- * Incorporated some HUD tweaks from Michelle America.
- * Tweaked the sky's sunset/rise colors.
- * Other misc. tweaks.
- *
- * Revision 1.6  1998/02/07 15:29:32  curt
- * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.5  1998/01/27 00:47:48  curt
- * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
- * system and commandline/config file processing code.
- *
- * Revision 1.4  1998/01/26 15:54:28  curt
- * Added a "skirt" to try to help hide gaps between scenery and sky.  This will
- * have to be revisited in the future.
- *
- * Revision 1.3  1998/01/19 19:26:59  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.2  1998/01/19 18:40:17  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.1  1998/01/07 03:16:19  curt
- * Moved from .../Src/Scenery/ to .../Src/Astro/
- *
- * Revision 1.11  1997/12/30 22:22:38  curt
- * Further integration of event manager.
- *
- * Revision 1.10  1997/12/30 20:47:53  curt
- * Integrated new event manager with subsystem initializations.
- *
- * Revision 1.9  1997/12/30 13:06:57  curt
- * A couple lighting tweaks ...
- *
- * Revision 1.8  1997/12/23 04:58:38  curt
- * Tweaked the sky coloring a bit to build in structures to allow finer rgb
- * control.
- *
- * Revision 1.7  1997/12/22 23:45:48  curt
- * First stab at sunset/sunrise sky glow effects.
- *
- * Revision 1.6  1997/12/22 04:14:34  curt
- * Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
- *
- * Revision 1.5  1997/12/19 23:34:59  curt
- * Lot's of tweaking with sky rendering and lighting.
- *
- * Revision 1.4  1997/12/19 16:45:02  curt
- * Working on scene rendering order and options.
- *
- * Revision 1.3  1997/12/18 23:32:36  curt
- * First stab at sky dome actually starting to look reasonable. :-)
- *
- * Revision 1.2  1997/12/18 04:07:03  curt
- * Worked on properly translating and positioning the sky dome.
- *
- * Revision 1.1  1997/12/17 23:14:30  curt
- * Initial revision.
- * Begin work on rendering the sky. (Rather than just using a clear screen.)
- *
- */
+// $Log$
+// Revision 1.12  1998/10/16 23:27:18  curt
+// C++-ifying.
+//
+// Revision 1.11  1998/10/16 00:52:19  curt
+// Converted to Point3D class.
+//
+// Revision 1.10  1998/08/29 13:07:16  curt
+// Rewrite of event manager thanks to Bernie Bright.
+//
+// Revision 1.9  1998/08/22 01:18:59  curt
+// Minor tweaks to avoid using unitialized memory.
+//
+// Revision 1.8  1998/08/12 21:40:44  curt
+// Sky now tracks adjusted fog color so it blends well with terrain.
+//
+// Revision 1.7  1998/07/22 21:39:21  curt
+// Lower skirt tracks adjusted fog color, not fog color.
+//
+// Revision 1.6  1998/05/23 14:07:14  curt
+// Use new C++ events class.
+//
+// Revision 1.5  1998/04/28 01:19:02  curt
+// Type-ified fgTIME and fgVIEW
+//
+// Revision 1.4  1998/04/26 05:10:01  curt
+// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
+//
+// Revision 1.3  1998/04/25 22:06:25  curt
+// Edited cvs log messages in source files ... bad bad bad!
+//
+// Revision 1.2  1998/04/24 00:45:03  curt
+// Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+// Fixed a bug when generating sky colors.
+//
+// Revision 1.1  1998/04/22 13:21:32  curt
+// C++ - ifing the code a bit.
+//
+// Revision 1.9  1998/04/03 21:52:50  curt
+// Converting to Gnu autoconf system.
+//
+// Revision 1.8  1998/03/09 22:47:25  curt
+// Incorporated Durk's updates.
+//
+// Revision 1.7  1998/02/19 13:05:49  curt
+// Incorporated some HUD tweaks from Michelle America.
+// Tweaked the sky's sunset/rise colors.
+// Other misc. tweaks.
+//
+// Revision 1.6  1998/02/07 15:29:32  curt
+// Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+// <chotchkiss@namg.us.anritsu.com>
+//
+// Revision 1.5  1998/01/27 00:47:48  curt
+// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
+// system and commandline/config file processing code.
+//
+// Revision 1.4  1998/01/26 15:54:28  curt
+// Added a "skirt" to try to help hide gaps between scenery and sky.  This will
+// have to be revisited in the future.
+//
+// Revision 1.3  1998/01/19 19:26:59  curt
+// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+// This should simplify things tremendously.
+//
+// Revision 1.2  1998/01/19 18:40:17  curt
+// Tons of little changes to clean up the code and to remove fatal errors
+// when building with the c++ compiler.
+//
+// Revision 1.1  1998/01/07 03:16:19  curt
+// Moved from .../Src/Scenery/ to .../Src/Astro/
+//
+// Revision 1.11  1997/12/30 22:22:38  curt
+// Further integration of event manager.
+//
+// Revision 1.10  1997/12/30 20:47:53  curt
+// Integrated new event manager with subsystem initializations.
+//
+// Revision 1.9  1997/12/30 13:06:57  curt
+// A couple lighting tweaks ...
+//
+// Revision 1.8  1997/12/23 04:58:38  curt
+// Tweaked the sky coloring a bit to build in structures to allow finer rgb
+// control.
+//
+// Revision 1.7  1997/12/22 23:45:48  curt
+// First stab at sunset/sunrise sky glow effects.
+//
+// Revision 1.6  1997/12/22 04:14:34  curt
+// Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
+//
+// Revision 1.5  1997/12/19 23:34:59  curt
+// Lot's of tweaking with sky rendering and lighting.
+//
+// Revision 1.4  1997/12/19 16:45:02  curt
+// Working on scene rendering order and options.
+//
+// Revision 1.3  1997/12/18 23:32:36  curt
+// First stab at sky dome actually starting to look reasonable. :-)
+//
+// Revision 1.2  1997/12/18 04:07:03  curt
+// Worked on properly translating and positioning the sky dome.
+//
+// Revision 1.1  1997/12/17 23:14:30  curt
+// Initial revision.
+// Begin work on rendering the sky. (Rather than just using a clear screen.)
+//
+
index 3b8e4634e8ac1e7a8bf27604cd761e4daccf5d64..d39528211628ff39c35c1bc8ba984c83739950fb 100644 (file)
@@ -1,27 +1,25 @@
-/**************************************************************************
- * sky.hxx -- model sky with an upside down "bowl"
- *
- * Written by Curtis Olson, started December 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
+// sky.hxx -- model sky with an upside down "bowl"
+//
+// Written by Curtis Olson, started December 1997.
+//
+// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+// (Log is kept at end of this file)
 
 
 #ifndef _SKY_HXX
 #endif                                   
 
 
-/* (Re)generate the display list */
+// (Re)generate the display list
 void fgSkyInit( void );
 
-/* (Re)calculate the sky colors at each vertex */
+// (Re)calculate the sky colors at each vertex
 void fgSkyColorsInit( void );
 
-/* Draw the Sky */
+// Draw the Sky
 void fgSkyRender( void );
 
 
-#endif /* _SKY_HXX */
+#endif // _SKY_HXX
 
 
-/* $Log$
-/* Revision 1.1  1998/04/22 13:21:33  curt
-/* C++ - ifing the code a bit.
-/*
- * Revision 1.4  1998/04/21 17:02:32  curt
- * Prepairing for C++ integration.
- *
- * Revision 1.3  1998/01/22 02:59:28  curt
- * Changed #ifdef FILE_H to #ifdef _FILE_H
- *
- * Revision 1.2  1998/01/19 18:40:17  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.1  1998/01/07 03:16:19  curt
- * Moved from .../Src/Scenery/ to .../Src/Astro/
- *
- * Revision 1.2  1997/12/22 23:45:49  curt
- * First stab at sunset/sunrise sky glow effects.
- *
- * Revision 1.1  1997/12/17 23:14:31  curt
- * Initial revision.
- * Begin work on rendering the sky. (Rather than just using a clear screen.)
- *
- */
+// $Log$
+// Revision 1.2  1998/10/16 23:27:19  curt
+// C++-ifying.
+//
+// Revision 1.1  1998/04/22 13:21:33  curt
+// C++ - ifing the code a bit.
+//
+// Revision 1.4  1998/04/21 17:02:32  curt
+// Prepairing for C++ integration.
+//
+// Revision 1.3  1998/01/22 02:59:28  curt
+// Changed #ifdef FILE_H to #ifdef _FILE_H
+//
+// Revision 1.2  1998/01/19 18:40:17  curt
+// Tons of little changes to clean up the code and to remove fatal errors
+// when building with the c++ compiler.
+//
+// Revision 1.1  1998/01/07 03:16:19  curt
+// Moved from .../Src/Scenery/ to .../Src/Astro/
+//
+// Revision 1.2  1997/12/22 23:45:49  curt
+// First stab at sunset/sunrise sky glow effects.
+//
+// Revision 1.1  1997/12/17 23:14:31  curt
+// Initial revision.
+// Begin work on rendering the sky. (Rather than just using a clear screen.)
+//
index 87bf8c5178b66a5d1b8ce43c9569974f66042f8f..453b33aad16919c9fe1bc882bce37ca19e231036 100644 (file)
@@ -40,7 +40,7 @@
 #include <GL/glut.h>
 #include <XGL/xgl.h>
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Misc/fgstream.hxx>
@@ -252,6 +252,9 @@ void fgStarsRender( void ) {
 
 
 // $Log$
+// Revision 1.19  1998/10/16 23:27:21  curt
+// C++-ifying.
+//
 // Revision 1.18  1998/10/16 00:52:20  curt
 // Converted to Point3D class.
 //
index f2574a697717a1a014128e2bdc971d19900fffa2..5e6e426c715e15f0bd828cd6707f2a7103a913b8 100644 (file)
@@ -27,8 +27,8 @@
 #define _AUTOPILOT_H
                        
 
-#include <Aircraft/aircraft.h>
-#include <Flight/flight.h>
+#include <Aircraft/aircraft.hxx>
+#include <Flight/flight.hxx>
 #include <Controls/controls.h>
                        
                        
index 01d83fe73cf9066d1564386b3d4b7154c0ef32a5..ed3932cfc8ddada5c1c0cab87b5759382b5baf2a 100644 (file)
@@ -39,7 +39,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Include/general.h>
@@ -316,6 +316,9 @@ void fgCockpitUpdate( void ) {
 
 
 // $Log$
+// Revision 1.18  1998/10/16 23:27:23  curt
+// C++-ifying.
+//
 // Revision 1.17  1998/09/29 14:56:30  curt
 // c++-ified comments.
 //
index da0195b8bdd372ebd7f54bc7173968dadaebe9c8..5a5f8ec809ce4ecbf7cb11b95c284d246798adec 100644 (file)
@@ -38,7 +38,7 @@
 #  include <values.h>  // for MAXINT
 #endif
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Main/options.hxx>
@@ -830,6 +830,9 @@ void fgUpdateHUD( void ) {
 }
 
 // $Log$
+// Revision 1.24  1998/10/16 23:27:25  curt
+// C++-ifying.
+//
 // Revision 1.23  1998/10/16 00:53:00  curt
 // Mods to display a bit more info when mini-hud is active.
 //
index 05974867e243c07b61453ec39dcb457b8a743f5d..cf611cb740edf582712d0c4db5458463660ef438 100644 (file)
@@ -47,8 +47,8 @@
 
 #include <fg_typedefs.h>
 #include <fg_constants.h>
-#include <Aircraft/aircraft.h>
-#include <Flight/flight.h>
+#include <Aircraft/aircraft.hxx>
+#include <Flight/flight.hxx>
 #include <Controls/controls.h>
 
 #include <deque>        // STL double ended queue
@@ -524,6 +524,9 @@ void fgHUDSetTimeMode( Hptr hud, int time_of_day );
 #endif // _HUD_H
 
 // $Log$
+// Revision 1.15  1998/10/16 23:27:27  curt
+// C++-ifying.
+//
 // Revision 1.14  1998/09/29 14:56:33  curt
 // c++-ified comments.
 //
index 7f4f15a5af46e024f0ad0d5f5a0fc17cb516a74c..1abc18cb67d0ee5f60e1c802b021ff0fba6dcaec 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index bb4e67a562a8d45476e0e16c0dd64ef849f9d56f..95f95b4039feb9be45ec7f2f7a7c37a9d15da3d9 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index 7ea060257aeaf33d1b54058e7f28c59e5ac04042..cbc9fde6e923c6e54332c7bece9650fe5c555349 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index b0cb37ee09e1fdb45535b245712c5f97d35b3689..2962c8d47fcd790331fa8f507a8062bebc854115 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index 2925692f32916c7edac5d4d05df68e86d96bad60..e98e1df1ff24332a532a673b39c32afc451e047c 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index 534374691baa16d06a360c2c721b67c4cd7f5ae0..962ab84c2be1ddcb197a79f264a6121cf2acaf0b 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index ad74c33f4a3ee92ed6a8bd4b9d000ab72a7eb7b0..25154b4bdc05536ab7a3ed45efbbb1c900a60414 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index c38c26b2779c5f8258f2d814bddd7fdca1c65025..20080083e81456ca5ad1818b0cdd13448f18a95f 100644 (file)
@@ -7,7 +7,7 @@
 #endif
 #include <stdlib.h>
 #include <string.h>
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Math/fg_random.h>
index 70bfb0a088f04e2fef740879d1b13bf4caed8f86..66c0bac18cf9b6d9ca2508a92135d392cb6e4c21 100644 (file)
@@ -41,7 +41,7 @@
 #include <string>
 #include <math.h>
 
-#include <Aircraft/aircraft.h>
+#include <Aircraft/aircraft.hxx>
 #include <Debug/fg_debug.h>
 #include <Main/options.hxx>
 #include <Main/views.hxx>
@@ -726,9 +726,12 @@ pointer->vertices[19] = pointer->vertices[3];
 
 
 /* $Log$
-/* Revision 1.7  1998/08/31 20:45:31  curt
-/* Tweaks from Friedemann.
+/* Revision 1.8  1998/10/16 23:27:37  curt
+/* C++-ifying.
 /*
+ * Revision 1.7  1998/08/31 20:45:31  curt
+ * Tweaks from Friedemann.
+ *
  * Revision 1.6  1998/08/28 18:14:40  curt
  * Added new cockpit code from Friedemann Reinhard
  * <mpt218@faupt212.physik.uni-erlangen.de>
index f2055d01e219e4c90007b503f15868bc0725eccc..3d8eec007bfc68e9f67043200fcbf48995c47250 100644 (file)
@@ -2,6 +2,6 @@ SUBDIRS = LaRCsim Slew
 
 noinst_LIBRARIES = libFlight.a
 
-libFlight_a_SOURCES = flight.cxx flight.hxx
+libFlight_a_SOURCES = flight.cxx flight.hxx LaRCsim.cxx LaRCsim.hxx
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
index 46b99669f622a9b3e9acf7b21338a9a9e7e970ce..6782a0dd114e1c542491a95bdc4cf715129d9e7f 100644 (file)
 
 #include <stdio.h>
 
+#include "flight.hxx"
+#include "LaRCsim.hxx"
+
 #include <Debug/fg_debug.h>
-#include <Flight/flight.h>
 #include <Flight/LaRCsim/ls_interface.h>
 #include <Include/fg_constants.h>
-#include <Math/fg_geodesy.h>
+#include <Math/fg_geodesy.hxx>
 
 
 fgFLIGHT cur_flight_params;
@@ -99,7 +101,7 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
 
 
 /* Set the altitude (force) */
-int fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters) {
+void fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters) {
     double sea_level_radius_meters;
     double lat_geoc;
     // Set the FG variables first
@@ -119,6 +121,9 @@ int fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters) {
 
 
 // $Log$
+// Revision 1.2  1998/10/16 23:27:40  curt
+// C++-ifying.
+//
 // Revision 1.1  1998/10/16 20:16:41  curt
 // Renamed flight.[ch] to flight.[ch]xx
 //
index f9c077f4cd243a6c9aabe37a3d584e20c1737316..00d7ba42a462af98624ac0b1ff5f3ca72ab14bd4 100644 (file)
 #define _FLIGHT_H
 
 
-#include <Flight/Slew/slew.h>
+#include <Flight/Slew/slew.hxx>
 
 
-#ifdef __cplusplus                                                          
-extern "C" {                            
+#ifndef __cplusplus                                                          
+# error This library requires C++
 #endif                                   
 
 
@@ -403,18 +403,16 @@ int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
 int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
 
 /* Set the altitude (force) */
-int fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters);
-
-
-#ifdef __cplusplus
-}
-#endif
+void fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters);
 
 
 #endif /* _FLIGHT_H */
 
 
 // $Log$
+// Revision 1.2  1998/10/16 23:27:41  curt
+// C++-ifying.
+//
 // Revision 1.1  1998/10/16 20:16:44  curt
 // Renamed flight.[ch] to flight.[ch]xx
 //
index 02cdaf210be920328726da0c56795be8ead8591d..6059cce1e52b07ce1031e5e3e5281396e46a0baf 100644 (file)
 #define _LS_GENERIC_H
 
 
+#ifdef __cplusplus                                                          
+extern "C" {                            
+#endif                                   
+
+
+#include "ls_types.h"
+
+
 typedef struct {
 
 /*================== Mass properties and geometry values ==================*/
@@ -407,6 +415,11 @@ typedef struct {
 extern GENERIC generic_;       /* usually defined in ls_main.c */
 
 
+#ifdef __cplusplus
+}
+#endif
+
+
 #endif /* _LS_GENERIC_H */
 
 
index f0165eca509ef994091f057bf7c3477178b53e90..0a12df1dd6acf09ca3efc6ee49714e7b883039ba 100644 (file)
@@ -241,9 +241,9 @@ $Original log: LaRCsim.c,v $
 #include "ls_model.h"
 #include "ls_init.h"
 
-#include <Flight/flight.h>
-#include <Aircraft/aircraft.h>
-#include <Debug/fg_debug.h>
+// #include <Flight/flight.h>
+// #include <Aircraft/aircraft.h>
+// #include <Debug/fg_debug.h>
 
 
 /* global variable declarations */
@@ -498,17 +498,17 @@ void ls_loop( SCALAR dt, int initialize ) {
 
 
 int ls_cockpit( void ) {
-    fgCONTROLS *c;
+    // fgCONTROLS *c;
 
     sim_control_.paused = 0;
 
-    c = current_aircraft.controls;
+    // c = current_aircraft.controls;
 
-    Lat_control = FG_Aileron;
-    Long_control = FG_Elevator;
-    Long_trim = FG_Elev_Trim;
-    Rudder_pedal = FG_Rudder;
-    Throttle_pct = FG_Throttle[0];
+    // Lat_control = FG_Aileron;
+    // Long_control = FG_Elevator;
+    // Long_trim = FG_Elev_Trim;
+    // Rudder_pedal = FG_Rudder;
+    // Throttle_pct = FG_Throttle[0];
 
     /* printf("Mach = %.2f  ", Mach_number);
     printf("%.4f,%.4f,%.2f  ", Latitude, Longitude, Altitude);
@@ -520,7 +520,7 @@ int ls_cockpit( void ) {
 
 /* Initialize the LaRCsim flight model, dt is the time increment for
    each subsequent iteration through the EOM */
-int fgLaRCsimInit(double dt) {
+int ls_toplevel_init(double dt) {
     model_dt = dt;
 
     ls_setdefopts();           /* set default options */
@@ -548,47 +548,22 @@ int fgLaRCsimInit(double dt) {
 
 
 /* Run an iteration of the EOM (equations of motion) */
-int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
-    double save_alt = 0.0;
+int ls_update(int multiloop) {
     int        i;
 
     if (speedup > 0) {
        ls_cockpit();
     }
 
-    /* lets try to avoid really screwing up the LaRCsim model */
-    if ( FG_Altitude < -9000 ) {
-       save_alt = FG_Altitude;
-       FG_Altitude = 0;
-    }
-
-    // translate FG to LaRCsim structure
-    fgFlight_2_LaRCsim(f);
-    // printf("FG_Altitude = %.2f\n", FG_Altitude * 0.3048);
-    // printf("Altitude = %.2f\n", Altitude * 0.3048);
-    // printf("Radius to Vehicle = %.2f\n", Radius_to_vehicle * 0.3048);
-
     for ( i = 0; i < multiloop; i++ ) {
        ls_loop( model_dt, 0);
     }
 
-    // printf("%d FG_Altitude = %.2f\n", i, FG_Altitude * 0.3048);
-    // printf("%d Altitude = %.2f\n", i, Altitude * 0.3048);
-    
-    // translate LaRCsim back to FG structure so that the
-    // autopilot (and the rest of the sim can use the updated
-    // values
-    fgLaRCsim_2_Flight(f);
-
-    /* but lets restore our original bogus altitude when we are done */
-    if ( save_alt < -9000 ) {
-       FG_Altitude = save_alt;
-    }
-
     return 1;
 }
 
 
+#if 0
 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
 int fgFlight_2_LaRCsim (fgFLIGHT *f) {
     Mass =      FG_Mass;
@@ -939,7 +914,7 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) {
 
     return ( 0 );
 }
-
+#endif
 
 /* Set the altitude (force) */
 int ls_ForceAltitude(double alt_feet) {
@@ -952,6 +927,9 @@ int ls_ForceAltitude(double alt_feet) {
 /* Flight Gear Modification Log
  *
  * $Log$
+ * Revision 1.23  1998/10/16 23:27:44  curt
+ * C++-ifying.
+ *
  * Revision 1.22  1998/09/29 02:02:59  curt
  * Added a brake + autopilot mods.
  *
index b1756ffeeb68f65af3e6194110a5bfc2b31141b2..1c91a9aa8c1ac5c5411392aead765b2a73e247cb 100644 (file)
 #define _LS_INTERFACE_H
 
 
-#include <Flight/flight.h>
+// #include <Flight/flight.h>
 #include "ls_types.h"
 
 
 /* reset flight params to a specific position */ 
-int fgLaRCsimInit(double dt);
+int ls_toplevel_init(double dt);
 
 /* update position based on inputs, positions, velocities, etc. */
-int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop);
+int ls_update(int multiloop);
 
+#if 0
 /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
 int fgFlight_2_LaRCsim (fgFLIGHT *f);
 
@@ -45,6 +46,7 @@ int fgFlight_2_LaRCsim (fgFLIGHT *f);
 int fgLaRCsim_2_Flight (fgFLIGHT *f);
 
 void ls_loop( SCALAR dt, int initialize );
+#endif
 
 /* Set the altitude (force) */
 int ls_ForceAltitude(double alt_feet);
@@ -54,15 +56,18 @@ int ls_ForceAltitude(double alt_feet);
 
 
 /* $Log$
-/* Revision 1.9  1998/07/12 03:11:04  curt
-/* Removed some printf()'s.
-/* Fixed the autopilot integration so it should be able to update it's control
-/*   positions every time the internal flight model loop is run, and not just
-/*   once per rendered frame.
-/* Added a routine to do the necessary stuff to force an arbitrary altitude
-/*   change.
-/* Gave the Navion engine just a tad more power.
+/* Revision 1.10  1998/10/16 23:27:45  curt
+/* C++-ifying.
 /*
+ * Revision 1.9  1998/07/12 03:11:04  curt
+ * Removed some printf()'s.
+ * Fixed the autopilot integration so it should be able to update it's control
+ *   positions every time the internal flight model loop is run, and not just
+ *   once per rendered frame.
+ * Added a routine to do the necessary stuff to force an arbitrary altitude
+ *   change.
+ * Gave the Navion engine just a tad more power.
+ *
  * Revision 1.8  1998/04/21 16:59:39  curt
  * Integrated autopilot.
  * Prepairing for C++ integration.
index c610a8f5b3ab309e3747671344a9d8194a6b0d2c..ee157faffde093a5fec25e8967becc56350c28d1 100644 (file)
@@ -65,7 +65,7 @@
 #include <Debug/fg_debug.h>
 #include <GUI/gui.h>
 #include <Joystick/joystick.h>
-#include <Math/fg_geodesy.h>
+#include <Math/fg_geodesy.hxx>
 #include <Math/mat3.h>
 #include <Math/polar3d.hxx>
 #include <PUI/pu.h>
@@ -894,6 +894,9 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.58  1998/10/16 23:27:52  curt
+// C++-ifying.
+//
 // Revision 1.57  1998/10/16 00:54:00  curt
 // Converted to Point3D class.
 //
index 8089d8225cd360a49379b63f7402f31aab50f763..746966debf48f4de061885eb153964c38d14ec0c 100644 (file)
@@ -54,7 +54,7 @@
 #include <Cockpit/cockpit.hxx>
 #include <Debug/fg_debug.h>
 #include <Joystick/joystick.h>
-#include <Math/fg_geodesy.h>
+#include <Math/fg_geodesy.hxx>
 #include <Math/fg_random.h>
 #include <Math/point3d.hxx>
 #include <Math/polar3d.hxx>
@@ -153,31 +153,6 @@ int fgInitGeneral( void ) {
 }
 
 
-// convert a geodetic point lon(radians), lat(radians), elev(meter) to
-// a cartesian point
-static Point3D geod_to_cart(double geod[3]) {
-    Point3D cp;
-    Point3D pp;
-    double gc_lon, gc_lat, sl_radius;
-
-    // printf("A geodetic point is (%.2f, %.2f, %.2f)\n", 
-    //        geod[0], geod[1], geod[2]);
-
-    gc_lon = geod[0];
-    fgGeodToGeoc(geod[1], geod[2], &sl_radius, &gc_lat);
-
-    // printf("A geocentric point is (%.2f, %.2f, %.2f)\n", gc_lon, 
-    //        gc_lat, sl_radius+geod[2]);
-
-    pp.setvals( gc_lon, gc_lat, sl_radius + geod[2] );
-    cp = fgPolarToCart3d(pp);
-    
-    // printf("A cart point is (%.8f, %.8f, %.8f)\n", cp.x, cp.y, cp.z);
-
-    return(cp);
-}
-
-
 // This is the top level init routine which calls all the other
 // initialization routines.  If you are adding a subsystem to flight
 // gear, its initialization call should located in this routine.
@@ -188,8 +163,7 @@ int fgInitSubsystems( void )
     fgLIGHT *l;
     fgTIME *t;
     fgVIEW *v;
-    double geod_pos[3];
-    Point3D abs_view_pos;
+    Point3D geod_pos, abs_view_pos;
 
     l = &cur_light_params;
     t = &cur_time_params;
@@ -225,13 +199,11 @@ int fgInitSubsystems( void )
     }
 
     // calculalate a cartesian point somewhere along the line between
-    // the center of the earth and our view position
-    geod_pos[0] = FG_Longitude;
-    geod_pos[1] = FG_Latitude;
-    // doesn't have to be the exact elevation (this is good because we
-    // don't know it yet :-)
-    geod_pos[2] = 0;
-    abs_view_pos = geod_to_cart(geod_pos);
+    // the center of the earth and our view position.  Doesn't have to
+    // be the exact elevation (this is good because we don't know it
+    // yet :-)
+    geod_pos.setvals( FG_Longitude, FG_Latitude, 0.0);
+    abs_view_pos = fgGeodToCart(geod_pos);
 
     // Calculate ground elevation at starting point
     scenery.cur_elev = 
@@ -393,6 +365,9 @@ int fgInitSubsystems( void )
 
 
 // $Log$
+// Revision 1.42  1998/10/16 23:27:54  curt
+// C++-ifying.
+//
 // Revision 1.41  1998/10/16 00:54:01  curt
 // Converted to Point3D class.
 //
index e63ce32d1ce10e78e22d970fa3d2f5054250f48f..22b5f1c5f03e759c3e114ead0deb3b8253aee8cb 100644 (file)
@@ -1,4 +1,3 @@
-//
 // views.hxx -- data structures and routines for managing and view parameters.
 //
 // Written by Curtis Olson, started August 1997.
@@ -32,8 +31,7 @@
 #endif                                   
 
 
-// #include <Include/fg_types.h>
-#include <Flight/flight.h>
+#include <Flight/flight.hxx>
 #include <Math/mat3.h>
 #include <Math/point3d.hxx>
 #include <Time/fg_time.hxx>
@@ -182,6 +180,9 @@ extern fgVIEW current_view;
 
 
 // $Log$
+// Revision 1.15  1998/10/16 23:27:56  curt
+// C++-ifying.
+//
 // Revision 1.14  1998/10/16 00:54:04  curt
 // Converted to Point3D class.
 //
index ae768ae4e139027f930c985ddbbca2874f90b5ba..6b171376ec51640ccb018df9b68af1b4b1b7b0e2 100644 (file)
@@ -1,28 +1,25 @@
-/* -*- Mode: C++ -*-
- *
- * scenery.c -- data structures and routines for managing scenery.
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
+// scenery.cxx -- data structures and routines for managing scenery.
+//
+// Written by Curtis Olson, started May 1997.
+//
+// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+// (Log is kept at end of this file)
 
 
 #ifdef HAVE_CONFIG_H
 // #include "texload.h"
 
 
-/* Temporary hack until we get a better texture management system running */
+// Temporary hack until we get a better texture management system running
 GLint area_texture;
 
 
-/* Shared structure to hold current scenery parameters */
+// Shared structure to hold current scenery parameters
 struct fgSCENERY scenery;
 
 
-/* Initialize the Scenery Management system */
+// Initialize the Scenery Management system
 int fgSceneryInit( void ) {
     fgOPTIONS *o;
     // char path[1024], fgpath[1024];
@@ -72,187 +69,189 @@ int fgSceneryInit( void ) {
 }
 
 
-/* Tell the scenery manager where we are so it can load the proper data, and
- * build the proper structures. */
+// Tell the scenery manager where we are so it can load the proper data, and
+// build the proper structures.
 void fgSceneryUpdate(double lon, double lat, double elev) {
     // does nothing;
 }
 
 
-/* Render out the current scene */
+// Render out the current scene
 void fgSceneryRender( void ) {
 }
 
 
-/* $Log$
-/* Revision 1.8  1998/08/25 16:52:40  curt
-/* material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to
-/*   ../Objects
-/*
- * Revision 1.7  1998/07/13 21:01:59  curt
- * Wrote access functions for current fgOPTIONS.
- *
- * Revision 1.6  1998/07/12 03:18:27  curt
- * Added ground collision detection.  This involved:
- * - saving the entire vertex list for each tile with the tile records.
- * - saving the face list for each fragment with the fragment records.
- * - code to intersect the current vertical line with the proper face in
- *   an efficient manner as possible.
- * Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
- *
- * Revision 1.5  1998/06/17 21:36:41  curt
- * Load and manage multiple textures defined in the Materials library.
- * Boost max material fagments for each material property to 800.
- * Multiple texture support when rendering.
- *
- * Revision 1.4  1998/05/13 18:26:40  curt
- * Root path info moved to fgOPTIONS.
- *
- * Revision 1.3  1998/05/07 23:15:20  curt
- * Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
- * Added support for --tile-radius=n option.
- *
- * Revision 1.2  1998/05/02 01:52:16  curt
- * Playing around with texture coordinates.
- *
- * Revision 1.1  1998/04/30 12:35:30  curt
- * Added a command line rendering option specify smooth/flat shading.
- *
- * Revision 1.42  1998/04/28 21:43:27  curt
- * Wrapped zlib calls up so we can conditionally comment out zlib support.
- *
- * Revision 1.41  1998/04/24 00:51:08  curt
- * Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
- * Tweaked the scenery file extentions to be "file.obj" (uncompressed)
- * or "file.obz" (compressed.)
- *
- * Revision 1.40  1998/04/18 04:14:06  curt
- * Moved fg_debug.c to it's own library.
- *
- * Revision 1.39  1998/04/08 23:30:07  curt
- * Adopted Gnu automake/autoconf system.
- *
- * Revision 1.38  1998/04/03 22:11:37  curt
- * Converting to Gnu autoconf system.
- *
- * Revision 1.37  1998/03/23 21:23:05  curt
- * Debugging output tweaks.
- *
- * Revision 1.36  1998/03/14 00:30:50  curt
- * Beginning initial terrain texturing experiments.
- *
- * Revision 1.35  1998/01/31 00:43:26  curt
- * Added MetroWorks patches from Carmen Volpe.
- *
- * Revision 1.34  1998/01/27 03:26:43  curt
- * Playing with new fgPrintf command.
- *
- * Revision 1.33  1998/01/19 19:27:17  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.32  1998/01/19 18:40:37  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.31  1998/01/13 00:23:11  curt
- * Initial changes to support loading and management of scenery tiles.  Note,
- * there's still a fair amount of work left to be done.
- *
- * Revision 1.30  1998/01/07 03:22:29  curt
- * Moved astro stuff to .../Src/Astro/
- *
- * Revision 1.29  1997/12/30 20:47:52  curt
- * Integrated new event manager with subsystem initializations.
- *
- * Revision 1.28  1997/12/15 23:55:02  curt
- * Add xgl wrappers for debugging.
- * Generate terrain normals on the fly.
- *
- * Revision 1.27  1997/12/12 21:41:30  curt
- * More light/material property tweaking ... still a ways off.
- *
- * Revision 1.26  1997/12/12 19:52:58  curt
- * Working on lightling and material properties.
- *
- * Revision 1.25  1997/12/10 22:37:51  curt
- * Prepended "fg" on the name of all global structures that didn't have it yet.
- * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
- *
- * Revision 1.24  1997/12/08 22:51:18  curt
- * Enhanced to handle ccw and cw tri-stripe winding.  This is a temporary
- * admission of defeat.  I will eventually go back and get all the stripes
- * wound the same way (ccw).
- *
- * Revision 1.23  1997/11/25 19:25:37  curt
- * Changes to integrate Durk's moon/sun code updates + clean up.
- *
- * Revision 1.22  1997/10/28 21:00:22  curt
- * Changing to new terrain format.
- *
- * 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.
- *
- * Revision 1.18  1997/09/05 01:35:59  curt
- * Working on getting stars right.
- *
- * Revision 1.17  1997/08/29 17:55:27  curt
- * Worked on properly aligning the stars.
- *
- * Revision 1.16  1997/08/27 21:32:29  curt
- * Restructured view calculation code.  Added stars.
- *
- * Revision 1.15  1997/08/27 03:30:32  curt
- * Changed naming scheme of basic shared structures.
- *
- * Revision 1.14  1997/08/25 20:27:24  curt
- * Merged in initial HUD and Joystick code.
- *
- * Revision 1.13  1997/08/22 21:34:41  curt
- * Doing a bit of reorganizing and house cleaning.
- *
- * Revision 1.12  1997/08/19 23:55:08  curt
- * Worked on better simulating real lighting.
- *
- * Revision 1.11  1997/08/13 20:24:22  curt
- * Changed default detail level.
- *
- * Revision 1.10  1997/08/06 00:24:30  curt
- * Working on correct real time sun lighting.
- *
- * Revision 1.9  1997/08/04 17:08:11  curt
- * Testing cvs on IRIX 6.x
- *
- * Revision 1.8  1997/07/18 23:41:27  curt
- * Tweaks for building with Cygnus Win32 compiler.
- *
- * Revision 1.7  1997/07/16 20:04:52  curt
- * Minor tweaks to aid Win32 port.
- *
- * Revision 1.6  1997/07/14 16:26:05  curt
- * Testing/playing -- placed objects randomly across the entire terrain.
- *
- * Revision 1.5  1997/07/11 03:23:19  curt
- * Solved some scenery display/orientation problems.  Still have a positioning
- * (or transformation?) problem.
- *
- * Revision 1.4  1997/07/11 01:30:03  curt
- * More tweaking of terrian floor.
- *
- * Revision 1.3  1997/06/29 21:16:50  curt
- * More twiddling with the Scenery Management system.
- *
- * Revision 1.2  1997/06/27 20:03:37  curt
- * Working on Makefile structure.
- *
- * Revision 1.1  1997/06/27 02:26:30  curt
- * Initial revision.
- *
- */
+// $Log$
+// Revision 1.9  1998/10/16 23:27:57  curt
+// C++-ifying.
+//
+// Revision 1.8  1998/08/25 16:52:40  curt
+// material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to
+//   ../Objects
+//
+// Revision 1.7  1998/07/13 21:01:59  curt
+// Wrote access functions for current fgOPTIONS.
+//
+// Revision 1.6  1998/07/12 03:18:27  curt
+// Added ground collision detection.  This involved:
+// - saving the entire vertex list for each tile with the tile records.
+// - saving the face list for each fragment with the fragment records.
+// - code to intersect the current vertical line with the proper face in
+//   an efficient manner as possible.
+// Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
+//
+// Revision 1.5  1998/06/17 21:36:41  curt
+// Load and manage multiple textures defined in the Materials library.
+// Boost max material fagments for each material property to 800.
+// Multiple texture support when rendering.
+//
+// Revision 1.4  1998/05/13 18:26:40  curt
+// Root path info moved to fgOPTIONS.
+//
+// Revision 1.3  1998/05/07 23:15:20  curt
+// Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
+// Added support for --tile-radius=n option.
+//
+// Revision 1.2  1998/05/02 01:52:16  curt
+// Playing around with texture coordinates.
+//
+// Revision 1.1  1998/04/30 12:35:30  curt
+// Added a command line rendering option specify smooth/flat shading.
+//
+// Revision 1.42  1998/04/28 21:43:27  curt
+// Wrapped zlib calls up so we can conditionally comment out zlib support.
+//
+// Revision 1.41  1998/04/24 00:51:08  curt
+// Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+// Tweaked the scenery file extentions to be "file.obj" (uncompressed)
+// or "file.obz" (compressed.)
+//
+// Revision 1.40  1998/04/18 04:14:06  curt
+// Moved fg_debug.c to it's own library.
+//
+// Revision 1.39  1998/04/08 23:30:07  curt
+// Adopted Gnu automake/autoconf system.
+//
+// Revision 1.38  1998/04/03 22:11:37  curt
+// Converting to Gnu autoconf system.
+//
+// Revision 1.37  1998/03/23 21:23:05  curt
+// Debugging output tweaks.
+//
+// Revision 1.36  1998/03/14 00:30:50  curt
+// Beginning initial terrain texturing experiments.
+//
+// Revision 1.35  1998/01/31 00:43:26  curt
+// Added MetroWorks patches from Carmen Volpe.
+//
+// Revision 1.34  1998/01/27 03:26:43  curt
+// Playing with new fgPrintf command.
+//
+// Revision 1.33  1998/01/19 19:27:17  curt
+// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+// This should simplify things tremendously.
+//
+// Revision 1.32  1998/01/19 18:40:37  curt
+// Tons of little changes to clean up the code and to remove fatal errors
+// when building with the c++ compiler.
+//
+// Revision 1.31  1998/01/13 00:23:11  curt
+// Initial changes to support loading and management of scenery tiles.  Note,
+// there's still a fair amount of work left to be done.
+//
+// Revision 1.30  1998/01/07 03:22:29  curt
+// Moved astro stuff to .../Src/Astro/
+//
+// Revision 1.29  1997/12/30 20:47:52  curt
+// Integrated new event manager with subsystem initializations.
+//
+// Revision 1.28  1997/12/15 23:55:02  curt
+// Add xgl wrappers for debugging.
+// Generate terrain normals on the fly.
+//
+// Revision 1.27  1997/12/12 21:41:30  curt
+// More light/material property tweaking ... still a ways off.
+//
+// Revision 1.26  1997/12/12 19:52:58  curt
+// Working on lightling and material properties.
+//
+// Revision 1.25  1997/12/10 22:37:51  curt
+// Prepended "fg" on the name of all global structures that didn't have it yet.
+// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+//
+// Revision 1.24  1997/12/08 22:51:18  curt
+// Enhanced to handle ccw and cw tri-stripe winding.  This is a temporary
+// admission of defeat.  I will eventually go back and get all the stripes
+// wound the same way (ccw).
+//
+// Revision 1.23  1997/11/25 19:25:37  curt
+// Changes to integrate Durk's moon/sun code updates + clean up.
+//
+// Revision 1.22  1997/10/28 21:00:22  curt
+// Changing to new terrain format.
+//
+// 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.
+//
+// Revision 1.18  1997/09/05 01:35:59  curt
+// Working on getting stars right.
+//
+// Revision 1.17  1997/08/29 17:55:27  curt
+// Worked on properly aligning the stars.
+//
+// Revision 1.16  1997/08/27 21:32:29  curt
+// Restructured view calculation code.  Added stars.
+//
+// Revision 1.15  1997/08/27 03:30:32  curt
+// Changed naming scheme of basic shared structures.
+//
+// Revision 1.14  1997/08/25 20:27:24  curt
+// Merged in initial HUD and Joystick code.
+//
+// Revision 1.13  1997/08/22 21:34:41  curt
+// Doing a bit of reorganizing and house cleaning.
+//
+// Revision 1.12  1997/08/19 23:55:08  curt
+// Worked on better simulating real lighting.
+//
+// Revision 1.11  1997/08/13 20:24:22  curt
+// Changed default detail level.
+//
+// Revision 1.10  1997/08/06 00:24:30  curt
+// Working on correct real time sun lighting.
+//
+// Revision 1.9  1997/08/04 17:08:11  curt
+// Testing cvs on IRIX 6.x
+//
+// Revision 1.8  1997/07/18 23:41:27  curt
+// Tweaks for building with Cygnus Win32 compiler.
+//
+// Revision 1.7  1997/07/16 20:04:52  curt
+// Minor tweaks to aid Win32 port.
+//
+// Revision 1.6  1997/07/14 16:26:05  curt
+// Testing/playing -- placed objects randomly across the entire terrain.
+//
+// Revision 1.5  1997/07/11 03:23:19  curt
+// Solved some scenery display/orientation problems.  Still have a positioning
+// (or transformation?) problem.
+//
+// Revision 1.4  1997/07/11 01:30:03  curt
+// More tweaking of terrian floor.
+//
+// Revision 1.3  1997/06/29 21:16:50  curt
+// More twiddling with the Scenery Management system.
+//
+// Revision 1.2  1997/06/27 20:03:37  curt
+// Working on Makefile structure.
+//
+// Revision 1.1  1997/06/27 02:26:30  curt
+// Initial revision.
+//
index 7e069e95082ee14b3c7409063d0717ba5d4fbce3..385c8a8f224f83567ff2c718fd2a3c40aaec9a5a 100644 (file)
@@ -1,27 +1,25 @@
-/**************************************************************************
- * scenery.hxx -- data structures and routines for managing scenery.
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
+// scenery.hxx -- data structures and routines for managing scenery.
+//
+// Written by Curtis Olson, started May 1997.
+//
+// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+// $Id$
+// (Log is kept at end of this file)
 
 
 #ifndef _SCENERY_HXX
 #endif                                   
 
 
-// #include <Include/fg_types.h>
 #include <Math/point3d.hxx>
 
 
-/* Define a structure containing global scenery parameters */
+// Define a structure containing global scenery parameters
 struct fgSCENERY {
-    /* center of current scenery chunk */
+    // center of current scenery chunk
     Point3D center;
 
-    /* next center of current scenery chunk */
+    // next center of current scenery chunk
     Point3D next_center;
 
-    /* angle of sun relative to current local horizontal */
+    // angle of sun relative to current local horizontal
     double sun_angle;
 
     // elevation of terrain at our current lat/lon (based on the
@@ -56,109 +53,112 @@ struct fgSCENERY {
 extern struct fgSCENERY scenery;
 
 
-/* Initialize the Scenery Management system */
+// Initialize the Scenery Management system
 int fgSceneryInit( void );
 
 
-/* Tell the scenery manager where we are so it can load the proper data, and
- * build the proper structures. */
+// Tell the scenery manager where we are so it can load the proper
+// data, and build the proper structures.
 void fgSceneryUpdate(double lon, double lat, double elev);
 
 
-/* Render out the current scene */
+// Render out the current scene
 void fgSceneryRender( void );
 
 
-#endif /* _SCENERY_HXX */
-
-
-/* $Log$
-/* Revision 1.5  1998/10/16 00:55:44  curt
-/* Converted to Point3D class.
-/*
- * Revision 1.4  1998/07/12 03:18:28  curt
- * Added ground collision detection.  This involved:
- * - saving the entire vertex list for each tile with the tile records.
- * - saving the face list for each fragment with the fragment records.
- * - code to intersect the current vertical line with the proper face in
- *   an efficient manner as possible.
- * Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
- *
- * Revision 1.3  1998/07/08 14:47:22  curt
- * Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
- * polare3d.h renamed to polar3d.hxx
- * fg{Cartesian,Polar}Point3d consolodated.
- * Added some initial support for calculating local current ground elevation.
- *
- * Revision 1.2  1998/05/02 01:52:16  curt
- * Playing around with texture coordinates.
- *
- * Revision 1.1  1998/04/30 12:35:31  curt
- * Added a command line rendering option specify smooth/flat shading.
- *
- * Revision 1.21  1998/04/25 22:06:31  curt
- * Edited cvs log messages in source files ... bad bad bad!
- *
- * Revision 1.20  1998/04/22 13:22:45  curt
- * C++ - ifing the code a bit.
- *
- * Revision 1.19  1998/04/21 17:02:43  curt
- * Prepairing for C++ integration.
- *
- * Revision 1.18  1998/03/14 00:30:51  curt
- * Beginning initial terrain texturing experiments.
- *
- * Revision 1.17  1998/02/20 00:16:24  curt
- * Thursday's tweaks.
- *
- * Revision 1.16  1998/01/27 00:48:03  curt
- * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
- * system and commandline/config file processing code.
- *
- * Revision 1.15  1998/01/22 02:59:41  curt
- * Changed #ifdef FILE_H to #ifdef _FILE_H
- *
- * Revision 1.14  1998/01/19 19:27:17  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.13  1998/01/19 18:40:38  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.12  1997/12/15 23:55:03  curt
- * Add xgl wrappers for debugging.
- * Generate terrain normals on the fly.
- *
- * Revision 1.11  1997/12/10 22:37:52  curt
- * Prepended "fg" on the name of all global structures that didn't have it yet.
- * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
- *
- * Revision 1.10  1997/09/04 02:17:37  curt
- * Shufflin' stuff.
- *
- * Revision 1.9  1997/08/27 03:30:33  curt
- * Changed naming scheme of basic shared structures.
- *
- * Revision 1.8  1997/08/06 00:24:30  curt
- * Working on correct real time sun lighting.
- *
- * Revision 1.7  1997/07/23 21:52:27  curt
- * Put comments around the text after an #endif for increased portability.
- *
- * Revision 1.6  1997/07/11 01:30:03  curt
- * More tweaking of terrian floor.
- *
- * Revision 1.5  1997/06/26 22:14:57  curt
- * Beginning work on a scenery management system.
- *
- * Revision 1.4  1997/06/21 17:57:21  curt
- * directory shuffling ...
- *
- * Revision 1.2  1997/05/23 15:40:43  curt
- * Added GNU copyright headers.
- *
- * Revision 1.1  1997/05/16 16:07:07  curt
- * Initial revision.
- *
- */
+#endif // _SCENERY_HXX
+
+
+// $Log$
+// Revision 1.6  1998/10/16 23:27:59  curt
+// C++-ifying.
+//
+// Revision 1.5  1998/10/16 00:55:44  curt
+// Converted to Point3D class.
+//
+// Revision 1.4  1998/07/12 03:18:28  curt
+// Added ground collision detection.  This involved:
+// - saving the entire vertex list for each tile with the tile records.
+// - saving the face list for each fragment with the fragment records.
+// - code to intersect the current vertical line with the proper face in
+//   an efficient manner as possible.
+// Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
+//
+// Revision 1.3  1998/07/08 14:47:22  curt
+// Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
+// polare3d.h renamed to polar3d.hxx
+// fg{Cartesian,Polar}Point3d consolodated.
+// Added some initial support for calculating local current ground elevation.
+//
+// Revision 1.2  1998/05/02 01:52:16  curt
+// Playing around with texture coordinates.
+//
+// Revision 1.1  1998/04/30 12:35:31  curt
+// Added a command line rendering option specify smooth/flat shading.
+//
+// Revision 1.21  1998/04/25 22:06:31  curt
+// Edited cvs log messages in source files ... bad bad bad!
+//
+// Revision 1.20  1998/04/22 13:22:45  curt
+// C++ - ifing the code a bit.
+//
+// Revision 1.19  1998/04/21 17:02:43  curt
+// Prepairing for C++ integration.
+//
+// Revision 1.18  1998/03/14 00:30:51  curt
+// Beginning initial terrain texturing experiments.
+//
+// Revision 1.17  1998/02/20 00:16:24  curt
+// Thursday's tweaks.
+//
+// Revision 1.16  1998/01/27 00:48:03  curt
+// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
+// system and commandline/config file processing code.
+//
+// Revision 1.15  1998/01/22 02:59:41  curt
+// Changed #ifdef FILE_H to #ifdef _FILE_H
+//
+// Revision 1.14  1998/01/19 19:27:17  curt
+// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+// This should simplify things tremendously.
+//
+// Revision 1.13  1998/01/19 18:40:38  curt
+// Tons of little changes to clean up the code and to remove fatal errors
+// when building with the c++ compiler.
+//
+// Revision 1.12  1997/12/15 23:55:03  curt
+// Add xgl wrappers for debugging.
+// Generate terrain normals on the fly.
+//
+// Revision 1.11  1997/12/10 22:37:52  curt
+// Prepended "fg" on the name of all global structures that didn't have it yet.
+// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
+//
+// Revision 1.10  1997/09/04 02:17:37  curt
+// Shufflin' stuff.
+//
+// Revision 1.9  1997/08/27 03:30:33  curt
+// Changed naming scheme of basic shared structures.
+//
+// Revision 1.8  1997/08/06 00:24:30  curt
+// Working on correct real time sun lighting.
+//
+// Revision 1.7  1997/07/23 21:52:27  curt
+// Put comments around the text after an #endif for increased portability.
+//
+// Revision 1.6  1997/07/11 01:30:03  curt
+// More tweaking of terrian floor.
+//
+// Revision 1.5  1997/06/26 22:14:57  curt
+// Beginning work on a scenery management system.
+//
+// Revision 1.4  1997/06/21 17:57:21  curt
+// directory shuffling ...
+//
+// Revision 1.2  1997/05/23 15:40:43  curt
+// Added GNU copyright headers.
+//
+// Revision 1.1  1997/05/16 16:07:07  curt
+// Initial revision.
+//
+
index 4109b2923eff01d3c7bc52d5ec26594aa45972a0..ff257f02928811006f0e9ccf54239519ed192054 100644 (file)
@@ -1,5 +1,5 @@
 noinst_LIBRARIES = libSlew.a
 
-libSlew_a_SOURCES = slew.c slew.h
+libSlew_a_SOURCES = slew.cxx slew.hxx
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator
diff --git a/Slew/slew.c b/Slew/slew.c
deleted file mode 100644 (file)
index c3f5475..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/**************************************************************************
- * slew.c -- the "slew" flight model
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
-
-
-#include <math.h>
-
-#include <Flight/Slew/slew.h>
-#include <Flight/flight.h>
-#include <Aircraft/aircraft.h>
-#include <Controls/controls.h>
-#include <Include/fg_constants.h>
-
-
-/* reset flight params to a specific position */
-void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
-    fgFLIGHT *f;
-
-    f = current_aircraft.flight;
-
-    /*
-    f->pos_x = pos_x;
-    f->pos_y = pos_y;
-    f->pos_z = pos_z;
-
-    f->vel_x = 0.0;
-    f->vel_y = 0.0;
-    f->vel_z = 0.0;
-
-    f->Phi = 0.0;
-    f->Theta = 0.0;
-    f->Psi = 0.0;
-
-    f->vel_Phi = 0.0;
-    f->vel_Theta = 0.0;
-    f->vel_Psi = 0.0;
-
-    f->Psi = heading;
-    */
-}
-
-
-/* update position based on inputs, positions, velocities, etc. */
-void fgSlewUpdate( void ) {
-    fgFLIGHT *f;
-    fgCONTROLS *c;
-
-    f = current_aircraft.flight;
-    c = current_aircraft.controls;
-
-    /* f->Psi += ( c->aileron / 8 );
-    if ( f->Psi > FG_2PI ) {
-       f->Psi -= FG_2PI;
-    } else if ( f->Psi < 0 ) {
-       f->Psi += FG_2PI;
-    }
-
-    f->vel_x = -c->elev;
-
-    f->pos_x = f->pos_x + (cos(f->Psi) * f->vel_x);
-    f->pos_y = f->pos_y + (sin(f->Psi) * f->vel_x); */
-}
-
-
-/* $Log$
-/* Revision 1.13  1998/04/25 22:06:29  curt
-/* Edited cvs log messages in source files ... bad bad bad!
-/*
- * Revision 1.12  1998/04/08 23:35:30  curt
- * Tweaks to Gnu automake/autoconf system.
- *
- * Revision 1.11  1998/02/07 15:29:39  curt
- * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
- * <chotchkiss@namg.us.anritsu.com>
- *
- * Revision 1.10  1998/01/27 00:47:53  curt
- * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
- * system and commandline/config file processing code.
- *
- * Revision 1.9  1998/01/19 19:27:06  curt
- * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
- * This should simplify things tremendously.
- *
- * Revision 1.8  1998/01/19 18:40:30  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.7  1997/12/15 23:54:42  curt
- * Add xgl wrappers for debugging.
- * Generate terrain normals on the fly.
- *
- * Revision 1.6  1997/08/27 03:30:11  curt
- * Changed naming scheme of basic shared structures.
- *
- * Revision 1.5  1997/07/19 22:35:06  curt
- * Moved fiddled with PI to avoid compiler warnings.
- *
- * Revision 1.4  1997/06/21 17:12:51  curt
- * Capitalized subdirectory names.
- *
- * Revision 1.3  1997/05/29 22:40:00  curt
- * Working on incorporating the LaRCsim flight model.
- *
- * Revision 1.2  1997/05/29 12:30:19  curt
- * Some initial mods to work better in a timer environment.
- *
- * Revision 1.1  1997/05/29 02:29:42  curt
- * Moved to their own directory.
- *
- * Revision 1.2  1997/05/23 15:40:37  curt
- * Added GNU copyright headers.
- *
- * Revision 1.1  1997/05/16 16:04:45  curt
- * Initial revision.
- *
- */
diff --git a/Slew/slew.cxx b/Slew/slew.cxx
new file mode 100644 (file)
index 0000000..d1683b1
--- /dev/null
@@ -0,0 +1,141 @@
+/**************************************************************************
+ * slew.cxx -- the "slew" flight model
+ *
+ * Written by Curtis Olson, started May 1997.
+ *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ * (Log is kept at end of this file)
+ **************************************************************************/
+
+
+#include <math.h>
+
+#include "slew.hxx"
+
+#include <Flight/flight.hxx>
+#include <Aircraft/aircraft.hxx>
+#include <Controls/controls.h>
+#include <Include/fg_constants.h>
+
+
+/* reset flight params to a specific position */
+void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
+    fgFLIGHT *f;
+
+    f = current_aircraft.flight;
+
+    /*
+    f->pos_x = pos_x;
+    f->pos_y = pos_y;
+    f->pos_z = pos_z;
+
+    f->vel_x = 0.0;
+    f->vel_y = 0.0;
+    f->vel_z = 0.0;
+
+    f->Phi = 0.0;
+    f->Theta = 0.0;
+    f->Psi = 0.0;
+
+    f->vel_Phi = 0.0;
+    f->vel_Theta = 0.0;
+    f->vel_Psi = 0.0;
+
+    f->Psi = heading;
+    */
+}
+
+
+/* update position based on inputs, positions, velocities, etc. */
+void fgSlewUpdate( void ) {
+    fgFLIGHT *f;
+    fgCONTROLS *c;
+
+    f = current_aircraft.flight;
+    c = current_aircraft.controls;
+
+    /* f->Psi += ( c->aileron / 8 );
+    if ( f->Psi > FG_2PI ) {
+       f->Psi -= FG_2PI;
+    } else if ( f->Psi < 0 ) {
+       f->Psi += FG_2PI;
+    }
+
+    f->vel_x = -c->elev;
+
+    f->pos_x = f->pos_x + (cos(f->Psi) * f->vel_x);
+    f->pos_y = f->pos_y + (sin(f->Psi) * f->vel_x); */
+}
+
+
+/* $Log$
+/* Revision 1.1  1998/10/16 23:27:50  curt
+/* C++-ifying.
+/*
+ * Revision 1.13  1998/04/25 22:06:29  curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
+ * Revision 1.12  1998/04/08 23:35:30  curt
+ * Tweaks to Gnu automake/autoconf system.
+ *
+ * Revision 1.11  1998/02/07 15:29:39  curt
+ * Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+ * <chotchkiss@namg.us.anritsu.com>
+ *
+ * Revision 1.10  1998/01/27 00:47:53  curt
+ * Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
+ * system and commandline/config file processing code.
+ *
+ * Revision 1.9  1998/01/19 19:27:06  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.8  1998/01/19 18:40:30  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
+ * Revision 1.7  1997/12/15 23:54:42  curt
+ * Add xgl wrappers for debugging.
+ * Generate terrain normals on the fly.
+ *
+ * Revision 1.6  1997/08/27 03:30:11  curt
+ * Changed naming scheme of basic shared structures.
+ *
+ * Revision 1.5  1997/07/19 22:35:06  curt
+ * Moved fiddled with PI to avoid compiler warnings.
+ *
+ * Revision 1.4  1997/06/21 17:12:51  curt
+ * Capitalized subdirectory names.
+ *
+ * Revision 1.3  1997/05/29 22:40:00  curt
+ * Working on incorporating the LaRCsim flight model.
+ *
+ * Revision 1.2  1997/05/29 12:30:19  curt
+ * Some initial mods to work better in a timer environment.
+ *
+ * Revision 1.1  1997/05/29 02:29:42  curt
+ * Moved to their own directory.
+ *
+ * Revision 1.2  1997/05/23 15:40:37  curt
+ * Added GNU copyright headers.
+ *
+ * Revision 1.1  1997/05/16 16:04:45  curt
+ * Initial revision.
+ *
+ */
diff --git a/Slew/slew.h b/Slew/slew.h
deleted file mode 100644 (file)
index 7f4606d..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**************************************************************************
- * slew.h -- the "slew" flight model
- *
- * Written by Curtis Olson, started May 1997.
- *
- * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
- * (Log is kept at end of this file)
- **************************************************************************/
-
-
-#ifndef _SLEW_H
-#define _SLEW_H
-
-
-/* reset flight params to a specific position */ 
-void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading);
-
-/* update position based on inputs, positions, velocities, etc. */
-void fgSlewUpdate( void );
-
-
-#endif /* _SLEW_H */
-
-
-/* $Log$
-/* Revision 1.4  1998/01/22 02:59:34  curt
-/* Changed #ifdef FILE_H to #ifdef _FILE_H
-/*
- * Revision 1.3  1998/01/19 18:40:30  curt
- * Tons of little changes to clean up the code and to remove fatal errors
- * when building with the c++ compiler.
- *
- * Revision 1.2  1997/07/23 21:52:20  curt
- * Put comments around the text after an #endif for increased portability.
- *
- * Revision 1.1  1997/05/29 02:29:43  curt
- * Moved to their own directory.
- *
- * Revision 1.2  1997/05/23 15:40:38  curt
- * Added GNU copyright headers.
- *
- * Revision 1.1  1997/05/16 16:04:46  curt
- * Initial revision.
- *
- */
diff --git a/Slew/slew.hxx b/Slew/slew.hxx
new file mode 100644 (file)
index 0000000..2c6ecf4
--- /dev/null
@@ -0,0 +1,69 @@
+/**************************************************************************
+ * slew.hxx -- the "slew" flight model
+ *
+ * Written by Curtis Olson, started May 1997.
+ *
+ * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ * (Log is kept at end of this file)
+ **************************************************************************/
+
+
+#ifndef _SLEW_HXX
+#define _SLEW_HXX
+
+
+#ifndef __cplusplus                                                          
+# error This library requires C++
+#endif                                   
+
+
+/* reset flight params to a specific position */ 
+void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading);
+
+/* update position based on inputs, positions, velocities, etc. */
+void fgSlewUpdate( void );
+
+
+#endif /* _SLEW_HXX */
+
+
+/* $Log$
+/* Revision 1.1  1998/10/16 23:27:52  curt
+/* C++-ifying.
+/*
+ * Revision 1.4  1998/01/22 02:59:34  curt
+ * Changed #ifdef FILE_H to #ifdef _FILE_H
+ *
+ * Revision 1.3  1998/01/19 18:40:30  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
+ * Revision 1.2  1997/07/23 21:52:20  curt
+ * Put comments around the text after an #endif for increased portability.
+ *
+ * Revision 1.1  1997/05/29 02:29:43  curt
+ * Moved to their own directory.
+ *
+ * Revision 1.2  1997/05/23 15:40:38  curt
+ * Added GNU copyright headers.
+ *
+ * Revision 1.1  1997/05/16 16:04:46  curt
+ * Initial revision.
+ *
+ */
index d1ba002c239f673ee6247e0dff2f0d7979a96157..10a1608fd27905b1998c97ae1b3cbf243ea48c77 100644 (file)
@@ -43,7 +43,7 @@
 #include <GL/glut.h>
 #include <time.h>
 
-#include <Flight/flight.h>
+#include <Flight/flight.hxx>
 
 
 // Define a structure containing global time parameters
@@ -117,6 +117,9 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t);
 
 
 // $Log$
+// Revision 1.8  1998/10/16 23:28:00  curt
+// C++-ifying.
+//
 // Revision 1.7  1998/10/16 00:56:09  curt
 // Converted to Point3D class.
 //