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;
(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 */
#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 */
/* 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 */