Changeset 9686 in orxonox.OLD for branches/new_class_id/src/lib/graphics/effects/snow_effect.h
- Timestamp:
- Aug 22, 2006, 2:36:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/effects/snow_effect.h
r9406 r9686 21 21 #include "sound_buffer.h" 22 22 23 class SnowEffect : public WeatherEffect { 23 class SnowEffect : public WeatherEffect 24 { 25 NewObjectListDeclaration(SnowEffect); 24 26 public: 25 26 27 SnowEffect(const TiXmlElement* root = NULL); 28 virtual ~SnowEffect(); 27 29 28 30 virtual void loadParams(const TiXmlElement* root); 29 31 30 32 virtual void init(); 31 33 32 33 34 virtual void activate(); 35 virtual void deactivate(); 34 36 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 } 41 45 42 43 46 virtual void draw() const; 47 virtual void tick(float dt); 44 48 45 49 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 } 92 106 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 } 100 115 101 116 102 117 private: 103 104 105 106 107 108 109 110 111 112 113 114 115 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; 116 131 117 118 132 bool snowMove; 133 bool snowActivate; 119 134 120 135 PlaneEmitter* emitter; 121 136 122 123 124 137 static SpriteParticles* snowParticles; 138 OrxSound::SoundSource soundSource; 139 OrxSound::SoundBuffer* windBuffer; 125 140 126 127 128 129 141 Vector oldSkyColor; 142 Vector oldCloudColor; 143 Vector skyColor; 144 Vector cloudColor; 130 145 }; 131 146
Note: See TracChangeset
for help on using the changeset viewer.