]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIThermal.cxx
assign a unique module name to ai/mp embedded nasal (again): __model%u
[flightgear.git] / src / AIModel / AIThermal.cxx
index 7c3b64742e076997dc496fd57987aad7ca0c4ff1..e9ad927a137e24fc4aedb4fda5364d63e9200dc1 100644 (file)
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
 #include <string>
 #include <math.h>
 
-SG_USING_STD(string);
+using std::string;
 
 #include "AIThermal.hxx"
 
@@ -54,9 +53,10 @@ void FGAIThermal::readFromScenario(SGPropertyNode* scFileNode) {
   setHeight(scFileNode->getDoubleValue("height-msl", 5000.0));
 }
 
-bool FGAIThermal::init() {
+bool FGAIThermal::init(bool search_in_AI_path) {
    factor = 8.0 * max_strength / (diameter * diameter * diameter);
-   return FGAIBase::init();
+   setAltitude( height );
+   return FGAIBase::init(search_in_AI_path);
 }
 
 void FGAIThermal::bind() {
@@ -87,8 +87,8 @@ void FGAIThermal::Run(double dt) {
    double user_altitude  = manager->get_user_altitude();
 
    // calculate range to target in feet and nautical miles
-   double lat_range = fabs(pos.lat() - user_latitude) * ft_per_deg_lat;
-   double lon_range = fabs(pos.lon() - user_longitude) * ft_per_deg_lon;
+   double lat_range = fabs(pos.getLatitudeDeg() - user_latitude) * ft_per_deg_lat;
+   double lon_range = fabs(pos.getLongitudeDeg() - user_longitude) * ft_per_deg_lon;
    double range_ft = sqrt(lat_range*lat_range + lon_range*lon_range);
    range = range_ft / 6076.11549;