- Timestamp:
- Jun 29, 2006, 1:37:36 PM (18 years ago)
- Location:
- branches/mountain_lake/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mountain_lake/src/lib/graphics/effects/cloud_effect.cc
r8902 r8903 75 75 { 76 76 PRINTF(0)("Initializing CloudEffect\n"); 77 77 78 78 this->offsetZ = 0; 79 79 this->animationSpeed = 2; … … 183 183 this->shader->activateShader(); 184 184 this->offset->set(0.0f, 0.0f, offsetZ); 185 185 186 186 if(cloudColor != newCloudColor) 187 187 { 188 188 if(fadeCloud) 189 { 189 { 190 190 this->cloudColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudX); 191 191 this->cloudColorFadeX->setInfinity(ANIM_INF_CONSTANT); … … 194 194 this->cloudColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudZ); 195 195 this->cloudColorFadeZ->setInfinity(ANIM_INF_CONSTANT); 196 196 197 197 this->cloudColorFadeX->addKeyFrame(cloudColor.x, fadeTime, ANIM_LINEAR); 198 198 this->cloudColorFadeX->addKeyFrame(newCloudColor.x, 0, ANIM_LINEAR); 199 199 200 200 this->cloudColorFadeY->addKeyFrame(cloudColor.y, fadeTime, ANIM_LINEAR); 201 201 this->cloudColorFadeY->addKeyFrame(newCloudColor.y, 0, ANIM_LINEAR); 202 202 203 203 this->cloudColorFadeZ->addKeyFrame(cloudColor.z, fadeTime, ANIM_LINEAR); 204 204 this->cloudColorFadeZ->addKeyFrame(newCloudColor.z, 0, ANIM_LINEAR); 205 205 206 206 fadeCloud = false; 207 207 208 208 this->cloudColorFadeX->replay(); 209 209 this->cloudColorFadeY->replay(); 210 210 this->cloudColorFadeZ->replay(); 211 211 } 212 212 213 213 this->cloudcolor->set(this->cloudColor.x, this->cloudColor.y, this->cloudColor.z); 214 214 } 215 215 216 216 if(skyColor != newSkyColor) 217 { 217 { 218 218 if(fadeSky) 219 { 219 { 220 220 this->skyColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyX); 221 221 this->skyColorFadeX->setInfinity(ANIM_INF_CONSTANT); … … 224 224 this->skyColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyZ); 225 225 this->skyColorFadeZ->setInfinity(ANIM_INF_CONSTANT); 226 226 227 227 this->skyColorFadeX->addKeyFrame(skyColor.x, fadeTime, ANIM_LINEAR); 228 228 this->skyColorFadeX->addKeyFrame(newSkyColor.x, 0, ANIM_LINEAR); 229 229 230 230 this->skyColorFadeY->addKeyFrame(skyColor.y, fadeTime, ANIM_LINEAR); 231 231 this->skyColorFadeY->addKeyFrame(newSkyColor.y, 0, ANIM_LINEAR); 232 232 233 233 this->skyColorFadeZ->addKeyFrame(skyColor.z, fadeTime, ANIM_LINEAR); 234 234 this->skyColorFadeZ->addKeyFrame(newSkyColor.z, 0, ANIM_LINEAR); 235 235 236 236 fadeSky = false; 237 237 238 238 this->skyColorFadeX->replay(); 239 239 this->skyColorFadeY->replay(); 240 240 this->skyColorFadeZ->replay(); 241 241 } 242 242 243 243 this->skycolor->set(this->skyColor.x, this->skyColor.y, this->skyColor.z); 244 244 } 245 245 246 246 this->shader->deactivateShader(); 247 247 } -
branches/mountain_lake/src/world_entities/skydome.cc
r8800 r8903 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2006 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler … … 43 43 { 44 44 PRINTF(0)("Skydome init\n"); 45 45 46 46 this->setClassID(CL_SKYDOME, "Skydome"); 47 47 this->toList(OM_BACKGROUND); 48 this->toReflectionList(); 49 48 this->toReflectionList(); 49 50 50 } 51 51 … … 57 57 { 58 58 PRINTF(0)("Deleting Skydome\n"); 59 59 60 60 if (glIsTexture(texture)) 61 61 glDeleteTextures(1, &texture); … … 88 88 glPushMatrix(); 89 89 glTranslatef(0.0f,pRadius,0.0f); 90 90 91 91 92 92 glBegin(GL_TRIANGLES); … … 115 115 116 116 // Make sure our vertex array is clear 117 //if (planeVertices)118 //{119 //delete planeVertices;120 //planeVertices = NULL;121 //}117 if (planeVertices) 118 { 119 delete planeVertices; 120 planeVertices = NULL; 121 } 122 122 123 123 // Make sure our index array is clear 124 //if (indices)125 //{126 //delete indices;127 //indices = NULL;128 //}124 if (indices) 125 { 126 delete indices; 127 indices = NULL; 128 } 129 129 130 130 // Set the number of divisions into a valid range 131 131 int divs = divisions; 132 if (divisions < 1) 132 if (divisions < 1) 133 133 divs = 1; 134 134 135 if (divisions > 256) 136 divs = 256; 135 if (divisions > 256) 136 divs = 256; 137 137 138 138 pRadius = planetRadius; … … 152 152 float delta = plane_size/(float)divs; 153 153 float tex_delta = 2.0f/(float)divs; 154 154 155 155 // Variables we'll use during the dome's generation 156 156 float x_dist = 0.0f; … … 193 193 int startvert = (i*(divs+1) + j); 194 194 195 195 // tri 1 196 196 indices[index++] = startvert; 197 197 indices[index++] = startvert+1; … … 203 203 indices[index++] = startvert+divs+1; 204 204 } 205 } 206 } 205 } 206 }
Note: See TracChangeset
for help on using the changeset viewer.