]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/cloud.cxx
FreeBSD fix.
[simgear.git] / simgear / scene / sky / cloud.cxx
index 48818bcfa5e884dcf9af9b7b32560369efcb2e04..a2b3b66237ed36fd1452e4c7f80ce71e0d077977 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started June 2000.
 //
-// Copyright (C) 2000  Curtis L. Olson  - curt@flightgear.org
+// Copyright (C) 2000  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This program is distributed in the hope that it will be useful, but
 // WITHOUT ANY WARRANTY; without even the implied warranty of
 // #include <stdio.h>
 #include <math.h>
 
-#if defined (__APPLE__) 
+#if defined (__APPLE__) || defined (__FreeBSD__)
 // any C++ header file undefines isinf and isnan
 // so this should be included before <iostream>
 inline int (isinf)(double r) { return isinf(r); }
 inline int (isnan)(double r) { return isnan(r); } 
 #endif
 
-// #include STL_IOSTREAM
-
 #include <plib/sg.h>
 #include <plib/ssg.h>
 
@@ -634,7 +632,6 @@ bool SGCloudLayer::repaint( sgVec3 fog_color ) {
     return true;
 }
 
-
 // reposition the cloud layer at the specified origin and orientation
 // lon specifies a rotation about the Z axis
 // lat specifies a rotation about the new Y axis
@@ -725,8 +722,8 @@ bool SGCloudLayer::reposition( sgVec3 p, sgVec3 up, double lon, double lat,
         }
 
         if (sp_dist > 0) {
-            bx = cos(-direction * SGD_DEGREES_TO_RADIANS) * sp_dist;
-            by = sin(-direction * SGD_DEGREES_TO_RADIANS) * sp_dist;
+            bx = cos((180.0-direction) * SGD_DEGREES_TO_RADIANS) * sp_dist;
+            by = sin((180.0-direction) * SGD_DEGREES_TO_RADIANS) * sp_dist;
         }