Make the sky disable cutoff distance configurable
This commit is contained in:
parent
3693e3600c
commit
70ec13e10b
@ -40,6 +40,7 @@
|
|||||||
// Constructor
|
// Constructor
|
||||||
SGSky::SGSky( void ) {
|
SGSky::SGSky( void ) {
|
||||||
effective_visibility = visibility = 10000.0;
|
effective_visibility = visibility = 10000.0;
|
||||||
|
minimum_sky_visibility = 1000;
|
||||||
|
|
||||||
// near cloud visibility state variables
|
// near cloud visibility state variables
|
||||||
in_puff = false;
|
in_puff = false;
|
||||||
@ -113,7 +114,7 @@ void SGSky::build( double h_radius_m, double v_radius_m,
|
|||||||
// 180 degrees = darkest midnight
|
// 180 degrees = darkest midnight
|
||||||
bool SGSky::repaint( const SGSkyColor &sc, const SGEphemeris& eph )
|
bool SGSky::repaint( const SGSkyColor &sc, const SGEphemeris& eph )
|
||||||
{
|
{
|
||||||
if ( effective_visibility > 1000.0 ) {
|
if ( effective_visibility > minimum_sky_visibility ) {
|
||||||
enable();
|
enable();
|
||||||
dome->repaint( sc.adj_sky_color, sc.sky_color, sc.fog_color,
|
dome->repaint( sc.adj_sky_color, sc.sky_color, sc.fog_color,
|
||||||
sc.sun_angle, effective_visibility );
|
sc.sun_angle, effective_visibility );
|
||||||
@ -292,6 +293,15 @@ void SGSky::set_3dCloudUseImpostors(bool imp)
|
|||||||
SGCloudField::setUseImpostors(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 ) {
|
void SGSky::texture_path( const string& path ) {
|
||||||
tex_path = SGPath( path );
|
tex_path = SGPath( path );
|
||||||
|
@ -229,6 +229,7 @@ private:
|
|||||||
// visibility
|
// visibility
|
||||||
float visibility;
|
float visibility;
|
||||||
float effective_visibility;
|
float effective_visibility;
|
||||||
|
float minimum_sky_visibility;
|
||||||
|
|
||||||
int in_cloud;
|
int in_cloud;
|
||||||
int cur_layer_pos;
|
int cur_layer_pos;
|
||||||
@ -478,7 +479,10 @@ public:
|
|||||||
virtual void set_3dCloudWrap(bool wrap);
|
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
|
#endif // _SG_SKY_HXX
|
||||||
|
Loading…
Reference in New Issue
Block a user