]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/light.cxx
First quick hack at panel shading.
[flightgear.git] / src / Time / light.cxx
index 4cee244bded339180cb4dc18a400ec197143ac48..b7c4a6b819f91e90b0336a923777c43041f7f3d3 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include <GL/glut.h>
-#include <simgear/xgl.h>
+#include <simgear/xgl/xgl.h>
 
 #include <simgear/compiler.h>
 
 #include <string>
 FG_USING_STD(string);
 
-#include <simgear/logstream.hxx>
 #include <simgear/constants.h>
-#include <simgear/fg_geodesy.hxx>
-#include <simgear/interpolater.hxx>
-#include <simgear/mat3.h>
-#include <simgear/polar3d.hxx>
-#include <simgear/fgpath.hxx>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/interpolater.hxx>
+#include <simgear/math/polar3d.hxx>
+#include <simgear/misc/fgpath.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Main/options.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;