Changeset 7652 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects
- Timestamp:
- May 17, 2006, 6:41:58 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r7628 r7652 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2004 orx 5 5 6 7 8 9 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler 13 13 */ 14 14 … … 22 22 /*#include "shell_command.h" 23 23 SHELL_COMMAND(activateFog, FogEffect, FogEffect::activate) 24 24 ->setAlias("aFog"); 25 25 SHELL_COMMAND(deactivateFog, FogEffect, FogEffect::deactivate) 26 26 ->setAlias("dFog");*/ 27 27 28 28 using namespace std; … … 32 32 FogEffect::FogEffect(const TiXmlElement* root) 33 33 { 34 35 36 37 38 39 34 this->setClassID(CL_FOG_EFFECT, "FogEffect"); 35 36 this->fogMode = GL_LINEAR; 37 this->fogDensity = 0.001f; 38 this->fogStart = 10.0f; 39 this->fogEnd = 1000.0f; 40 40 41 42 41 if (root != NULL) 42 this->loadParams(root); 43 43 44 44 this->activate(); 45 45 } 46 46 … … 49 49 FogEffect::~FogEffect() 50 50 { 51 51 this->deactivate(); 52 52 } 53 53 … … 55 55 void FogEffect::loadParams(const TiXmlElement* root) 56 56 { 57 57 WeatherEffect::loadParams(root); 58 58 59 60 61 59 LoadParam(root, "fog-mode", this, FogEffect, setFogMode); 60 LoadParam(root, "fog-density", this, FogEffect, setFogDensity); 61 LoadParam(root, "fog-color", this, FogEffect, setFogColor); 62 62 63 63 … … 71 71 bool FogEffect::activate() 72 72 { 73 73 PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z); 74 74 75 76 77 78 75 glEnable(GL_FOG); 76 { 77 //GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0}; 78 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 79 79 80 81 82 83 84 85 80 glFogi(GL_FOG_MODE, this->fogMode); 81 glFogfv(GL_FOG_COLOR, fogColor); 82 glFogf(GL_FOG_DENSITY, this->fogDensity); 83 glHint(GL_FOG_HINT, GL_DONT_CARE); 84 glFogf(GL_FOG_START, this->fogStart); 85 glFogf(GL_FOG_END, this->fogEnd); 86 86 87 88 89 87 //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE); 88 } 89 glClearColor(0.5, 0.5, 0.5, 1.0); 90 90 } 91 91 … … 93 93 bool FogEffect::deactivate() 94 94 { 95 95 PRINTF(0)("Deactivating FogEffect\n"); 96 96 glDisable(GL_FOG); 97 97 } … … 101 101 GLint FogEffect::stringToFogMode(const std::string& mode) 102 102 { 103 104 105 106 107 108 109 110 103 if(mode == "GL_LINEAR") 104 return GL_LINEAR; 105 else if(mode == "GL_EXP") 106 return GL_EXP; 107 else if(mode == "GL_EXP2" ) 108 return GL_EXP2; 109 else 110 return -1; 111 111 } 112 112 -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
r7416 r7652 1 1 /** 2 3 2 * @file fog_effect.h 3 */ 4 4 5 5 #ifndef _FOG_EFFECT … … 12 12 class FogEffect : public WeatherEffect 13 13 { 14 15 16 14 public: 15 FogEffect(const TiXmlElement* root = NULL); 16 virtual ~FogEffect(); 17 17 18 18 virtual void loadParams(const TiXmlElement* root); 19 19 20 20 virtual bool init(); 21 21 22 23 22 virtual bool activate(); 23 virtual bool deactivate(); 24 24 25 26 27 28 25 inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); } 26 inline void setFogDensity(float density) { this->fogDensity = density; } 27 inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } 28 inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); } 29 29 30 30 31 32 31 private: 32 GLint stringToFogMode(const std::string& mode); 33 33 34 34 35 36 37 38 39 40 35 private: 36 GLint fogMode; 37 GLfloat fogDensity; 38 GLfloat fogStart; 39 GLfloat fogEnd; 40 Vector colorVector; 41 41 }; 42 42 -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r7646 r7652 20 20 21 21 #include "glincl.h" 22 // #include "debug.h" 23 22 #include "p_node.h" 24 23 #include "state.h" 25 24 #include "spark_particles.h" … … 37 36 RainEffect::RainEffect(const TiXmlElement* root) 38 37 { 39 38 this->setClassID(CL_RAIN_EFFECT, "RainEffect"); 40 39 41 if (root != NULL) 42 this->loadParams(root); 40 this->init(); 43 41 44 // this->soundSource.setSourceNode(this); 42 if (root != NULL) 43 this->loadParams(root); 45 44 46 47 48 49 45 //load sound 46 if (this->rainBuffer != NULL) 47 ResourceManager::getInstance()->unload(this->rainBuffer); 48 this->rainBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV); 50 49 51 this->init(); 52 53 this->activate(); 50 this->activate(); 54 51 } 55 52 56 53 RainEffect::~RainEffect() 57 54 { 58 55 this->deactivate(); 59 56 } 60 57 … … 63 60 WeatherEffect::loadParams(root); 64 61 62 LoadParam(root, "moverain", this, RainEffect, setMoveRain); 65 63 LoadParam(root, "coord", this, RainEffect, setRainCoord); 66 64 LoadParam(root, "size", this, RainEffect, setRainSize); 67 65 LoadParam(root, "rate", this, RainEffect, setRainRate); 68 66 LoadParam(root, "velocity", this, RainEffect, setRainVelocity); 67 LoadParam(root, "life", this, RainEffect, setRainLife); 69 68 } 70 69 … … 72 71 bool RainEffect::init() 73 72 { 74 this->emitter = new PlaneEmitter(this->rainSize); 73 //Default values 74 this->rainCoord = Vector(500, 500, 500); 75 this->rainSize = Vector2D(1000, 1000); 76 this->rainRate = 5000; 77 this->rainVelocity = -300; 78 this->rainLife = 2; 75 79 80 this->emitter = new PlaneEmitter(this->rainSize); 76 81 } 77 82 … … 81 86 bool RainEffect::activate() 82 87 { 83 PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f \n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity);88 PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f, moveRain: %s\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity, this->rainMove ? "true" : "false" ); 84 89 85 90 if (unlikely(RainEffect::rainParticles == NULL)) 86 91 { 87 RainEffect::rainParticles = new SparkParticles( 10000);92 RainEffect::rainParticles = new SparkParticles(50000); 88 93 RainEffect::rainParticles->setName("RainParticles"); 89 RainEffect::rainParticles->setLifeSpan( 2, 2);94 RainEffect::rainParticles->setLifeSpan(this->rainLife, 2); 90 95 RainEffect::rainParticles->setRadius(0.02, 0.02); 91 96 RainEffect::rainParticles->setRadius(0.01, 0.01); … … 98 103 99 104 this->emitter->setSystem(RainEffect::rainParticles); 100 101 // RainEffect::rainParticles->debug();102 105 103 106 this->emitter->setRelCoor(this->rainCoord); … … 115 118 bool RainEffect::deactivate() 116 119 { 117 120 PRINTF(0)("Deactivating RainEffect\n"); 118 121 119 122 this->emitter->setSystem(NULL); 120 123 } 121 124 122 125 void RainEffect::tick (float dt) 123 126 { 127 //float distance = (State::getCameraNode()->getAbsCoor() - rainCoord).len(); 128 129 // PRINTF(0)( "RainEffect, coords: %f, %f, %f\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z ); 124 130 131 //if (this->rainMove) { 132 //PRINTF(0)( "Moving Rain" ); 133 // this->rainCoord = State::getCameraNode()->getAbsCoor(); 134 // this->emitter->setRelCoor(this->rainCoord.x +150, this->rainCoord.y+700, this->rainCoord.z+150); 135 //} 125 136 } -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r7646 r7652 1 1 /** 2 3 2 * @file rain_effect.h 3 */ 4 4 5 5 #ifndef _RAIN_EFFECT … … 22 22 class RainEffect : public WeatherEffect 23 23 { 24 25 26 24 public: 25 RainEffect(const TiXmlElement* root = NULL); 26 virtual ~RainEffect(); 27 27 28 28 virtual void loadParams(const TiXmlElement* root); 29 29 30 30 virtual bool init(); 31 31 32 33 32 virtual bool activate(); 33 virtual bool deactivate(); 34 34 35 35 virtual void tick(float dt); 36 36 37 inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); } 38 inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); } 39 inline void setRainRate(float rate) { this->rainRate = rate;} 40 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; } 37 inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); } 38 inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); } 39 inline void setRainRate(float rate) { this->rainRate = rate;} 40 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; } 41 inline void setRainLife(float life) { this->rainLife = life; } 42 inline void setMoveRain() { PRINTF(0)( "setting move true\n"); this->rainMove = true; } 41 43 42 private:43 static SparkParticles* rainParticles;44 ParticleEmitter* emitter;45 44 46 Vector rainCoord; 47 Vector2D rainSize; 48 GLfloat rainRate; 49 GLfloat rainVelocity; 45 private: 46 static SparkParticles* rainParticles; 47 ParticleEmitter* emitter; 50 48 51 SoundSource soundSource; 52 SoundBuffer* rainBuffer; 49 Vector rainCoord; 50 Vector2D rainSize; 51 GLfloat rainRate; 52 GLfloat rainVelocity; 53 GLfloat rainLife; 54 bool rainMove; 55 56 SoundSource soundSource; 57 SoundBuffer* rainBuffer; 53 58 }; 54 59 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r7651 r7652 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2004 orx 5 5 6 7 8 9 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler 13 13 */ 14 14 … … 38 38 SnowEffect::SnowEffect(const TiXmlElement* root) 39 39 { 40 40 this->setClassID(CL_SNOW_EFFECT, "SnowEffect"); 41 41 42 42 this->init(); 43 43 44 45 44 if (root != NULL) 45 this->loadParams(root); 46 46 47 47 this->activate(); 48 48 } 49 49 … … 51 51 SnowEffect::~SnowEffect() 52 52 { 53 53 this->deactivate(); 54 54 } 55 55 … … 58 58 void SnowEffect::loadParams(const TiXmlElement* root) 59 59 { 60 60 WeatherEffect::loadParams(root); 61 61 62 63 64 65 66 67 68 69 70 71 62 LoadParam(root, "numParticles", this, SnowEffect, numParticles); 63 LoadParam(root, "materialTexture", this, SnowEffect, materialTexture); 64 LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan); 65 LoadParam(root, "radius", this, SnowEffect, radius); 66 LoadParam(root, "mass", this, SnowEffect, mass); 67 LoadParam(root, "emissionRate", this, SnowEffect, emissionRate); 68 LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity); 69 LoadParam(root, "spread", this, SnowEffect, spread); 70 LoadParam(root, "size", this, SnowEffect, size); 71 LoadParam(root, "coord", this, SnowEffect, coord); 72 72 } 73 73 74 74 bool SnowEffect::init() 75 75 { 76 76 this->emitter = new PlaneEmitter(); 77 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 78 // Default values 79 particles = 10000; 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; 91 randomAngle = 0.3; 92 alpha = 0.5; 93 snowSize = Vector2D(1200, 1200); 94 snowCoord = Vector(100, 600, 200); 95 95 96 96 activated = false; 97 97 } 98 98 99 99 bool SnowEffect::activate() 100 100 { 101 PRINTF(0)("Activating SnowEffect\n"); 102 activated = true; 103 104 SnowEffect::snowParticles = new SpriteParticles(particles); 105 SnowEffect::snowParticles->setName("SnowEffectTrailParticles"); 106 SnowEffect::snowParticles->setMaterialTexture(texture); 107 SnowEffect::snowParticles->setLifeSpan(life, randomLife); 108 SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius); 109 SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius); 110 SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius); 111 SnowEffect::snowParticles->setMass(0, snowMass, randomMass); 112 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 113 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); 114 SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0); 101 PRINTF(0)("Activating SnowEffect\n"); 102 activated = true; 115 103 116 117 this->emitter->setSystem(SnowEffect::snowParticles); 118 119 // this->updateNode(0); 120 this->emitter->setRelCoor(snowCoord); 121 this->emitter->setEmissionRate(rate); 122 this->emitter->setEmissionVelocity(velocity, randomVelocity); 123 this->emitter->setSpread(angle, randomAngle); 124 this->emitter->setSize(snowSize); 104 SnowEffect::snowParticles = new SpriteParticles(particles); 105 SnowEffect::snowParticles->setName("SnowEffectTrailParticles"); 106 SnowEffect::snowParticles->setMaterialTexture(texture); 107 SnowEffect::snowParticles->setLifeSpan(life, randomLife); 108 SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius); 109 SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius); 110 SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius); 111 SnowEffect::snowParticles->setMass(0, snowMass, randomMass); 112 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 113 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); 114 SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0); 115 116 this->emitter->setSystem(SnowEffect::snowParticles); 117 118 // this->updateNode(0); 119 this->emitter->setRelCoor(snowCoord); 120 this->emitter->setEmissionRate(rate); 121 this->emitter->setEmissionVelocity(velocity, randomVelocity); 122 this->emitter->setSpread(angle, randomAngle); 123 this->emitter->setSize(snowSize); 125 124 } 126 125 … … 128 127 bool SnowEffect::deactivate() 129 128 { 130 131 132 133 129 PRINTF(0)("Deactivating SnowEffect\n"); 130 activated = false; 131 132 this->emitter->setSystem(NULL); 134 133 } 135 134 136 135 void SnowEffect::activateSnow() 137 136 { 138 137 this->activate(); 139 138 } 140 139 141 140 void SnowEffect::deactivateSnow() 142 141 { 143 142 this->deactivate(); 144 143 } 145 144 … … 150 149 void SnowEffect::tick(float dt) 151 150 { 152 153 154 155 156 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(); 157 156 } 158 157 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h
r7651 r7652 1 1 /** 2 3 2 * @file snow_effect.h 3 */ 4 4 5 5 #ifndef _SNOW_EFFECT … … 19 19 class SnowEffect : public WeatherEffect 20 20 { 21 22 23 21 public: 22 SnowEffect(const TiXmlElement* root = NULL); 23 virtual ~SnowEffect(); 24 24 25 25 virtual void loadParams(const TiXmlElement* root); 26 26 27 27 virtual bool init(); 28 28 29 30 29 virtual bool activate(); 30 virtual bool deactivate(); 31 31 32 33 32 virtual void draw() const; 33 virtual void tick(float dt); 34 34 35 36 35 void activateSnow(); 36 void deactivateSnow(); 37 37 38 39 40 41 42 43 44 45 46 47 48 38 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 spread(float angle, float randomAngle) { this->angle = angle; this->randomAngle = randomAngle; } 47 void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); } 48 void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); } 49 49 50 51 52 53 54 55 56 57 58 59 60 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; 61 61 62 62 bool activated; 63 63 64 64 static SpriteParticles* snowParticles; 65 65 66 66 PlaneEmitter* emitter; 67 67 }; 68 68 -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
r7577 r7652 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2004 orx 5 5 6 7 8 9 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler 13 13 */ 14 14 … … 27 27 VolFogEffect::VolFogEffect(const TiXmlElement* root) 28 28 { 29 29 this->setClassID(CL_VOLFOG_EFFECT, "VolFogEffect"); 30 30 31 32 31 if (root != NULL) 32 this->loadParams(root); 33 33 34 35 34 // Initialize Effect 35 this->init(); 36 36 37 38 37 // Activate Effect 38 this->activate(); 39 39 } 40 40 … … 42 42 VolFogEffect::~VolFogEffect() 43 43 { 44 44 this->deactivate(); 45 45 } 46 46 47 47 void VolFogEffect::loadParams(const TiXmlElement* root) 48 48 { 49 49 WeatherEffect::loadParams(root); 50 50 } 51 51 52 52 bool VolFogEffect::init() 53 53 { 54 55 56 57 58 59 54 PRINTF(0)("Initalize VolFogEffect\n"); 55 56 if (glewInit() == GLEW_OK) 57 PRINTF(0)("glewInit OK\n"); 58 else 59 PRINTF(0)("glewInit failed\n"); 60 60 61 62 61 // Set fog color 62 float fogColor[4] = {0.0, 1.0, 0.0, 1.0}; 63 63 64 65 66 67 68 69 70 71 64 /* set up fog params */ 65 glEnable(GL_FOG); // Enable Fog 66 glFogi(GL_FOG_MODE, GL_LINEAR); // Fog Fade Is Linear 67 glFogfv(GL_FOG_COLOR, fogColor); // Set The Fog Color 68 glFogf(GL_FOG_START, 0.0f); // Set The Fog Start 69 glFogf(GL_FOG_END, 1.0f); // Set The Fog End 70 glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); // Set The Fog based on vertice coordinates 71 // glHint(GL_FOG_HINT, GL_NICEST); // Per-Pixel Fog Calculation 72 72 73 73 // glClearColor(0.0, 0.0, 0.0, 1.0); //sets bg color?! 74 74 75 76 77 75 /* enable texturing & set texturing function */ 76 // glEnable(GL_TEXTURE_2D); 77 // glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); 78 78 79 80 81 82 83 84 85 86 87 88 79 if (glewGetExtension("GL_EXT_fog_coord")) 80 { 81 PRINTF(0)("GL_EXT_fog_coord extension found\n"); 82 return true; 83 } 84 else 85 { 86 PRINTF(0)("GL_EXT_fog_coord extension NOT found\n"); 87 return false; 88 } 89 89 } 90 90 … … 92 92 bool VolFogEffect::activate() 93 93 { 94 94 PRINTF(0)("Activating VolFogEffect\n"); 95 95 } 96 96 97 97 bool VolFogEffect::deactivate() 98 98 { 99 99 PRINTF(0)("Deactivating VolFogEffect\n"); 100 100 } 101 101 102 102 103 103 /** 104 105 104 * draws the effect, if needed 105 */ 106 106 void VolFogEffect::draw() const 107 107 { … … 134 134 135 135 glBegin(GL_QUADS); // Back Wall 136 136 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f,0.0f); 137 137 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f,0.0f); 138 138 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,0.0f); … … 141 141 142 142 glBegin(GL_QUADS); // Front Wall 143 143 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f,100.0f); 144 144 glFogCoordfEXT(0.0f); glVertex3f( 100.0f,0.0f,100.0f); 145 145 glFogCoordfEXT(1.0f); glVertex3f( 100.0f, 100.0f,100.0f); … … 155 155 156 156 glBegin(GL_QUADS); // Left Wall 157 157 glFogCoordfEXT(0.0f); glVertex3f(0.0f,0.0f, 100.0f); 158 158 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f, 100.0f); 159 159 glFogCoordfEXT(1.0f); glVertex3f(0.0f, 100.0f,0.0f); … … 169 169 170 170 /** 171 172 171 * ticks the effect if there is any time dependancy 172 */ 173 173 void VolFogEffect::tick(float dt) 174 174 { -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h
r7568 r7652 1 1 /** 2 3 2 * @file volfog_effect.h 3 */ 4 4 5 5 #ifndef _VOLFOG_EFFECT … … 12 12 class VolFogEffect : public WeatherEffect 13 13 { 14 15 16 14 public: 15 VolFogEffect(const TiXmlElement* root = NULL); 16 virtual ~VolFogEffect(); 17 17 18 18 virtual void loadParams(const TiXmlElement* root); 19 19 20 20 virtual bool init(); 21 21 22 23 22 virtual bool activate(); 23 virtual bool deactivate(); 24 24 25 26 25 virtual void draw() const; 26 virtual void tick(float dt); 27 27 28 29 28 private: 29 GLfloat fogColor[4]; 30 30 31 31 };
Note: See TracChangeset
for help on using the changeset viewer.