CVS: source/src/Environment environment.cxx, 1.32, 1.33 environment.hxx, 1.12, 1.13 environment_mgr.cxx, 1.38, 1.39
Torsten Dreyer <[email protected]> Thu, 15 Apr 2010 02:56:30 -0500
| Newsgroups | gmane.games.flightgear.cvc |
|---|---|
| Message-ID | <[email protected]> |
Update of /var/cvs/FlightGear-0.9/source/src/Environment
In directory baron.flightgear.org:/tmp/cvs-serv9655
Modified Files:
environment.cxx environment.hxx environment_mgr.cxx
Log Message:
Support for the local weather system from Thorsten Renk
Index: environment.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- environment.cxx 22 Sep 2009 18:47:24 -0000 1.32
+++ environment.cxx 15 Apr 2010 07:56:23 -0000 1.33
@@ -140,6 +140,7 @@
wind_from_down_fps = 0;
thermal_lift_fps = 0;
ridge_lift_fps= 0;
+ local_weather_lift_fps=0;
altitude_half_to_sun_m = 1000;
altitude_tropo_top_m = 10000;
#ifdef USING_TABLES
@@ -182,6 +183,7 @@
wind_from_down_fps = env.wind_from_down_fps;
thermal_lift_fps = env.thermal_lift_fps;
ridge_lift_fps= env.ridge_lift_fps;
+ local_weather_lift_fps = env.local_weather_lift_fps;
turbulence_magnitude_norm = env.turbulence_magnitude_norm;
turbulence_rate_hz = env.turbulence_rate_hz;
}
@@ -238,6 +240,7 @@
maybe_copy_value(this, node, "turbulence/rate-hz",
&FGEnvironment::set_turbulence_rate_hz);
+
// calculate derived properties here to avoid duplicate expensive computations
_recalc_ne();
_recalc_alt_pt();
@@ -370,6 +373,12 @@
}
double
+FGEnvironment::get_local_weather_lift_fps () const
+{
+ return local_weather_lift_fps;
+}
+
+double
FGEnvironment::get_turbulence_magnitude_norm () const
{
if( sgEnviro.get_turbulence_enable_state() )
@@ -524,7 +533,16 @@
ridge_lift_fps = ri;
if( live_update ) {
_recalc_updraft();
+ }
}
+
+void
+FGEnvironment::set_local_weather_lift_fps (double lwl)
+{
+ local_weather_lift_fps = lwl;
+ if( live_update ) {
+ _recalc_updraft();
+ }
}
void
@@ -618,7 +636,7 @@
void
FGEnvironment::_recalc_updraft ()
{
- wind_from_down_fps = thermal_lift_fps + ridge_lift_fps ;
+ wind_from_down_fps = thermal_lift_fps + ridge_lift_fps + local_weather_lift_fps ;
}
// Intended to help with the interpretation of METAR data,
Index: environment.hxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment.hxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- environment.hxx 12 Sep 2009 15:20:31 -0000 1.12
+++ environment.hxx 15 Apr 2010 07:56:23 -0000 1.13
@@ -72,6 +72,7 @@
virtual double get_wind_from_down_fps () const;
virtual double get_thermal_lift_fps () const;
virtual double get_ridge_lift_fps () const;
+ virtual double get_local_weather_lift_fps () const;
virtual double get_turbulence_magnitude_norm () const;
virtual double get_turbulence_rate_hz () const;
@@ -92,6 +93,7 @@
virtual void set_wind_from_down_fps (double d);
virtual void set_thermal_lift_fps (double th);
virtual void set_ridge_lift_fps (double ri);
+ virtual void set_local_weather_lift_fps (double lwl);
virtual void set_turbulence_magnitude_norm (double t);
virtual void set_turbulence_rate_hz (double t);
@@ -147,6 +149,7 @@
double wind_from_down_fps;
double thermal_lift_fps;
double ridge_lift_fps;
+ double local_weather_lift_fps;
bool live_update;
Index: environment_mgr.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_mgr.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- environment_mgr.cxx 3 Jun 2009 16:29:59 -0000 1.38
+++ environment_mgr.cxx 15 Apr 2010 07:56:24 -0000 1.39
@@ -166,9 +166,12 @@
fgSetArchivable("/environment/thermal-lift-fps");
fgTie("/environment/ridge-lift-fps", _environment,
&FGEnvironment::get_ridge_lift_fps,
- &FGEnvironment::set_ridge_lift_fps);
+ &FGEnvironment::set_ridge_lift_fps);
fgSetArchivable("/environment/ridge-lift-fps");
-
+
+ fgTie("/environment/local-weather-lift", _environment,
+ &FGEnvironment::get_local_weather_lift_fps); //read-only
+
fgTie("/environment/turbulence/magnitude-norm", _environment,
&FGEnvironment::get_turbulence_magnitude_norm,
&FGEnvironment::set_turbulence_magnitude_norm);
@@ -255,6 +258,7 @@
fgUntie("/environment/thermal-lift-fps");
fgUntie("/environment/ridge-lift-fps");
+ fgUntie("/environment/local-weather-lift");
fgUntie("/environment/atmosphere/altitude-half-to-sun");
fgUntie("/environment/atmosphere/altitude-troposphere-top");
@@ -293,6 +297,7 @@
_environment->get_wind_from_east_fps(),
_environment->get_wind_from_down_fps());
_environment->set_elevation_ft(fgGetDouble("/position/altitude-ft"));
+ _environment->set_local_weather_lift_fps(fgGetDouble("/local-weather/current/thermal-lift"));
osg::Vec3 windVec(-_environment->get_wind_from_north_fps(),
-_environment->get_wind_from_east_fps(),
_environment->get_wind_from_down_fps());
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev