1
0
Fork 0

C++ ifying ...

This commit is contained in:
curt 1998-10-17 01:33:52 +00:00
parent 9f1658bba4
commit 5b752bfb5f
37 changed files with 771 additions and 739 deletions

View file

@ -1,27 +1,25 @@
/**************************************************************************
* aircraft.c -- various aircraft routines
*
* Written by Curtis Olson, started May 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
// aircraft.cxx -- various aircraft routines
//
// Written by Curtis Olson, started May 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
#include <stdio.h>
@ -30,12 +28,12 @@
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
/* This is a record containing all the info for the aircraft currently
being operated */
// This is a record containing all the info for the aircraft currently
// being operated
fgAIRCRAFT current_aircraft;
/* Initialize an Aircraft structure */
// Initialize an Aircraft structure
void fgAircraftInit( void ) {
fgPrintf( FG_AIRCRAFT, FG_INFO, "Initializing Aircraft structure\n" );
@ -44,7 +42,7 @@ void fgAircraftInit( void ) {
}
/* Display various parameters to stdout */
// Display various parameters to stdout
void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
fgFLIGHT *f;
fgCONTROLS *c;
@ -63,72 +61,75 @@ void fgAircraftOutputCurrent(fgAIRCRAFT *a) {
}
/* $Log$
/* Revision 1.1 1998/10/16 23:26:47 curt
/* C++-ifying.
/*
* Revision 1.19 1998/04/25 22:06:24 curt
* Edited cvs log messages in source files ... bad bad bad!
*
* Revision 1.18 1998/04/18 04:13:56 curt
* Moved fg_debug.c to it's own library.
*
* Revision 1.17 1998/02/12 21:59:31 curt
* Incorporated code changes contributed by Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.16 1998/02/07 15:29:31 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.15 1998/01/27 00:47:46 curt
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
* system and commandline/config file processing code.
*
* Revision 1.14 1998/01/19 19:26:56 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.13 1997/12/15 23:54:30 curt
* Add xgl wrappers for debugging.
* Generate terrain normals on the fly.
*
* Revision 1.12 1997/12/10 22:37:37 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
*
* Revision 1.11 1997/09/13 02:00:05 curt
* Mostly working on stars and generating sidereal time for accurate star
* placement.
*
* Revision 1.10 1997/08/27 03:29:56 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.9 1997/07/19 22:39:08 curt
* Moved PI to ../constants.h
*
* Revision 1.8 1997/06/25 15:39:45 curt
* Minor changes to compile with rsxnt/win32.
*
* Revision 1.7 1997/06/02 03:01:39 curt
* Working on views (side, front, back, transitions, etc.)
*
* Revision 1.6 1997/05/31 19:16:26 curt
* Elevator trim added.
*
* Revision 1.5 1997/05/30 19:30:14 curt
* The LaRCsim flight model is starting to look like it is working.
*
* Revision 1.4 1997/05/30 03:54:11 curt
* Made a bit more progress towards integrating the LaRCsim flight model.
*
* Revision 1.3 1997/05/29 22:39:56 curt
* Working on incorporating the LaRCsim flight model.
*
* Revision 1.2 1997/05/23 15:40:29 curt
* Added GNU copyright headers.
*
* Revision 1.1 1997/05/16 15:58:24 curt
* Initial revision.
*
*/
// $Log$
// Revision 1.2 1998/10/17 01:33:52 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/16 23:26:47 curt
// C++-ifying.
//
// Revision 1.19 1998/04/25 22:06:24 curt
// Edited cvs log messages in source files ... bad bad bad!
//
// Revision 1.18 1998/04/18 04:13:56 curt
// Moved fg_debug.c to it's own library.
//
// Revision 1.17 1998/02/12 21:59:31 curt
// Incorporated code changes contributed by Charlie Hotchkiss
// <chotchkiss@namg.us.anritsu.com>
//
// Revision 1.16 1998/02/07 15:29:31 curt
// Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
// <chotchkiss@namg.us.anritsu.com>
//
// Revision 1.15 1998/01/27 00:47:46 curt
// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
// system and commandline/config file processing code.
//
// Revision 1.14 1998/01/19 19:26:56 curt
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
// This should simplify things tremendously.
//
// Revision 1.13 1997/12/15 23:54:30 curt
// Add xgl wrappers for debugging.
// Generate terrain normals on the fly.
//
// Revision 1.12 1997/12/10 22:37:37 curt
// Prepended "fg" on the name of all global structures that didn't have it yet.
// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
//
// Revision 1.11 1997/09/13 02:00:05 curt
// Mostly working on stars and generating sidereal time for accurate star
// placement.
//
// Revision 1.10 1997/08/27 03:29:56 curt
// Changed naming scheme of basic shared structures.
//
// Revision 1.9 1997/07/19 22:39:08 curt
// Moved PI to ../constants.h
//
// Revision 1.8 1997/06/25 15:39:45 curt
// Minor changes to compile with rsxnt/win32.
//
// Revision 1.7 1997/06/02 03:01:39 curt
// Working on views (side, front, back, transitions, etc.)
//
// Revision 1.6 1997/05/31 19:16:26 curt
// Elevator trim added.
//
// Revision 1.5 1997/05/30 19:30:14 curt
// The LaRCsim flight model is starting to look like it is working.
//
// Revision 1.4 1997/05/30 03:54:11 curt
// Made a bit more progress towards integrating the LaRCsim flight model.
//
// Revision 1.3 1997/05/29 22:39:56 curt
// Working on incorporating the LaRCsim flight model.
//
// Revision 1.2 1997/05/23 15:40:29 curt
// Added GNU copyright headers.
//
// Revision 1.1 1997/05/16 15:58:24 curt
// Initial revision.
//

View file

@ -1,31 +1,31 @@
/**************************************************************************
* aircraft.h -- define shared aircraft parameters
*
* Written by Curtis Olson, started May 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
//*************************************************************************
// aircraft.hxx -- define shared aircraft parameters
//
// Written by Curtis Olson, started May 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
//*************************************************************************/
#ifndef _AIRCRAFT_H
#define _AIRCRAFT_H
#ifndef _AIRCRAFT_HXX
#define _AIRCRAFT_HXX
#ifndef __cplusplus
@ -34,99 +34,76 @@
#include <Flight/flight.hxx>
#include <Controls/controls.h>
#include <Controls/controls.hxx>
/* Define a structure containing all the parameters for an aircraft */
// Define a structure containing all the parameters for an aircraft
typedef struct{
fgFLIGHT *flight;
fgCONTROLS *controls;
} fgAIRCRAFT ;
/* current_aircraft contains all the parameters of the aircraft
currently being operated. */
// current_aircraft contains all the parameters of the aircraft
// currently being operated.
extern fgAIRCRAFT current_aircraft;
/* Initialize an Aircraft structure */
// Initialize an Aircraft structure
void fgAircraftInit( void );
/* Display various parameters to stdout */
// Display various parameters to stdout
void fgAircraftOutputCurrent(fgAIRCRAFT *a);
#endif /* _AIRCRAFT_H */
#endif // _AIRCRAFT_HXX
/* $Log$
/* Revision 1.1 1998/10/16 23:26:49 curt
/* C++-ifying.
/*
* Revision 1.12 1998/04/22 13:26:15 curt
* C++ - ifing the code a bit.
*
* Revision 1.11 1998/04/21 17:02:27 curt
* Prepairing for C++ integration.
*
* Revision 1.10 1998/02/07 15:29:32 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.9 1998/01/22 02:59:23 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.8 1998/01/19 19:26:57 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.7 1997/12/10 22:37:38 curt
* Prepended "fg"AIRCRAFT_H */
/* $Log$
/* Revision 1.1 1998/10/16 23:26:49 curt
/* C++-ifying.
/*
* Revision 1.12 1998/04/22 13:26:15 curt
* C++ - ifing the code a bit.
*
* Revision 1.11 1998/04/21 17:02:27 curt
* Prepairing for C++ integration.
*
* Revision 1.10 1998/02/07 15:29:32 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.9 1998/01/22 02:59:23 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.8 1998/01/19 19:26:57 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.7 1997/12/10 22:37:38 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
*
* Revision 1.6 1997/09/13 02:00:06 curt
* Mostly working on stars and generating sidereal time for accurate star
* placement.
*
* Revision 1.5 1997/08/27 03:29:58 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.4 1997/07/23 21:52:17 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.3 1997/06/21 17:12:42 curt
* Capitalized subdirectory names.
*
* Revision 1.2 1997/05/23 15:40:30 curt
* Added GNU copyright headers.
*
* Revision 1.1 1997/05/16 15:58:25 curt
* Initial revision.
*
*/
// $Log$
// Revision 1.2 1998/10/17 01:33:54 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/16 23:26:49 curt
// C++-ifying.
//
// Revision 1.12 1998/04/22 13:26:15 curt
// C++ - ifing the code a bit.
//
// Revision 1.11 1998/04/21 17:02:27 curt
// Prepairing for C++ integration.
//
// Revision 1.10 1998/02/07 15:29:32 curt
// Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
// <chotchkiss@namg.us.anritsu.com>
//
// Revision 1.9 1998/01/22 02:59:23 curt
// Changed #ifdef FILE_H to #ifdef _FILE_H
//
// Revision 1.8 1998/01/19 19:26:57 curt
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
// This should simplify things tremendously.
//
// Revision 1.7 1997/12/10 22:37:38 curt
// Prepended "fg" on the name of all global structures that didn't have it yet.
// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
//
// Revision 1.6 1997/09/13 02:00:06 curt
// Mostly working on stars and generating sidereal time for accurate star
// placement.
//
// Revision 1.5 1997/08/27 03:29:58 curt
// Changed naming scheme of basic shared structures.
//
// Revision 1.4 1997/07/23 21:52:17 curt
// Put comments around the text after an #endif for increased portability.
//
// Revision 1.3 1997/06/21 17:12:42 curt
// Capitalized subdirectory names.
//
// Revision 1.2 1997/05/23 15:40:30 curt
// Added GNU copyright headers.
//
// Revision 1.1 1997/05/16 15:58:25 curt
// Initial revision.
//

View file

@ -29,7 +29,7 @@
#include <Aircraft/aircraft.hxx>
#include <Flight/flight.hxx>
#include <Controls/controls.h>
#include <Controls/controls.hxx>
#ifdef __cplusplus

View file

@ -50,7 +50,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "cockpit.hxx"
@ -316,6 +315,9 @@ void fgCockpitUpdate( void ) {
// $Log$
// Revision 1.19 1998/10/17 01:33:56 curt
// C++ ifying ...
//
// Revision 1.18 1998/10/16 23:27:23 curt
// C++-ifying.
//

View file

@ -47,7 +47,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#if defined ( __sun__ ) || defined ( __sgi )
extern "C" {
@ -830,6 +829,9 @@ void fgUpdateHUD( void ) {
}
// $Log$
// Revision 1.25 1998/10/17 01:33:57 curt
// C++ ifying ...
//
// Revision 1.24 1998/10/16 23:27:25 curt
// C++-ifying.
//

View file

@ -49,7 +49,7 @@
#include <fg_constants.h>
#include <Aircraft/aircraft.hxx>
#include <Flight/flight.hxx>
#include <Controls/controls.h>
#include <Controls/controls.hxx>
#include <deque> // STL double ended queue
@ -524,6 +524,9 @@ void fgHUDSetTimeMode( Hptr hud, int time_of_day );
#endif // _HUD_H
// $Log$
// Revision 1.16 1998/10/17 01:33:59 curt
// C++ ifying ...
//
// Revision 1.15 1998/10/16 23:27:27 curt
// C++-ifying.
//

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -18,7 +18,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -15,7 +15,6 @@
#include <Math/polar3d.hxx>
#include <Scenery/scenery.hxx>
#include <Time/fg_timer.hxx>
#include <Weather/weather.h>
#include "hud.hxx"

View file

@ -1,5 +1,5 @@
noinst_LIBRARIES = libControls.a
libControls_a_SOURCES = controls.c controls.h
libControls_a_SOURCES = controls.cxx controls.hxx
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Simulator

View file

@ -25,7 +25,7 @@
#include "LaRCsim.hxx"
#include <Aircraft/aircraft.hxx>
#include <Controls/controls.h>
#include <Controls/controls.hxx>
#include <Flight/flight.hxx>
#include <Flight/LaRCsim/ls_cockpit.h>
#include <Flight/LaRCsim/ls_generic.h>
@ -78,6 +78,17 @@ int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop) {
// Convert from the fgFLIGHT struct to the LaRCsim generic_ struct
int fgFlight_2_LaRCsim (fgFLIGHT *f) {
fgCONTROLS *c;
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];
Brake_pct = FG_Brake_Amt;
Mass = FG_Mass;
I_xx = FG_I_xx;
I_yy = FG_I_yy;
@ -254,16 +265,6 @@ int fgFlight_2_LaRCsim (fgFLIGHT *f) {
// Convert from the LaRCsim generic_ struct to the fgFLIGHT struct
int fgLaRCsim_2_Flight (fgFLIGHT *f) {
fgCONTROLS *c;
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];
FG_Mass = Mass;
FG_I_xx = I_xx;
FG_I_yy = I_yy;
@ -439,6 +440,9 @@ int fgLaRCsim_2_Flight (fgFLIGHT *f) {
// $Log$
// Revision 1.2 1998/10/17 01:34:11 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/17 00:43:58 curt
// Initial revision.
//

View file

@ -1,27 +1,27 @@
/**************************************************************************
* ls_interface.h -- interface to the "LaRCsim" flight model
*
* Written by Curtis Olson, started May 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
//*************************************************************************
// LaRCsim.hxx -- interface to the "LaRCsim" flight model
//
// Written by Curtis Olson, started May 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
//*************************************************************************/
#ifndef _LARCSIM_HXX
@ -31,24 +31,26 @@
#include "flight.hxx"
/* reset flight params to a specific position */
// reset flight params to a specific position
int fgLaRCsimInit(double dt);
/* update position based on inputs, positions, velocities, etc. */
// update position based on inputs, positions, velocities, etc.
int fgLaRCsimUpdate(fgFLIGHT *f, int multiloop);
/* 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);
/* Convert from the LaRCsim generic_ struct to the fgFLIGHT struct */
// Convert from the LaRCsim generic_ struct to the fgFLIGHT struct
int fgLaRCsim_2_Flight (fgFLIGHT *f);
#endif /* _LARCSIM_HXX */
#endif // _LARCSIM_HXX
/* $Log$
/* Revision 1.1 1998/10/17 00:43:58 curt
/* Initial revision.
/*
*/
// $Log$
// Revision 1.2 1998/10/17 01:34:13 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/17 00:43:58 curt
// Initial revision.
//

View file

@ -35,6 +35,9 @@
$Header$
$Log$
Revision 1.5 1998/10/17 01:34:14 curt
C++ ifying ...
Revision 1.4 1998/08/06 12:46:39 curt
Header change.
@ -73,6 +76,7 @@ typedef struct {
short left_pb_on_stick, right_pb_on_stick, trig_pos_1, trig_pos_2;
short sb_extend, sb_retract, gear_sel_up;
float throttle_pct;
float brake_pct;
} COCKPIT;
extern COCKPIT cockpit_;
@ -94,6 +98,7 @@ extern COCKPIT cockpit_;
#define SB_extend cockpit_.sb_extend
#define SB_retract cockpit_.sb_retract
#define Gear_sel_up cockpit_.gear_sel_up
#define Brake_pct cockpit_.brake_pct
#endif /* _LS_COCKPIT_H */

View file

@ -28,7 +28,11 @@
#define _LS_INTERFACE_H
// #include <Flight/flight.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "ls_types.h"
@ -55,48 +59,55 @@ int ls_ForceAltitude(double alt_feet);
#endif /* _LS_INTERFACE_H */
/* $Log$
/* 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.
*
* Revision 1.7 1998/02/07 15:29:39 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.6 1998/02/03 23:20:17 curt
* Lots of little tweaks to fix various consistency problems discovered by
* Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
* passed arguments along to the real printf(). Also incorporated HUD changes
* by Michele America.
*
* Revision 1.5 1998/01/19 19:27:05 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.4 1998/01/19 18:40:27 curt
* Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler.
*
* Revision 1.3 1997/07/23 21:52:20 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.2 1997/05/29 22:39:59 curt
* Working on incorporating the LaRCsim flight model.
*
* Revision 1.1 1997/05/29 00:09:58 curt
* Initial Flight Gear revision.
*
*/
#ifdef __cplusplus
}
#endif
// $Log$
// Revision 1.11 1998/10/17 01:34:15 curt
// C++ ifying ...
//
// 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.
//
// Revision 1.7 1998/02/07 15:29:39 curt
// Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
// <chotchkiss@namg.us.anritsu.com>
//
// Revision 1.6 1998/02/03 23:20:17 curt
// Lots of little tweaks to fix various consistency problems discovered by
// Solaris' CC. Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
// passed arguments along to the real printf(). Also incorporated HUD changes
// by Michele America.
//
// Revision 1.5 1998/01/19 19:27:05 curt
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
// This should simplify things tremendously.
//
// Revision 1.4 1998/01/19 18:40:27 curt
// Tons of little changes to clean up the code and to remove fatal errors
// when building with the c++ compiler.
//
// Revision 1.3 1997/07/23 21:52:20 curt
// Put comments around the text after an #endif for increased portability.
//
// Revision 1.2 1997/05/29 22:39:59 curt
// Working on incorporating the LaRCsim flight model.
//
// Revision 1.1 1997/05/29 00:09:58 curt
// Initial Flight Gear revision.
//

View file

@ -36,6 +36,9 @@
$Header$
$Log$
Revision 1.6 1998/10/17 01:34:16 curt
C++ ifying ...
Revision 1.5 1998/09/29 02:03:00 curt
Added a brake + autopilot mods.
@ -83,7 +86,6 @@ Initial Flight Gear revision.
#include "ls_generic.h"
#include "ls_cockpit.h"
#include <Controls/controls.h>
void sub3( DATA v1[], DATA v2[], DATA result[] )
{
@ -211,7 +213,8 @@ char rcsid[] = "$Id$";
* Put aircraft specific executable code here
*/
percent_brake[1] = fgBrakeGet(); /* replace with cockpit brake handle connection code */
/* replace with cockpit brake handle connection code */
percent_brake[1] = Brake_pct;
percent_brake[2] = percent_brake[1];
caster_angle_rad[0] = 0.03*Rudder_pedal;

View file

@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Astro/solarsystem.hxx>
#include <Astro/sky.hxx>
#include <Autopilot/autopilot.hxx>
@ -46,7 +46,7 @@
#include <Objects/material.hxx>
#include <PUI/pu.h>
#include <Time/light.hxx>
#include <Weather/weather.h>
#include <Weather/weather.hxx>
#include "GLUTkey.hxx"
#include "options.hxx"
@ -381,6 +381,9 @@ void GLUTspecialkey(int k, int x, int y) {
// $Log$
// Revision 1.28 1998/10/17 01:34:20 curt
// C++ ifying ...
//
// Revision 1.27 1998/10/02 12:46:46 curt
// Added an "auto throttle"
//

View file

@ -50,7 +50,7 @@
#include <Include/fg_constants.h> // for VERSION
#include <Include/general.h>
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Astro/sky.hxx>
#include <Astro/stars.hxx>
#include <Astro/solarsystem.hxx>
@ -75,7 +75,7 @@
#include <Time/fg_time.hxx>
#include <Time/fg_timer.hxx>
#include <Time/sunpos.hxx>
#include <Weather/weather.h>
#include <Weather/weather.hxx>
#include "GLUTkey.hxx"
#include "fg_init.hxx"
@ -894,6 +894,9 @@ int main( int argc, char **argv ) {
// $Log$
// Revision 1.59 1998/10/17 01:34:21 curt
// C++ ifying ...
//
// Revision 1.58 1998/10/16 23:27:52 curt
// C++-ifying.
//

View file

@ -42,13 +42,10 @@
#include <Include/fg_constants.h>
#include <Include/general.h>
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx>
// #include <Astro/moon.hxx>
// #include <Astro/planets.hxx>
#include <Astro/sky.hxx>
#include <Astro/stars.hxx>
// #include <Astro/sun.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
@ -64,7 +61,7 @@
#include <Time/fg_time.hxx>
#include <Time/light.hxx>
#include <Time/sunpos.hxx>
#include <Weather/weather.h>
#include <Weather/weather.hxx>
#include "fg_init.hxx"
#include "options.hxx"
@ -365,6 +362,9 @@ int fgInitSubsystems( void )
// $Log$
// Revision 1.43 1998/10/17 01:34:22 curt
// C++ ifying ...
//
// Revision 1.42 1998/10/16 23:27:54 curt
// C++-ifying.
//

View file

@ -34,7 +34,7 @@
#include <string>
#include <Debug/fg_debug.h>
#include <Flight/flight.h>
#include <Flight/flight.hxx>
#include <Include/fg_constants.h>
#include <Misc/fgstream.hxx>
@ -566,6 +566,9 @@ fgOPTIONS::~fgOPTIONS( void ) {
// $Log$
// Revision 1.26 1998/10/17 01:34:24 curt
// C++ ifying ...
//
// Revision 1.25 1998/09/15 02:09:27 curt
// Include/fg_callback.hxx
// Moved code inline to stop g++ 2.7 from complaining.

View file

@ -36,7 +36,6 @@
#include <string.h>
#include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h>
#include <Main/options.hxx>
#include <Objects/texload.h>
@ -149,6 +148,9 @@ void fgSplashUpdate ( double progress ) {
// $Log$
// Revision 1.6 1998/10/17 01:34:25 curt
// C++ ifying ...
//
// Revision 1.5 1998/09/26 13:17:29 curt
// Clear screen to "black" before drawing splash screen.
//

View file

@ -27,7 +27,7 @@
# include <config.h>
#endif
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
#include <Math/mat3.h>
@ -585,6 +585,9 @@ fgVIEW::~fgVIEW( void ) {
// $Log$
// Revision 1.23 1998/10/17 01:34:26 curt
// C++ ifying ...
//
// Revision 1.22 1998/10/16 00:54:03 curt
// Converted to Point3D class.
//

View file

@ -33,22 +33,21 @@
#include <GL/glut.h>
#include <XGL/xgl.h>
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Bucket/bucketutils.h>
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
// #include <Include/fg_types.h>
#include <Main/options.hxx>
#include <Main/views.hxx>
#include <Math/fg_geodesy.h>
#include <Math/fg_geodesy.hxx>
#include <Math/mat3.h>
#include <Math/point3d.hxx>
#include <Math/polar3d.hxx>
#include <Math/vector.hxx>
#include <Objects/material.hxx>
#include <Objects/obj.hxx>
#include <Weather/weather.h>
#include <Weather/weather.hxx>
#include "scenery.hxx"
#include "tile.hxx"
@ -634,6 +633,9 @@ void fgTileMgrRender( void ) {
// $Log$
// Revision 1.40 1998/10/17 01:34:28 curt
// C++ ifying ...
//
// Revision 1.39 1998/10/16 00:55:50 curt
// Converted to Point3D class.
//

View file

@ -1,27 +1,25 @@
/**************************************************************************
* slew.cxx -- the "slew" flight model
*
* Written by Curtis Olson, started May 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
// slew.cxx -- the "slew" flight model
//
// Written by Curtis Olson, started May 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
#include <math.h>
@ -30,11 +28,11 @@
#include <Flight/flight.hxx>
#include <Aircraft/aircraft.hxx>
#include <Controls/controls.h>
#include <Controls/controls.hxx>
#include <Include/fg_constants.h>
/* reset flight params to a specific position */
// reset flight params to a specific position
void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
fgFLIGHT *f;
@ -62,7 +60,7 @@ void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading) {
}
/* update position based on inputs, positions, velocities, etc. */
// update position based on inputs, positions, velocities, etc.
void fgSlewUpdate( void ) {
fgFLIGHT *f;
fgCONTROLS *c;
@ -84,58 +82,61 @@ void fgSlewUpdate( void ) {
}
/* $Log$
/* Revision 1.1 1998/10/16 23:27:50 curt
/* C++-ifying.
/*
* Revision 1.13 1998/04/25 22:06:29 curt
* Edited cvs log messages in source files ... bad bad bad!
*
* Revision 1.12 1998/04/08 23:35:30 curt
* Tweaks to Gnu automake/autoconf system.
*
* Revision 1.11 1998/02/07 15:29:39 curt
* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
* <chotchkiss@namg.us.anritsu.com>
*
* Revision 1.10 1998/01/27 00:47:53 curt
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
* system and commandline/config file processing code.
*
* Revision 1.9 1998/01/19 19:27:06 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.8 1998/01/19 18:40:30 curt
* Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler.
*
* Revision 1.7 1997/12/15 23:54:42 curt
* Add xgl wrappers for debugging.
* Generate terrain normals on the fly.
*
* Revision 1.6 1997/08/27 03:30:11 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.5 1997/07/19 22:35:06 curt
* Moved fiddled with PI to avoid compiler warnings.
*
* Revision 1.4 1997/06/21 17:12:51 curt
* Capitalized subdirectory names.
*
* Revision 1.3 1997/05/29 22:40:00 curt
* Working on incorporating the LaRCsim flight model.
*
* Revision 1.2 1997/05/29 12:30:19 curt
* Some initial mods to work better in a timer environment.
*
* Revision 1.1 1997/05/29 02:29:42 curt
* Moved to their own directory.
*
* Revision 1.2 1997/05/23 15:40:37 curt
* Added GNU copyright headers.
*
* Revision 1.1 1997/05/16 16:04:45 curt
* Initial revision.
*
*/
// $Log$
// Revision 1.2 1998/10/17 01:34:17 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/16 23:27:50 curt
// C++-ifying.
//
// Revision 1.13 1998/04/25 22:06:29 curt
// Edited cvs log messages in source files ... bad bad bad!
//
// Revision 1.12 1998/04/08 23:35:30 curt
// Tweaks to Gnu automake/autoconf system.
//
// Revision 1.11 1998/02/07 15:29:39 curt
// Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
// <chotchkiss@namg.us.anritsu.com>
//
// Revision 1.10 1998/01/27 00:47:53 curt
// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
// system and commandline/config file processing code.
//
// Revision 1.9 1998/01/19 19:27:06 curt
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
// This should simplify things tremendously.
//
// Revision 1.8 1998/01/19 18:40:30 curt
// Tons of little changes to clean up the code and to remove fatal errors
// when building with the c++ compiler.
//
// Revision 1.7 1997/12/15 23:54:42 curt
// Add xgl wrappers for debugging.
// Generate terrain normals on the fly.
//
// Revision 1.6 1997/08/27 03:30:11 curt
// Changed naming scheme of basic shared structures.
//
// Revision 1.5 1997/07/19 22:35:06 curt
// Moved fiddled with PI to avoid compiler warnings.
//
// Revision 1.4 1997/06/21 17:12:51 curt
// Capitalized subdirectory names.
//
// Revision 1.3 1997/05/29 22:40:00 curt
// Working on incorporating the LaRCsim flight model.
//
// Revision 1.2 1997/05/29 12:30:19 curt
// Some initial mods to work better in a timer environment.
//
// Revision 1.1 1997/05/29 02:29:42 curt
// Moved to their own directory.
//
// Revision 1.2 1997/05/23 15:40:37 curt
// Added GNU copyright headers.
//
// Revision 1.1 1997/05/16 16:04:45 curt
// Initial revision.
//

View file

@ -1,27 +1,25 @@
/**************************************************************************
* slew.hxx -- the "slew" flight model
*
* Written by Curtis Olson, started May 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
// slew.hxx -- the "slew" flight model
//
// Written by Curtis Olson, started May 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
#ifndef _SLEW_HXX
@ -33,37 +31,40 @@
#endif
/* reset flight params to a specific position */
// reset flight params to a specific position
void fgSlewInit(double pos_x, double pos_y, double pos_z, double heading);
/* update position based on inputs, positions, velocities, etc. */
// update position based on inputs, positions, velocities, etc.
void fgSlewUpdate( void );
#endif /* _SLEW_HXX */
#endif // _SLEW_HXX
/* $Log$
/* Revision 1.1 1998/10/16 23:27:52 curt
/* C++-ifying.
/*
* Revision 1.4 1998/01/22 02:59:34 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.3 1998/01/19 18:40:30 curt
* Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler.
*
* Revision 1.2 1997/07/23 21:52:20 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.1 1997/05/29 02:29:43 curt
* Moved to their own directory.
*
* Revision 1.2 1997/05/23 15:40:38 curt
* Added GNU copyright headers.
*
* Revision 1.1 1997/05/16 16:04:46 curt
* Initial revision.
*
*/
// $Log$
// Revision 1.2 1998/10/17 01:34:18 curt
// C++ ifying ...
//
// Revision 1.1 1998/10/16 23:27:52 curt
// C++-ifying.
//
// Revision 1.4 1998/01/22 02:59:34 curt
// Changed #ifdef FILE_H to #ifdef _FILE_H
//
// Revision 1.3 1998/01/19 18:40:30 curt
// Tons of little changes to clean up the code and to remove fatal errors
// when building with the c++ compiler.
//
// Revision 1.2 1997/07/23 21:52:20 curt
// Put comments around the text after an #endif for increased portability.
//
// Revision 1.1 1997/05/29 02:29:43 curt
// Moved to their own directory.
//
// Revision 1.2 1997/05/23 15:40:38 curt
// Added GNU copyright headers.
//
// Revision 1.1 1997/05/16 16:04:46 curt
// Initial revision.
//

View file

@ -54,7 +54,7 @@
#include <Astro/sky.hxx>
#include <Astro/solarsystem.hxx>
#include <Debug/fg_debug.h>
#include <Flight/flight.h>
#include <Flight/flight.hxx>
#include <Include/fg_constants.h>
#include <Main/options.hxx>
#include <Time/light.hxx>
@ -448,6 +448,9 @@ void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
// $Log$
// Revision 1.19 1998/10/17 01:34:29 curt
// C++ ifying ...
//
// Revision 1.18 1998/10/02 21:36:09 curt
// Fixes to try to break through the win95/98 18.3 fps barrier.
//

View file

@ -35,12 +35,12 @@
#include <string.h>
#include <Aircraft/aircraft.h>
#include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
#include <Main/options.hxx>
#include <Main/views.hxx>
#include <Math/fg_geodesy.h>
#include <Math/fg_geodesy.hxx>
#include <Math/interpolater.hxx>
#include <Math/mat3.h>
#include <Math/polar3d.hxx>
@ -212,6 +212,9 @@ fgLIGHT::~fgLIGHT( void ) {
// $Log$
// Revision 1.18 1998/10/17 01:34:30 curt
// C++ ifying ...
//
// Revision 1.17 1998/08/29 13:11:33 curt
// Bernie Bright writes:
// I've created some new classes to enable pointers-to-functions and

View file

@ -1,4 +1,4 @@
// sunpos.c (taken from XEarth)
// sunpos.cxx (adapted from XEarth)
// kirk johnson
// july 1993
//
@ -47,7 +47,7 @@
#include <Astro/solarsystem.hxx>
#include <Include/fg_constants.h>
#include <Main/views.hxx>
#include <Math/fg_geodesy.h>
#include <Math/fg_geodesy.hxx>
#include <Math/mat3.h>
#include <Math/point3d.hxx>
#include <Math/polar3d.hxx>
@ -423,6 +423,9 @@ void fgUpdateSunPos( void ) {
// $Log$
// Revision 1.14 1998/10/17 01:34:32 curt
// C++ ifying ...
//
// Revision 1.13 1998/10/16 00:56:12 curt
// Converted to Point3D class.
//

View file

@ -4,6 +4,6 @@
noinst_LIBRARIES = libWeather.a
libWeather_a_SOURCES = weather.c weather.h
libWeather_a_SOURCES = weather.cxx weather.hxx
INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator

View file

@ -1,173 +0,0 @@
/**************************************************************************
* weather.c -- routines to model weather
*
* Written by Curtis Olson, started July 1997.
*
* Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id$
* (Log is kept at end of this file)
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <GL/glut.h>
#include <XGL/xgl.h>
#include <math.h>
#include <stdio.h>
#include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h>
#include <Math/fg_random.h>
#include <Weather/weather.h>
/* This is a record containing current weather info */
struct fgWEATHER current_weather;
/* Initialize the weather modeling subsystem */
void fgWeatherInit( void ) {
struct fgWEATHER *w;
w = &current_weather;
printf("Initializing weather subsystem\n");
/* Configure some wind */
/* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
// fgWeatherSetVisibility(45000.0); /* in meters */
fgWeatherSetVisibility(32000.0); /* about 20 miles (in meters) */
}
/* Update the weather parameters for the current position */
void fgWeatherUpdate( void ) {
/* temporarily remove the code of this do-nothing routine */
// #ifdef FG_WEATHER_UPDATE
fgFLIGHT *f;
struct fgWEATHER *w;
f = current_aircraft.flight;
w = &current_weather;
/* Add some random turbulence */
// FG_U_gust = fg_random() * 5.0 - 2.5;
// FG_V_gust = fg_random() * 5.0 - 2.5;
// FG_W_gust = fg_random() * 5.0 - 2.5;
// #endif FG_WEATHER_UPDATE
}
/* Get the current visibility */
float fgWeatherGetVisibility( void ) {
struct fgWEATHER *w;
w = &current_weather;
return ( w->visibility );
}
/* Set the visibility and update fog parameters */
void fgWeatherSetVisibility( float visibility ) {
struct fgWEATHER *w;
w = &current_weather;
w->visibility = visibility; /* in meters */
// w->fog_density = -log(0.01 / w->visibility; /* for GL_FOG_EXP */
w->fog_density = sqrt( -log(0.01) ) / w->visibility; /* for GL_FOG_EXP2 */
xglFogf (GL_FOG_DENSITY, w->fog_density);
fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->fog_density);
}
/* $Log$
/* Revision 1.18 1998/10/02 12:46:50 curt
/* Added an "auto throttle"
/*
* Revision 1.17 1998/07/20 12:51:57 curt
* Default visibility to about 20 miles.
*
* Revision 1.16 1998/06/12 01:00:59 curt
* Build only static libraries.
* Declare memmove/memset for Sloaris.
* Added support for exponetial fog, which solves for the proper density to
* achieve the desired visibility range.
*
* Revision 1.15 1998/04/25 22:06:34 curt
* Edited cvs log messages in source files ... bad bad bad!
*
* Revision 1.14 1998/02/09 15:07:54 curt
* Minor tweaks.
*
* Revision 1.13 1998/01/27 00:48:08 curt
* Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
* system and commandline/config file processing code.
*
* Revision 1.12 1998/01/19 19:27:22 curt
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
* This should simplify things tremendously.
*
* Revision 1.11 1998/01/19 18:40:41 curt
* Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler.
*
* Revision 1.10 1997/12/30 22:22:46 curt
* Further integration of event manager.
*
* Revision 1.9 1997/12/30 20:48:03 curt
* Integrated new event manager with subsystem initializations.
*
* Revision 1.8 1997/12/11 04:43:58 curt
* Fixed sun vector and lighting problems. I thing the moon is now lit
* correctly.
*
* Revision 1.7 1997/12/10 22:37:56 curt
* Prepended "fg" on the name of all global structures that didn't have it yet.
* i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
*
* Revision 1.6 1997/08/27 03:30:38 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.5 1997/08/22 21:34:42 curt
* Doing a bit of reorganizing and house cleaning.
*
* Revision 1.4 1997/08/02 16:23:55 curt
* Misc. tweaks.
*
* Revision 1.3 1997/07/31 22:52:41 curt
* Working on redoing internal coordinate systems & scenery transformations.
*
* Revision 1.2 1997/07/30 16:12:44 curt
* Moved fg_random routines from Util/ to Math/
*
* Revision 1.1 1997/07/19 23:03:57 curt
* Initial revision.
*
*/

175
Weather/weather.cxx Normal file
View file

@ -0,0 +1,175 @@
// weather.cxx -- routines to model weather
//
// Written by Curtis Olson, started July 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@me.umn.edu
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// $Id$
// (Log is kept at end of this file)
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#include <GL/glut.h>
#include <XGL/xgl.h>
#include <math.h>
#include <stdio.h>
#include "weather.hxx"
#include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h>
#include <Math/fg_random.h>
// This is a record containing current weather info
struct fgWEATHER current_weather;
// Initialize the weather modeling subsystem
void fgWeatherInit( void ) {
struct fgWEATHER *w;
w = &current_weather;
printf("Initializing weather subsystem\n");
// Configure some wind
// FG_V_north_airmass = 15; // ft/s =~ 10mph
// fgWeatherSetVisibility(45000.0); // in meters
fgWeatherSetVisibility(32000.0); // about 20 miles (in meters)
}
// Update the weather parameters for the current position
void fgWeatherUpdate( void ) {
// temporarily remove the code of this do-nothing routine
// #ifdef FG_WEATHER_UPDATE
fgFLIGHT *f;
struct fgWEATHER *w;
f = current_aircraft.flight;
w = &current_weather;
// Add some random turbulence
// FG_U_gust = fg_random() * 5.0 - 2.5;
// FG_V_gust = fg_random() * 5.0 - 2.5;
// FG_W_gust = fg_random() * 5.0 - 2.5;
// #endif FG_WEATHER_UPDATE
}
// Get the current visibility
float fgWeatherGetVisibility( void ) {
struct fgWEATHER *w;
w = &current_weather;
return ( w->visibility );
}
// Set the visibility and update fog parameters
void fgWeatherSetVisibility( float visibility ) {
struct fgWEATHER *w;
w = &current_weather;
w->visibility = visibility; // in meters
// w->fog_density = -log(0.01 / w->visibility; // for GL_FOG_EXP
w->fog_density = sqrt( -log(0.01) ) / w->visibility; // for GL_FOG_EXP2
xglFogf (GL_FOG_DENSITY, w->fog_density);
fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->fog_density);
}
// $Log$
// Revision 1.1 1998/10/17 01:34:36 curt
// C++ ifying ...
//
// Revision 1.18 1998/10/02 12:46:50 curt
// Added an "auto throttle"
//
// Revision 1.17 1998/07/20 12:51:57 curt
// Default visibility to about 20 miles.
//
// Revision 1.16 1998/06/12 01:00:59 curt
// Build only static libraries.
// Declare memmove/memset for Sloaris.
// Added support for exponetial fog, which solves for the proper density to
// achieve the desired visibility range.
//
// Revision 1.15 1998/04/25 22:06:34 curt
// Edited cvs log messages in source files ... bad bad bad!
//
// Revision 1.14 1998/02/09 15:07:54 curt
// Minor tweaks.
//
// Revision 1.13 1998/01/27 00:48:08 curt
// Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
// system and commandline/config file processing code.
//
// Revision 1.12 1998/01/19 19:27:22 curt
// Merged in make system changes from Bob Kuehne <rpk@sgi.com>
// This should simplify things tremendously.
//
// Revision 1.11 1998/01/19 18:40:41 curt
// Tons of little changes to clean up the code and to remove fatal errors
// when building with the c++ compiler.
//
// Revision 1.10 1997/12/30 22:22:46 curt
// Further integration of event manager.
//
// Revision 1.9 1997/12/30 20:48:03 curt
// Integrated new event manager with subsystem initializations.
//
// Revision 1.8 1997/12/11 04:43:58 curt
// Fixed sun vector and lighting problems. I thing the moon is now lit
// correctly.
//
// Revision 1.7 1997/12/10 22:37:56 curt
// Prepended "fg" on the name of all global structures that didn't have it yet.
// i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
//
// Revision 1.6 1997/08/27 03:30:38 curt
// Changed naming scheme of basic shared structures.
//
// Revision 1.5 1997/08/22 21:34:42 curt
// Doing a bit of reorganizing and house cleaning.
//
// Revision 1.4 1997/08/02 16:23:55 curt
// Misc. tweaks.
//
// Revision 1.3 1997/07/31 22:52:41 curt
// Working on redoing internal coordinate systems & scenery transformations.
//
// Revision 1.2 1997/07/30 16:12:44 curt
// Moved fg_random routines from Util/ to Math/
//
// Revision 1.1 1997/07/19 23:03:57 curt
// Initial revision.
//

View file

@ -1,105 +0,0 @@
/**************************************************************************
* weather.h -- routines to model weather
*
* Written by Curtis Olson, started July 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 _WEATHER_H
#define _WEATHER_H
#ifdef __cplusplus
extern "C" {
#endif
/* holds the current weather values */
struct fgWEATHER {
float visibility;
float fog_density;
};
extern struct fgWEATHER current_weather;
/* Initialize the weather modeling subsystem */
void fgWeatherInit( void );
/* Update the weather parameters for the current position */
void fgWeatherUpdate( void );
/* Get the current visibility */
float fgWeatherGetVisibility( void );
/* Set the visibility and update fog parameters */
void fgWeatherSetVisibility( float visibility );
#ifdef __cplusplus
}
#endif
#endif /* _WEATHER_H */
/* $Log$
/* Revision 1.10 1998/06/12 01:01:00 curt
/* Build only static libraries.
/* Declare memmove/memset for Sloaris.
/* Added support for exponetial fog, which solves for the proper density to
/* achieve the desired visibility range.
/*
* Revision 1.9 1998/04/21 17:02:46 curt
* Prepairing for C++ integration.
*
* Revision 1.8 1998/01/22 02:59:44 curt
* Changed #ifdef FILE_H to #ifdef _FILE_H
*
* Revision 1.7 1998/01/19 18:40:41 curt
* Tons of little changes to clean up the code and to remove fatal errors
* when building with the c++ compiler.
*
* Revision 1.6 1997/12/30 22:22:47 curt
* Further integration of event manager.
*
* Revision 1.5 1997/12/10 22:37:56 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.4 1997/08/27 03:30:39 curt
* Changed naming scheme of basic shared structures.
*
* Revision 1.3 1997/08/22 21:34:43 curt
* Doing a bit of reorganizing and house cleaning.
*
* Revision 1.2 1997/07/23 21:52:30 curt
* Put comments around the text after an #endif for increased portability.
*
* Revision 1.1 1997/07/19 23:03:58 curt
* Initial revision.
*
*/

106
Weather/weather.hxx Normal file
View file

@ -0,0 +1,106 @@
// weather.hxx -- routines to model weather
//
// Written by Curtis Olson, started July 1997.
//
// Copyright (C) 1997 Curtis L. Olson - curt@me.umn.edu
//
// 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 _WEATHER_H
#define _WEATHER_H
#ifdef __cplusplus
extern "C" {
#endif
// holds the current weather values
struct fgWEATHER {
float visibility;
float fog_density;
};
extern struct fgWEATHER current_weather;
// Initialize the weather modeling subsystem
void fgWeatherInit( void );
// Update the weather parameters for the current position
void fgWeatherUpdate( void );
// Get the current visibility
float fgWeatherGetVisibility( void );
// Set the visibility and update fog parameters
void fgWeatherSetVisibility( float visibility );
#ifdef __cplusplus
}
#endif
#endif // _WEATHER_H
// $Log$
// Revision 1.1 1998/10/17 01:34:37 curt
// C++ ifying ...
//
// Revision 1.10 1998/06/12 01:01:00 curt
// Build only static libraries.
// Declare memmove/memset for Sloaris.
// Added support for exponetial fog, which solves for the proper density to
// achieve the desired visibility range.
//
// Revision 1.9 1998/04/21 17:02:46 curt
// Prepairing for C++ integration.
//
// Revision 1.8 1998/01/22 02:59:44 curt
// Changed #ifdef FILE_H to #ifdef _FILE_H
//
// Revision 1.7 1998/01/19 18:40:41 curt
// Tons of little changes to clean up the code and to remove fatal errors
// when building with the c++ compiler.
//
// Revision 1.6 1997/12/30 22:22:47 curt
// Further integration of event manager.
//
// Revision 1.5 1997/12/10 22:37:56 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.4 1997/08/27 03:30:39 curt
// Changed naming scheme of basic shared structures.
//
// Revision 1.3 1997/08/22 21:34:43 curt
// Doing a bit of reorganizing and house cleaning.
//
// Revision 1.2 1997/07/23 21:52:30 curt
// Put comments around the text after an #endif for increased portability.
//
// Revision 1.1 1997/07/19 23:03:58 curt
// Initial revision.
//