Changeset 6771 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 26, 2006, 2:39:31 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6766 r6771 85 85 } 86 86 87 /** 88 * @brief rebuilds the Grid below the WaterSurface, killing all hight information 89 * 90 * This should be called on all subGrid changes except wave and tick. 91 */ 87 92 void Water::rebuildGrid() 88 93 { … … 118 123 } 119 124 125 /** 126 * after this a rebuild() must be called 127 */ 120 128 void Water::setResolution(unsigned int resX, unsigned int resY) 121 129 { … … 124 132 } 125 133 134 /** 135 * after this a rebuild() must be called 136 */ 126 137 void Water::setSize(float sizeX, float sizeY) 127 138 { … … 136 147 137 148 149 /** 150 * @brief calculated the Position in the Grid, this Point is nearest to 151 * @param x, the x-position over the Grid 152 * @param z: the z-Position(or y) over the Grid 153 * @param row returns the row if not out of range 154 * @param column returns the column if not out of range 155 * @returns true if a valid point is found, false if any x or y are out of range 156 */ 138 157 bool Water::posToGridPoint(float x, float z, unsigned int& row, unsigned int& column) 139 158 { … … 152 171 void Water::draw() const 153 172 { 154 if (this->grid != NULL) 155 { 156 //SkyBox::enableCubeMap(); 157 WorldEntity::draw(); 158 glBindTexture(GL_TEXTURE_2D, 15); 159 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 160 161 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 162 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 163 glEnable(GL_TEXTURE_GEN_S); 164 glEnable(GL_TEXTURE_GEN_T); 165 166 glEnable(GL_BLEND); 173 assert (this->grid != NULL); 174 { 175 glMatrixMode(GL_MODELVIEW); 176 glPushMatrix(); 177 178 /* translate */ 179 glTranslatef (this->getAbsCoor ().x, 180 this->getAbsCoor ().y, 181 this->getAbsCoor ().z); 182 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 183 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 184 185 if (State::getSkyBox()) 186 { 187 glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_TOP)); 188 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 189 190 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 191 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 192 glEnable(GL_TEXTURE_GEN_S); 193 glEnable(GL_TEXTURE_GEN_T); 194 } 167 195 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 196 this->grid->draw(); 168 197 // this->waterShader->activateShader(); 169 198 // this->waterMaterial->select(); -
trunk/src/world_entities/skybox.h
r6634 r6771 12 12 /* INCLUDES */ 13 13 #include "world_entity.h" 14 #include "material.h" 14 15 15 /* FORWARD DECLARATION */ 16 class Material; 17 class Texture; 16 enum SKY_SIDE 17 { 18 SKY_TOP = 0, 19 SKY_BOTTOM, 20 SKY_LEFT, 21 SKY_RIGHT, 22 SKY_FRONT, 23 SKY_BACK 24 }; 18 25 19 26 //! A Class to handle a SkyBox … … 46 53 const char* right, const char* front, const char* back); 47 54 55 GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->getDiffuseTexture(): 0; }; 56 48 57 static void enableCubeMap(); 49 58 static void disableCubeMap();
Note: See TracChangeset
for help on using the changeset viewer.