]> git.mxchange.org Git - flightgear.git/commitdiff
cleanup
authormfranz <mfranz>
Wed, 15 Feb 2006 08:25:23 +0000 (08:25 +0000)
committermfranz <mfranz>
Wed, 15 Feb 2006 08:25:23 +0000 (08:25 +0000)
src/Input/input.cxx

index 37820e1ba3fd5199611a04ed2620d7a00601fcc8..c6540efd134def3fc9524e8b208b57494c3ad06b 100644 (file)
@@ -324,19 +324,11 @@ FGInput::doMouseClick (int b, int updown, int x, int y)
 
         Point3D geod = sgCartToGeod(Point3D(hit[0], hit[1], hit[2]));
 
-        static SGPropertyNode_ptr lon
-                = fgGetNode("/sim/input/click/longitude-deg", true);
-        static SGPropertyNode_ptr lat
-                = fgGetNode("/sim/input/click/latitude-deg", true);
-        static SGPropertyNode_ptr elev_m
-                = fgGetNode("/sim/input/click/elevation-m", true);
-        static SGPropertyNode_ptr elev_ft
-                = fgGetNode("/sim/input/click/elevation-ft", true);
-
-        lon->setDoubleValue(geod.lon() * SGD_RADIANS_TO_DEGREES);
-        lat->setDoubleValue(geod.lat() * SGD_RADIANS_TO_DEGREES);
-        elev_m->setDoubleValue(geod.elev());
-        elev_ft->setDoubleValue(geod.elev() * SG_METER_TO_FEET);
+        SGPropertyNode *c = fgGetNode("/sim/input/click", true);
+        c->setDoubleValue("longitude-deg", geod.lon() * SGD_RADIANS_TO_DEGREES);
+        c->setDoubleValue("latitude-deg", geod.lat() * SGD_RADIANS_TO_DEGREES);
+        c->setDoubleValue("elevation-m", geod.elev());
+        c->setDoubleValue("elevation-ft", geod.elev() * SG_METER_TO_FEET);
       }
     }
   }