- Timestamp:
- May 18, 2006, 2:56:01 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r7652 r7683 35 35 36 36 this->fogMode = GL_LINEAR; 37 this->fogDensity = 0.001f; 38 this->fogStart = 10.0f; 39 this->fogEnd = 1000.0f; 37 this->fogDensity = 0.1f; 38 this->fogStart = 0.0f; 39 this->fogEnd = 5000.0f; 40 this->colorVector = Vector(0.7, 0.7, 0.7); 40 41 41 42 if (root != NULL) -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r7652 r7683 67 67 LoadParam(root, "emissionRate", this, SnowEffect, emissionRate); 68 68 LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity); 69 LoadParam(root, "spread", this, SnowEffect, spread);69 LoadParam(root, "wind", this, SnowEffect, wind); 70 70 LoadParam(root, "size", this, SnowEffect, size); 71 71 LoadParam(root, "coord", this, SnowEffect, coord); … … 77 77 78 78 // Default values 79 particles = 1 0000;79 particles = 12000; 80 80 texture = "maps/snow_flake_01_32x32.png"; 81 81 life = 8; … … 88 88 velocity = -100; 89 89 randomVelocity = 5; 90 angle = 0 ;91 randomAngle = 0. 3;90 angle = 0.5; 91 randomAngle = 0.2; 92 92 alpha = 0.5; 93 snowSize = Vector2D( 1200, 1200);94 snowCoord = Vector(100, 600, 200);93 snowSize = Vector2D(2500, 2500); 94 snowCoord = Vector(100,450,400); 95 95 96 96 activated = false; … … 107 107 SnowEffect::snowParticles->setLifeSpan(life, randomLife); 108 108 SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius); 109 SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius );110 SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius );109 SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8); 110 SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5); 111 111 SnowEffect::snowParticles->setMass(0, snowMass, randomMass); 112 112 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); … … 116 116 this->emitter->setSystem(SnowEffect::snowParticles); 117 117 118 // this->updateNode(0);119 118 this->emitter->setRelCoor(snowCoord); 120 119 this->emitter->setEmissionRate(rate); … … 122 121 this->emitter->setSpread(angle, randomAngle); 123 122 this->emitter->setSize(snowSize); 123 124 //SnowEffect::snowParticles->precache(8); 124 125 } 125 126 … … 149 150 void SnowEffect::tick(float dt) 150 151 { 151 float distance = (State::getCameraNode()->getAbsCoor() - snowCoord).len(); 152 if( activated && ( distance > 0.6*snowSize.x || distance > 0.6*snowSize.y) ) 153 this->deactivate(); 154 if( !activated && ( distance < 0.6*snowSize.x || distance < 0.6*snowSize.y )) 155 this->activate(); 152 float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len(); 153 154 if(activated) 155 { 156 if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y) 157 this->deactivate(); 158 else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y) 159 this->alpha = 0.15; 160 else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y) 161 this->alpha = 0.25; 162 else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y) 163 this->alpha = 0.4; 164 165 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 166 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); 167 SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0); 168 } 169 else 170 { 171 if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y ) 172 this->activate(); 173 if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y ) 174 this->alpha = 0.25; 175 else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y ) 176 this->alpha = 0.4; 177 else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y ) 178 this->alpha = 0.5; 179 180 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 181 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); 182 SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0); 183 } 156 184 } 157 185 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
r7652 r7683 44 44 void emissionRate(float emissionRate){ this->rate = emissionRate; } 45 45 void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; } 46 void spread(float angle, float randomAngle) { this->angle = angle; this->randomAngle = randomAngle; }47 46 void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); } 48 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; } 49 49 50 50 int particles;
Note: See TracChangeset
for help on using the changeset viewer.