]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/particles.hxx
Improved tile cache priority scheme.
[simgear.git] / simgear / scene / model / particles.hxx
index 6dda343db2628b77b7ed2c6c114e41ab598475b8..78c10821407b9577a2b23940e06131afd7f5b404 100644 (file)
@@ -257,6 +257,13 @@ public:
      * magnitude is the velocity in meters per second.
      */
     static void setWindVector(const osg::Vec3& wind) { _wind = wind; }
+    static void setWindFrom(const double from_deg, const double speed_kt) {
+       double map_rad = -from_deg * SG_DEGREES_TO_RADIANS;
+       double speed_mps = speed_kt * SG_KT_TO_MPS;
+       _wind[0] = cos(map_rad) * speed_mps;
+       _wind[1] = sin(map_rad) * speed_mps;
+       _wind[2] = 0.0;
+    }
     static const osg::Vec3& getWindVector() { return _wind; }
 protected:
     float shooterExtraRange;