From 70ec13e10b09658f8f65189f8a1b16498ea6be2d Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Fri, 9 Mar 2012 20:58:24 +0100 Subject: [PATCH] Make the sky disable cutoff distance configurable --- simgear/scene/sky/sky.cxx | 12 +++++++++++- simgear/scene/sky/sky.hxx | 8 ++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index 4c3a4e2b..9c8d83b9 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -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 ); diff --git a/simgear/scene/sky/sky.hxx b/simgear/scene/sky/sky.hxx index 2e84629f..08fddd6f 100644 --- a/simgear/scene/sky/sky.hxx +++ b/simgear/scene/sky/sky.hxx @@ -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 -- 2.39.5