Changeset 7577 in orxonox.OLD for branches/atmospheric_engine/src/lib
- Timestamp:
- May 10, 2006, 5:20:24 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/rain_effect.cc
r7572 r7577 28 28 #include "parser/tinyxml/tinyxml.h" 29 29 #include <algorithm> 30 #include "box_emitter.h" 31 #include "spark_particles.h" 32 30 33 31 34 using namespace std; … … 37 40 this->setClassID(CL_RAIN_EFFECT, "RainEffect"); 38 41 39 // this->rainMode = GL_LINEAR; 40 // this->rainDensity = 0.001f; 41 // this->rainStart = 10.0f; 42 // this->rainEnd = 1000.0f; 42 // BoxEmitter::BoxEmitter(const Vector& size, float emissionRate, float velocity, float angle) 43 44 // <name>RainEmitter</name> 45 // <rel-coor>-1200, 300, 0</rel-coor> 46 // <rel-dir>3.1412, 0, 0, 1</rel-dir> 47 // <spread>0,.3</spread> 48 // <emission-velocity>500,50</emission-velocity> 49 // <size>1000, 1000</size> 50 // <rate>5000</rate> 51 52 this->emitter = new BoxEmitter(Vector(1000, 300, 100), 20000, 1000, M_2_PI); 53 this->emitter->setRelCoor(100, 0, 0); 54 // this->emitter->setParent(this); 55 this->emitter->setSpread(0, 0.3); 43 56 44 57 if (root != NULL) … … 48 61 } 49 62 50 51 52 63 RainEffect::~RainEffect() 53 64 { … … 60 71 WeatherEffect::loadParams(root); 61 72 62 // LoadParam(root, "rain-mode", this, RainEffect, setRainMode); 63 // LoadParam(root, "rain-density", this, RainEffect, setRainDensity); 64 // LoadParam(root, "rain-color", this, RainEffect, setRainColor); 65 73 // LoadParam(root, "rel-coor", this, RainEffect, setRainMode); 74 // 75 // LoadParam(root, "rate", this, RainEffect, setRainColor); 76 // LoadParam(root, "velocity", this, RainEffect, setRainColor); 77 // LoadParam(root, "angle", this, RainEffect, setRainColor); 78 // 79 // LoadParam(root, "spread", this, RainEffect, setRainColor); 80 81 // BoxEmitter::BoxEmitter(const Vector& size, float emissionRate, float velocity, float angle) 82 83 this->emitter = new BoxEmitter(Vector(0, 1000, 0), 20000, 4000, 1); 84 this->emitter->setRelCoor(0, 100, 0); 85 // this->emitter->setParent(this); 86 this->emitter->setSpread(0, 0.3); 87 88 // LOAD_PARAM_START_CYCLE(root, element); 89 // { 90 // element->ToText(); 91 // // PER-PARTICLE-ATTRIBUTES: 92 // LoadParam_CYCLE(element, "radius", this, ParticleSystem, setRadius) 93 // .describe("The Radius of each particle over time (TimeIndex [0-1], radius at TimeIndex, randomRadius at TimeIndex)"); 94 // 95 // LoadParam_CYCLE(element, "mass", this, ParticleSystem, setMass) 96 // .describe("The Mass of each particle over time (TimeIndex: [0-1], mass at TimeIndex, randomMass at TimeIndex)"); 97 // 98 // LoadParam_CYCLE(element, "color", this, ParticleSystem, setColor) 99 // .describe("The Color of each particle over time (TimeIndex: [0-1], red: [0-1], green: [0-1], blue: [0-1], alpha: [0-1])"); 100 // } 101 // LOAD_PARAM_END_CYCLE(element); 66 102 67 103 } … … 70 106 {} 71 107 72 108 SparkParticles* RainEffect::rainParticles = NULL; 73 109 74 110 bool RainEffect::activate() 75 111 { 76 PRINTF(0)("Activating Rain Effect\n"); 112 // PRINTF(0)( "Enabling Rain Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->rainMode, this->rainDensity, this->rainStart, this->rainEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z); 113 PRINTF(0)("Activating Rain Effect\n"); 114 115 if (unlikely(RainEffect::rainParticles == NULL)) 116 { 117 RainEffect::rainParticles = new SparkParticles(10000); 118 RainEffect::rainParticles->setName("RainParticles"); 119 RainEffect::rainParticles->setLifeSpan(2, 2); 120 RainEffect::rainParticles->setRadius(0.05, 0.05); 121 RainEffect::rainParticles->setRadius(0.04, 0.04); 122 RainEffect::rainParticles->setRadius(0.03, 0.03); 123 RainEffect::rainParticles->setColor(0, 0, 0, 1, .3); 124 RainEffect::rainParticles->setColor(0.5, 0.5, 0.5, 1, 0.2); 125 RainEffect::rainParticles->setColor(0.8, 0.8, 0.2, 0.3, 0.3); 126 RainEffect::rainParticles->setColor(1, 0.5, 0.5, 1, 0); 127 128 // <life-span>2,2</life-span> 129 // <radius>0, 0.05, 0.05</radius> 130 // <radius>1, 0.05, 0.05</radius> 131 // <mass>0,1, .05</mass> 132 // <color>0, 0, 0, 1, .3</color> 133 // <color>.5, .5, .5, 1, .2</color> 134 // <color>1,0.5, .5,1, .0</color> 135 // <precache>2</precache> 136 // <emitters> 137 // <PlaneEmitter> 138 139 // </PlaneEmitter> 140 // </emitters> 141 142 } 143 144 this->emitter->setSystem(RainEffect::rainParticles); 145 // this->size = 4.0; 146 147 RainEffect::rainParticles->debug(); 148 // this->updateNode(0); 149 this->emitter->setEmissionRate(5000.0); 150 this->emitter->setEmissionVelocity(50.0); 151 152 // this->setHealth(200); 153 77 154 } 78 155 … … 81 158 { 82 159 PRINTF(0)("Deactivating Rain Effect\n"); 83 // glDisable(GL_RAIN); 160 161 this->emitter->setSystem(NULL); 162 // this->lifeCycle = 0.0; 163 // this->toList(OM_NULL); 164 165 // GarbageCollector::getInstance()->collect(this); 166 // this->toList(OM_DEAD); 167 84 168 } 85 169 -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r7562 r7577 8 8 #include "vector.h" 9 9 #include "particle_system.h" 10 #include "material.h" 10 //#include "material.h" 11 12 class SparkParticles; 13 class ParticleEmitter; 11 14 12 15 #include "weather_effect.h" … … 34 37 35 38 private: 36 // GLint rainMode; 39 static SparkParticles* rainParticles; 40 ParticleEmitter* emitter; 41 37 42 // GLfloat rainDensity; 38 43 // GLfloat rainStart; -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
r7568 r7577 60 60 61 61 // Set fog color 62 float fogColor[4] = {0. 2, 0.2, 0.2, 1.0};62 float fogColor[4] = {0.0, 1.0, 0.0, 1.0}; 63 63 64 64 /* set up fog params */ … … 67 67 glFogfv(GL_FOG_COLOR, fogColor); // Set The Fog Color 68 68 glFogf(GL_FOG_START, 0.0f); // Set The Fog Start 69 glFogf(GL_FOG_END, 1 0.0f); // Set The Fog End69 glFogf(GL_FOG_END, 1.0f); // Set The Fog End 70 70 glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); // Set The Fog based on vertice coordinates 71 71 // glHint(GL_FOG_HINT, GL_NICEST); // Per-Pixel Fog Calculation … … 111 111 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 112 112 113 /* Enable blending */ 113 114 //glEnable(GL_BLEND); 114 115 //glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); … … 126 127 127 128 glBegin(GL_QUADS); // Roof 128 glFogCoordfEXT( 5.0f); glVertex3f(0.0f, 100.0f,0.0f);129 glFogCoordfEXT( 5.0f); glVertex3f( 100.0f, 100.0f,0.0f);130 glFogCoordfEXT( 5.0f); glVertex3f( 100.0f, 100.0f, 100.0f);131 glFogCoordfEXT( 5.0f); glVertex3f(0.0f, 100.0f, 100.0f);129 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f,0.0f); 130 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,0.0f); 131 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f, 100.0f); 132 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f, 100.0f); 132 133 glEnd(); 133 134 … … 135 136 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f,0.0f); 136 137 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f,0.0f); 137 glFogCoordfEXT( 5.0f); glVertex3f( 100.0f, 100.0f,0.0f);138 glFogCoordfEXT( 5.0f); glVertex3f(0.0f, 100.0f,0.0f);138 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,0.0f); 139 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f,0.0f); 139 140 glEnd(); 140 141 … … 142 143 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f,100.0f); 143 144 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f,100.0f); 144 glFogCoordfEXT( 50.0f); glVertex3f( 100.0f, 100.0f,100.0f);145 glFogCoordfEXT( 50.0f); glVertex3f(0.0f, 100.0f,100.0f);145 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,100.0f); 146 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f,100.0f); 146 147 glEnd(); 147 148 148 149 glBegin(GL_QUADS); // Right Wall 149 150 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f, 100.0f); 150 glFogCoordfEXT( 5.0f); glVertex3f( 100.0f, 100.0f, 100.0f);151 glFogCoordfEXT( 5.0f); glVertex3f( 100.0f, 100.0f,0.0f);151 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f, 100.0f); 152 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,0.0f); 152 153 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f,0.0f); 153 154 glEnd(); … … 155 156 glBegin(GL_QUADS); // Left Wall 156 157 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f, 100.0f); 157 glFogCoordfEXT( 5.0f); glVertex3f(0.0f, 100.0f, 100.0f);158 glFogCoordfEXT( 5.0f); glVertex3f(0.0f, 100.0f,0.0f);158 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f, 100.0f); 159 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f,0.0f); 159 160 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f,0.0f); 160 161 glEnd();
Note: See TracChangeset
for help on using the changeset viewer.