]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIThermal.cxx
Don't restore initial screen geometry because there is nothing in fg_os* to resize...
[flightgear.git] / src / AIModel / AIThermal.cxx
index c3d2def1c32375ba74eda9039913e95d158dae02..7c3b64742e076997dc496fd57987aad7ca0c4ff1 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #  include <config.h>
@@ -34,19 +34,25 @@ SG_USING_STD(string);
 #include "AIThermal.hxx"
 
 
-FGAIThermal::FGAIThermal(FGAIManager* mgr) {
-   manager = mgr;   
-   _type_str = "thermal";
-   _otype = otThermal;
+FGAIThermal::FGAIThermal() : FGAIBase(otThermal) {
    max_strength = 6.0;
    diameter = 0.5;
    strength = factor = 0.0;
 }
 
-
 FGAIThermal::~FGAIThermal() {
 }
 
+void FGAIThermal::readFromScenario(SGPropertyNode* scFileNode) {
+  if (!scFileNode)
+    return;
+
+  FGAIBase::readFromScenario(scFileNode);
+
+  setMaxStrength(scFileNode->getDoubleValue("strength-fps", 8.0)); 
+  setDiameter(scFileNode->getDoubleValue("diameter-ft", 0.0)/6076.11549);
+  setHeight(scFileNode->getDoubleValue("height-msl", 5000.0));
+}
 
 bool FGAIThermal::init() {
    factor = 8.0 * max_strength / (diameter * diameter * diameter);
@@ -71,8 +77,6 @@ void FGAIThermal::update(double dt) {
 
 void FGAIThermal::Run(double dt) {
 
-   FGAIThermal::dt = dt;
-       
    //###########################//
    // do calculations for range //
    //###########################//