1
0
Fork 0

C++-ifying.

This commit is contained in:
curt 1998-10-16 23:26:44 +00:00
parent cf2fa0f213
commit bf5fb5108b
37 changed files with 720 additions and 733 deletions

View file

@ -1,5 +1,5 @@
noinst_LIBRARIES = libAircraft.a 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 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator

View file

@ -26,7 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <Aircraft/aircraft.h> #include "aircraft.hxx"
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
@ -64,9 +64,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
/* $Log$ /* $Log$
/* Revision 1.19 1998/04/25 22:06:24 curt /* Revision 1.1 1998/10/16 23:26:47 curt
/* Edited cvs log messages in source files ... bad bad bad! /* 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 * Revision 1.18 1998/04/18 04:13:56 curt
* Moved fg_debug.c to it's own library. * Moved fg_debug.c to it's own library.
* *

View file

@ -28,15 +28,15 @@
#define _AIRCRAFT_H #define _AIRCRAFT_H
#include <Flight/flight.h> #ifndef __cplusplus
#include <Controls/controls.h> # error This library requires C++
#ifdef __cplusplus
extern "C" {
#endif #endif
#include <Flight/flight.hxx>
#include <Controls/controls.h>
/* Define a structure containing all the parameters for an aircraft */ /* Define a structure containing all the parameters for an aircraft */
typedef struct{ typedef struct{
fgFLIGHT *flight; fgFLIGHT *flight;
@ -57,18 +57,16 @@ void fgAircraftInit( void );
void fgAircraftOutputCurrent(fgAIRCRAFT *a); void fgAircraftOutputCurrent(fgAIRCRAFT *a);
#ifdef __cplusplus
}
#endif
#endif /* _AIRCRAFT_H */ #endif /* _AIRCRAFT_H */
/* $Log$ /* $Log$
/* Revision 1.12 1998/04/22 13:26:15 curt /* Revision 1.1 1998/10/16 23:26:49 curt
/* C++ - ifing the code a bit. /* 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 * Revision 1.11 1998/04/21 17:02:27 curt
* Prepairing for C++ integration. * Prepairing for C++ integration.
* *
@ -88,9 +86,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a);
/* $Log$ /* $Log$
/* Revision 1.12 1998/04/22 13:26:15 curt /* Revision 1.1 1998/10/16 23:26:49 curt
/* C++ - ifing the code a bit. /* 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 * Revision 1.11 1998/04/21 17:02:27 curt
* Prepairing for C++ integration. * Prepairing for C++ integration.
* *

View file

@ -33,7 +33,7 @@ using namespace std;
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
// #include <Include/fg_types.h> // #include <Include/fg_types.h>
#include <Math/fg_geodesy.h> #include <Math/fg_geodesy.hxx>
#include <Math/mat3.h> #include <Math/mat3.h>
#include <Math/point3d.hxx> #include <Math/point3d.hxx>
#include <Math/polar3d.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 #define FG_APT_BASE_TEX_CONSTANT 2000.0
#ifdef OLD_TEX_COORDS #ifdef OLD_TEX_COORDS
@ -196,7 +172,7 @@ gen_base( const Point3D& average, const container& perimeter, fgTILE *t)
// first point on perimeter // first point on perimeter
const_iterator current = perimeter.begin(); const_iterator current = perimeter.begin();
cart = geod_to_cart( *current ); cart = fgGeodToCart( *current );
cart_trans = cart - t->center; cart_trans = cart - t->center;
t->nodes[t->ncount][0] = cart_trans.x(); t->nodes[t->ncount][0] = cart_trans.x();
t->nodes[t->ncount][1] = cart_trans.y(); 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(); const_iterator last = perimeter.end();
for ( ; current != last; ++current ) { for ( ; current != last; ++current ) {
cart = geod_to_cart( *current ); cart = fgGeodToCart( *current );
cart_trans = cart - t->center; cart_trans = cart - t->center;
t->nodes[t->ncount][0] = cart_trans.x(); t->nodes[t->ncount][0] = cart_trans.x();
t->nodes[t->ncount][1] = cart_trans.y(); 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) // last point (first point in perimeter list)
current = perimeter.begin(); current = perimeter.begin();
cart = geod_to_cart( *current ); cart = fgGeodToCart( *current );
cart_trans = cart - t->center; cart_trans = cart - t->center;
fragment.add_face(center_num, i - 1, 1); fragment.add_face(center_num, i - 1, 1);
@ -346,6 +322,9 @@ fgAptGenerate(const string& path, fgTILE *tile)
// $Log$ // $Log$
// Revision 1.5 1998/10/16 23:27:14 curt
// C++-ifying.
//
// Revision 1.4 1998/10/16 00:51:46 curt // Revision 1.4 1998/10/16 00:51:46 curt
// Converted to Point3D class. // Converted to Point3D class.
// //

View file

@ -22,7 +22,7 @@
* $Id$ * $Id$
* (Log is kept at end of this file) * (Log is kept at end of this file)
**************************************************************************/ **************************************************************************/
#include <Flight/flight.h> #include <Flight/flight.hxx>
#include <string.h> #include <string.h>
#include "moon.hxx" #include "moon.hxx"

View file

@ -25,7 +25,7 @@
#ifndef _MOON_HXX_ #ifndef _MOON_HXX_
#define _MOON_HXX_ #define _MOON_HXX_
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>

View file

@ -1,27 +1,25 @@
/************************************************************************** // sky.cxx -- model sky with an upside down "bowl"
* sky.c -- model sky with an upside down "bowl" //
* // Written by Curtis Olson, started December 1997.
* Written by Curtis Olson, started December 1997. //
* // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com //
* // This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as
* modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the
* published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version.
* License, or (at your option) any later version. //
* // This program is distributed in the hope that it will be useful, but
* This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of
* WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details.
* General Public License for more details. //
* // You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software
* along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
* // $Id$
* $Id$ // (Log is kept at end of this file)
* (Log is kept at end of this file)
**************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -37,9 +35,9 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Flight/flight.h> #include <Flight/flight.hxx>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/views.hxx> #include <Main/views.hxx>
#include <Math/fg_random.h> #include <Math/fg_random.h>
@ -49,11 +47,7 @@
#include "sky.hxx" #include "sky.hxx"
/* // in meters of course
#include <Include/general.h>
*/
/* in meters of course */
#define CENTER_ELEV 25000.0 #define CENTER_ELEV 25000.0
#define INNER_RADIUS 50000.0 #define INNER_RADIUS 50000.0
@ -79,7 +73,7 @@ static float middle_color[12][4];
static float outer_color[12][4]; static float outer_color[12][4];
/* Calculate the sky structure vertices */ // Calculate the sky structure vertices
void fgSkyVerticesInit( void ) { void fgSkyVerticesInit( void ) {
float theta; float theta;
int i; int i;
@ -93,8 +87,8 @@ void fgSkyVerticesInit( void ) {
inner_vertex[i][1] = sin(theta) * INNER_RADIUS; inner_vertex[i][1] = sin(theta) * INNER_RADIUS;
inner_vertex[i][2] = INNER_ELEV; inner_vertex[i][2] = INNER_ELEV;
/* printf(" %.2f %.2f\n", cos(theta) * INNER_RADIUS, // printf(" %.2f %.2f\n", cos(theta) * INNER_RADIUS,
sin(theta) * INNER_RADIUS); */ // sin(theta) * INNER_RADIUS);
middle_vertex[i][0] = cos((double)theta) * MIDDLE_RADIUS; middle_vertex[i][0] = cos((double)theta) * MIDDLE_RADIUS;
middle_vertex[i][1] = sin((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 ) { void fgSkyColorsInit( void ) {
fgLIGHT *l; fgLIGHT *l;
double sun_angle, diff; double sun_angle, diff;
@ -124,13 +118,13 @@ void fgSkyColorsInit( void ) {
fgPrintf( FG_ASTRO, FG_INFO, fgPrintf( FG_ASTRO, FG_INFO,
" Generating the sky colors for each vertex.\n" ); " 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; sun_angle = l->sun_angle * RAD_TO_DEG;
// fgPrintf( FG_ASTRO, FG_INFO, // fgPrintf( FG_ASTRO, FG_INFO,
// " Sun angle in degrees = %.2f\n", sun_angle); // " Sun angle in degrees = %.2f\n", sun_angle);
if ( (sun_angle > 80.0) && (sun_angle < 100.0) ) { 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[0] = (10.0 - fabs(90.0 - sun_angle)) / 25.0;
outer_param[1] = (10.0 - fabs(90.0 - sun_angle)) / 35.0; outer_param[1] = (10.0 - fabs(90.0 - sun_angle)) / 35.0;
outer_param[2] = 0.0; outer_param[2] = 0.0;
@ -153,10 +147,10 @@ void fgSkyColorsInit( void ) {
outer_diff[0] = outer_diff[1] = outer_diff[2] = 0.0; outer_diff[0] = outer_diff[1] = outer_diff[2] = 0.0;
middle_diff[0] = middle_diff[1] = middle_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", // printf(" outer_red_param = %.2f outer_red_diff = %.2f\n",
outer_red_param, outer_red_diff); */ // 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++ ) { for ( j = 0; j < 3; j++ ) {
outer_amt[j] = outer_param[j]; outer_amt[j] = outer_param[j];
middle_amt[j] = middle_param[j]; middle_amt[j] = middle_param[j];
@ -166,8 +160,8 @@ void fgSkyColorsInit( void ) {
for ( j = 0; j < 3; j++ ) { for ( j = 0; j < 3; j++ ) {
diff = l->sky_color[j] - l->fog_color[j]; diff = l->sky_color[j] - l->fog_color[j];
/* printf("sky = %.2f fog = %.2f diff = %.2f\n", // printf("sky = %.2f fog = %.2f diff = %.2f\n",
l->sky_color[j], l->fog_color[j], diff); */ // l->sky_color[j], l->fog_color[j], diff);
inner_color[i][j] = l->sky_color[j] - diff * 0.3; 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]; 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++ ) { for ( j = 0; j < 3; j++ ) {
diff = l->sky_color[j] - l->fog_color[j]; diff = l->sky_color[j] - l->fog_color[j];
/* printf("sky = %.2f fog = %.2f diff = %.2f\n", // printf("sky = %.2f fog = %.2f diff = %.2f\n",
l->sky_color[j], l->fog_color[j], diff); */ // l->sky_color[j], l->fog_color[j], diff);
inner_color[i][j] = l->sky_color[j] - diff * 0.3; 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]; 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 ) { void fgSkyInit( void ) {
fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n"); fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n");
fgSkyVerticesInit(); fgSkyVerticesInit();
/* regester fgSkyColorsInit() as an event to be run periodically */ // regester fgSkyColorsInit() as an event to be run periodically
global_events.Register( "fgSkyColorsInit()", fgSkyColorsInit, global_events.Register( "fgSkyColorsInit()", fgSkyColorsInit,
fgEVENT::FG_EVENT_READY, 30000); fgEVENT::FG_EVENT_READY, 30000);
} }
/* Draw the Sky */ // Draw the Sky
void fgSkyRender( void ) { void fgSkyRender( void ) {
fgFLIGHT *f; fgFLIGHT *f;
fgLIGHT *l; fgLIGHT *l;
@ -273,14 +267,14 @@ void fgSkyRender( void ) {
l = &cur_light_params; l = &cur_light_params;
v = &current_view; v = &current_view;
/* printf("Rendering the sky.\n"); */ // printf("Rendering the sky.\n");
// calculate the proper colors // calculate the proper colors
for ( i = 0; i < 3; i++ ) { for ( i = 0; i < 3; i++ ) {
diff = l->sky_color[i] - l->adj_fog_color[i]; diff = l->sky_color[i] - l->adj_fog_color[i];
/* printf("sky = %.2f fog = %.2f diff = %.2f\n", // printf("sky = %.2f fog = %.2f diff = %.2f\n",
l->sky_color[j], l->adj_fog_color[j], diff); */ // l->sky_color[j], l->adj_fog_color[j], diff);
inner_color[i] = l->sky_color[i] - diff * 0.3; inner_color[i] = l->sky_color[i] - diff * 0.3;
middle_color[i] = l->sky_color[i] - diff * 0.9; middle_color[i] = l->sky_color[i] - diff * 0.9;
@ -290,21 +284,21 @@ void fgSkyRender( void ) {
xglPushMatrix(); xglPushMatrix();
/* Translate to view position */ // Translate to view position
xglTranslatef( v->cur_zero_elev.x(), xglTranslatef( v->cur_zero_elev.x(),
v->cur_zero_elev.y(), v->cur_zero_elev.y(),
v->cur_zero_elev.z() ); v->cur_zero_elev.z() );
/* printf(" Translated to %.2f %.2f %.2f\n", // printf(" Translated to %.2f %.2f %.2f\n",
v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z ); */ // v->cur_zero_elev.x, v->cur_zero_elev.y, v->cur_zero_elev.z );
/* Rotate to proper orientation */ // Rotate to proper orientation
/* printf(" lon = %.2f lat = %.2f\n", FG_Longitude * RAD_TO_DEG, // printf(" lon = %.2f lat = %.2f\n", FG_Longitude * RAD_TO_DEG,
FG_Latitude * RAD_TO_DEG); */ // FG_Latitude * RAD_TO_DEG);
xglRotatef( FG_Longitude * RAD_TO_DEG, 0.0, 0.0, 1.0 ); 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( 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 ); 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 ); xglBegin( GL_TRIANGLE_FAN );
xglColor4fv(l->sky_color); xglColor4fv(l->sky_color);
xglVertex3f(0.0, 0.0, CENTER_ELEV); xglVertex3f(0.0, 0.0, CENTER_ELEV);
@ -320,15 +314,15 @@ void fgSkyRender( void ) {
xglBegin( GL_TRIANGLE_STRIP ); xglBegin( GL_TRIANGLE_STRIP );
for ( i = 0; i < 12; i++ ) { for ( i = 0; i < 12; i++ ) {
xglColor4fv( middle_color ); xglColor4fv( middle_color );
/* printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i, // 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][0], middle_color[i][1], middle_color[i][2],
middle_color[i][3]); */ // middle_color[i][3]);
// xglColor4f(1.0, 0.0, 0.0, 1.0); // xglColor4f(1.0, 0.0, 0.0, 1.0);
xglVertex3fv( middle_vertex[i] ); xglVertex3fv( middle_vertex[i] );
xglColor4fv( inner_color ); xglColor4fv( inner_color );
/* printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, // 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][0], inner_color[i][1], inner_color[i][2],
inner_color[i][3]); */ // inner_color[i][3]);
// xglColor4f(0.0, 0.0, 1.0, 1.0); // xglColor4f(0.0, 0.0, 1.0, 1.0);
xglVertex3fv( inner_vertex[i] ); xglVertex3fv( inner_vertex[i] );
} }
@ -340,7 +334,7 @@ void fgSkyRender( void ) {
xglVertex3fv( inner_vertex[0] ); xglVertex3fv( inner_vertex[0] );
xglEnd(); xglEnd();
/* Draw the outer ring */ // Draw the outer ring
xglBegin( GL_TRIANGLE_STRIP ); xglBegin( GL_TRIANGLE_STRIP );
for ( i = 0; i < 12; i++ ) { for ( i = 0; i < 12; i++ ) {
xglColor4fv( outer_color ); xglColor4fv( outer_color );
@ -354,7 +348,7 @@ void fgSkyRender( void ) {
xglVertex3fv( middle_vertex[0] ); xglVertex3fv( middle_vertex[0] );
xglEnd(); xglEnd();
/* Draw the bottom skirt */ // Draw the bottom skirt
xglBegin( GL_TRIANGLE_STRIP ); xglBegin( GL_TRIANGLE_STRIP );
xglColor4fv( outer_color ); xglColor4fv( outer_color );
for ( i = 0; i < 12; i++ ) { for ( i = 0; i < 12; i++ ) {
@ -369,108 +363,111 @@ void fgSkyRender( void ) {
} }
/* $Log$ // $Log$
/* Revision 1.11 1998/10/16 00:52:19 curt // Revision 1.12 1998/10/16 23:27:18 curt
/* Converted to Point3D class. // C++-ifying.
/* //
* Revision 1.10 1998/08/29 13:07:16 curt // Revision 1.11 1998/10/16 00:52:19 curt
* Rewrite of event manager thanks to Bernie Bright. // Converted to Point3D class.
* //
* Revision 1.9 1998/08/22 01:18:59 curt // Revision 1.10 1998/08/29 13:07:16 curt
* Minor tweaks to avoid using unitialized memory. // Rewrite of event manager thanks to Bernie Bright.
* //
* Revision 1.8 1998/08/12 21:40:44 curt // Revision 1.9 1998/08/22 01:18:59 curt
* Sky now tracks adjusted fog color so it blends well with terrain. // Minor tweaks to avoid using unitialized memory.
* //
* Revision 1.7 1998/07/22 21:39:21 curt // Revision 1.8 1998/08/12 21:40:44 curt
* Lower skirt tracks adjusted fog color, not fog color. // Sky now tracks adjusted fog color so it blends well with terrain.
* //
* Revision 1.6 1998/05/23 14:07:14 curt // Revision 1.7 1998/07/22 21:39:21 curt
* Use new C++ events class. // Lower skirt tracks adjusted fog color, not fog color.
* //
* Revision 1.5 1998/04/28 01:19:02 curt // Revision 1.6 1998/05/23 14:07:14 curt
* Type-ified fgTIME and fgVIEW // Use new C++ events class.
* //
* Revision 1.4 1998/04/26 05:10:01 curt // Revision 1.5 1998/04/28 01:19:02 curt
* "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd. // Type-ified fgTIME and fgVIEW
* //
* Revision 1.3 1998/04/25 22:06:25 curt // Revision 1.4 1998/04/26 05:10:01 curt
* Edited cvs log messages in source files ... bad bad bad! // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
* //
* Revision 1.2 1998/04/24 00:45:03 curt // Revision 1.3 1998/04/25 22:06:25 curt
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H" // Edited cvs log messages in source files ... bad bad bad!
* Fixed a bug when generating sky colors. //
* // Revision 1.2 1998/04/24 00:45:03 curt
* Revision 1.1 1998/04/22 13:21:32 curt // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
* C++ - ifing the code a bit. // Fixed a bug when generating sky colors.
* //
* Revision 1.9 1998/04/03 21:52:50 curt // Revision 1.1 1998/04/22 13:21:32 curt
* Converting to Gnu autoconf system. // C++ - ifing the code a bit.
* //
* Revision 1.8 1998/03/09 22:47:25 curt // Revision 1.9 1998/04/03 21:52:50 curt
* Incorporated Durk's updates. // Converting to Gnu autoconf system.
* //
* Revision 1.7 1998/02/19 13:05:49 curt // Revision 1.8 1998/03/09 22:47:25 curt
* Incorporated some HUD tweaks from Michelle America. // Incorporated Durk's updates.
* Tweaked the sky's sunset/rise colors. //
* Other misc. tweaks. // Revision 1.7 1998/02/19 13:05:49 curt
* // Incorporated some HUD tweaks from Michelle America.
* Revision 1.6 1998/02/07 15:29:32 curt // Tweaked the sky's sunset/rise colors.
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss // Other misc. tweaks.
* <chotchkiss@namg.us.anritsu.com> //
* // Revision 1.6 1998/02/07 15:29:32 curt
* Revision 1.5 1998/01/27 00:47:48 curt // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message // <chotchkiss@namg.us.anritsu.com>
* system and commandline/config file processing code. //
* // Revision 1.5 1998/01/27 00:47:48 curt
* Revision 1.4 1998/01/26 15:54:28 curt // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
* Added a "skirt" to try to help hide gaps between scenery and sky. This will // system and commandline/config file processing code.
* have to be revisited in the future. //
* // Revision 1.4 1998/01/26 15:54:28 curt
* Revision 1.3 1998/01/19 19:26:59 curt // Added a "skirt" to try to help hide gaps between scenery and sky. This will
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> // have to be revisited in the future.
* This should simplify things tremendously. //
* // Revision 1.3 1998/01/19 19:26:59 curt
* Revision 1.2 1998/01/19 18:40:17 curt // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* Tons of little changes to clean up the code and to remove fatal errors // This should simplify things tremendously.
* when building with the c++ compiler. //
* // Revision 1.2 1998/01/19 18:40:17 curt
* Revision 1.1 1998/01/07 03:16:19 curt // Tons of little changes to clean up the code and to remove fatal errors
* Moved from .../Src/Scenery/ to .../Src/Astro/ // when building with the c++ compiler.
* //
* Revision 1.11 1997/12/30 22:22:38 curt // Revision 1.1 1998/01/07 03:16:19 curt
* Further integration of event manager. // Moved from .../Src/Scenery/ to .../Src/Astro/
* //
* Revision 1.10 1997/12/30 20:47:53 curt // Revision 1.11 1997/12/30 22:22:38 curt
* Integrated new event manager with subsystem initializations. // Further integration of event manager.
* //
* Revision 1.9 1997/12/30 13:06:57 curt // Revision 1.10 1997/12/30 20:47:53 curt
* A couple lighting tweaks ... // Integrated new event manager with subsystem initializations.
* //
* Revision 1.8 1997/12/23 04:58:38 curt // Revision 1.9 1997/12/30 13:06:57 curt
* Tweaked the sky coloring a bit to build in structures to allow finer rgb // A couple lighting tweaks ...
* control. //
* // Revision 1.8 1997/12/23 04:58:38 curt
* Revision 1.7 1997/12/22 23:45:48 curt // Tweaked the sky coloring a bit to build in structures to allow finer rgb
* First stab at sunset/sunrise sky glow effects. // control.
* //
* Revision 1.6 1997/12/22 04:14:34 curt // Revision 1.7 1997/12/22 23:45:48 curt
* Aligned sky with sun so dusk/dawn effects can be correct relative to the sun. // First stab at sunset/sunrise sky glow effects.
* //
* Revision 1.5 1997/12/19 23:34:59 curt // Revision 1.6 1997/12/22 04:14:34 curt
* Lot's of tweaking with sky rendering and lighting. // Aligned sky with sun so dusk/dawn effects can be correct relative to the sun.
* //
* Revision 1.4 1997/12/19 16:45:02 curt // Revision 1.5 1997/12/19 23:34:59 curt
* Working on scene rendering order and options. // Lot's of tweaking with sky rendering and lighting.
* //
* Revision 1.3 1997/12/18 23:32:36 curt // Revision 1.4 1997/12/19 16:45:02 curt
* First stab at sky dome actually starting to look reasonable. :-) // Working on scene rendering order and options.
* //
* Revision 1.2 1997/12/18 04:07:03 curt // Revision 1.3 1997/12/18 23:32:36 curt
* Worked on properly translating and positioning the sky dome. // First stab at sky dome actually starting to look reasonable. :-)
* //
* Revision 1.1 1997/12/17 23:14:30 curt // Revision 1.2 1997/12/18 04:07:03 curt
* Initial revision. // Worked on properly translating and positioning the sky dome.
* Begin work on rendering the sky. (Rather than just using a clear screen.) //
* // 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.)
//

View file

@ -1,27 +1,25 @@
/************************************************************************** // sky.hxx -- model sky with an upside down "bowl"
* sky.hxx -- model sky with an upside down "bowl" //
* // Written by Curtis Olson, started December 1997.
* Written by Curtis Olson, started December 1997. //
* // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com //
* // This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as
* modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the
* published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version.
* License, or (at your option) any later version. //
* // This program is distributed in the hope that it will be useful, but
* This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of
* WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details.
* General Public License for more details. //
* // You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software
* along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
* // $Id$
* $Id$ // (Log is kept at end of this file)
* (Log is kept at end of this file)
**************************************************************************/
#ifndef _SKY_HXX #ifndef _SKY_HXX
@ -33,41 +31,43 @@
#endif #endif
/* (Re)generate the display list */ // (Re)generate the display list
void fgSkyInit( void ); void fgSkyInit( void );
/* (Re)calculate the sky colors at each vertex */ // (Re)calculate the sky colors at each vertex
void fgSkyColorsInit( void ); void fgSkyColorsInit( void );
/* Draw the Sky */ // Draw the Sky
void fgSkyRender( void ); void fgSkyRender( void );
#endif /* _SKY_HXX */ #endif // _SKY_HXX
/* $Log$ // $Log$
/* Revision 1.1 1998/04/22 13:21:33 curt // Revision 1.2 1998/10/16 23:27:19 curt
/* C++ - ifing the code a bit. // C++-ifying.
/* //
* Revision 1.4 1998/04/21 17:02:32 curt // Revision 1.1 1998/04/22 13:21:33 curt
* Prepairing for C++ integration. // C++ - ifing the code a bit.
* //
* Revision 1.3 1998/01/22 02:59:28 curt // Revision 1.4 1998/04/21 17:02:32 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H // Prepairing for C++ integration.
* //
* Revision 1.2 1998/01/19 18:40:17 curt // Revision 1.3 1998/01/22 02:59:28 curt
* Tons of little changes to clean up the code and to remove fatal errors // Changed #ifdef FILE_H to #ifdef _FILE_H
* when building with the c++ compiler. //
* // Revision 1.2 1998/01/19 18:40:17 curt
* Revision 1.1 1998/01/07 03:16:19 curt // Tons of little changes to clean up the code and to remove fatal errors
* Moved from .../Src/Scenery/ to .../Src/Astro/ // when building with the c++ compiler.
* //
* Revision 1.2 1997/12/22 23:45:49 curt // Revision 1.1 1998/01/07 03:16:19 curt
* First stab at sunset/sunrise sky glow effects. // Moved from .../Src/Scenery/ to .../Src/Astro/
* //
* Revision 1.1 1997/12/17 23:14:31 curt // Revision 1.2 1997/12/22 23:45:49 curt
* Initial revision. // First stab at sunset/sunrise sky glow effects.
* Begin work on rendering the sky. (Rather than just using a clear screen.) //
* // 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.)
//

View file

@ -40,7 +40,7 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Misc/fgstream.hxx> #include <Misc/fgstream.hxx>
@ -252,6 +252,9 @@ void fgStarsRender( void ) {
// $Log$ // $Log$
// Revision 1.19 1998/10/16 23:27:21 curt
// C++-ifying.
//
// Revision 1.18 1998/10/16 00:52:20 curt // Revision 1.18 1998/10/16 00:52:20 curt
// Converted to Point3D class. // Converted to Point3D class.
// //

View file

@ -27,8 +27,8 @@
#define _AUTOPILOT_H #define _AUTOPILOT_H
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Flight/flight.h> #include <Flight/flight.hxx>
#include <Controls/controls.h> #include <Controls/controls.h>

View file

@ -39,7 +39,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>
@ -316,6 +316,9 @@ void fgCockpitUpdate( void ) {
// $Log$ // $Log$
// Revision 1.18 1998/10/16 23:27:23 curt
// C++-ifying.
//
// Revision 1.17 1998/09/29 14:56:30 curt // Revision 1.17 1998/09/29 14:56:30 curt
// c++-ified comments. // c++-ified comments.
// //

View file

@ -38,7 +38,7 @@
# include <values.h> // for MAXINT # include <values.h> // for MAXINT
#endif #endif
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/options.hxx> #include <Main/options.hxx>
@ -830,6 +830,9 @@ void fgUpdateHUD( void ) {
} }
// $Log$ // $Log$
// Revision 1.24 1998/10/16 23:27:25 curt
// C++-ifying.
//
// Revision 1.23 1998/10/16 00:53:00 curt // Revision 1.23 1998/10/16 00:53:00 curt
// Mods to display a bit more info when mini-hud is active. // Mods to display a bit more info when mini-hud is active.
// //

View file

@ -47,8 +47,8 @@
#include <fg_typedefs.h> #include <fg_typedefs.h>
#include <fg_constants.h> #include <fg_constants.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Flight/flight.h> #include <Flight/flight.hxx>
#include <Controls/controls.h> #include <Controls/controls.h>
#include <deque> // STL double ended queue #include <deque> // STL double ended queue
@ -524,6 +524,9 @@ void fgHUDSetTimeMode( Hptr hud, int time_of_day );
#endif // _HUD_H #endif // _HUD_H
// $Log$ // $Log$
// Revision 1.15 1998/10/16 23:27:27 curt
// C++-ifying.
//
// Revision 1.14 1998/09/29 14:56:33 curt // Revision 1.14 1998/09/29 14:56:33 curt
// c++-ified comments. // c++-ified comments.
// //

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -10,7 +10,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -7,7 +7,7 @@
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_random.h> #include <Math/fg_random.h>

View file

@ -41,7 +41,7 @@
#include <string> #include <string>
#include <math.h> #include <math.h>
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Main/options.hxx> #include <Main/options.hxx>
#include <Main/views.hxx> #include <Main/views.hxx>
@ -726,9 +726,12 @@ pointer->vertices[19] = pointer->vertices[3];
/* $Log$ /* $Log$
/* Revision 1.7 1998/08/31 20:45:31 curt /* Revision 1.8 1998/10/16 23:27:37 curt
/* Tweaks from Friedemann. /* 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 * Revision 1.6 1998/08/28 18:14:40 curt
* Added new cockpit code from Friedemann Reinhard * Added new cockpit code from Friedemann Reinhard
* <mpt218@faupt212.physik.uni-erlangen.de> * <mpt218@faupt212.physik.uni-erlangen.de>

View file

@ -2,6 +2,6 @@ SUBDIRS = LaRCsim Slew
noinst_LIBRARIES = libFlight.a 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 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator

View file

@ -24,11 +24,13 @@
#include <stdio.h> #include <stdio.h>
#include "flight.hxx"
#include "LaRCsim.hxx"
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Flight/flight.h>
#include <Flight/LaRCsim/ls_interface.h> #include <Flight/LaRCsim/ls_interface.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Math/fg_geodesy.h> #include <Math/fg_geodesy.hxx>
fgFLIGHT cur_flight_params; fgFLIGHT cur_flight_params;
@ -99,7 +101,7 @@ int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop) {
/* Set the altitude (force) */ /* 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 sea_level_radius_meters;
double lat_geoc; double lat_geoc;
// Set the FG variables first // Set the FG variables first
@ -119,6 +121,9 @@ int fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters) {
// $Log$ // $Log$
// Revision 1.2 1998/10/16 23:27:40 curt
// C++-ifying.
//
// Revision 1.1 1998/10/16 20:16:41 curt // Revision 1.1 1998/10/16 20:16:41 curt
// Renamed flight.[ch] to flight.[ch]xx // Renamed flight.[ch] to flight.[ch]xx
// //

View file

@ -26,11 +26,11 @@
#define _FLIGHT_H #define _FLIGHT_H
#include <Flight/Slew/slew.h> #include <Flight/Slew/slew.hxx>
#ifdef __cplusplus #ifndef __cplusplus
extern "C" { # error This library requires C++
#endif #endif
@ -403,18 +403,16 @@ int fgFlightModelInit(int model, fgFLIGHT *f, double dt);
int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop); int fgFlightModelUpdate(int model, fgFLIGHT *f, int multiloop);
/* Set the altitude (force) */ /* Set the altitude (force) */
int fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters); void fgFlightModelSetAltitude(int model, fgFLIGHT *f, double alt_meters);
#ifdef __cplusplus
}
#endif
#endif /* _FLIGHT_H */ #endif /* _FLIGHT_H */
// $Log$ // $Log$
// Revision 1.2 1998/10/16 23:27:41 curt
// C++-ifying.
//
// Revision 1.1 1998/10/16 20:16:44 curt // Revision 1.1 1998/10/16 20:16:44 curt
// Renamed flight.[ch] to flight.[ch]xx // Renamed flight.[ch] to flight.[ch]xx
// //

View file

@ -71,6 +71,14 @@
#define _LS_GENERIC_H #define _LS_GENERIC_H
#ifdef __cplusplus
extern "C" {
#endif
#include "ls_types.h"
typedef struct { typedef struct {
/*================== Mass properties and geometry values ==================*/ /*================== Mass properties and geometry values ==================*/
@ -407,6 +415,11 @@ typedef struct {
extern GENERIC generic_; /* usually defined in ls_main.c */ extern GENERIC generic_; /* usually defined in ls_main.c */
#ifdef __cplusplus
}
#endif
#endif /* _LS_GENERIC_H */ #endif /* _LS_GENERIC_H */

View file

@ -241,9 +241,9 @@ $Original log: LaRCsim.c,v $
#include "ls_model.h" #include "ls_model.h"
#include "ls_init.h" #include "ls_init.h"
#include <Flight/flight.h> // #include <Flight/flight.h>
#include <Aircraft/aircraft.h> // #include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h> // #include <Debug/fg_debug.h>
/* global variable declarations */ /* global variable declarations */
@ -498,17 +498,17 @@ void ls_loop( SCALAR dt, int initialize ) {
int ls_cockpit( void ) { int ls_cockpit( void ) {
fgCONTROLS *c; // fgCONTROLS *c;
sim_control_.paused = 0; sim_control_.paused = 0;
c = current_aircraft.controls; // c = current_aircraft.controls;
Lat_control = FG_Aileron; // Lat_control = FG_Aileron;
Long_control = FG_Elevator; // Long_control = FG_Elevator;
Long_trim = FG_Elev_Trim; // Long_trim = FG_Elev_Trim;
Rudder_pedal = FG_Rudder; // Rudder_pedal = FG_Rudder;
Throttle_pct = FG_Throttle[0]; // Throttle_pct = FG_Throttle[0];
/* printf("Mach = %.2f ", Mach_number); /* printf("Mach = %.2f ", Mach_number);
printf("%.4f,%.4f,%.2f ", Latitude, Longitude, Altitude); 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 /* Initialize the LaRCsim flight model, dt is the time increment for
each subsequent iteration through the EOM */ each subsequent iteration through the EOM */
int fgLaRCsimInit(double dt) { int ls_toplevel_init(double dt) {
model_dt = dt; model_dt = dt;
ls_setdefopts(); /* set default options */ ls_setdefopts(); /* set default options */
@ -548,47 +548,22 @@ int fgLaRCsimInit(double dt) {
/* Run an iteration of the EOM (equations of motion) */ /* Run an iteration of the EOM (equations of motion) */
int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) { int ls_update(int multiloop) {
double save_alt = 0.0;
int i; int i;
if (speedup > 0) { if (speedup > 0) {
ls_cockpit(); 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++ ) { for ( i = 0; i < multiloop; i++ ) {
ls_loop( model_dt, 0); 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; return 1;
} }
#if 0
/* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */ /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (fgFLIGHT *f) { int fgFlight_2_LaRCsim (fgFLIGHT *f) {
Mass = FG_Mass; Mass = FG_Mass;
@ -939,7 +914,7 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) {
return ( 0 ); return ( 0 );
} }
#endif
/* Set the altitude (force) */ /* Set the altitude (force) */
int ls_ForceAltitude(double alt_feet) { int ls_ForceAltitude(double alt_feet) {
@ -952,6 +927,9 @@ int ls_ForceAltitude(double alt_feet) {
/* Flight Gear Modification Log /* Flight Gear Modification Log
* *
* $Log$ * $Log$
* Revision 1.23 1998/10/16 23:27:44 curt
* C++-ifying.
*
* Revision 1.22 1998/09/29 02:02:59 curt * Revision 1.22 1998/09/29 02:02:59 curt
* Added a brake + autopilot mods. * Added a brake + autopilot mods.
* *

View file

@ -28,16 +28,17 @@
#define _LS_INTERFACE_H #define _LS_INTERFACE_H
#include <Flight/flight.h> // #include <Flight/flight.h>
#include "ls_types.h" #include "ls_types.h"
/* reset flight params to a specific position */ /* 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. */ /* 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 */ /* Convert from the fgFLIGHT struct to the LaRCsim generic_ struct */
int fgFlight_2_LaRCsim (fgFLIGHT *f); int fgFlight_2_LaRCsim (fgFLIGHT *f);
@ -45,6 +46,7 @@ int fgFlight_2_LaRCsim (fgFLIGHT *f);
int fgLaRCsim_2_Flight (fgFLIGHT *f); int fgLaRCsim_2_Flight (fgFLIGHT *f);
void ls_loop( SCALAR dt, int initialize ); void ls_loop( SCALAR dt, int initialize );
#endif
/* Set the altitude (force) */ /* Set the altitude (force) */
int ls_ForceAltitude(double alt_feet); int ls_ForceAltitude(double alt_feet);
@ -54,15 +56,18 @@ int ls_ForceAltitude(double alt_feet);
/* $Log$ /* $Log$
/* Revision 1.9 1998/07/12 03:11:04 curt /* Revision 1.10 1998/10/16 23:27:45 curt
/* Removed some printf()'s. /* C++-ifying.
/* 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.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 * Revision 1.8 1998/04/21 16:59:39 curt
* Integrated autopilot. * Integrated autopilot.
* Prepairing for C++ integration. * Prepairing for C++ integration.

View file

@ -65,7 +65,7 @@
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <GUI/gui.h> #include <GUI/gui.h>
#include <Joystick/joystick.h> #include <Joystick/joystick.h>
#include <Math/fg_geodesy.h> #include <Math/fg_geodesy.hxx>
#include <Math/mat3.h> #include <Math/mat3.h>
#include <Math/polar3d.hxx> #include <Math/polar3d.hxx>
#include <PUI/pu.h> #include <PUI/pu.h>
@ -894,6 +894,9 @@ int main( int argc, char **argv ) {
// $Log$ // $Log$
// Revision 1.58 1998/10/16 23:27:52 curt
// C++-ifying.
//
// Revision 1.57 1998/10/16 00:54:00 curt // Revision 1.57 1998/10/16 00:54:00 curt
// Converted to Point3D class. // Converted to Point3D class.
// //

View file

@ -54,7 +54,7 @@
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Joystick/joystick.h> #include <Joystick/joystick.h>
#include <Math/fg_geodesy.h> #include <Math/fg_geodesy.hxx>
#include <Math/fg_random.h> #include <Math/fg_random.h>
#include <Math/point3d.hxx> #include <Math/point3d.hxx>
#include <Math/polar3d.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 // This is the top level init routine which calls all the other
// initialization routines. If you are adding a subsystem to flight // initialization routines. If you are adding a subsystem to flight
// gear, its initialization call should located in this routine. // gear, its initialization call should located in this routine.
@ -188,8 +163,7 @@ int fgInitSubsystems( void )
fgLIGHT *l; fgLIGHT *l;
fgTIME *t; fgTIME *t;
fgVIEW *v; fgVIEW *v;
double geod_pos[3]; Point3D geod_pos, abs_view_pos;
Point3D abs_view_pos;
l = &cur_light_params; l = &cur_light_params;
t = &cur_time_params; t = &cur_time_params;
@ -225,13 +199,11 @@ int fgInitSubsystems( void )
} }
// calculalate a cartesian point somewhere along the line between // calculalate a cartesian point somewhere along the line between
// the center of the earth and our view position // the center of the earth and our view position. Doesn't have to
geod_pos[0] = FG_Longitude; // be the exact elevation (this is good because we don't know it
geod_pos[1] = FG_Latitude; // yet :-)
// doesn't have to be the exact elevation (this is good because we geod_pos.setvals( FG_Longitude, FG_Latitude, 0.0);
// don't know it yet :-) abs_view_pos = fgGeodToCart(geod_pos);
geod_pos[2] = 0;
abs_view_pos = geod_to_cart(geod_pos);
// Calculate ground elevation at starting point // Calculate ground elevation at starting point
scenery.cur_elev = scenery.cur_elev =
@ -393,6 +365,9 @@ int fgInitSubsystems( void )
// $Log$ // $Log$
// Revision 1.42 1998/10/16 23:27:54 curt
// C++-ifying.
//
// Revision 1.41 1998/10/16 00:54:01 curt // Revision 1.41 1998/10/16 00:54:01 curt
// Converted to Point3D class. // Converted to Point3D class.
// //

View file

@ -1,4 +1,3 @@
//
// views.hxx -- data structures and routines for managing and view parameters. // views.hxx -- data structures and routines for managing and view parameters.
// //
// Written by Curtis Olson, started August 1997. // Written by Curtis Olson, started August 1997.
@ -32,8 +31,7 @@
#endif #endif
// #include <Include/fg_types.h> #include <Flight/flight.hxx>
#include <Flight/flight.h>
#include <Math/mat3.h> #include <Math/mat3.h>
#include <Math/point3d.hxx> #include <Math/point3d.hxx>
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
@ -182,6 +180,9 @@ extern fgVIEW current_view;
// $Log$ // $Log$
// Revision 1.15 1998/10/16 23:27:56 curt
// C++-ifying.
//
// Revision 1.14 1998/10/16 00:54:04 curt // Revision 1.14 1998/10/16 00:54:04 curt
// Converted to Point3D class. // Converted to Point3D class.
// //

View file

@ -1,28 +1,25 @@
/* -*- Mode: C++ -*- // scenery.cxx -- data structures and routines for managing scenery.
* //
* scenery.c -- data structures and routines for managing scenery. // Written by Curtis Olson, started May 1997.
* //
* Written by Curtis Olson, started May 1997. // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
* //
* 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
* This program is free software; you can redistribute it and/or // published by the Free Software Foundation; either version 2 of the
* modify it under the terms of the GNU General Public License as // License, or (at your option) any later version.
* 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
* This program is distributed in the hope that it will be useful, but // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* WITHOUT ANY WARRANTY; without even the implied warranty of // General Public License for more details.
* 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
* You should have received a copy of the GNU General Public License // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* 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)
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -47,15 +44,15 @@
// #include "texload.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; GLint area_texture;
/* Shared structure to hold current scenery parameters */ // Shared structure to hold current scenery parameters
struct fgSCENERY scenery; struct fgSCENERY scenery;
/* Initialize the Scenery Management system */ // Initialize the Scenery Management system
int fgSceneryInit( void ) { int fgSceneryInit( void ) {
fgOPTIONS *o; fgOPTIONS *o;
// char path[1024], fgpath[1024]; // 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 // Tell the scenery manager where we are so it can load the proper data, and
* build the proper structures. */ // build the proper structures.
void fgSceneryUpdate(double lon, double lat, double elev) { void fgSceneryUpdate(double lon, double lat, double elev) {
// does nothing; // does nothing;
} }
/* Render out the current scene */ // Render out the current scene
void fgSceneryRender( void ) { void fgSceneryRender( void ) {
} }
/* $Log$ // $Log$
/* Revision 1.8 1998/08/25 16:52:40 curt // Revision 1.9 1998/10/16 23:27:57 curt
/* material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to // C++-ifying.
/* ../Objects //
/* // Revision 1.8 1998/08/25 16:52:40 curt
* Revision 1.7 1998/07/13 21:01:59 curt // material.cxx material.hxx obj.cxx obj.hxx texload.c texload.h moved to
* Wrote access functions for current fgOPTIONS. // ../Objects
* //
* Revision 1.6 1998/07/12 03:18:27 curt // Revision 1.7 1998/07/13 21:01:59 curt
* Added ground collision detection. This involved: // Wrote access functions for current fgOPTIONS.
* - saving the entire vertex list for each tile with the tile records. //
* - saving the face list for each fragment with the fragment records. // Revision 1.6 1998/07/12 03:18:27 curt
* - code to intersect the current vertical line with the proper face in // Added ground collision detection. This involved:
* an efficient manner as possible. // - saving the entire vertex list for each tile with the tile records.
* Fixed a bug where the tiles weren't being shifted to "near" (0,0,0) // - saving the face list for each fragment with the fragment records.
* // - code to intersect the current vertical line with the proper face in
* Revision 1.5 1998/06/17 21:36:41 curt // an efficient manner as possible.
* Load and manage multiple textures defined in the Materials library. // Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
* Boost max material fagments for each material property to 800. //
* Multiple texture support when rendering. // Revision 1.5 1998/06/17 21:36:41 curt
* // Load and manage multiple textures defined in the Materials library.
* Revision 1.4 1998/05/13 18:26:40 curt // Boost max material fagments for each material property to 800.
* Root path info moved to fgOPTIONS. // Multiple texture support when rendering.
* //
* Revision 1.3 1998/05/07 23:15:20 curt // Revision 1.4 1998/05/13 18:26:40 curt
* Fixed a glTexImage2D() usage bug where width and height were mis-swapped. // Root path info moved to fgOPTIONS.
* Added support for --tile-radius=n option. //
* // Revision 1.3 1998/05/07 23:15:20 curt
* Revision 1.2 1998/05/02 01:52:16 curt // Fixed a glTexImage2D() usage bug where width and height were mis-swapped.
* Playing around with texture coordinates. // Added support for --tile-radius=n option.
* //
* Revision 1.1 1998/04/30 12:35:30 curt // Revision 1.2 1998/05/02 01:52:16 curt
* Added a command line rendering option specify smooth/flat shading. // Playing around with texture coordinates.
* //
* Revision 1.42 1998/04/28 21:43:27 curt // Revision 1.1 1998/04/30 12:35:30 curt
* Wrapped zlib calls up so we can conditionally comment out zlib support. // Added a command line rendering option specify smooth/flat shading.
* //
* Revision 1.41 1998/04/24 00:51:08 curt // Revision 1.42 1998/04/28 21:43:27 curt
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H" // Wrapped zlib calls up so we can conditionally comment out zlib support.
* Tweaked the scenery file extentions to be "file.obj" (uncompressed) //
* or "file.obz" (compressed.) // Revision 1.41 1998/04/24 00:51:08 curt
* // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
* Revision 1.40 1998/04/18 04:14:06 curt // Tweaked the scenery file extentions to be "file.obj" (uncompressed)
* Moved fg_debug.c to it's own library. // or "file.obz" (compressed.)
* //
* Revision 1.39 1998/04/08 23:30:07 curt // Revision 1.40 1998/04/18 04:14:06 curt
* Adopted Gnu automake/autoconf system. // Moved fg_debug.c to it's own library.
* //
* Revision 1.38 1998/04/03 22:11:37 curt // Revision 1.39 1998/04/08 23:30:07 curt
* Converting to Gnu autoconf system. // Adopted Gnu automake/autoconf system.
* //
* Revision 1.37 1998/03/23 21:23:05 curt // Revision 1.38 1998/04/03 22:11:37 curt
* Debugging output tweaks. // Converting to Gnu autoconf system.
* //
* Revision 1.36 1998/03/14 00:30:50 curt // Revision 1.37 1998/03/23 21:23:05 curt
* Beginning initial terrain texturing experiments. // Debugging output tweaks.
* //
* Revision 1.35 1998/01/31 00:43:26 curt // Revision 1.36 1998/03/14 00:30:50 curt
* Added MetroWorks patches from Carmen Volpe. // Beginning initial terrain texturing experiments.
* //
* Revision 1.34 1998/01/27 03:26:43 curt // Revision 1.35 1998/01/31 00:43:26 curt
* Playing with new fgPrintf command. // Added MetroWorks patches from Carmen Volpe.
* //
* Revision 1.33 1998/01/19 19:27:17 curt // Revision 1.34 1998/01/27 03:26:43 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> // Playing with new fgPrintf command.
* This should simplify things tremendously. //
* // Revision 1.33 1998/01/19 19:27:17 curt
* Revision 1.32 1998/01/19 18:40:37 curt // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* Tons of little changes to clean up the code and to remove fatal errors // This should simplify things tremendously.
* when building with the c++ compiler. //
* // Revision 1.32 1998/01/19 18:40:37 curt
* Revision 1.31 1998/01/13 00:23:11 curt // Tons of little changes to clean up the code and to remove fatal errors
* Initial changes to support loading and management of scenery tiles. Note, // when building with the c++ compiler.
* there's still a fair amount of work left to be done. //
* // Revision 1.31 1998/01/13 00:23:11 curt
* Revision 1.30 1998/01/07 03:22:29 curt // Initial changes to support loading and management of scenery tiles. Note,
* Moved astro stuff to .../Src/Astro/ // there's still a fair amount of work left to be done.
* //
* Revision 1.29 1997/12/30 20:47:52 curt // Revision 1.30 1998/01/07 03:22:29 curt
* Integrated new event manager with subsystem initializations. // Moved astro stuff to .../Src/Astro/
* //
* Revision 1.28 1997/12/15 23:55:02 curt // Revision 1.29 1997/12/30 20:47:52 curt
* Add xgl wrappers for debugging. // Integrated new event manager with subsystem initializations.
* Generate terrain normals on the fly. //
* // Revision 1.28 1997/12/15 23:55:02 curt
* Revision 1.27 1997/12/12 21:41:30 curt // Add xgl wrappers for debugging.
* More light/material property tweaking ... still a ways off. // Generate terrain normals on the fly.
* //
* Revision 1.26 1997/12/12 19:52:58 curt // Revision 1.27 1997/12/12 21:41:30 curt
* Working on lightling and material properties. // More light/material property tweaking ... still a ways off.
* //
* Revision 1.25 1997/12/10 22:37:51 curt // Revision 1.26 1997/12/12 19:52:58 curt
* Prepended "fg" on the name of all global structures that didn't have it yet. // Working on lightling and material properties.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" //
* // Revision 1.25 1997/12/10 22:37:51 curt
* Revision 1.24 1997/12/08 22:51:18 curt // Prepended "fg" on the name of all global structures that didn't have it yet.
* Enhanced to handle ccw and cw tri-stripe winding. This is a temporary // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
* admission of defeat. I will eventually go back and get all the stripes //
* wound the same way (ccw). // Revision 1.24 1997/12/08 22:51:18 curt
* // Enhanced to handle ccw and cw tri-stripe winding. This is a temporary
* Revision 1.23 1997/11/25 19:25:37 curt // admission of defeat. I will eventually go back and get all the stripes
* Changes to integrate Durk's moon/sun code updates + clean up. // wound the same way (ccw).
* //
* Revision 1.22 1997/10/28 21:00:22 curt // Revision 1.23 1997/11/25 19:25:37 curt
* Changing to new terrain format. // Changes to integrate Durk's moon/sun code updates + clean up.
* //
* Revision 1.21 1997/10/25 03:24:24 curt // Revision 1.22 1997/10/28 21:00:22 curt
* Incorporated sun, moon, and star positioning code contributed by Durk Talsma. // Changing to new terrain format.
* //
* Revision 1.20 1997/10/25 03:18:27 curt // Revision 1.21 1997/10/25 03:24:24 curt
* Incorporated sun, moon, and planet position and rendering code contributed // Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
* by Durk Talsma. //
* // Revision 1.20 1997/10/25 03:18:27 curt
* Revision 1.19 1997/09/05 14:17:30 curt // Incorporated sun, moon, and planet position and rendering code contributed
* More tweaking with stars. // by Durk Talsma.
* //
* Revision 1.18 1997/09/05 01:35:59 curt // Revision 1.19 1997/09/05 14:17:30 curt
* Working on getting stars right. // More tweaking with stars.
* //
* Revision 1.17 1997/08/29 17:55:27 curt // Revision 1.18 1997/09/05 01:35:59 curt
* Worked on properly aligning the stars. // Working on getting stars right.
* //
* Revision 1.16 1997/08/27 21:32:29 curt // Revision 1.17 1997/08/29 17:55:27 curt
* Restructured view calculation code. Added stars. // Worked on properly aligning the stars.
* //
* Revision 1.15 1997/08/27 03:30:32 curt // Revision 1.16 1997/08/27 21:32:29 curt
* Changed naming scheme of basic shared structures. // Restructured view calculation code. Added stars.
* //
* Revision 1.14 1997/08/25 20:27:24 curt // Revision 1.15 1997/08/27 03:30:32 curt
* Merged in initial HUD and Joystick code. // Changed naming scheme of basic shared structures.
* //
* Revision 1.13 1997/08/22 21:34:41 curt // Revision 1.14 1997/08/25 20:27:24 curt
* Doing a bit of reorganizing and house cleaning. // Merged in initial HUD and Joystick code.
* //
* Revision 1.12 1997/08/19 23:55:08 curt // Revision 1.13 1997/08/22 21:34:41 curt
* Worked on better simulating real lighting. // Doing a bit of reorganizing and house cleaning.
* //
* Revision 1.11 1997/08/13 20:24:22 curt // Revision 1.12 1997/08/19 23:55:08 curt
* Changed default detail level. // Worked on better simulating real lighting.
* //
* Revision 1.10 1997/08/06 00:24:30 curt // Revision 1.11 1997/08/13 20:24:22 curt
* Working on correct real time sun lighting. // Changed default detail level.
* //
* Revision 1.9 1997/08/04 17:08:11 curt // Revision 1.10 1997/08/06 00:24:30 curt
* Testing cvs on IRIX 6.x // Working on correct real time sun lighting.
* //
* Revision 1.8 1997/07/18 23:41:27 curt // Revision 1.9 1997/08/04 17:08:11 curt
* Tweaks for building with Cygnus Win32 compiler. // Testing cvs on IRIX 6.x
* //
* Revision 1.7 1997/07/16 20:04:52 curt // Revision 1.8 1997/07/18 23:41:27 curt
* Minor tweaks to aid Win32 port. // Tweaks for building with Cygnus Win32 compiler.
* //
* Revision 1.6 1997/07/14 16:26:05 curt // Revision 1.7 1997/07/16 20:04:52 curt
* Testing/playing -- placed objects randomly across the entire terrain. // Minor tweaks to aid Win32 port.
* //
* Revision 1.5 1997/07/11 03:23:19 curt // Revision 1.6 1997/07/14 16:26:05 curt
* Solved some scenery display/orientation problems. Still have a positioning // Testing/playing -- placed objects randomly across the entire terrain.
* (or transformation?) problem. //
* // Revision 1.5 1997/07/11 03:23:19 curt
* Revision 1.4 1997/07/11 01:30:03 curt // Solved some scenery display/orientation problems. Still have a positioning
* More tweaking of terrian floor. // (or transformation?) problem.
* //
* Revision 1.3 1997/06/29 21:16:50 curt // Revision 1.4 1997/07/11 01:30:03 curt
* More twiddling with the Scenery Management system. // More tweaking of terrian floor.
* //
* Revision 1.2 1997/06/27 20:03:37 curt // Revision 1.3 1997/06/29 21:16:50 curt
* Working on Makefile structure. // More twiddling with the Scenery Management system.
* //
* Revision 1.1 1997/06/27 02:26:30 curt // Revision 1.2 1997/06/27 20:03:37 curt
* Initial revision. // Working on Makefile structure.
* //
*/ // Revision 1.1 1997/06/27 02:26:30 curt
// Initial revision.
//

View file

@ -1,27 +1,25 @@
/************************************************************************** // scenery.hxx -- data structures and routines for managing scenery.
* scenery.hxx -- data structures and routines for managing scenery. //
* // Written by Curtis Olson, started May 1997.
* Written by Curtis Olson, started May 1997. //
* // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com //
* // This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as
* modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the
* published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version.
* License, or (at your option) any later version. //
* // This program is distributed in the hope that it will be useful, but
* This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of
* WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details.
* General Public License for more details. //
* // You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software
* along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
* // $Id$
* $Id$ // (Log is kept at end of this file)
* (Log is kept at end of this file)
**************************************************************************/
#ifndef _SCENERY_HXX #ifndef _SCENERY_HXX
@ -33,19 +31,18 @@
#endif #endif
// #include <Include/fg_types.h>
#include <Math/point3d.hxx> #include <Math/point3d.hxx>
/* Define a structure containing global scenery parameters */ // Define a structure containing global scenery parameters
struct fgSCENERY { struct fgSCENERY {
/* center of current scenery chunk */ // center of current scenery chunk
Point3D center; Point3D center;
/* next center of current scenery chunk */ // next center of current scenery chunk
Point3D next_center; Point3D next_center;
/* angle of sun relative to current local horizontal */ // angle of sun relative to current local horizontal
double sun_angle; double sun_angle;
// elevation of terrain at our current lat/lon (based on the // elevation of terrain at our current lat/lon (based on the
@ -56,109 +53,112 @@ struct fgSCENERY {
extern struct fgSCENERY scenery; extern struct fgSCENERY scenery;
/* Initialize the Scenery Management system */ // Initialize the Scenery Management system
int fgSceneryInit( void ); int fgSceneryInit( void );
/* Tell the scenery manager where we are so it can load the proper data, and // Tell the scenery manager where we are so it can load the proper
* build the proper structures. */ // data, and build the proper structures.
void fgSceneryUpdate(double lon, double lat, double elev); void fgSceneryUpdate(double lon, double lat, double elev);
/* Render out the current scene */ // Render out the current scene
void fgSceneryRender( void ); void fgSceneryRender( void );
#endif /* _SCENERY_HXX */ #endif // _SCENERY_HXX
/* $Log$ // $Log$
/* Revision 1.5 1998/10/16 00:55:44 curt // Revision 1.6 1998/10/16 23:27:59 curt
/* Converted to Point3D class. // C++-ifying.
/* //
* Revision 1.4 1998/07/12 03:18:28 curt // Revision 1.5 1998/10/16 00:55:44 curt
* Added ground collision detection. This involved: // Converted to Point3D class.
* - saving the entire vertex list for each tile with the tile records. //
* - saving the face list for each fragment with the fragment records. // Revision 1.4 1998/07/12 03:18:28 curt
* - code to intersect the current vertical line with the proper face in // Added ground collision detection. This involved:
* an efficient manner as possible. // - saving the entire vertex list for each tile with the tile records.
* Fixed a bug where the tiles weren't being shifted to "near" (0,0,0) // - saving the face list for each fragment with the fragment records.
* // - code to intersect the current vertical line with the proper face in
* Revision 1.3 1998/07/08 14:47:22 curt // an efficient manner as possible.
* Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen. // Fixed a bug where the tiles weren't being shifted to "near" (0,0,0)
* polare3d.h renamed to polar3d.hxx //
* fg{Cartesian,Polar}Point3d consolodated. // Revision 1.3 1998/07/08 14:47:22 curt
* Added some initial support for calculating local current ground elevation. // Fix GL_MODULATE vs. GL_DECAL problem introduced by splash screen.
* // polare3d.h renamed to polar3d.hxx
* Revision 1.2 1998/05/02 01:52:16 curt // fg{Cartesian,Polar}Point3d consolodated.
* Playing around with texture coordinates. // Added some initial support for calculating local current ground elevation.
* //
* Revision 1.1 1998/04/30 12:35:31 curt // Revision 1.2 1998/05/02 01:52:16 curt
* Added a command line rendering option specify smooth/flat shading. // Playing around with texture coordinates.
* //
* Revision 1.21 1998/04/25 22:06:31 curt // Revision 1.1 1998/04/30 12:35:31 curt
* Edited cvs log messages in source files ... bad bad bad! // Added a command line rendering option specify smooth/flat shading.
* //
* Revision 1.20 1998/04/22 13:22:45 curt // Revision 1.21 1998/04/25 22:06:31 curt
* C++ - ifing the code a bit. // Edited cvs log messages in source files ... bad bad bad!
* //
* Revision 1.19 1998/04/21 17:02:43 curt // Revision 1.20 1998/04/22 13:22:45 curt
* Prepairing for C++ integration. // C++ - ifing the code a bit.
* //
* Revision 1.18 1998/03/14 00:30:51 curt // Revision 1.19 1998/04/21 17:02:43 curt
* Beginning initial terrain texturing experiments. // Prepairing for C++ integration.
* //
* Revision 1.17 1998/02/20 00:16:24 curt // Revision 1.18 1998/03/14 00:30:51 curt
* Thursday's tweaks. // Beginning initial terrain texturing experiments.
* //
* Revision 1.16 1998/01/27 00:48:03 curt // Revision 1.17 1998/02/20 00:16:24 curt
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message // Thursday's tweaks.
* system and commandline/config file processing code. //
* // Revision 1.16 1998/01/27 00:48:03 curt
* Revision 1.15 1998/01/22 02:59:41 curt // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
* Changed #ifdef FILE_H to #ifdef _FILE_H // system and commandline/config file processing code.
* //
* Revision 1.14 1998/01/19 19:27:17 curt // Revision 1.15 1998/01/22 02:59:41 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com> // Changed #ifdef FILE_H to #ifdef _FILE_H
* This should simplify things tremendously. //
* // Revision 1.14 1998/01/19 19:27:17 curt
* Revision 1.13 1998/01/19 18:40:38 curt // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* Tons of little changes to clean up the code and to remove fatal errors // This should simplify things tremendously.
* when building with the c++ compiler. //
* // Revision 1.13 1998/01/19 18:40:38 curt
* Revision 1.12 1997/12/15 23:55:03 curt // Tons of little changes to clean up the code and to remove fatal errors
* Add xgl wrappers for debugging. // when building with the c++ compiler.
* Generate terrain normals on the fly. //
* // Revision 1.12 1997/12/15 23:55:03 curt
* Revision 1.11 1997/12/10 22:37:52 curt // Add xgl wrappers for debugging.
* Prepended "fg" on the name of all global structures that didn't have it yet. // Generate terrain normals on the fly.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}" //
* // Revision 1.11 1997/12/10 22:37:52 curt
* Revision 1.10 1997/09/04 02:17:37 curt // Prepended "fg" on the name of all global structures that didn't have it yet.
* Shufflin' stuff. // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
* //
* Revision 1.9 1997/08/27 03:30:33 curt // Revision 1.10 1997/09/04 02:17:37 curt
* Changed naming scheme of basic shared structures. // Shufflin' stuff.
* //
* Revision 1.8 1997/08/06 00:24:30 curt // Revision 1.9 1997/08/27 03:30:33 curt
* Working on correct real time sun lighting. // Changed naming scheme of basic shared structures.
* //
* Revision 1.7 1997/07/23 21:52:27 curt // Revision 1.8 1997/08/06 00:24:30 curt
* Put comments around the text after an #endif for increased portability. // Working on correct real time sun lighting.
* //
* Revision 1.6 1997/07/11 01:30:03 curt // Revision 1.7 1997/07/23 21:52:27 curt
* More tweaking of terrian floor. // Put comments around the text after an #endif for increased portability.
* //
* Revision 1.5 1997/06/26 22:14:57 curt // Revision 1.6 1997/07/11 01:30:03 curt
* Beginning work on a scenery management system. // More tweaking of terrian floor.
* //
* Revision 1.4 1997/06/21 17:57:21 curt // Revision 1.5 1997/06/26 22:14:57 curt
* directory shuffling ... // Beginning work on a scenery management system.
* //
* Revision 1.2 1997/05/23 15:40:43 curt // Revision 1.4 1997/06/21 17:57:21 curt
* Added GNU copyright headers. // directory shuffling ...
* //
* Revision 1.1 1997/05/16 16:07:07 curt // Revision 1.2 1997/05/23 15:40:43 curt
* Initial revision. // Added GNU copyright headers.
* //
*/ // Revision 1.1 1997/05/16 16:07:07 curt
// Initial revision.
//

View file

@ -1,5 +1,5 @@
noinst_LIBRARIES = libSlew.a 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 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator

View file

@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* slew.c -- the "slew" flight model * slew.cxx -- the "slew" flight model
* *
* Written by Curtis Olson, started May 1997. * Written by Curtis Olson, started May 1997.
* *
@ -26,9 +26,10 @@
#include <math.h> #include <math.h>
#include <Flight/Slew/slew.h> #include "slew.hxx"
#include <Flight/flight.h>
#include <Aircraft/aircraft.h> #include <Flight/flight.hxx>
#include <Aircraft/aircraft.hxx>
#include <Controls/controls.h> #include <Controls/controls.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
@ -84,9 +85,12 @@ void fgSlewUpdate( void ) {
/* $Log$ /* $Log$
/* Revision 1.13 1998/04/25 22:06:29 curt /* Revision 1.1 1998/10/16 23:27:50 curt
/* Edited cvs log messages in source files ... bad bad bad! /* 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 * Revision 1.12 1998/04/08 23:35:30 curt
* Tweaks to Gnu automake/autoconf system. * Tweaks to Gnu automake/autoconf system.
* *

View file

@ -1,5 +1,5 @@
/************************************************************************** /**************************************************************************
* slew.h -- the "slew" flight model * slew.hxx -- the "slew" flight model
* *
* Written by Curtis Olson, started May 1997. * Written by Curtis Olson, started May 1997.
* *
@ -24,8 +24,13 @@
**************************************************************************/ **************************************************************************/
#ifndef _SLEW_H #ifndef _SLEW_HXX
#define _SLEW_H #define _SLEW_HXX
#ifndef __cplusplus
# error This library requires C++
#endif
/* reset flight params to a specific position */ /* reset flight params to a specific position */
@ -35,13 +40,16 @@ void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading);
void fgSlewUpdate( void ); void fgSlewUpdate( void );
#endif /* _SLEW_H */ #endif /* _SLEW_HXX */
/* $Log$ /* $Log$
/* Revision 1.4 1998/01/22 02:59:34 curt /* Revision 1.1 1998/10/16 23:27:52 curt
/* Changed #ifdef FILE_H to #ifdef _FILE_H /* 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 * Revision 1.3 1998/01/19 18:40:30 curt
* Tons of little changes to clean up the code and to remove fatal errors * Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler. * when building with the c++ compiler.

View file

@ -43,7 +43,7 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <time.h> #include <time.h>
#include <Flight/flight.h> #include <Flight/flight.hxx>
// Define a structure containing global time parameters // Define a structure containing global time parameters
@ -117,6 +117,9 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t);
// $Log$ // $Log$
// Revision 1.8 1998/10/16 23:28:00 curt
// C++-ifying.
//
// Revision 1.7 1998/10/16 00:56:09 curt // Revision 1.7 1998/10/16 00:56:09 curt
// Converted to Point3D class. // Converted to Point3D class.
// //