Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9118 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 1:21:52 PM (18 years ago)
Author:
hdavid
Message:

branches/presentation: cloud effects

Location:
branches/presentation/src/lib/graphics/effects
Files:
3 edited

Legend:

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

    r9112 r9118  
    187187    // If we're not fading, change color immediately
    188188    if (!this->rainFadeInActivate || !this->rainFadeOutActivate) {
    189         CloudEffect::changeCloudColor(this->cloudColor, 0);
    190         CloudEffect::changeSkyColor(this->skyColor, 0);
     189        CloudEffect::changeCloudColor(this->cloudColor, 0.2);
     190        CloudEffect::changeSkyColor(this->skyColor, 0.2);
    191191    }
    192192}
     
    208208
    209209    // Restore the old cloud- and sky color
    210     CloudEffect::changeCloudColor(this->oldCloudColor, 0);
    211     CloudEffect::changeSkyColor(this->oldSkyColor, 0);
     210    CloudEffect::changeCloudColor(this->oldCloudColor, 0.2);
     211    CloudEffect::changeSkyColor(this->oldSkyColor, 0.2);
    212212}
    213213
  • branches/presentation/src/lib/graphics/effects/snow_effect.cc

    r9112 r9118  
    2828#include "shell_command.h"
    2929#include "script_class.h"
     30#include "cloud_effect.h"
    3031
    3132#include "parser/tinyxml/tinyxml.h"
     
    8788        LoadParam(root, "size", this, SnowEffect, size);
    8889        LoadParam(root, "coord", this, SnowEffect, coord);
     90  LoadParam(root, "cloudcolor", this, SnowEffect, setCloudColor);
     91  LoadParam(root, "skycolor", this, SnowEffect, setSkyColor);
     92  LoadParam(root, "fadetime", this, SnowEffect, setFadeTime);
    8993
    9094        LOAD_PARAM_START_CYCLE(root, element);
     
    119123        this->snowCoord = Vector(100,450,400);
    120124        this->snowWindForce = 1;
     125 
     126  this->fadeTime = 10;
     127  this->cloudColor = Vector(0.2f, 0.2f, 0.2f);
     128  this->skyColor = Vector(0.0f, 0.0f, 0.0f);
    121129}
    122130
     
    149157  if (this->snowWindForce != 0)
    150158    this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
     159 
     160  // Store cloud- and sky color before the snow
     161  this->oldCloudColor = CloudEffect::cloudColor;
     162  this->oldSkyColor   = CloudEffect::skyColor;
     163
     164  // Change the colors
     165  CloudEffect::changeCloudColor(this->cloudColor, this->fadeTime);
     166  CloudEffect::changeSkyColor(this->skyColor, this->fadeTime);
    151167
    152168}
     
    162178        if (this->windBuffer != NULL)
    163179                ResourceManager::getInstance()->unload(this->windBuffer);
     180 
     181  // Restore the old cloud- and sky color
     182  CloudEffect::changeCloudColor(this->oldCloudColor, this->fadeTime);
     183  CloudEffect::changeSkyColor(this->oldSkyColor, this->fadeTime);
    164184}
    165185
  • branches/presentation/src/lib/graphics/effects/snow_effect.h

    r8495 r9118  
    1616class PlaneEmitter;
    1717class PNode;
     18class CloudEffect;
    1819
    1920#include "sound_source.h"
     
    7778        this->snowWindForce = force;
    7879    }
     80    inline void setCloudColor(float colorX, float colorY, float colorZ)
     81    {
     82      this->cloudColor = Vector(colorX, colorY, colorZ);
     83    }
     84    inline void setSkyColor(float colorX, float colorY, float colorZ)
     85    {
     86      this->skyColor = Vector(colorX, colorY, colorZ);
     87    }
     88    inline void setFadeTime(float time)
     89    {
     90      this->fadeTime = time;
     91    }
    7992
    8093    inline void setSnowOption(const std::string& option) {
     
    97110    float         angle, randomAngle;
    98111    float         alpha;
     112    float         fadeTime;
    99113    Vector        snowCoord;
    100114    Vector2D      snowSize;
     
    110124    OrxSound::SoundBuffer*    windBuffer;
    111125
     126    Vector oldSkyColor;
     127    Vector oldCloudColor;
     128    Vector skyColor;
     129    Vector cloudColor;
    112130};
    113131
Note: See TracChangeset for help on using the changeset viewer.