Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8495 in orxonox.OLD for trunk/src/lib/graphics/effects/rain_effect.h


Ignore:
Timestamp:
Jun 15, 2006, 9:50:56 PM (19 years ago)
Author:
bensch
Message:

merged the branche atmos back. no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/effects/rain_effect.h

    r8255 r8495  
    2222
    2323
    24 class RainEffect : public WeatherEffect
    25 {
    26         public:
    27                 RainEffect(const TiXmlElement* root = NULL);
    28                 virtual ~RainEffect();
     24class RainEffect : public WeatherEffect {
     25public:
     26    RainEffect(const TiXmlElement* root = NULL);
     27    virtual ~RainEffect();
    2928
    30                 virtual void loadParams(const TiXmlElement* root);
     29    virtual void loadParams(const TiXmlElement* root);
    3130
    32                 virtual bool init();
     31    virtual void init();
    3332
    34                 virtual bool activate();
    35                 virtual bool deactivate();
     33    virtual void activate();
     34    virtual void deactivate();
    3635
    37                 virtual void tick(float dt);
     36    inline void activateRain() {
     37        this->activate();
     38    }
     39    inline void deactivateRain() {
     40        this->deactivate();
     41    }
    3842
    39                 inline void activateRain() { this->activate(); }
    40                 inline void deactivateRain() { this->deactivate(); }
    41                 void startRaining();
     43    virtual void tick(float dt);
    4244
    43                 inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); }
    44                 inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); }
    45                 inline void setRainRate(float rate) { this->rainRate = rate;}
    46                 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; }
    47                 inline void setRainLife(float life) { this->rainLife = life; }
    48                 inline void setRainWind(int force) { this->rainWindForce = force; }
    49                 inline void setRainStart(float duration) { this->rainStartDuration = duration; }
     45    void startRaining();
     46    void stopRaining();
    5047
    51                 inline void setRainOption(const std::string& option) {
    52                         if (option == "moverain") this->rainMove = true;
    53                         if (option == "activate") this->rainActivate = true;
    54                 }
     48    inline void setRainCoord(float x, float y, float z) {
     49        this->rainCoord = Vector(x, y, z);
     50    }
     51    inline void setRainSize(float x, float y) {
     52        this->rainSize = Vector2D(x, y);
     53    }
     54    inline void setRainRate(float rate) {
     55        this->rainRate = rate;
     56    }
     57    inline void setRainVelocity(float velocity) {
     58        this->rainVelocity = -velocity;
     59    }
     60    inline void setRainLife(float life) {
     61        this->rainLife = life;
     62    }
     63    inline void setRainWind(int force) {
     64        this->rainWindForce = force;
     65    }
     66
     67    inline void setRainFadeIn(float fadein) {
     68        this->rainFadeInDuration = fadein;
     69    }
     70    inline void setRainFadeOut(float fadeout) {
     71        this->rainFadeOutDuration = fadeout;
     72    }
     73
     74    inline void setRainOption(const std::string& option) {
     75        if (option == "moverain")
     76            this->rainMove = true;
     77        if (option == "activate")
     78            this->rainActivate = true;
     79    }
    5580
    5681
    57         private:
    58                 static SparkParticles*                  rainParticles;
    59                 ParticleEmitter*                        emitter;
     82private:
     83    static SparkParticles*      rainParticles;
     84    ParticleEmitter*            emitter;
    6085
    61                 float                                   localTimer;
     86    GLfloat         rainFadeInDuration;
     87    GLfloat         rainFadeOutDuration;
     88    float           localTimer;
    6289
    63                 Vector                                  rainCoord;
    64                 Vector2D                                rainSize;
    65                 GLfloat                                 rainRate;
    66                 GLfloat                                 rainVelocity;
    67                 GLfloat                                 rainLife;
    68                 GLfloat                                 rainMaxParticles;
    69                 int                                     rainWindForce;
    70                 GLfloat                                 rainStartDuration;
    71                 bool                                    rainMove;
    72                 bool                                    rainActivate;
     90    Vector          rainCoord;
     91    Vector2D        rainSize;
     92    GLfloat         rainRate;
     93    GLfloat         rainVelocity;
     94    GLfloat         rainLife;
     95    GLfloat         rainMaxParticles;
     96    int             rainWindForce;
     97    bool            rainMove;
     98    bool            rainActivate;
    7399
    74                 OrxSound::SoundSource                   soundSource;
    75                 OrxSound::SoundBuffer*                  rainBuffer;
    76                 OrxSound::SoundBuffer*                  windBuffer;
     100    OrxSound::SoundSource     soundSource;
     101    OrxSound::SoundBuffer*      rainBuffer;
     102    OrxSound::SoundBuffer*      windBuffer;
    77103
    78                 float                                   soundRainVolume;
     104    float         soundRainVolume;
    79105
    80                 LightManager*                           lightMan;
    81                 GLfloat                                 rainAmbient;
     106    LightManager*       lightMan;
     107    GLfloat         rainAmbient;
    82108
    83109};
Note: See TracChangeset for help on using the changeset viewer.