Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h @ 8179

Last change on this file since 8179 was 8023, checked in by hdavid, 18 years ago

branches/atmospheric_engine: activating/deactivating fogEffect in the oxw-file works,default: deactivate

File size: 2.8 KB
Line 
1/**
2* @file snow_effect.h
3*/
4
5#ifndef _SNOW_EFFECT
6#define _SNOW_EFFECT
7
8#include "vector.h"
9#include "particle_system.h"
10#include "material.h"
11#include "vector2D.h"
12
13#include "weather_effect.h"
14
15class SpriteParticles;
16class PlaneEmitter;
17class PNode;
18
19#include "sound_source.h"
20#include "sound_buffer.h"
21
22class SnowEffect : public WeatherEffect
23{
24        public:
25                SnowEffect(const TiXmlElement* root = NULL);
26                virtual ~SnowEffect();
27
28                virtual void loadParams(const TiXmlElement* root);
29
30                virtual bool init();
31
32                virtual bool activate();
33                virtual bool deactivate();
34
35                virtual void draw() const;
36                virtual void tick(float dt);
37
38    void activateSnow() { this->activate(); }
39    void deactivateSnow() { this->deactivate(); }
40
41                inline void numParticles(int n) { this->particles = n; }
42                inline void materialTexture(const std::string& texture) { this->texture = texture; }
43                inline void lifeSpan(float lifeSpan, float randomLifeSpan) { this->life = lifeSpan; this->randomLife = randomLifeSpan; }
44                inline void radius(float radius, float randomRadius) { this->snowRadius = radius; this->randomRadius = randomRadius; }
45                inline void mass(float mass, float randomMass) { this->snowMass = mass; this->randomMass = randomMass; }
46                inline void emissionRate(float emissionRate){ this->rate = emissionRate; }
47                inline void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; }
48                inline void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); }
49                inline void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); }
50    inline void wind(int force) { this->snowWindForce = force; }
51    inline void setSnowOption(const std::string& option) { /*if (option == "fade") this->snowFade = true;*/
52                                                                                  if (option == "movesnow") this->snowMove = true;
53                                                                                  if (option == "activate") this->snowActivate = true; }
54
55
56        private:
57                int                                                                                                                             particles;
58                std::string                                                                                             texture;
59                float                                                                                                                   life, randomLife;
60                float                                                                                                                           snowRadius, randomRadius;
61                float                                                                                                                           snowMass, randomMass;
62                float                                                                                                                   rate;
63                float                                                                                                                   velocity, randomVelocity;
64                float                                                                                                                   angle, randomAngle;
65                float                                                                                                                   alpha;
66                Vector                                                                                                                  snowCoord;
67                Vector2D                                                                                                                snowSize;
68                int                                                                                                                                     snowWindForce;
69
70                //bool                                                                                                                          activated;
71    bool                              snowMove;
72    bool                              snowActivate;
73   
74                PlaneEmitter*                                                                                           emitter;
75
76                static SpriteParticles*                                                 snowParticles;
77                OrxSound::SoundSource              soundSource;
78                OrxSound::SoundBuffer*             windBuffer;
79
80};
81
82
83#endif  /* _SNOW_EFFECT */
Note: See TracBrowser for help on using the repository browser.