Changeset 8828 in orxonox.OLD for branches/mountain_lake/src
- Timestamp:
- Jun 27, 2006, 3:01:54 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
r8821 r8828 292 292 293 293 294 // if(this->tempcounter == 200) {294 // if(this->tempcounter == 100) { 295 295 // this->resetWaterColor(1, 0, 0); 296 296 // resetShininess(1); … … 299 299 // } 300 300 // tempcounter++; 301 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 } 301 319 302 320 } -
branches/mountain_lake/src/world_entities/environments/mapped_water.h
r8792 r8828 44 44 45 45 // functions to set parameters for the water, usually they're called through loadparam 46 void setLightPos(float x, float y, float z) { this->lightPos = Vector(x,y,z); } ;47 void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); } ;48 void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; } ;49 void setWaterAngle(float angle) { this->waterAngle = angle; } ;50 void setWaterUV(float uv) { this->waterUV = uv; } ;46 void setLightPos(float x, float y, float z) { this->lightPos = Vector(x,y,z); } 47 void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); } 48 void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; } 49 void setWaterAngle(float angle) { this->waterAngle = angle; } 50 void setWaterUV(float uv) { this->waterUV = uv; } 51 51 void setWaterFlow(float flow) { this->waterFlow = flow; }; 52 void setNormalMapScale(float scale) { this->kNormalMapScale = scale; } ;53 void setShininess(float shine) { this->shininess = shine; } ;54 void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); };52 void setNormalMapScale(float scale) { this->kNormalMapScale = scale; } 53 void setShininess(float shine) { this->shininess = shine; } 54 void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; } 55 55 56 56 // functions to change water parameters during runtime … … 61 61 62 62 // fade functions 63 void fadeWaterColor(float r, float g, float b, float time) ;63 void fadeWaterColor(float r, float g, float b, float time) {this->newWaterColor = Vector(r, g, b); this->colorFadeTime = time; } 64 64 void fadeShininess(float shine, float time); 65 65 void fadeLightPos(float x, float y, float z, float time); … … 76 76 float waterAngle; //!< defines how much the water will be turned around the point waterPos 77 77 Vector waterColor; //!< color of the water 78 float move; //!< textures coords, speeds, positions for the shaded textures.... 78 79 Vector newWaterColor; //!< used to fade the water color 80 float colorFadeTime; 81 82 float move; 79 83 float move2; 80 84 float waterUV; //!< size of the waves
Note: See TracChangeset
for help on using the changeset viewer.