Changeset 7392 in orxonox.OLD for branches/atmospheric_engine/src/lib
- Timestamp:
- Apr 27, 2006, 9:49:33 AM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc
r7381 r7392 27 27 using namespace std; 28 28 29 30 31 29 /** 32 30 * @param root The XML-element to load the AtmosphericEngine from … … 34 32 AtmosphericEngine::AtmosphericEngine() 35 33 { 36 // this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");37 this->bActivated = false;34 // this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine"); 35 // this->bActivated = false; 38 36 } 39 37 … … 92 90 * initializes the graphics effect 93 91 */ 94 bool AtmosphericEngine::init()95 {}92 //bool AtmosphericEngine::init() 93 //{} 96 94 97 95 -
branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.h
r7381 r7392 15 15 { 16 16 public: 17 virtual~AtmosphericEngine();17 ~AtmosphericEngine(); 18 18 19 19 /** @returns a Pointer to the only object of this Class */ 20 20 inline static AtmosphericEngine* getInstance() { if (!AtmosphericEngine::singletonRef) AtmosphericEngine::singletonRef = new AtmosphericEngine(); return AtmosphericEngine::singletonRef; }; 21 21 22 v irtual void loadParams(const TiXmlElement* root);22 void loadParams(const TiXmlElement* root); 23 23 24 virtualbool init();24 // bool init(); 25 25 26 //virtual bool activate() = 0;27 //virtual bool deactivate() = 0;26 void draw() const; 27 void tick(float dt); 28 28 29 virtual void draw() const; 30 virtual void tick(float dt); 31 32 inline bool isActivated() const { return this->bActivated; } 29 // inline bool isActivated() const { return this->bActivated; } 33 30 34 31 void loadWeatherEffect(const TiXmlElement* root); … … 41 38 static AtmosphericEngine* singletonRef; //!< Pointer to the only instance of this Class 42 39 43 protected:44 bool bActivated;40 //protected: 41 // bool bActivated; 45 42 }; 46 43 -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r7381 r7392 20 20 #include "glincl.h" 21 21 22 22 #include "shell_command.h" 23 /*SHELL_COMMAND(activateFog, FogEffect, FogEffect::activate) 24 ->setAlias("aFog"); 25 SHELL_COMMAND(deactivateFog, FogEffect, FogEffect::deactivate) 26 ->setAlias("dFog");*/ 23 27 24 28 using namespace std; … … 26 30 CREATE_FACTORY(FogEffect, CL_FOG_EFFECT); 27 31 28 29 32 FogEffect::FogEffect(const TiXmlElement* root) 30 33 { 31 34 //this->setClassID(CL_FOG_EFFECT, "FogEffect"); 32 /* 35 33 36 this->fogMode = GL_LINEAR; 34 37 this->fogDensity = 0.001f; 35 38 this->fogStart = 10.0f; 36 39 this->fogEnd = 1000.0f; 37 */ 40 38 41 if (root != NULL) 39 42 this->loadParams(root); … … 54 57 WeatherEffect::loadParams(root); 55 58 56 /*57 59 LoadParam(root, "fog-mode", this, FogEffect, setFogMode); 58 60 59 61 LoadParam(root, "fog-density", this, FogEffect, setFogDensity); 60 62 61 LoadParam(root, "fog-color", this, FogEffect, setFogColor); */63 LoadParam(root, "fog-color", this, FogEffect, setFogColor); 62 64 63 LoadParam(root, "test", this, FogEffect, setTest);65 // LoadParam(root, "test", this, FogEffect, setTest); 64 66 65 67 … … 77 79 78 80 bool FogEffect::activate() 79 { /*81 { 80 82 PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, 81 83 this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z); 82 84 85 /*PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f\n", this->fogMode, this->fogDensity, 86 this->fogStart, this->fogEnd);*/ 87 83 88 glEnable(GL_FOG); 84 89 { 85 //GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};90 //GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0}; 86 91 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 87 92 … … 95 100 //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE); 96 101 } 97 glClearColor(0.5, 0.5, 0.5, 1.0); */102 glClearColor(0.5, 0.5, 0.5, 1.0); 98 103 } 99 104 … … 102 107 bool FogEffect::deactivate() 103 108 { 104 //glDisable(GL_FOG);109 glDisable(GL_FOG); 105 110 } 106 111 107 112 108 /* 113 109 114 GLint FogEffect::stringToFogMode(const std::string& mode) 110 115 { … … 118 123 return -1; 119 124 } 120 */121 125 126 -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
r7381 r7392 5 5 #ifndef _FOG_EFFECT 6 6 #define _FOG_EFFECT 7 8 #include "vector.h" 7 9 8 10 #include "weather_effect.h" … … 24 26 void setTest(int test); 25 27 26 /*inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }28 inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); } 27 29 inline void setFogDensity(float density) { this->fogDensity = density; } 28 30 inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } 29 31 inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); } 30 */31 32 private:33 //GLint stringToFogMode(const std::string& mode);34 32 35 33 36 34 private: 37 /* GLint fogMode; 35 GLint stringToFogMode(const std::string& mode); 36 37 38 private: 39 GLint fogMode; 38 40 GLfloat fogDensity; 39 41 GLfloat fogStart; 40 42 GLfloat fogEnd; 41 Vector colorVector; */43 Vector colorVector; 42 44 }; 43 45
Note: See TracChangeset
for help on using the changeset viewer.