Changeset 8457 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
- Timestamp:
- Jun 15, 2006, 1:43:24 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
r8455 r8457 20 20 #include "sound_buffer.h" 21 21 22 class SnowEffect : public WeatherEffect 23 { 24 public: 25 SnowEffect(const TiXmlElement* root = NULL); 26 virtual ~SnowEffect(); 22 class SnowEffect : public WeatherEffect { 23 public: 24 SnowEffect(const TiXmlElement* root = NULL); 25 virtual ~SnowEffect(); 27 26 28 27 virtual void loadParams(const TiXmlElement* root); 29 28 30 29 virtual void init(); 31 30 32 33 31 virtual void activate(); 32 virtual void deactivate(); 34 33 35 inline void activateSnow() { this->activate(); } 36 inline void deactivateSnow() { this->deactivate(); } 37 38 virtual void draw() const; 39 virtual void tick(float dt); 34 inline void activateSnow() { 35 this->activate(); 36 } 37 inline void deactivateSnow() { 38 this->deactivate(); 39 } 40 41 virtual void draw() const; 42 virtual void tick(float dt); 40 43 41 44 42 inline void numParticles(int n) { this->particles = n; } 43 inline void materialTexture(const std::string& texture) { this->texture = texture; } 44 inline void lifeSpan(float lifeSpan, float randomLifeSpan) { this->life = lifeSpan; this->randomLife = randomLifeSpan; } 45 inline void radius(float radius, float randomRadius) { this->snowRadius = radius; this->randomRadius = randomRadius; } 46 inline void mass(float mass, float randomMass) { this->snowMass = mass; this->randomMass = randomMass; } 47 inline void emissionRate(float emissionRate){ this->rate = emissionRate; } 48 inline void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; } 49 inline void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); } 50 inline void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); } 51 inline void wind(int force) { this->snowWindForce = force; } 45 inline void numParticles(int n) { 46 this->particles = n; 47 } 48 inline void materialTexture(const std::string& texture) { 49 this->texture = texture; 50 } 51 inline void lifeSpan(float lifeSpan, float randomLifeSpan) { 52 this->snowLife = lifeSpan; 53 this->randomLife = randomLifeSpan; 54 } 55 inline void radius(float radius, float randomRadius) { 56 this->snowRadius = radius; 57 this->randomRadius = randomRadius; 58 } 59 inline void mass(float mass, float randomMass) { 60 this->snowMass = mass; 61 this->randomMass = randomMass; 62 } 63 inline void emissionRate(float emissionRate) { 64 this->rate = emissionRate; 65 } 66 inline void emissionVelocity(float velocity, float randomVelocity) { 67 this->velocity = velocity; 68 this->randomVelocity = randomVelocity; 69 } 70 inline void size(float sizeX, float sizeY) { 71 this->snowSize = Vector2D(sizeX, sizeY); 72 } 73 inline void coord(float x, float y, float z) { 74 this->snowCoord = Vector(x, y, z); 75 } 76 inline void wind(int force) { 77 this->snowWindForce = force; 78 } 52 79 53 inline void setSnowOption(const std::string& option) { 54 /*if (option == "fade") this->snowFade = true;*/ 55 if (option == "movesnow") this->snowMove = true; 56 if (option == "activate") this->snowActivate = true; 57 } 80 inline void setSnowOption(const std::string& option) { 81 /*if (option == "fade") this->snowFade = true;*/ 82 if (option == "movesnow") 83 this->snowMove = true; 84 if (option == "activate") 85 this->snowActivate = true; 86 } 58 87 59 88 60 61 intparticles;62 std::stringtexture;63 float life, randomLife;64 floatsnowRadius, randomRadius;65 floatsnowMass, randomMass;66 floatrate;67 floatvelocity, randomVelocity;68 floatangle, randomAngle;69 floatalpha;70 VectorsnowCoord;71 Vector2DsnowSize;72 intsnowWindForce;89 private: 90 int particles; 91 std::string texture; 92 float snowLife, randomLife; 93 float snowRadius, randomRadius; 94 float snowMass, randomMass; 95 float rate; 96 float velocity, randomVelocity; 97 float angle, randomAngle; 98 float alpha; 99 Vector snowCoord; 100 Vector2D snowSize; 101 int snowWindForce; 73 102 74 boolsnowMove;75 boolsnowActivate;103 bool snowMove; 104 bool snowActivate; 76 105 77 PlaneEmitter*emitter;106 PlaneEmitter* emitter; 78 107 79 static SpriteParticles*snowParticles;80 OrxSound::SoundSourcesoundSource;81 OrxSound::SoundBuffer*windBuffer;108 static SpriteParticles* snowParticles; 109 OrxSound::SoundSource soundSource; 110 OrxSound::SoundBuffer* windBuffer; 82 111 83 112 };
Note: See TracChangeset
for help on using the changeset viewer.