Changeset 8868 in orxonox.OLD
- Timestamp:
- Jun 28, 2006, 4:33:27 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/mountain_lake/src/world_entities/environments/mapped_water.h
r8867 r8868 35 35 virtual ~MappedWater(); 36 36 37 // worldentity functions 37 38 void loadParams(const TiXmlElement* root); 38 39 39 void draw() const; 40 40 void tick(float dt); … … 51 51 void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; } 52 52 void setWaterAngle(float angle) { this->waterAngle = angle; } 53 void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; } 53 54 void setWaterUV(float uv) { this->waterUV = uv; } 54 55 void setWaterFlow(float flow) { this->waterFlow = flow; }; … … 58 59 void setReflStrength(float strength) { this->reflStrength = strength; } 59 60 void setRefraction(float refraction) { this->refraction = refraction; } 60 void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; }61 61 62 62 // functions to change water parameters during runtime 63 63 // to reset waterUV and waterFlow just use the normal set functions 64 // don't reset kNormalMapScale (because it won't change anything) 65 void resetLightPos(float x, float y, float z); 66 void resetWaterPos(float x, float y, float z) { this->setWaterPos(x, y, z); this->calcVerts(); } 67 void resetWaterSize(float x, float z) { this->setWaterSize(x, z); this->calcVerts(); } 68 void resetWaterAngle(float angle) { this->setWaterAngle(angle); this->calcVerts(); } 64 69 void resetWaterColor(float r, float g, float b); 65 70 void resetShineSize(float shine); … … 67 72 void resetReflStrength(float strength); 68 73 void resetRefraction(float refraction); 69 void resetLightPos(float x, float y, float z);70 void resetWaterPos(float x, float y, float z) { this->setWaterPos(x, y, z); this->calcVerts(); }71 void resetWaterSize(float x, float z) { this->setWaterSize(x, z); this->calcVerts(); }72 void resetWaterAngle(float angle) { this->setWaterAngle(angle); this->calcVerts(); }73 74 74 // fade functions 75 // fade functions, hacky HACK 75 76 void fadeWaterColor(float r, float g, float b, float time) {this->newWaterColor = Vector(r, g, b); this->colorFadeTime = time; } 76 77 void fadeShininess(float shine, float time); … … 84 85 85 86 private: 87 Material mat; 88 Shader* shader; 89 90 // water size and position 86 91 float waterHeight; //!< position of the water 87 92 float waterVerts[8]; //!< coords of the 4 vertexes of the water quad 88 93 float xWidth, zWidth; //!< size of the water quad 89 Vector lightPos; //!< position of the light that is used to render the reflection90 94 float waterAngle; //!< defines how much the water will be turned around the point waterPos 91 Vector waterColor; //!< color of the water92 95 96 // values for texture size, scale, texture coords 93 97 float move; 94 98 float move2; … … 97 101 float normalUV; 98 102 float kNormalMapScale; 103 int textureSize; //!< height and width of the texture 104 105 // values for the uniforms 106 Vector waterColor; //!< color of the water 107 Vector lightPos; //!< position of the light that is used to render the reflection 99 108 float shineSize; //!< the bigger the value, the smaller the specular reflection point 100 109 float shineStrength; … … 102 111 float refraction; 103 112 104 int textureSize; //!< height and width of the texture 105 Material mat; 106 Shader* shader; 113 // uniforms 107 114 Shader::Uniform* cam_uni; //!< uniform that is used for the camera position 108 115 Shader::Uniform* light_uni; //!< uniform that is used for the light position … … 113 120 Shader::Uniform* reflStrength_uni; //!< uniform that is used for the strength of the reflection 114 121 115 122 // skirmish HACK 116 123 Vector newWaterColor; //!< used to fade the water color 117 124 float colorFadeTime;
Note: See TracChangeset
for help on using the changeset viewer.