Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 2, 2006, 12:16:09 PM (19 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: added function to slowly start rain

File:
1 edited

Legend:

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

    r8074 r8119  
    11/*
    2    orxonox - the future of 3D-vertical-scrollers
     2orxonox - the future of 3D-vertical-scrollers
    33
    4    Copyright (C) 2004 orx
     4Copyright (C) 2004 orx
    55
    6    This program is free software; you can redistribute it and/or modify
    7    it under the terms of the GNU General Public License as published by
    8    the Free Software Foundation; either version 2, or (at your option)
    9    any later version.
     6This program is free software; you can redistribute it and/or modify
     7it under the terms of the GNU General Public License as published by
     8the Free Software Foundation; either version 2, or (at your option)
     9any later version.
    1010
    1111### File Specific:
    12    main-programmer: hdavid, amaechler
     12main-programmer: hdavid, amaechler
    1313*/
    1414
     
    3131SHELL_COMMAND(activate, RainEffect, activateRain);
    3232SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
     33
     34SHELL_COMMAND(startRaining, RainEffect, startRaining);
    3335
    3436using namespace std;
     
    5961        }
    6062
    61   if(rainActivate)
    62          this->activate();
     63        if(rainActivate)
     64                this->activate();
    6365}
    6466
     
    8486        LoadParam(root, "life", this, RainEffect, setRainLife);
    8587        LoadParam(root, "wind", this, RainEffect, setRainWind);
    86  
    87   LOAD_PARAM_START_CYCLE(root, element);
    88   {
    89     LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
    90   }
    91   LOAD_PARAM_END_CYCLE(element);
    92  
     88
     89        LOAD_PARAM_START_CYCLE(root, element);
     90        {
     91                LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption);
     92        }
     93        LOAD_PARAM_END_CYCLE(element);
     94
    9395}
    9496
     
    9799{
    98100        //Default values
    99   this->rainActivate = false;
    100   this->rainMove = false;
     101        this->rainActivate = false;
     102        this->rainMove = false;
    101103        this->rainCoord = Vector(500, 500, 500);
    102104        this->rainSize = Vector2D(1000, 1000);
     
    108110
    109111        this->emitter = new PlaneEmitter(this->rainSize);
    110  
    111   lightMan = LightManager::getInstance();
     112
     113        lightMan = LightManager::getInstance();
    112114}
    113115
     
    145147        if (this->rainWindForce > 0)
    146148                this->soundSource.loop(this->windBuffer, 0.5f);
    147  
    148   lightMan->setAmbientColor(.1,.1,.1);
     149
     150        lightMan->setAmbientColor(.1,.1,.1);
    149151}
    150152
     
    156158
    157159        this->soundSource.stop();
    158  
    159   lightMan->setAmbientColor(1,1,1);
     160
     161        lightMan->setAmbientColor(1,1,1);
    160162}
    161163
     
    167169        }
    168170}
     171
     172/**
     173*  Slowly starts rain
     174*  @param duration duration of the fade in process in seconds
     175*/
     176void RainEffect::startRaining(float duration)
     177{
     178        // use alpha in color to fade in
     179        // increase radius for more "heavy" rain
     180        // increase sound volume
     181}
Note: See TracChangeset for help on using the changeset viewer.