head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.40; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.58; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.04; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.22.01; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# sky.hxx

Go to the documentation of this file.

    00001
    00006 // Written by Curtis Olson, started December 1997.
    00007 // SSG-ified by Curtis Olson, February 2000.
    00008 //
    00009 // Copyright (C) 1997-2000  Curtis L. Olson  - curt@@flightgear.org
    00010 //
    00011 // This library is free software; you can redistribute it and/or
    00012 // modify it under the terms of the GNU Library General Public
    00013 // License as published by the Free Software Foundation; either
    00014 // version 2 of the License, or (at your option) any later version.
    00015 //
    00016 // This library is distributed in the hope that it will be useful,
    00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00019 // Library General Public License for more details.
    00020 //
    00021 // You should have received a copy of the GNU Library General Public
    00022 // License along with this library; if not, write to the
    00023 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00024 // Boston, MA  02111-1307, USA.
    00025 //
    00026 // $Id: sky.hxx,v 1.15 2002/05/16 23:16:40 david Exp $
    00027
    00028
    00029 #ifndef _SG_SKY_HXX
    00030 #define _SG_SKY_HXX
    00031
    00032
    00033 #ifndef __cplusplus
    00034 # error This library requires C++
    00035 #endif
    00036
    00037
    00038 #include <plib/ssg.h>           // plib include
    00039
    00040 #include <simgear/compiler.h>
    00041 #include <simgear/misc/sg_path.hxx>
    00042
    00043 #include <vector>
    00044
    00045 #include <simgear/sky/cloud.hxx>
    00046 #include <simgear/sky/dome.hxx>
    00047 #include <simgear/sky/moon.hxx>
    00048 #include <simgear/sky/oursun.hxx>
    00049 #include <simgear/sky/stars.hxx>
    00050
    00051 SG_USING_STD(vector);
    00052
    00053
    00054 typedef vector < SGCloudLayer* > layer_list_type;
    00055 typedef layer_list_type::iterator layer_list_iterator;
    00056 typedef layer_list_type::const_iterator layer_list_const_iterator;
    00057
    00184 class SGSky {
    00185
    00186 private:
    00187
    00188     // components of the sky
    00189     SGSkyDome *dome;
    00190     SGSun *oursun;
    00191     SGMoon *moon;
    00192     SGStars *planets;
    00193     SGStars *stars;
    00194     layer_list_type cloud_layers;
    00195
    00196     ssgRoot *pre_root, *post_root;
    00197
    00198     ssgSelector *pre_selector, *post_selector;
    00199     ssgTransform *pre_transform, *post_transform;
    00200
    00201     SGPath tex_path;
    00202
    00203     // visibility
    00204     float visibility;
    00205     float effective_visibility;
    00206
    00207     // near cloud visibility state variables
    00208     bool in_puff;
    00209     double puff_length;         // in seconds
    00210     double puff_progression;    // in seconds
    00211     double ramp_up;             // in seconds
    00212     double ramp_down;           // in seconds
    00213
    00214 public:
    00215
    00217     SGSky( void );
    00218
    00220     ~SGSky( void );
    00221
    00236     void build( double sun_size, double moon_size,
    00237                 int nplanets, sgdVec3 *planet_data, double planet_dist,
    00238                 int nstars, sgdVec3 *star_data, double star_dist );
    00239
    00264     bool repaint( sgVec4 sky_color, sgVec4 fog_color,
    00265                   double sun_angle, double moon_angle,
    00266                   int nplanets, sgdVec3 *planet_data,
    00267                   int nstars, sgdVec3 *star_data );
    00268
    00297     bool reposition( sgVec3 view_pos, sgVec3 zero_elev, sgVec3 view_up,
    00298                      double lon, double lat, double alt, double spin,
    00299                      double gst,
    00300                      double sun_ra, double sun_dec, double sun_dist,
    00301                      double moon_ra, double moon_dec, double moon_dist );
    00302
    00311     void modify_vis( float alt, float time_factor );
    00312
    00318     void preDraw();
    00319
    00326     void postDraw( float alt );
    00327
    00332     inline void texture_path( const string& path ) {
    00333         tex_path = SGPath( path );
    00334     }
    00335
    00337     inline void enable() {
    00338         pre_selector->select( 1 );
    00339         post_selector->select( 1 );
    00340     }
    00341
    00346     inline void disable() {
    00347         pre_selector->select( 0 );
    00348         post_selector->select( 0 );
    00349     }
    00350
    00358     void add_cloud_layer (SGCloudLayer * layer);
    00359
    00360
    00369     const SGCloudLayer * get_cloud_layer (int i) const;
    00370
    00371
    00380     SGCloudLayer * get_cloud_layer (int i);
    00381
    00382
    00388     int get_cloud_layer_count () const;
    00389
    00390
    00392     inline float get_visibility() const { return effective_visibility; }
    00393
    00397     inline void set_visibility( float v ) {
    00398         effective_visibility = visibility = v;
    00399     }
    00400 };
    00401
    00402
    00403 #endif // _SG_SKY_HXX

@ 1.3 log @Oops, try again. @ text @d154 1 a154 1