current_aircraft.fdm_state->get_Longitude(),
current_aircraft.fdm_state->get_Altitude() * FEET_TO_METER );
FGLocalWeatherDatabase::theFGLocalWeatherDatabase =
- new FGLocalWeatherDatabase( position, globals->get_options()->get_fg_root() );
+ new FGLocalWeatherDatabase( position,
+ globals->get_options()->get_fg_root() );
// cout << theFGLocalWeatherDatabase << endl;
// cout << "visibility = "
// << theFGLocalWeatherDatabase->getWeatherVisibility() << endl;
WeatherDatabase = FGLocalWeatherDatabase::theFGLocalWeatherDatabase;
-
+
+ double init_vis = globals->get_options()->get_default_visibility();
+ if ( init_vis > 0 ) {
+ WeatherDatabase->setWeatherVisibility( init_vis );
+ }
+
// register the periodic update of the weather
global_events.Register( "weather update", fgUpdateWeatherDatabase,
fgEVENT::FG_EVENT_READY, 30000);
bpp(16),
view_mode(FG_VIEW_PILOT),
default_view_offset(0),
+ visibility(-1.0),
// HUD options
units(FG_UNITS_FEET),
pilot_view->set_view_offset( default_view_offset );
pilot_view->set_goal_view_offset( default_view_offset );
// $$$ end - added VS Renganathan, 14 Oct 2K
+ } else if ( arg.find( "--visibility=" ) != string::npos ) {
+ visibility = atof( arg.substr( 13 ) );
+ } else if ( arg.find( "--visibility-miles=" ) != string::npos ) {
+ visibility = atof( arg.substr( 19 ) ) * 5280.0 * FEET_TO_METER;
} else if ( arg.find( "--wp=" ) != string::npos ) {
parse_wp( arg.substr( 5 ) );
} else if ( arg.find( "--flight-plan=") != string::npos) {
cout << "\t\tas an offset from straight ahead. Allowable values are"
<< endl;
cout << "\t\tLEFT, RIGHT, CENTER, or a specific number of degrees" << endl;
+ cout << "\t--visibility=xxx: specify initial visibility in meters" << endl;
+ cout << "\t--visibility-miles=xxx: specify initial visibility in miles"
+ << endl;
cout << endl;
cout << "Scenery Options:" << endl;
fgViewMode view_mode; // view mode
double default_view_offset; // default forward view offset (for use by
// multi-display configuration
+ double visibility; // visibilty in meters
// HUD options
int units; // feet or meters
inline double get_default_view_offset() const {
return default_view_offset;
}
+ inline double get_default_visibility() const { return visibility; }
inline int get_units() const { return units; }
inline int get_tris_or_culled() const { return tris_or_culled; }
};
-// extern FGOptions current_options;
-
-
#endif /* _OPTIONS_HXX */