Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 2:36:54 PM (18 years ago)
Author:
bensch
Message:

new_class_id: many more classes done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/effects/snow_effect.h

    r9406 r9686  
    2121#include "sound_buffer.h"
    2222
    23 class SnowEffect : public WeatherEffect {
     23class SnowEffect : public WeatherEffect
     24{
     25  NewObjectListDeclaration(SnowEffect);
    2426public:
    25     SnowEffect(const TiXmlElement* root = NULL);
    26     virtual ~SnowEffect();
     27  SnowEffect(const TiXmlElement* root = NULL);
     28  virtual ~SnowEffect();
    2729
    28     virtual void loadParams(const TiXmlElement* root);
     30  virtual void loadParams(const TiXmlElement* root);
    2931
    30     virtual void init();
     32  virtual void init();
    3133
    32     virtual void activate();
    33     virtual void deactivate();
     34  virtual void activate();
     35  virtual void deactivate();
    3436
    35     inline void activateSnow() {
    36         this->activate();
    37     }
    38     inline void deactivateSnow() {
    39         this->deactivate();
    40     }
     37  inline void activateSnow()
     38  {
     39    this->activate();
     40  }
     41  inline void deactivateSnow()
     42  {
     43    this->deactivate();
     44  }
    4145
    42     virtual void draw() const;
    43     virtual void tick(float dt);
     46  virtual void draw() const;
     47  virtual void tick(float dt);
    4448
    4549
    46     inline void numParticles(int n) {
    47         this->particles = n;
    48     }
    49     inline void materialTexture(const std::string& texture) {
    50         this->texture = texture;
    51     }
    52     inline void lifeSpan(float lifeSpan, float randomLifeSpan) {
    53         this->snowLife = lifeSpan;
    54         this->randomLife = randomLifeSpan;
    55     }
    56     inline void radius(float radius, float randomRadius) {
    57         this->snowRadius = radius;
    58         this->randomRadius = randomRadius;
    59     }
    60     inline void mass(float mass, float randomMass) {
    61         this->snowMass = mass;
    62         this->randomMass = randomMass;
    63     }
    64     inline void emissionRate(float emissionRate) {
    65         this->rate = emissionRate;
    66     }
    67     inline void emissionVelocity(float velocity, float randomVelocity) {
    68         this->velocity = velocity;
    69         this->randomVelocity = randomVelocity;
    70     }
    71     inline void size(float sizeX, float sizeY) {
    72         this->snowSize = Vector2D(sizeX, sizeY);
    73     }
    74     inline void coord(float x, float y, float z) {
    75         this->snowCoord = Vector(x, y, z);
    76     }
    77     inline void wind(int force) {
    78         this->snowWindForce = force;
    79     }
    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     }
     50  inline void numParticles(int n)
     51  {
     52    this->particles = n;
     53  }
     54  inline void materialTexture(const std::string& texture)
     55  {
     56    this->texture = texture;
     57  }
     58  inline void lifeSpan(float lifeSpan, float randomLifeSpan)
     59  {
     60    this->snowLife = lifeSpan;
     61    this->randomLife = randomLifeSpan;
     62  }
     63  inline void radius(float radius, float randomRadius)
     64  {
     65    this->snowRadius = radius;
     66    this->randomRadius = randomRadius;
     67  }
     68  inline void mass(float mass, float randomMass)
     69  {
     70    this->snowMass = mass;
     71    this->randomMass = randomMass;
     72  }
     73  inline void emissionRate(float emissionRate)
     74  {
     75    this->rate = emissionRate;
     76  }
     77  inline void emissionVelocity(float velocity, float randomVelocity)
     78  {
     79    this->velocity = velocity;
     80    this->randomVelocity = randomVelocity;
     81  }
     82  inline void size(float sizeX, float sizeY)
     83  {
     84    this->snowSize = Vector2D(sizeX, sizeY);
     85  }
     86  inline void coord(float x, float y, float z)
     87  {
     88    this->snowCoord = Vector(x, y, z);
     89  }
     90  inline void wind(int force)
     91  {
     92    this->snowWindForce = force;
     93  }
     94  inline void setCloudColor(float colorX, float colorY, float colorZ)
     95  {
     96    this->cloudColor = Vector(colorX, colorY, colorZ);
     97  }
     98  inline void setSkyColor(float colorX, float colorY, float colorZ)
     99  {
     100    this->skyColor = Vector(colorX, colorY, colorZ);
     101  }
     102  inline void setFadeTime(float time)
     103  {
     104    this->fadeTime = time;
     105  }
    92106
    93     inline void setSnowOption(const std::string& option) {
    94         /*if (option == "fade") this->snowFade = true;*/
    95         if (option == "movesnow")
    96             this->snowMove = true;
    97         if (option == "activate")
    98             this->snowActivate = true;
    99     }
     107  inline void setSnowOption(const std::string& option)
     108  {
     109    /*if (option == "fade") this->snowFade = true;*/
     110    if (option == "movesnow")
     111      this->snowMove = true;
     112    if (option == "activate")
     113      this->snowActivate = true;
     114  }
    100115
    101116
    102117private:
    103     int               particles;
    104     std::string       texture;
    105     float             snowLife, randomLife;
    106     float             snowRadius, randomRadius;
    107     float             snowMass, randomMass;
    108     float             rate;
    109     float             velocity, randomVelocity;
    110     float             angle, randomAngle;
    111     float             alpha;
    112     float             fadeTime;
    113     Vector            snowCoord;
    114     Vector2D          snowSize;
    115     int               snowWindForce;
     118  int               particles;
     119  std::string       texture;
     120  float             snowLife, randomLife;
     121  float             snowRadius, randomRadius;
     122  float             snowMass, randomMass;
     123  float             rate;
     124  float             velocity, randomVelocity;
     125  float             angle, randomAngle;
     126  float             alpha;
     127  float             fadeTime;
     128  Vector            snowCoord;
     129  Vector2D          snowSize;
     130  int               snowWindForce;
    116131
    117     bool              snowMove;
    118     bool              snowActivate;
     132  bool              snowMove;
     133  bool              snowActivate;
    119134
    120     PlaneEmitter*     emitter;
     135  PlaneEmitter*     emitter;
    121136
    122     static SpriteParticles*   snowParticles;
    123     OrxSound::SoundSource     soundSource;
    124     OrxSound::SoundBuffer*    windBuffer;
     137  static SpriteParticles*   snowParticles;
     138  OrxSound::SoundSource     soundSource;
     139  OrxSound::SoundBuffer*    windBuffer;
    125140
    126     Vector            oldSkyColor;
    127     Vector            oldCloudColor;
    128     Vector            skyColor;
    129     Vector            cloudColor;
     141  Vector            oldSkyColor;
     142  Vector            oldCloudColor;
     143  Vector            skyColor;
     144  Vector            cloudColor;
    130145};
    131146
Note: See TracChangeset for help on using the changeset viewer.