- Timestamp:
- Feb 7, 2006, 11:06:19 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/fog_effect.cc
r6980 r7107 39 39 this->setClassID(CL_FOG_EFFECT, "FogEffect"); 40 40 41 this->fogMode = GL_ EXP2;41 this->fogMode = GL_LINEAR; 42 42 this->fogDensity = 0.001f; 43 43 this->fogStart = 10.0f; … … 46 46 if (root != NULL) 47 47 this->loadParams(root); 48 49 this->activate(); 48 50 } 49 51 … … 72 74 .describe("sets the the fog density of the exponentionl functions"); 73 75 74 LoadParam(root, "fog-range", this, FogEffect, setFogRange) 75 .describe("sets the the range of the linear functions"); 76 LoadParam(root, "fog-color", this, FogEffect, setFogColor) 77 .describe("sets the fog color"); 78 76 79 } 77 80 … … 89 92 bool FogEffect::activate() 90 93 { 91 PRINTF( 4)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end:%f\n", this->fogMode, this->fogDensity,92 this->fogStart, this->fogEnd );94 PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, 95 this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z); 93 96 94 97 glEnable(GL_FOG); 95 98 { 96 GLfloat fogColor[4] = {0.6, 0.6, 0.6, 1.0}; 99 // GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0}; 100 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 97 101 98 102 glFogi(GL_FOG_MODE, this->fogMode); -
trunk/src/lib/graphics/effects/fog_effect.h
r6772 r7107 7 7 #define _FOG_EFFECT 8 8 9 #include "vector.h" 9 10 #include "graphics_effect.h" 10 11 … … 25 26 virtual bool deactivate(); 26 27 27 void setFogMode(const char* mode) { this->fogMode = this->charToFogMode(mode); } 28 void setFogDensity(float density) { this->fogDensity = density; } 29 void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } 28 inline void setFogMode(const char* mode) { this->fogMode = this->charToFogMode(mode); } 29 inline void setFogDensity(float density) { this->fogDensity = density; } 30 inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } 31 inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); } 30 32 31 33 … … 39 41 GLfloat fogStart; 40 42 GLfloat fogEnd; 43 Vector colorVector; 41 44 }; 42 45 -
trunk/src/world_entities/camera.cc
r7014 r7107 181 181 Vector targetPosition = this->target->getAbsCoor(); 182 182 183 // Setting the Camera Eye, lookAt and up Vectors 183 glMatrixMode (GL_MODELVIEW); 184 glLoadIdentity(); 185 186 // Setting the Camera Eye, lookAt and up Vectors 184 187 gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z, 185 188 targetPosition.x, targetPosition.y, targetPosition.z, … … 187 190 188 191 189 glMatrixMode (GL_MODELVIEW);190 glLoadIdentity();191 192 192 } 193 193
Note: See TracChangeset
for help on using the changeset viewer.