Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7685 in orxonox.OLD for branches


Ignore:
Timestamp:
May 18, 2006, 3:07:45 PM (19 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

    r7682 r7685  
    6767        LoadParam(root, "life", this, RainEffect, setRainLife);
    6868        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 
     69        LoadParam(root, "option", this, RainEffect, setRainOption);
    7770}
    7871
     
    8780        this->rainLife = 4;
    8881        this->rainMaxParticles = this->rainRate * this->rainLife;
     82        this->rainWindForce  = 0;
    8983
    9084        this->emitter = new PlaneEmitter(this->rainSize);
     
    119113        this->emitter->setEmissionVelocity(this->rainVelocity);
    120114
    121         this->emitter->setSpread(this->rainWindForce / 5, .2);
     115        this->emitter->setSpread(this->rainWindForce / 50, 0.2);
    122116
    123117        this->soundSource.loop(this->rainBuffer);
     
    136130{
    137131        //float distance = (State::getCameraNode()->getAbsCoor() - rainCoord).len();
    138        
    139132        // PRINTF(0)( "RainEffect, coords: %f, %f, %f\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z );
    140133
    141         //if (this->rainMove) {
    142                 //PRINTF(0)( "Moving Rain" );
    143         //      this->rainCoord = State::getCameraNode()->getAbsCoor();
    144         //      this->emitter->setRelCoor(this->rainCoord.x +150, this->rainCoord.y+700, this->rainCoord.z+150);
    145         //}
     134        if (this->rainMove) {
     135                PRINTF(0)( "Moving Rain" );
     136                this->rainCoord = State::getCameraNode()->getAbsCoor();
     137                this->emitter->setRelCoor(this->rainCoord.x +150, this->rainCoord.y+700, this->rainCoord.z+150);
     138        }
    146139}
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h

    r7682 r7685  
    88#include "vector.h"
    99#include "vector2D.h"
     10#include <string>
    1011
    1112#include "particle_system.h"
     
    4142                inline void setRainLife(float life) { this->rainLife = life; }
    4243                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                 }
     44                inline void setRainOption(const std::string& option) { if (option == "moverain") this->rainMove = true; }
    4845
    4946
Note: See TracChangeset for help on using the changeset viewer.