include/weather.h

Go to the documentation of this file.
00001 #ifndef _WEATHER_H
00002 
00003 #include <stdio.h>                      // Header File For Standard Input/Output
00004 #include <GL/gl.h>
00005 #include <GL/glu.h>
00006 #include <SDL/SDL.h>
00007 #ifdef __APPLE__
00008 #include <SDL_image/SDL_image.h>
00009 #else
00010 #include <SDL/SDL_image.h>
00011 #endif
00012 #include <string>
00013 #include <iostream>
00014 #include <fstream>
00015 #include <cmath>
00016 #include <cassert>
00017 
00018 #include "quat.h"
00019 #include "camera.h"
00020 
00021 #include "globals.h"
00022 
00023 //once dewpoint gets this close to the temp, clouds begin to form.
00024 #define CLOUD_FORMATION 20.0f
00025 
00026 class WEATHERVARIABLE
00027 {
00028 public:
00029         float value;
00030         float next_value;
00031         float duration;
00032         double start_time;
00033         float night_dip;
00034         
00035         void Update(double abs_time);
00036         void Init(float minval, float maxval, float mindur, float maxdur);
00037         void Init(float minval, float maxval, float mindur, float maxdur, float newnightdip);
00038         void CalcNew(double abs_time);
00039         float GetVal(double abs_time);
00040 
00041         float valmax, valmin, durmax, durmin;
00042 };
00043 
00044 class WEATHERVERTEX
00045 {
00046 public:
00047         WEATHERVARIABLE components[3];
00048         
00049         void Update(double abs_time);
00050         void Init(float minval, float maxval, float mindur, float maxdur);
00051         void CalcNew(double abs_time);
00052         VERTEX GetVal(double abs_time);
00053 };
00054 
00055 class WEATHER
00056 {
00057 private:
00058         double abs_time;
00059         
00060         WEATHERVARIABLE temperature;
00061         WEATHERVARIABLE dewpoint;
00062 
00063         WEATHERVERTEX globalwind_lowfreq;
00064         WEATHERVERTEX globalwind_highfreq;
00065 
00066         //this will be added later, once it's important
00067         //WEATHERVERTEX localwind[9];
00068 
00069 public:
00070         void Init();
00071         void Update(double cur_time);
00072         
00073         int GetCloudCover();
00074         int GetCloudFuzziness();
00075         VERTEX GetGlobalWind();
00076         int GetRainDrops();
00077         float GetFogDensity();
00078 };
00079 
00080 #define _WEATHER_H
00081 #endif

Generated on Thu Oct 19 04:05:48 2006 by  doxygen 1.4.6