1998-04-24 00:49:17 +00:00
|
|
|
// options.hxx -- class to handle command line options
|
|
|
|
//
|
|
|
|
// Written by Curtis Olson, started April 1998.
|
|
|
|
//
|
|
|
|
// Copyright (C) 1998 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$
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _OPTIONS_HXX
|
|
|
|
#define _OPTIONS_HXX
|
|
|
|
|
|
|
|
|
1998-09-08 21:40:08 +00:00
|
|
|
#ifndef __cplusplus
|
1998-04-24 00:49:17 +00:00
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
1998-09-08 21:40:08 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#include <simgear/compiler.h>
|
1999-01-19 20:57:00 +00:00
|
|
|
|
1998-09-17 18:35:30 +00:00
|
|
|
#ifdef HAVE_WINDOWS_H
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <GL/glut.h>
|
2000-02-16 23:01:03 +00:00
|
|
|
#include <simgear/xgl/xgl.h>
|
1998-09-17 18:35:30 +00:00
|
|
|
|
1999-03-11 23:09:26 +00:00
|
|
|
#if defined(FX) && defined(XMESA)
|
|
|
|
extern bool global_fullscreen;
|
|
|
|
#endif
|
|
|
|
|
2000-09-26 23:39:29 +00:00
|
|
|
#include <simgear/math/sg_types.hxx>
|
2000-07-06 22:13:24 +00:00
|
|
|
#include <simgear/timing/sg_time.hxx>
|
1999-11-19 02:10:24 +00:00
|
|
|
|
1999-01-19 20:57:00 +00:00
|
|
|
#include STL_STRING
|
1999-02-02 20:13:29 +00:00
|
|
|
#include <vector>
|
1999-02-26 22:08:34 +00:00
|
|
|
|
1999-02-02 20:13:29 +00:00
|
|
|
FG_USING_STD(vector);
|
|
|
|
FG_USING_STD(string);
|
1998-11-16 13:59:58 +00:00
|
|
|
|
2000-02-15 03:30:01 +00:00
|
|
|
#define NEW_DEFAULT_MODEL_HZ 120
|
|
|
|
|
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
class fgOPTIONS {
|
1998-10-25 14:08:37 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
public:
|
1998-10-25 14:08:37 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_OPTIONS_OK = 0,
|
|
|
|
FG_OPTIONS_HELP = 1,
|
|
|
|
FG_OPTIONS_ERROR = 2
|
|
|
|
};
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-11-02 23:04:02 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_UNITS_FEET = 0,
|
|
|
|
FG_UNITS_METERS = 1
|
|
|
|
};
|
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
enum fgFogKind
|
|
|
|
{
|
|
|
|
FG_FOG_DISABLED = 0,
|
|
|
|
FG_FOG_FASTEST = 1,
|
|
|
|
FG_FOG_NICEST = 2
|
|
|
|
};
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-11-23 21:48:09 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FG_RADIUS_MIN = 1,
|
|
|
|
FG_RADIUS_MAX = 4
|
|
|
|
};
|
1998-08-27 17:01:55 +00:00
|
|
|
|
1999-08-10 03:44:47 +00:00
|
|
|
enum fgControlMode
|
|
|
|
{
|
|
|
|
FG_JOYSTICK = 0,
|
|
|
|
FG_KEYBOARD = 1,
|
|
|
|
FG_MOUSE = 2
|
|
|
|
};
|
|
|
|
|
1999-09-09 00:16:28 +00:00
|
|
|
enum fgViewMode
|
|
|
|
{
|
1999-10-15 13:55:44 +00:00
|
|
|
FG_VIEW_PILOT = 0, // Pilot perspective
|
|
|
|
FG_VIEW_FOLLOW = 1, // Following in the "foot steps" so to speak
|
|
|
|
FG_VIEW_CHASE = 2, // Chase
|
|
|
|
FG_VIEW_CIRCLING = 3, // Circling
|
|
|
|
FG_VIEW_SATELLITE = 4, // From high above
|
|
|
|
FG_VIEW_ANCHOR = 5, // Drop an anchor and watch from there
|
|
|
|
FG_VIEW_TOWER = 6, // From nearest tower?
|
|
|
|
FG_VIEW_SPOTTER = 7 // Fron a ground spotter
|
1999-09-09 00:16:28 +00:00
|
|
|
};
|
|
|
|
|
1999-10-06 20:58:57 +00:00
|
|
|
enum fgAutoCoordMode
|
|
|
|
{
|
|
|
|
FG_AUTO_COORD_NOT_SPECIFIED = 0,
|
|
|
|
FG_AUTO_COORD_DISABLED = 1,
|
|
|
|
FG_AUTO_COORD_ENABLED = 2
|
|
|
|
};
|
|
|
|
|
2000-07-07 21:52:45 +00:00
|
|
|
enum fgTimingOffsetType {
|
|
|
|
FG_TIME_SYS_OFFSET = 0,
|
|
|
|
FG_TIME_GMT_OFFSET = 1,
|
|
|
|
FG_TIME_LAT_OFFSET = 2,
|
|
|
|
FG_TIME_SYS_ABSOLUTE = 3,
|
|
|
|
FG_TIME_GMT_ABSOLUTE = 4,
|
|
|
|
FG_TIME_LAT_ABSOLUTE = 5
|
|
|
|
};
|
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
private:
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// The flight gear "root" directory
|
1998-08-27 17:01:55 +00:00
|
|
|
string fg_root;
|
1998-04-24 00:49:17 +00:00
|
|
|
|
2000-07-14 16:57:55 +00:00
|
|
|
// The scenery "root" directory
|
|
|
|
string fg_scenery;
|
|
|
|
|
1998-07-30 23:48:24 +00:00
|
|
|
// Starting position and orientation
|
1998-08-27 17:01:55 +00:00
|
|
|
string airport_id; // ID of initial starting airport
|
1998-07-30 23:48:24 +00:00
|
|
|
double lon; // starting longitude in degrees (west = -)
|
|
|
|
double lat; // starting latitude in degrees (south = -)
|
|
|
|
double altitude; // starting altitude in meters
|
|
|
|
double heading; // heading (yaw) angle in degress (Psi)
|
|
|
|
double roll; // roll angle in degrees (Phi)
|
|
|
|
double pitch; // pitch angle in degrees (Theta)
|
1999-07-31 04:58:26 +00:00
|
|
|
double uBody; // Body axis X velocity (U)
|
|
|
|
double vBody; // Body axis Y velocity (V)
|
|
|
|
double wBody; // Body axis Z velocity (W)
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
double vkcas; // Calibrated airspeed, knots
|
|
|
|
double mach; // Mach number
|
1998-04-25 15:11:10 +00:00
|
|
|
|
1998-07-06 21:34:17 +00:00
|
|
|
// Miscellaneous
|
1998-08-27 17:01:55 +00:00
|
|
|
bool game_mode; // Game mode enabled/disabled
|
|
|
|
bool splash_screen; // show splash screen
|
|
|
|
bool intro_music; // play introductory music
|
|
|
|
int mouse_pointer; // show mouse pointer
|
1999-08-10 03:44:47 +00:00
|
|
|
fgControlMode control_mode; // primary control mode
|
1999-10-06 20:58:57 +00:00
|
|
|
fgAutoCoordMode auto_coordination; // enable auto coordination
|
1998-07-06 21:34:17 +00:00
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Features
|
1998-08-27 17:01:55 +00:00
|
|
|
bool hud_status; // HUD on/off
|
|
|
|
bool panel_status; // Panel on/off
|
|
|
|
bool sound; // play sound effects
|
2000-05-13 00:02:43 +00:00
|
|
|
bool anti_alias_hud;
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-07-30 23:48:24 +00:00
|
|
|
// Flight Model options
|
1999-12-20 20:26:18 +00:00
|
|
|
int flight_model; // Core flight model code: jsb, larcsim, magic, etc.
|
|
|
|
string aircraft; // Aircraft to model
|
1999-09-01 20:24:54 +00:00
|
|
|
int model_hz; // number of FDM iterations per second
|
1999-08-10 03:44:47 +00:00
|
|
|
int speed_up; // Sim mechanics run this much faster than normal speed
|
2000-05-19 16:29:23 +00:00
|
|
|
int trim; // use the FDM trimming routine during init
|
|
|
|
// <0 --notrim set, 0 no trim, >0 trim
|
|
|
|
// default behavior is to enable trimming for jsbsim
|
|
|
|
// disable for all other fdm's
|
1998-07-30 23:48:24 +00:00
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Rendering options
|
1998-08-27 17:01:55 +00:00
|
|
|
fgFogKind fog; // Fog nicest/fastest/disabled
|
1999-10-22 00:27:49 +00:00
|
|
|
bool clouds; // Enable clouds
|
|
|
|
double clouds_asl; // Cloud layer height above sea level
|
1998-08-27 17:01:55 +00:00
|
|
|
double fov; // Field of View
|
|
|
|
bool fullscreen; // Full screen mode enabled/disabled
|
|
|
|
int shading; // shading method, 0 = Flat, 1 = Smooth
|
|
|
|
bool skyblend; // Blend sky to haze (using polygons) or just clear
|
|
|
|
bool textures; // Textures enabled/disabled
|
|
|
|
bool wireframe; // Wireframe mode enabled/disabled
|
1998-11-16 13:59:58 +00:00
|
|
|
int xsize, ysize; // window size derived from geometry string
|
2000-05-13 00:02:43 +00:00
|
|
|
int bpp; // bits per pixel
|
1999-09-09 00:16:28 +00:00
|
|
|
fgViewMode view_mode; // view mode
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-05-06 03:16:23 +00:00
|
|
|
// Scenery options
|
1998-05-16 13:08:34 +00:00
|
|
|
int tile_radius; // Square radius of rendered tiles (around center
|
|
|
|
// square.)
|
|
|
|
int tile_diameter; // Diameter of rendered tiles. for instance
|
|
|
|
// if tile_diameter = 3 then a 3 x 3 grid of tiles will
|
1998-05-06 03:16:23 +00:00
|
|
|
// be drawn. Increase this to see terrain that is
|
|
|
|
// further away.
|
|
|
|
|
1998-08-24 20:11:12 +00:00
|
|
|
// HUD options
|
1998-11-02 23:04:02 +00:00
|
|
|
int units; // feet or meters
|
1998-08-24 20:11:12 +00:00
|
|
|
int tris_or_culled;
|
|
|
|
|
1998-04-30 12:34:17 +00:00
|
|
|
// Time options
|
1999-09-07 23:09:43 +00:00
|
|
|
int time_offset; // Use this value to change time.
|
2000-07-07 21:52:45 +00:00
|
|
|
fgTimingOffsetType time_offset_type; // Will be set to one of the
|
|
|
|
// FG_TIME_* enums, to deterine how
|
2000-07-05 02:39:30 +00:00
|
|
|
// time_offset should be used
|
1998-04-28 01:20:20 +00:00
|
|
|
|
1998-11-16 13:59:58 +00:00
|
|
|
// Serial port configuration strings
|
1999-11-19 02:10:24 +00:00
|
|
|
string_list channel_options_list;
|
1999-06-22 21:24:31 +00:00
|
|
|
|
|
|
|
// Network options
|
2000-02-28 04:16:12 +00:00
|
|
|
bool network_olk;
|
1999-06-22 21:24:31 +00:00
|
|
|
string net_id;
|
1998-11-16 13:59:58 +00:00
|
|
|
|
1998-07-13 21:00:09 +00:00
|
|
|
public:
|
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
fgOPTIONS();
|
|
|
|
~fgOPTIONS();
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// Parse a single option
|
1998-08-27 17:01:55 +00:00
|
|
|
int parse_option( const string& arg );
|
1998-05-13 18:29:56 +00:00
|
|
|
|
2000-10-04 22:52:34 +00:00
|
|
|
// Scan the command line options for an fg_root definition and set
|
|
|
|
// just that.
|
|
|
|
int scan_command_line_for_root( int argc, char **argv );
|
|
|
|
|
|
|
|
// Scan the config file for an fg_root definition and set just
|
|
|
|
// that.
|
|
|
|
int scan_config_file_for_root( const string& path );
|
|
|
|
|
1998-05-13 18:29:56 +00:00
|
|
|
// Parse the command line options
|
|
|
|
int parse_command_line( int argc, char **argv );
|
|
|
|
|
1998-04-24 00:49:17 +00:00
|
|
|
// Parse the command line options
|
1998-08-27 17:01:55 +00:00
|
|
|
int parse_config_file( const string& path );
|
1998-04-24 00:49:17 +00:00
|
|
|
|
|
|
|
// Print usage message
|
|
|
|
void usage ( void );
|
|
|
|
|
1998-07-13 21:00:09 +00:00
|
|
|
// Query functions
|
1998-10-25 14:08:37 +00:00
|
|
|
inline string get_fg_root() const { return fg_root; }
|
2000-07-14 16:57:55 +00:00
|
|
|
inline string get_fg_scenery() const { return fg_scenery; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline string get_airport_id() const { return airport_id; }
|
|
|
|
inline double get_lon() const { return lon; }
|
|
|
|
inline double get_lat() const { return lat; }
|
|
|
|
inline double get_altitude() const { return altitude; }
|
|
|
|
inline double get_heading() const { return heading; }
|
|
|
|
inline double get_roll() const { return roll; }
|
|
|
|
inline double get_pitch() const { return pitch; }
|
1999-07-31 04:58:26 +00:00
|
|
|
inline double get_uBody() const {return uBody;}
|
|
|
|
inline double get_vBody() const {return vBody;}
|
|
|
|
inline double get_wBody() const {return wBody;}
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline double get_vc() const {return vkcas;}
|
|
|
|
inline double get_mach() const {return mach;}
|
|
|
|
|
1998-10-25 14:08:37 +00:00
|
|
|
inline bool get_game_mode() const { return game_mode; }
|
|
|
|
inline bool get_splash_screen() const { return splash_screen; }
|
|
|
|
inline bool get_intro_music() const { return intro_music; }
|
|
|
|
inline int get_mouse_pointer() const { return mouse_pointer; }
|
2000-05-13 00:02:43 +00:00
|
|
|
inline bool get_anti_alias_hud() const { return anti_alias_hud; }
|
1999-08-10 03:44:47 +00:00
|
|
|
inline fgControlMode get_control_mode() const { return control_mode; }
|
|
|
|
inline void set_control_mode( fgControlMode mode ) { control_mode = mode; }
|
1999-10-06 20:58:57 +00:00
|
|
|
inline fgAutoCoordMode get_auto_coordination() const {
|
|
|
|
return auto_coordination;
|
|
|
|
}
|
|
|
|
inline void set_auto_coordination(fgAutoCoordMode m) {
|
|
|
|
auto_coordination = m;
|
|
|
|
}
|
1998-10-25 14:08:37 +00:00
|
|
|
inline bool get_hud_status() const { return hud_status; }
|
|
|
|
inline bool get_panel_status() const { return panel_status; }
|
|
|
|
inline bool get_sound() const { return sound; }
|
|
|
|
inline int get_flight_model() const { return flight_model; }
|
1999-12-20 20:26:18 +00:00
|
|
|
inline string get_aircraft() const { return aircraft; }
|
1999-09-01 20:24:54 +00:00
|
|
|
inline int get_model_hz() const { return model_hz; }
|
1999-08-10 03:44:47 +00:00
|
|
|
inline int get_speed_up() const { return speed_up; }
|
|
|
|
inline void set_speed_up( int speed ) { speed_up = speed; }
|
2000-05-19 16:29:23 +00:00
|
|
|
inline int get_trim_mode(void) { return trim; }
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1998-10-25 14:08:37 +00:00
|
|
|
inline bool fog_enabled() const { return fog != FG_FOG_DISABLED; }
|
|
|
|
inline fgFogKind get_fog() const { return fog; }
|
1999-10-22 00:27:49 +00:00
|
|
|
inline bool get_clouds() const { return clouds; }
|
|
|
|
inline double get_clouds_asl() const { return clouds_asl; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline double get_fov() const { return fov; }
|
|
|
|
inline bool get_fullscreen() const { return fullscreen; }
|
|
|
|
inline int get_shading() const { return shading; }
|
|
|
|
inline bool get_skyblend() const { return skyblend; }
|
|
|
|
inline bool get_textures() const { return textures; }
|
|
|
|
inline bool get_wireframe() const { return wireframe; }
|
1998-11-16 13:59:58 +00:00
|
|
|
inline int get_xsize() const { return xsize; }
|
|
|
|
inline int get_ysize() const { return ysize; }
|
2000-05-13 00:02:43 +00:00
|
|
|
inline int get_bpp() const { return bpp; }
|
1999-09-09 00:16:28 +00:00
|
|
|
inline fgViewMode get_view_mode() const { return view_mode; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline int get_tile_radius() const { return tile_radius; }
|
|
|
|
inline int get_tile_diameter() const { return tile_diameter; }
|
1998-11-16 13:59:58 +00:00
|
|
|
|
1998-11-02 23:04:02 +00:00
|
|
|
inline int get_units() const { return units; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline int get_tris_or_culled() const { return tris_or_culled; }
|
1998-08-24 20:11:12 +00:00
|
|
|
|
1998-11-16 13:59:58 +00:00
|
|
|
inline int get_time_offset() const { return time_offset; }
|
2000-07-07 21:52:45 +00:00
|
|
|
inline fgTimingOffsetType get_time_offset_type() const {
|
2000-07-05 02:39:30 +00:00
|
|
|
return time_offset_type;
|
|
|
|
};
|
1998-11-16 13:59:58 +00:00
|
|
|
|
1999-11-19 02:10:24 +00:00
|
|
|
inline string_list get_channel_options_list() const {
|
|
|
|
return channel_options_list;
|
1998-11-25 01:33:58 +00:00
|
|
|
}
|
2000-02-28 04:16:12 +00:00
|
|
|
|
|
|
|
inline bool get_network_olk() const { return network_olk; }
|
1999-06-22 21:24:31 +00:00
|
|
|
inline string get_net_id() const { return net_id; }
|
1998-11-16 13:59:58 +00:00
|
|
|
|
1998-08-24 20:11:12 +00:00
|
|
|
// Update functions
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_fg_root (const string value) { fg_root = value; }
|
2000-07-14 16:57:55 +00:00
|
|
|
inline void set_fg_scenery (const string value) { fg_scenery = value; }
|
1999-04-27 15:52:32 +00:00
|
|
|
inline void set_airport_id( const string id ) { airport_id = id; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_lon (double value) { lon = value; }
|
|
|
|
inline void set_lat (double value) { lat = value; }
|
|
|
|
inline void set_altitude (double value) { altitude = value; }
|
|
|
|
inline void set_heading (double value) { heading = value; }
|
|
|
|
inline void set_roll (double value) { roll = value; }
|
|
|
|
inline void set_pitch (double value) { pitch = value; }
|
|
|
|
inline void set_uBody (double value) { uBody = value; }
|
|
|
|
inline void set_vBody (double value) { vBody = value; }
|
|
|
|
inline void set_wBody (double value) { wBody = value; }
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline void set_vc (double value) { vkcas = value; }
|
|
|
|
inline void set_mach(double value) { mach = value; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_game_mode (bool value) { game_mode = value; }
|
|
|
|
inline void set_splash_screen (bool value) { splash_screen = value; }
|
|
|
|
inline void set_intro_music (bool value) { intro_music = value; }
|
|
|
|
inline void set_mouse_pointer (int value) { mouse_pointer = value; }
|
2000-05-13 00:02:43 +00:00
|
|
|
inline void set_anti_alias_hud (bool value) { anti_alias_hud = value; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline void set_hud_status( bool status ) { hud_status = status; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_sound (bool value) { sound = value; }
|
|
|
|
inline void set_flight_model (int value) { flight_model = value; }
|
2000-05-06 21:47:53 +00:00
|
|
|
inline void set_aircraft (const string &ac) { aircraft = ac; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_model_hz (int value) { model_hz = value; }
|
2000-05-19 16:29:23 +00:00
|
|
|
inline void set_trim_mode(int value) { trim = value; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_fog (fgFogKind value) { fog = value; }
|
1999-10-22 00:27:49 +00:00
|
|
|
inline void set_clouds( bool value ) { clouds = value; }
|
|
|
|
inline void set_clouds_asl( double value ) { clouds_asl = value; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline void set_fov( double amount ) { fov = amount; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_fullscreen (bool value) { fullscreen = value; }
|
|
|
|
inline void set_shading (int value) { shading = value; }
|
|
|
|
inline void set_skyblend (bool value) { skyblend = value; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline void set_textures( bool status ) { textures = status; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_wireframe (bool status) { wireframe = status; }
|
1998-10-25 14:08:37 +00:00
|
|
|
inline void cycle_fog( void ) {
|
1998-09-17 18:35:30 +00:00
|
|
|
if ( fog == FG_FOG_DISABLED ) {
|
|
|
|
fog = FG_FOG_FASTEST;
|
|
|
|
} else if ( fog == FG_FOG_FASTEST ) {
|
|
|
|
fog = FG_FOG_NICEST;
|
|
|
|
xglHint ( GL_FOG_HINT, GL_NICEST );
|
|
|
|
} else if ( fog == FG_FOG_NICEST ) {
|
|
|
|
fog = FG_FOG_DISABLED;
|
|
|
|
xglHint ( GL_FOG_HINT, GL_FASTEST );
|
|
|
|
}
|
|
|
|
}
|
1999-05-06 22:16:12 +00:00
|
|
|
void toggle_panel();
|
1999-09-09 00:16:28 +00:00
|
|
|
inline void set_xsize( int x ) { xsize = x; }
|
|
|
|
inline void set_ysize( int y ) { ysize = y; }
|
2000-02-11 22:27:23 +00:00
|
|
|
inline void set_view_mode (fgViewMode value) { view_mode = value; }
|
|
|
|
inline void set_tile_radius (int value) { tile_radius = value; }
|
|
|
|
inline void set_tile_diameter (int value) { tile_diameter = value; }
|
|
|
|
inline void set_units (int value) { units = value; }
|
|
|
|
inline void set_tris_or_culled (int value) { tris_or_culled = value; }
|
|
|
|
inline void set_time_offset (int value) { time_offset = value; }
|
2000-07-07 21:52:45 +00:00
|
|
|
inline void set_time_offset_type (fgTimingOffsetType value) {
|
2000-07-05 02:39:30 +00:00
|
|
|
time_offset_type = value;
|
|
|
|
}
|
1999-09-09 00:16:28 +00:00
|
|
|
inline void cycle_view_mode() {
|
1999-10-15 13:55:44 +00:00
|
|
|
if ( view_mode == FG_VIEW_PILOT ) {
|
1999-09-09 00:16:28 +00:00
|
|
|
view_mode = FG_VIEW_FOLLOW;
|
|
|
|
} else if ( view_mode == FG_VIEW_FOLLOW ) {
|
1999-10-15 13:55:44 +00:00
|
|
|
view_mode = FG_VIEW_PILOT;
|
1999-09-09 00:16:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-02-28 04:16:12 +00:00
|
|
|
inline void set_network_olk( bool net ) { network_olk = net; }
|
1999-06-22 21:24:31 +00:00
|
|
|
inline void set_net_id( const string id ) { net_id = id; }
|
1998-08-24 20:11:12 +00:00
|
|
|
|
1998-08-27 17:01:55 +00:00
|
|
|
private:
|
1998-04-24 00:49:17 +00:00
|
|
|
|
1999-08-10 03:44:47 +00:00
|
|
|
void parse_control( const string& mode );
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_time( const string& time_str );
|
1999-04-11 13:19:29 +00:00
|
|
|
long int parse_date( const string& date_str );
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_degree( const string& degree_str );
|
|
|
|
int parse_time_offset( const string& time_str );
|
|
|
|
int parse_tile_radius( const string& arg );
|
1999-02-05 21:28:09 +00:00
|
|
|
int parse_fdm( const string& fm );
|
1998-08-27 17:01:55 +00:00
|
|
|
double parse_fov( const string& arg );
|
1999-11-19 02:10:24 +00:00
|
|
|
bool parse_channel( const string& type, const string& channel_str );
|
1998-04-24 00:49:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern fgOPTIONS current_options;
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _OPTIONS_HXX */
|
|
|
|
|
|
|
|
|