C++-ifying.
This commit is contained in:
parent
cf2fa0f213
commit
bf5fb5108b
37 changed files with 720 additions and 733 deletions
|
@ -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
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <Aircraft/aircraft.h>
|
||||
#include "aircraft.hxx"
|
||||
#include <Debug/fg_debug.h>
|
||||
#include <Include/fg_constants.h>
|
||||
|
||||
|
@ -64,9 +64,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.19 1998/04/25 22:06:24 curt
|
||||
/* Edited cvs log messages in source files ... bad bad bad!
|
||||
/* 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.
|
||||
*
|
|
@ -28,15 +28,15 @@
|
|||
#define _AIRCRAFT_H
|
||||
|
||||
|
||||
#include <Flight/flight.h>
|
||||
#include <Controls/controls.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#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;
|
||||
|
@ -57,18 +57,16 @@ void fgAircraftInit( void );
|
|||
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.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.
|
||||
*
|
||||
|
@ -88,9 +86,12 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a);
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.12 1998/04/22 13:26:15 curt
|
||||
/* C++ - ifing the code a bit.
|
||||
/* 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.
|
||||
*
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
337
Astro/sky.cxx
337
Astro/sky.cxx
|
@ -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>
|
||||
|
@ -49,11 +47,7 @@
|
|||
#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 = ¤t_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.)
|
||||
//
|
||||
|
||||
|
|
106
Astro/sky.hxx
106
Astro/sky.hxx
|
@ -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
|
||||
|
@ -33,41 +31,43 @@
|
|||
#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.)
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,11 +24,13 @@
|
|||
|
||||
#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
|
||||
//
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
#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
|
||||
//
|
||||
|
|
|
@ -71,6 +71,14 @@
|
|||
#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 */
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -28,16 +28,17 @@
|
|||
#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.
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -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
|
||||
|
@ -47,15 +44,15 @@
|
|||
// #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.
|
||||
//
|
||||
|
|
|
@ -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
|
||||
|
@ -33,19 +31,18 @@
|
|||
#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 */
|
||||
#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.
|
||||
*
|
||||
*/
|
||||
// $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.
|
||||
//
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**************************************************************************
|
||||
* slew.c -- the "slew" flight model
|
||||
* slew.cxx -- the "slew" flight model
|
||||
*
|
||||
* Written by Curtis Olson, started May 1997.
|
||||
*
|
||||
|
@ -26,9 +26,10 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#include <Flight/Slew/slew.h>
|
||||
#include <Flight/flight.h>
|
||||
#include <Aircraft/aircraft.h>
|
||||
#include "slew.hxx"
|
||||
|
||||
#include <Flight/flight.hxx>
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Controls/controls.h>
|
||||
#include <Include/fg_constants.h>
|
||||
|
||||
|
@ -84,9 +85,12 @@ void fgSlewUpdate( void ) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.13 1998/04/25 22:06:29 curt
|
||||
/* Edited cvs log messages in source files ... bad bad bad!
|
||||
/* 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.
|
||||
*
|
|
@ -1,5 +1,5 @@
|
|||
/**************************************************************************
|
||||
* slew.h -- the "slew" flight model
|
||||
* slew.hxx -- the "slew" flight model
|
||||
*
|
||||
* Written by Curtis Olson, started May 1997.
|
||||
*
|
||||
|
@ -24,8 +24,13 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef _SLEW_H
|
||||
#define _SLEW_H
|
||||
#ifndef _SLEW_HXX
|
||||
#define _SLEW_HXX
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
# error This library requires C++
|
||||
#endif
|
||||
|
||||
|
||||
/* 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 );
|
||||
|
||||
|
||||
#endif /* _SLEW_H */
|
||||
#endif /* _SLEW_HXX */
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.4 1998/01/22 02:59:34 curt
|
||||
/* Changed #ifdef FILE_H to #ifdef _FILE_H
|
||||
/* 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.
|
|
@ -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.
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue