Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 8, 2006, 4:28:24 PM (18 years ago)
Author:
amaechler
Message:

raise the number:)

File:
1 edited

Legend:

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

    r8255 r8267  
    5858        LoadParam(root, "range", this, FogEffect, setFogRange);
    5959        LoadParam(root, "color", this, FogEffect, setFogColor);
     60        LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn);
     61        LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut);
    6062
    6163        LOAD_PARAM_START_CYCLE(root, element);
     
    7072        //default values
    7173        this->fogActivate = false;
    72         this->fogFadeDuration = 0;
     74        this->fogFadeInDuration = 0;
     75        this->fogFadeOutDuration = 0;
    7376        this->localTimer = 0;
    7477       
     
    7982        this->colorVector = Vector(0.7, 0.7, 0.7);
    8083
     84        return 0;
    8185}
    8286
     
    98102        glEnable(GL_FOG);
    99103        // glClearColor(0.5, 0.5, 0.5, 1.0);
     104
     105        return 0;
    100106}
    101107
     
    108114       
    109115        glDisable(GL_FOG);
     116
     117        return 0;
    110118}
    111119
    112120void FogEffect::draw() const {
    113121
    114         if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration)
     122        if (this->fogFadeInDuration > 0 && this->localTimer < this->fogFadeInDuration)
    115123                glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
    116124        //else
     
    124132               
    125133
    126         if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration) {
     134        if (this->fogFadeInDuration > 0 && this->localTimer < this->fogFadeInDuration) {
    127135                this->localTimer += dt;
    128                 float progress = this->localTimer / this->fogFadeDuration;
     136                float progress = this->localTimer / this->fogFadeInDuration;
    129137                this->fogFadeDensity = progress * this->fogDensity;
    130138        }
     
    136144                this->deactivate();
    137145
    138         this->fogFadeDuration = 10;
     146        if (!this->fogFadeInDuration > 0)
     147                this->fogFadeInDuration = 20;
     148
    139149        this->localTimer = 0;
    140150        this->activate();
Note: See TracChangeset for help on using the changeset viewer.