Make the sky disable cutoff distance configurable

This commit is contained in:
Torsten Dreyer 2012-03-09 20:58:24 +01:00
parent 3693e3600c
commit 70ec13e10b
2 changed files with 17 additions and 3 deletions

View 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 );

View 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