]> git.mxchange.org Git - simgear.git/commitdiff
Make the sky disable cutoff distance configurable
authorTorsten Dreyer <Torsten@t3r.de>
Fri, 9 Mar 2012 19:58:24 +0000 (20:58 +0100)
committerTorsten Dreyer <Torsten@t3r.de>
Fri, 9 Mar 2012 19:58:24 +0000 (20:58 +0100)
simgear/scene/sky/sky.cxx
simgear/scene/sky/sky.hxx

index 4c3a4e2b35b50ad01b6429a27b6633d0b437d5a8..9c8d83b996b2ecffed96e56eec4eed38c406611a 100644 (file)
@@ -40,6 +40,7 @@
 // Constructor
 SGSky::SGSky( void ) {
     effective_visibility = visibility = 10000.0;
+    minimum_sky_visibility = 1000;
 
     // near cloud visibility state variables
     in_puff = false;
@@ -113,7 +114,7 @@ void SGSky::build( double h_radius_m, double v_radius_m,
 // 180 degrees = darkest midnight
 bool SGSky::repaint( const SGSkyColor &sc, const SGEphemeris& eph )
 {
-    if ( effective_visibility > 1000.0 ) {
+    if ( effective_visibility > minimum_sky_visibility ) {
        enable();
        dome->repaint( sc.adj_sky_color, sc.sky_color, sc.fog_color,
                        sc.sun_angle, effective_visibility );
@@ -292,6 +293,15 @@ void SGSky::set_3dCloudUseImpostors(bool imp)
     SGCloudField::setUseImpostors(imp);
 }
 
+float SGSky::get_minimum_sky_visibility() const 
+{
+    return minimum_sky_visibility;
+}
+
+void SGSky::set_minimum_sky_visibility( float value )
+{
+    minimum_sky_visibility = value;
+}
 
 void SGSky::texture_path( const string& path ) {
        tex_path = SGPath( path );
index 2e84629f1ed8462c2b80e59eacdc6e99df6d5cfb..08fddd6fe0f346d2caea48993f0dc293819c2e43 100644 (file)
@@ -229,6 +229,7 @@ private:
     // visibility
     float visibility;
     float effective_visibility;
+    float minimum_sky_visibility;
 
     int in_cloud;
     int cur_layer_pos;
@@ -478,7 +479,10 @@ public:
     virtual void set_3dCloudWrap(bool wrap);
 
 
-};
-
+    /** Get minimum sky visibility */
+    virtual float get_minimum_sky_visibility() const;
 
+    /** Set minimum sky visibility */
+    virtual void set_minimum_sky_visibility( float value );
+};
 #endif // _SG_SKY_HXX