Changeset 7696 in orxonox.OLD for branches/atmospheric_engine/src
- Timestamp:
- May 18, 2006, 4:25:18 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r7691 r7696 62 62 { 63 63 //default values 64 this->fogMode = GL_ LINEAR;65 this->fogDensity = 0. 1;64 this->fogMode = GL_EXP2; 65 this->fogDensity = 0.001; 66 66 this->fogStart = 0; 67 67 this->fogEnd = 5000; -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r7691 r7696 24 24 #include "spark_particles.h" 25 25 #include "plane_emitter.h" 26 #include "shell_command.h" 26 27 27 28 #include "parser/tinyxml/tinyxml.h" 28 29 29 //SHELL_COMMAND(activate, RainEffect, activateRain);30 //SHELL_COMMAND(deactivate, RainEffect, deactivateRain);30 SHELL_COMMAND(activate, RainEffect, activateRain); 31 SHELL_COMMAND(deactivate, RainEffect, deactivateRain); 31 32 32 33 using namespace std; … … 43 44 this->loadParams(root); 44 45 45 //load sound46 //load rain sound 46 47 if (this->rainBuffer != NULL) 47 48 ResourceManager::getInstance()->unload(this->rainBuffer); 48 49 this->rainBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV); 50 51 //load wind sound 52 if (this->rainWindForce > 0) { 53 if (this->windBuffer != NULL) 54 ResourceManager::getInstance()->unload(this->windBuffer); 55 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV); 56 } 49 57 50 58 this->activate(); … … 54 62 { 55 63 this->deactivate(); 64 65 if (this->rainBuffer != NULL) 66 ResourceManager::getInstance()->unload(this->rainBuffer); 67 68 if (this->windBuffer != NULL) 69 ResourceManager::getInstance()->unload(this->windBuffer); 56 70 } 57 71 … … 114 128 115 129 this->emitter->setSpread(this->rainWindForce / 50, 0.2); 116 130 117 131 this->soundSource.loop(this->rainBuffer); 118 PRINTF(0)( "Playing RainSound\n" ); 132 if (this->rainWindForce > 0) 133 this->soundSource.loop(this->windBuffer); 119 134 } 120 135 … … 123 138 { 124 139 PRINTF(0)("Deactivating RainEffect\n"); 140 this->emitter->setSystem(NULL); 125 141 126 this-> emitter->setSystem(NULL);142 this->soundSource.stop(); 127 143 } 144 145 void RainEffect::activateRain() 146 { 147 this->activate(); 148 } 149 150 void RainEffect::deactivateRain() 151 { 152 this->deactivate(); 153 } 154 128 155 129 156 void RainEffect::tick (float dt) -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r7685 r7696 34 34 virtual bool deactivate(); 35 35 36 void activateRain(); 37 void deactivateRain(); 38 36 39 virtual void tick(float dt); 37 40 … … 60 63 SoundSource soundSource; 61 64 SoundBuffer* rainBuffer; 65 SoundBuffer* windBuffer; 62 66 }; 63 67 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r7683 r7696 17 17 #include "util/loading/load_param.h" 18 18 #include "util/loading/factory.h" 19 #include "util/loading/resource_manager.h" 19 20 20 21 #include "glincl.h" … … 44 45 if (root != NULL) 45 46 this->loadParams(root); 47 48 //load wind sound 49 if (this->snowWindForce > 1) { 50 if (this->windBuffer != NULL) 51 ResourceManager::getInstance()->unload(this->windBuffer); 52 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV); 53 } 46 54 47 55 this->activate(); … … 77 85 78 86 // Default values 79 particles = 12000; 80 texture = "maps/snow_flake_01_32x32.png"; 81 life = 8; 82 randomLife = 2; 83 snowRadius = 3.5; 84 randomRadius = 1; 85 snowMass = 1.0; 86 randomMass = 0.3; 87 rate = 900; 88 velocity = -100; 89 randomVelocity = 5; 90 angle = 0.5; 91 randomAngle = 0.2; 92 alpha = 0.5; 93 snowSize = Vector2D(2500, 2500); 94 snowCoord = Vector(100,450,400); 95 96 activated = false; 87 this->particles = 12000; 88 this->texture = "maps/snow_flake_01_32x32.png"; 89 this->life = 8; 90 this->randomLife = 2; 91 this->snowRadius = 3.5; 92 this->randomRadius = 1; 93 this->snowMass = 1.0; 94 this->randomMass = 0.3; 95 this->rate = 900; 96 this->velocity = -100; 97 this->randomVelocity = 5; 98 this->angle = 0.5; 99 this->randomAngle = 0.2; 100 this->alpha = 0.5; 101 this->snowSize = Vector2D(2500, 2500); 102 this->snowCoord = Vector(100,450,400); 103 this->snowWindForce = 1; 104 105 this->activated = false; 97 106 } 98 107 … … 119 128 this->emitter->setEmissionRate(rate); 120 129 this->emitter->setEmissionVelocity(velocity, randomVelocity); 121 this->emitter->setSpread(angle , randomAngle);130 this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce); 122 131 this->emitter->setSize(snowSize); 123 132 124 133 //SnowEffect::snowParticles->precache(8); 134 135 if (this->snowWindForce > 1) 136 this->soundSource.loop(this->windBuffer); 125 137 } 126 138 … … 132 144 133 145 this->emitter->setSystem(NULL); 146 147 if (this->windBuffer != NULL) 148 ResourceManager::getInstance()->unload(this->windBuffer); 149 134 150 } 135 151 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
r7683 r7696 16 16 class PlaneEmitter; 17 17 class PNode; 18 19 #include "sound_buffer.h" 20 #include "sound_source.h" 18 21 19 22 class SnowEffect : public WeatherEffect … … 36 39 void deactivateSnow(); 37 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 52 38 53 private: 39 void numParticles(int n) { this->particles = n; } 40 void materialTexture(const std::string& texture) { this->texture = texture; } 41 void lifeSpan(float lifeSpan, float randomLifeSpan) { this->life = lifeSpan; this->randomLife = randomLifeSpan; } 42 void radius(float radius, float randomRadius) { this->snowRadius = radius; this->randomRadius = randomRadius; } 43 void mass(float mass, float randomMass) { this->snowMass = mass; this->randomMass = randomMass; } 44 void emissionRate(float emissionRate){ this->rate = emissionRate; } 45 void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; } 46 void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); } 47 void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); } 48 void wind(int force) { this->angle = angle*force; this->randomAngle = randomAngle*force; } 54 int particles; 55 std::string texture; 56 float life, randomLife; 57 float snowRadius, randomRadius; 58 float snowMass, randomMass; 59 float rate; 60 float velocity, randomVelocity; 61 float angle, randomAngle; 62 float alpha; 63 Vector snowCoord; 64 Vector2D snowSize; 65 int snowWindForce; 49 66 50 int particles; 51 std::string texture; 52 float life, randomLife; 53 float snowRadius, randomRadius; 54 float snowMass, randomMass; 55 float rate; 56 float velocity, randomVelocity; 57 float angle, randomAngle; 58 float alpha; 59 Vector snowCoord; 60 Vector2D snowSize; 67 bool activated; 61 68 62 bool activated;69 PlaneEmitter* emitter; 63 70 64 static SpriteParticles* snowParticles;71 static SpriteParticles* snowParticles; 65 72 66 PlaneEmitter* emitter; 73 SoundSource soundSource; 74 SoundBuffer* windBuffer; 67 75 }; 68 76 -
branches/atmospheric_engine/src/world_entities/space_ships/helicopter.cc
r7647 r7696 51 51 { 52 52 this->setPlayer(NULL); 53 54 if (this->chopperBuffer != NULL) 55 ResourceManager::getInstance()->unload(this->chopperBuffer); 53 56 } 54 57 … … 215 218 216 219 this->soundSource.loop(this->chopperBuffer); 217 PRINTF(0)( "Playing ChopperSound\n" );220 // PRINTF(0)( "Playing ChopperSound\n" ); 218 221 } 219 222 … … 222 225 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 223 226 this->detachCamera(); 224 227 this->soundSource.stop(); 225 228 } 226 229
Note: See TracChangeset
for help on using the changeset viewer.