Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8521 in orxonox.OLD


Ignore:
Timestamp:
Jun 16, 2006, 10:34:43 AM (18 years ago)
Author:
amaechler
Message:


Location:
branches/atmospheric_engine/src/lib/graphics/effects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc

    r8495 r8521  
    8787
    8888void FogEffect::activate() {
    89     PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
     89    PRINTF(0)( "Activating FogEffect\n");
    9090
    91     this->fogActivate = true;
    92 
     91    // init fogGL
    9392    GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
    9493    glFogi(GL_FOG_MODE, this->fogMode);
     
    9897    glFogf(GL_FOG_START, this->fogStart);
    9998    glFogf(GL_FOG_END, this->fogEnd);
     99
     100    this->fogActivate = true;
    100101
    101102    glEnable(GL_FOG);
     
    127128
    128129void FogEffect::tick(float dt) {
     130
    129131    if (!this->fogActivate)
    130132        return;
     
    193195}
    194196
    195 
    196 GLint FogEffect::stringToFogMode(const std::string& mode) {
    197     if(mode == "GL_LINEAR")
    198         return GL_LINEAR;
    199     else if(mode == "GL_EXP")
    200         return GL_EXP;
    201     else if(mode == "GL_EXP2" )
    202         return GL_EXP2;
    203     else
    204         return -1;
    205 }
    206 
    207 
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h

    r8495 r8521  
    6363
    6464private:
    65     GLint stringToFogMode(const std::string& mode);
     65    inline GLint stringToFogMode(const std::string& mode) {
     66        if(mode == "GL_LINEAR")
     67            return GL_LINEAR;
     68        else if(mode == "GL_EXP")
     69            return GL_EXP;
     70        else if(mode == "GL_EXP2" )
     71            return GL_EXP2;
     72        else
     73            return -1;
     74    }
    6675
    6776    bool          fogActivate;
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc

    r8495 r8521  
    3939
    4040/* TODO:
    41   - test multiple rain emitters
     41  - test multiple rain emitters <-- doesn't work
    4242  - Think about what happens with building poss. to hang movewithcam off
    4343  - Possible to activate lightening
     
    207207        // increase sound volume
    208208        // this->soundSource.fadein(this->rainBuffer, 10);
     209
    209210    } else if ( this->rainFadeOutDuration != 0 ) {
    210211        if ( this->localTimer < this->rainFadeOutDuration ) {
     
    227228            // decrease sound volume
    228229            // this->soundSource.fadeout(this->rainBuffer, 10);
     230
    229231        } else
    230232            this->deactivate();
     
    258260
    259261}
     262
     263void RainEffect::hideRain() {
     264
     265  RainEffect::rainParticles->setColor(0, 0,0,0, 0);
     266  RainEffect::rainParticles->setColor(0, 0,0,0, 0);
     267
     268}
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h

    r8495 r8521  
    3737        this->activate();
    3838    }
     39
    3940    inline void deactivateRain() {
    4041        this->deactivate();
     
    4546    void startRaining();
    4647    void stopRaining();
     48
     49    void hideRain();
    4750
    4851    inline void setRainCoord(float x, float y, float z) {
     
    8487    ParticleEmitter*            emitter;
    8588
    86     GLfloat         rainFadeInDuration;
    87     GLfloat         rainFadeOutDuration;
    88     float           localTimer;
     89    GLfloat                     rainFadeInDuration;
     90    GLfloat                     rainFadeOutDuration;
     91    float                       localTimer;
    8992
    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;
     93    Vector                      rainCoord;
     94    Vector2D                    rainSize;
     95    GLfloat                     rainRate;
     96    GLfloat                     rainVelocity;
     97    GLfloat                     rainLife;
     98    GLfloat                     rainMaxParticles;
     99    int                         rainWindForce;
     100    bool                        rainMove;
     101    bool                        rainActivate;
    99102
    100     OrxSound::SoundSource     soundSource;
     103    OrxSound::SoundSource       soundSource;
    101104    OrxSound::SoundBuffer*      rainBuffer;
    102105    OrxSound::SoundBuffer*      windBuffer;
    103106
    104     float         soundRainVolume;
     107    float                       soundRainVolume;
    105108
    106     LightManager*       lightMan;
    107     GLfloat         rainAmbient;
     109    LightManager*               lightMan;
     110    GLfloat                     rainAmbient;
    108111
    109112};
  • branches/atmospheric_engine/src/lib/graphics/effects/sun_effect.cc

    r7836 r8521  
    5656 *  initializes the graphics effect
    5757 */
    58 bool SunEffect::init()
     58void SunEffect::init()
    5959{}
    6060
  • branches/atmospheric_engine/src/lib/graphics/effects/sun_effect.h

    r7810 r8521  
    11/*!
    22 * @file sun_effect.h
    3  * 
     3 *
    44 */
    55
     
    2020    virtual void loadParams(const TiXmlElement* root);
    2121
    22     virtual bool init();
     22    virtual void init();
    2323
    24     virtual bool activate() = 0;
    25     virtual bool deactivate() = 0;
     24    virtual void activate() = 0;
     25    virtual void deactivate() = 0;
    2626
    2727    virtual void draw() const;
Note: See TracChangeset for help on using the changeset viewer.