]> git.mxchange.org Git - flightgear.git/commitdiff
Check for less than -1.0 also.
authorehofman <ehofman>
Mon, 19 Jan 2004 14:26:24 +0000 (14:26 +0000)
committerehofman <ehofman>
Mon, 19 Jan 2004 14:26:24 +0000 (14:26 +0000)
src/Time/sunpos.cxx

index 0b1e03f595c496fb517912640dbc63b74bd5f25e..3a190d10330d5713b48b0856ee06d00f653128ba 100644 (file)
@@ -341,11 +341,16 @@ void fgUpdateSunPos( void ) {
     dot = sgScalarProductVec3( surface_to_sun, v->get_surface_south() );
     // cout << "  Dot product = " << dot << endl;
 
-    if (dot > 1) {
+    if (dot > 1.0) {
         SG_LOG( SG_ASTRO, SG_WARN,
                 "Dot product  = " << dot << " is greater than 1.0" );
         dot = 1.0;
     }
+    else if (dot < -1.0) {
+         SG_LOG( SG_ASTRO, SG_WARN,
+                 "Dot product  = " << dot << " is less than -1.0" );
+         dot = -1.0;
+     }
 
     if ( east_dot >= 0 ) {
        l->set_sun_rotation( acos(dot) );