]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/light.hxx
Clean-up cmake (linker) dependencies.
[flightgear.git] / src / Time / light.hxx
index 9517adb8191da47fe353f2385e8eae153bbbb2f8..75c23ca93c54cfb7d4e834f5356124c0a0178a01 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
 #include <simgear/compiler.h>
 
-#include SG_GL_H
-
-#include <plib/sg.h>                   // plib include
-
+#include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
-#include <simgear/math/point3d.hxx>
 
 
 // Define a structure containing the global lighting parameters
@@ -66,12 +58,9 @@ private:
      */
 
     // in geocentric coordinates
-    double _sun_lon, _sun_gc_lat;
+    double _sun_lon, _sun_lat;
     double _moon_lon, _moon_gc_lat;
 
-    // in cartesian coordiantes
-    SGVec3d _sunpos, _moonpos;
-
     // (in view coordinates)
     SGVec4f _sun_vec, _moon_vec;
 
@@ -97,8 +86,10 @@ private:
     SGVec4f _scene_ambient;
     SGVec4f _scene_diffuse;
     SGVec4f _scene_specular;
+    SGVec4f _scene_chrome;
 
     // clear sky, fog and cloud color
+    SGVec4f _sun_color;
     SGVec4f _sky_color;
     SGVec4f _fog_color;
     SGVec4f _cloud_color;
@@ -107,11 +98,23 @@ private:
     SGVec4f _adj_fog_color;
     SGVec4f _adj_sky_color;
 
+    // input parameters affected by the weather system
+    float _saturation;
+    float _scattering;
+    float _overcast;
+
     double _dt_total;
 
     void update_sky_color ();
     void update_adj_fog_color ();
 
+    void updateSunPos();
+    
+    // properties for chrome light; not a tie because I want to fire
+    // property listeners when the values change.
+    SGPropertyNode_ptr _chromeProps[4];
+  
+    SGPropertyNode_ptr _sunAngleRad;
 public:
 
     FGLight ();
@@ -129,11 +132,12 @@ public:
     inline const SGVec4f& scene_ambient () const { return _scene_ambient; }
     inline const SGVec4f& scene_diffuse () const { return _scene_diffuse; }
     inline const SGVec4f& scene_specular () const { return _scene_specular; }
+    inline const SGVec4f& scene_chrome () const { return _scene_chrome; }
 
     inline const SGVec4f& sky_color () const { return _sky_color; }
     inline const SGVec4f& cloud_color () const { return _cloud_color; }
     inline const SGVec4f& adj_fog_color () const { return _adj_fog_color; }
-
+    inline const SGVec4f& adj_sky_color () const { return _adj_sky_color; }
 
     // Sun related functions
 
@@ -146,11 +150,8 @@ public:
     inline double get_sun_lon () const { return _sun_lon; }
     inline void set_sun_lon (double l) { _sun_lon = l; }
 
-    inline double get_sun_gc_lat () const { return _sun_gc_lat; }
-    inline void set_sun_gc_lat (double l) { _sun_gc_lat = l; }
-
-    inline const SGVec3d& get_sunpos () const { return _sunpos; }
-    inline void set_sunpos (const SGVec3d& p) { _sunpos = p; }
+    inline double get_sun_lat () const { return _sun_lat; }
+    inline void set_sun_lat (double l) { _sun_lat = l; }
 
     inline SGVec4f& sun_vec () { return _sun_vec; }
     inline SGVec4f& sun_vec_inv () { return _sun_vec_inv; }
@@ -170,9 +171,6 @@ public:
     inline double get_moon_gc_lat () const { return _moon_gc_lat; }
     inline void set_moon_gc_lat (double l) { _moon_gc_lat = l; }
 
-    inline const SGVec3d& get_moonpos () const { return _moonpos; }
-    inline void set_moonpos (const SGVec3d& p) { _moonpos = p; }
-
     inline const SGVec4f& moon_vec () const { return _moon_vec; }
     inline const SGVec4f& moon_vec_inv () const { return _moon_vec_inv; }
 };