Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7682 in orxonox.OLD for branches/atmospheric_engine/src/lib


Ignore:
Timestamp:
May 18, 2006, 2:38:19 PM (18 years ago)
Author:
amaechler
Message:

branches/atmosphere_engine: wind, rain changes

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

Legend:

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

    r7652 r7682  
    6060        WeatherEffect::loadParams(root);
    6161
    62         LoadParam(root, "moverain", this, RainEffect, setMoveRain);
     62        // LoadParam(root, "moverain", this, RainEffect, setMoveRain);
    6363        LoadParam(root, "coord", this, RainEffect, setRainCoord);
    6464        LoadParam(root, "size", this, RainEffect, setRainSize);
     
    6666        LoadParam(root, "velocity", this, RainEffect, setRainVelocity);
    6767        LoadParam(root, "life", this, RainEffect, setRainLife);
     68        LoadParam(root, "wind", this, RainEffect, setRainWind);
     69
     70//      LOAD_PARAM_START_CYCLE(root, element);
     71//      {
     72//              element->ToText();
     73//              LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
     74//      }
     75//      LOAD_PARAM_END_CYCLE(element);
     76
    6877}
    6978
     
    7483        this->rainCoord = Vector(500, 500, 500);
    7584        this->rainSize = Vector2D(1000, 1000);
    76         this->rainRate = 5000;
     85        this->rainRate = 3000;
    7786        this->rainVelocity = -300;
    78         this->rainLife = 2;
     87        this->rainLife = 4;
     88        this->rainMaxParticles = this->rainRate * this->rainLife;
    7989
    8090        this->emitter = new PlaneEmitter(this->rainSize);
     
    90100        if (unlikely(RainEffect::rainParticles == NULL))
    91101        {
    92                 RainEffect::rainParticles = new SparkParticles(50000);
     102                RainEffect::rainParticles = new SparkParticles((int) this->rainMaxParticles);
    93103                RainEffect::rainParticles->setName("RainParticles");
     104                RainEffect::rainParticles->precache((int)this->rainLife);
    94105                RainEffect::rainParticles->setLifeSpan(this->rainLife, 2);
    95                 RainEffect::rainParticles->setRadius(0.02, 0.02);
    96                 RainEffect::rainParticles->setRadius(0.01, 0.01);
    97                 RainEffect::rainParticles->setRadius(0.03, 0.03);
    98                 RainEffect::rainParticles->setRadius(0.04, 0.04);
    99                 RainEffect::rainParticles->setColor(0.7, 0.3, 0.3, 0.5, 0.2); // grey blue 1
    100                 RainEffect::rainParticles->setColor(1, 0.4, 0.4, 0.5, 0.1); // grey blue 2
    101                 RainEffect::rainParticles->setColor(0.5, 0.7, 0.7, 0.7, 0); // light grey
     106                RainEffect::rainParticles->setRadius(0, 0.03);
     107                RainEffect::rainParticles->setRadius(0.2, 0.02);
     108                RainEffect::rainParticles->setRadius(1, 0.01);
     109                RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2); // grey blue 1
     110                RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2); // grey blue 2
     111                RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2); // light grey
    102112        }
    103113
     
    109119        this->emitter->setEmissionVelocity(this->rainVelocity);
    110120
    111         this->emitter->setSpread(0, .2);
     121        this->emitter->setSpread(this->rainWindForce / 5, .2);
    112122
    113123        this->soundSource.loop(this->rainBuffer);
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h

    r7652 r7682  
    4040                inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; }
    4141                inline void setRainLife(float life) { this->rainLife = life; }
    42                 inline void setMoveRain() { PRINTF(0)( "setting move true\n"); this->rainMove = true; }
     42                inline void setRainWind(int force) { this->rainWindForce = force; }
     43
     44                inline void setRainOption(string option) {
     45                        PRINTF(0)( "setting move true\n");
     46                        this->rainMove = true;
     47                }
    4348
    4449
     
    5257                GLfloat                                                                                                         rainVelocity;
    5358                GLfloat                                                                                                         rainLife;
     59                GLfloat                                                                                                         rainMaxParticles;
     60                int                                                                                                                             rainWindForce;
    5461                bool                                                                                                                    rainMove;
    5562
Note: See TracChangeset for help on using the changeset viewer.