head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.37; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.52; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.54.00; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.55; 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

# cloud.hxx

    00001 // cloud.hxx -- model a single cloud layer
    00002 //
    00003 // Written by Curtis Olson, started June 2000.
    00004 //
    00005 // Copyright (C) 2000  Curtis L. Olson  - curt@@flightgear.org
    00006 //
    00007 // This library is free software; you can redistribute it and/or
    00008 // modify it under the terms of the GNU Library General Public
    00009 // License as published by the Free Software Foundation; either
    00010 // version 2 of the License, or (at your option) any later version.
    00011 //
    00012 // This library is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00015 // Library General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Library General Public
    00018 // License along with this library; if not, write to the
    00019 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00020 // Boston, MA  02111-1307, USA.
    00021 //
    00022 // $Id: cloud.hxx,v 1.10 2002/05/16 23:16:40 david Exp $
    00023
    00024
    00025 #ifndef _SG_CLOUD_HXX_
    00026 #define _SG_CLOUD_HXX_
    00027
    00028 #include <simgear/compiler.h>
    00029
    00030 #include <plib/ssg.h>
    00031
    00032 #include STL_STRING
    00033 SG_USING_STD(string);
    00034
    00035
    00036 class SGCloudLayer {
    00037
    00038 public:
    00039
    00040     enum Type {
    00041         SG_CLOUD_OVERCAST = 0,
    00042         SG_CLOUD_MOSTLY_CLOUDY,
    00043         SG_CLOUD_MOSTLY_SUNNY,
    00044         SG_CLOUD_CIRRUS,
    00045         SG_CLOUD_CLEAR,
    00046         SG_MAX_CLOUD_TYPES
    00047     };
    00048
    00049     // Constructors
    00050     SGCloudLayer( const string &tex_path );
    00051
    00052     // Destructor
    00053     ~SGCloudLayer( void );
    00054
    00055     float getSpan_m () const;
    00056     void setSpan_m (float span_m);
    00057
    00058     float getElevation_m () const;
    00059     void setElevation_m (float elevation_m);
    00060
    00061     float getThickness_m () const;
    00062     void setThickness_m (float thickness_m);
    00063
    00064     float getTransition_m () const;
    00065     void setTransition_m (float transition_m);
    00066
    00067     Type getType () const;
    00068     void setType (Type type);
    00069
    00070     // build the cloud object
    00071     void rebuild();
    00072
    00073     // repaint the cloud colors based on current value of sun_angle,
    00074     // sky, and fog colors.  This updates the color arrays for
    00075     // ssgVtxTable.
    00076     // sun angle in degrees relative to verticle
    00077     // 0 degrees = high noon
    00078     // 90 degrees = sun rise/set
    00079     // 180 degrees = darkest midnight
    00080     bool repaint( sgVec3 fog_color );
    00081
    00082     // reposition the cloud layer at the specified origin and
    00083     // orientation
    00084     // lon specifies a rotation about the Z axis
    00085     // lat specifies a rotation about the new Y axis
    00086     // spin specifies a rotation about the new Z axis (and orients the
    00087     // sunrise/set effects
    00088     bool reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt );
    00089
    00090     // draw the cloud layer
    00091     void draw();
    00092
    00093 private:
    00094
    00095     static ssgSimpleState *layer_states[SG_MAX_CLOUD_TYPES];
    00096     static int layer_sizes[SG_MAX_CLOUD_TYPES];
    00097
    00098     ssgRoot *layer_root;
    00099     ssgTransform *layer_transform;
    00100     ssgLeaf * layer;
    00101
    00102     ssgColourArray *cl;
    00103     ssgVertexArray *vl;
    00104     ssgTexCoordArray *tl;
    00105
    00106     // height above sea level (meters)
    00107     SGPath texture_path;
    00108     float layer_span;
    00109     float layer_asl;
    00110     float layer_thickness;
    00111     float layer_transition;
    00112     Type layer_type;
    00113     float scale;
    00114
    00115     // for handling texture coordinates to simulate cloud movement
    00116     // from winds, and to simulate the clouds being tied to ground
    00117     // position, not view position
    00118     // double xoff, yoff;
    00119     double last_lon, last_lat;
    00120
    00121 };
    00122
    00123
    00124 // make an ssgSimpleState for a cloud layer given the named texture
    00125 ssgSimpleState *SGCloudMakeState( const string &path );
    00126
    00127
    00128 #endif // _SG_CLOUD_HXX_

@ 1.3 log @Oops, try again. @ text @d137 1 a137 1