1
0
Fork 0

Updates by Christian Mayer.

This commit is contained in:
curt 1999-10-12 03:30:24 +00:00
parent c4963be66c
commit a0aee5d866
2 changed files with 32 additions and 1 deletions

View file

@ -201,6 +201,17 @@ FGPhysicalProperty FGLocalWeatherDatabase::get(const Point3D& p) const
return global->get(p);
}
FGPhysicalProperty FGLocalWeatherDatabase::get(const sgVec3& p) const
{
Point3D temp(p[0], p[1], p[2]);
unsigned int a = AreaWith(temp);
if (a != 0)
return WeatherAreas[a-1].get(temp.elev());
else //point is outside => ask GlobalWeatherDatabase
return global->get(temp);
}
WeatherPrecition FGLocalWeatherDatabase::getAirDensity(const Point3D& p) const
{
FGPhysicalProperty dummy;
@ -215,6 +226,21 @@ WeatherPrecition FGLocalWeatherDatabase::getAirDensity(const Point3D& p) const
(dummy.Temperature*FG_WEATHER_DEFAULT_AIRPRESSURE);
}
WeatherPrecition FGLocalWeatherDatabase::getAirDensity(const sgVec3& p) const
{
Point3D temp(p[0], p[1], p[2]);
FGPhysicalProperty dummy;
unsigned int a = AreaWith(temp);
if (a != 0)
dummy = WeatherAreas[a-1].get(temp.elev());
else //point is outside => ask GlobalWeatherDatabase
dummy = global->get(temp);
return
(dummy.AirPressure*FG_WEATHER_DEFAULT_AIRDENSITY*FG_WEATHER_DEFAULT_TEMPERATURE) /
(dummy.Temperature*FG_WEATHER_DEFAULT_AIRPRESSURE);
}
/****************************************************************************/
/* Add a weather feature at the point p and surrounding area */

View file

@ -53,12 +53,14 @@ HISTORY
#include <GL/glut.h>
#include <XGL/xgl.h>
#include <vector>
#include "sg.h"
#include "FGPhysicalProperties.h"
#include "FGGlobalWeatherDatabase.h"
#include "FGMicroWeather.h"
#include "FGWeatherFeature.h"
#include "FGWeatherDefs.h"
#include <vector>
/****************************************************************************/
/* DEFINES */
@ -138,7 +140,10 @@ public:
/* Get the physical properties on the specified point p */
/************************************************************************/
FGPhysicalProperty get(const Point3D& p) const;
FGPhysicalProperty get(const sgVec3& p) const;
WeatherPrecition getAirDensity(const Point3D& p) const;
WeatherPrecition getAirDensity(const sgVec3& p) const;
/************************************************************************/
/* Add a weather feature at the point p and surrounding area */