]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/light.cxx
Replaced Durk's mymath.* with plib/sg.h (contributed by Durk).
[flightgear.git] / src / Time / light.cxx
index 875eb4347bf776b3acd9f73aaa7c4555e1ca6987..b7c4a6b819f91e90b0336a923777c43041f7f3d3 100644 (file)
@@ -52,7 +52,6 @@ FG_USING_STD(string);
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/fg_geodesy.hxx>
 #include <simgear/math/interpolater.hxx>
-#include <simgear/math/mat3.h>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/misc/fgpath.hxx>
 
@@ -118,7 +117,7 @@ void fgLIGHT::Update( void ) {
     // calculate lighting parameters based on sun's relative angle to
     // local up
 
-    deg = sun_angle * 180.0 / FG_PI;
+    deg = sun_angle * RAD_TO_DEG;
     FG_LOG( FG_EVENT, FG_INFO, "  Sun angle = " << deg );
 
     ambient = ambient_tbl->interpolate( deg );
@@ -138,10 +137,12 @@ void fgLIGHT::Update( void ) {
     scene_ambient[0] = white[0] * ambient;
     scene_ambient[1] = white[1] * ambient;
     scene_ambient[2] = white[2] * ambient;
+    scene_ambient[3] = 1.0;
 
     scene_diffuse[0] = white[0] * diffuse;
     scene_diffuse[1] = white[1] * diffuse;
     scene_diffuse[2] = white[2] * diffuse;
+    scene_diffuse[3] = 1.0;
 
     // set sky color
     sky_color[0] = base_sky_color[0] * sky_brightness;