- Timestamp:
- Jun 28, 2006, 1:36:56 PM (18 years ago)
- Location:
- branches/mountain_lake/src/world_entities/environments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mountain_lake/src/world_entities/environments/mapped_water.cc
r8828 r8848 45 45 /// initialization of the shaders 46 46 this->initShaders(); 47 47 48 /// calculation of the 4 verts of the water quad 49 this->waterVerts[0] = this->waterPos.x; 50 this->waterVerts[1] = this->waterPos.z; 51 this->waterVerts[2] = this->waterVerts[0] + cos(this->waterAngle) * this->xWidth; 52 this->waterVerts[3] = this->waterVerts[1] + sin(this->waterAngle) * this->xWidth; 53 this->waterVerts[2] = this->waterVerts[0] - sin(this->waterAngle) * this->zWidth; 54 this->waterVerts[3] = this->waterVerts[1] + cos(this->waterAngle) * this->zWidth; 55 this->waterVerts[2] = this->waterVerts[0] + cos(this->waterAngle) * this->xWidth - sin(this->waterAngle) * this->zWidth; 56 this->waterVerts[3] = this->waterVerts[1] + sin(this->waterAngle) * this->xWidth + cos(this->waterAngle) * this->zWidth; 57 48 58 tempcounter = 0; 49 59 } … … 300 310 // tempcounter++; 301 311 302 if(this->tempcounter == 10) { 303 this->fadeWaterColor(1, 0, 0, 10); 304 305 PRINTF(0)("test waterchangecolor "); 306 } 307 tempcounter++; 308 309 if(this->newWaterColor != this->waterColor) 310 { 311 float time = this->colorFadeTime / dt; 312 float x = (this->newWaterColor.x - this->waterColor.x) * time +this->waterColor.x; 313 float y = (this->newWaterColor.y - this->waterColor.y) * time +this->waterColor.y; 314 float z = (this->newWaterColor.z - this->waterColor.z) * time +this->waterColor.z; 315 316 this->colorFadeTime -= dt; 317 this->resetWaterColor(x, y, z); 318 } 319 312 // if(this->tempcounter == 100) { 313 // this->fadeWaterColor(1, 0, 0, 10); 314 // 315 // PRINTF(0)("test waterchangecolor "); 316 // } 317 // tempcounter++; 318 // 319 // if(this->newWaterColor != this->waterColor) 320 // { 321 // float dtime = this->colorFadeTime / dt; 322 // Vector temp = (this->newWaterColor - this->waterColor) * dtime + this->waterColor; 323 // 324 // temp.debug(); 325 // 326 // this->colorFadeTime -= dt; 327 // this->resetWaterColor(temp.x, temp.y, temp.z); 328 // } 320 329 } 321 330 -
branches/mountain_lake/src/world_entities/environments/mapped_water.h
r8828 r8848 73 73 Vector waterPos; //!< position of the water 74 74 float xWidth, zWidth; //!< size of the water quad 75 float waterVerts[8]; //!< coords of the 4 vertexes of the water quad 75 76 Vector lightPos; //!< position of the light that is used to render the reflection 76 77 float waterAngle; //!< defines how much the water will be turned around the point waterPos
Note: See TracChangeset
for help on using the changeset viewer.