Changeset 6519 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 18, 2006, 12:38:19 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6518 r6519 46 46 this->velocities = NULL; 47 47 this->viscosity = 5; 48 this->cohesion = .0000 2;48 this->cohesion = .00000001; 49 49 50 50 if (root != NULL) … … 55 55 this->waterShader = (Shader*)ResourceManager::getInstance()->load("shaders/water.vert", SHADER, RP_GAME, (void*)"shaders/water.frag"); 56 56 57 this->grid->height(this->grid->columns()/2,this->grid->rows()/2) = 100 0;57 this->grid->height(this->grid->columns()/2,this->grid->rows()/2) = 100; 58 58 } 59 59 … … 185 185 186 186 // calc normals 187 /* float l[3]; 188 float m[3]; 189 for(j = 1; j < _width-1; j++) { 190 for(i = 1; i < _width - 1; i++) { 191 l[0] = _map[i][j-1].u[0] - _map[i][j+1].u[0]; 192 l[1] = _map[i][j-1].u[1] - _map[i][j+1].u[1]; 193 l[2] = _map[i][j-1].u[2] - _map[i][j+1].u[2]; 194 m[0] = _map[i-1][j].u[0] - _map[i+1][j].u[0]; 195 m[1] = _map[i-1][j].u[1] - _map[i+1][j].u[1]; 196 m[2] = _map[i-1][j].u[2] - _map[i+1][j].u[2]; 197 _map[i][j].n[0] = l[1]*m[2]-l[2]*m[1]; 198 _map[i][j].n[1] = l[2]*m[0]-l[0]*m[2]; 199 _map[i][j].n[2] = l[0]*m[1]-l[1]*m[0]; 200 } 201 }*/ 202 } 187 // float l[3]; 188 // float m[3]; 189 // for(j = 1; j < this->grid->rows() -1; j++) { 190 // for(i = 1; i < this->grid->columns() - 1; i++) { 191 // l[0] = this->grid->vertexG(i, j-1).x - this->grid->vertexG(i, j+1).x; 192 // l[1] = this->grid->vertexG(i, j-1).y - this->grid->vertexG(i, j+1).y; 193 // l[2] = this->grid->vertexG(i, j-1).z - this->grid->vertexG(i, j+1).z; 194 // m[0] = this->grid->vertexG(i-1,j).x - this->grid->vertexG(i+1, j).x; 195 // m[1] = this->grid->vertexG(i-1,j).y - this->grid->vertexG(i+1, j).y; 196 // m[2] = this->grid->vertexG(i-1,j).z - this->grid->vertexG(i+1, j).z; 197 // this->grid->normalG(i, j).x = l[1] * m[2] - l[2] * m[1]; 198 // this->grid->normalG(i, j).y = l[2] * m[0] - l[0] * m[2]; 199 // this->grid->normalG(i, j).z = l[0] * m[1] - l[1] * m[0]; 200 // } 201 // } 202 this->grid->rebuildNormals(this->height); 203 } -
trunk/src/world_entities/skybox.cc
r6512 r6519 81 81 this->material[i]->setAmbient(2.0, 2.0, 2.0); 82 82 83 this-> texture[i] = NULL;83 this->cubeTexture[i] = NULL; 84 84 } 85 85 this->setParentMode(PNODE_MOVEMENT); … … 166 166 const char* right, const char* front, const char* back) 167 167 { 168 this-> texture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB);169 this-> texture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB);170 this-> texture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB);171 this-> texture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB);172 this-> texture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB);173 this-> texture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB);168 this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB); 169 this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB); 170 this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB); 171 this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB); 172 this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB); 173 this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB); 174 174 } 175 175 … … 177 177 { 178 178 glEnable(GL_TEXTURE_CUBE_MAP_ARB); 179 glEnable(GL_TEXTURE_2D); 179 180 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); 180 181 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); … … 188 189 { 189 190 glDisable(GL_TEXTURE_CUBE_MAP_ARB); 191 glDisable(GL_TEXTURE_2D); 190 192 glDisable(GL_TEXTURE_GEN_S); 191 193 glDisable(GL_TEXTURE_GEN_T); -
trunk/src/world_entities/skybox.h
r6512 r6519 57 57 58 58 Material* material[6]; //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back 59 Texture* texture[6];//!< Textures for the CubeMap.59 Texture* cubeTexture[6]; //!< Textures for the CubeMap. 60 60 61 61 float size; //!< Size of the SkyBox. This should match the frustum maximum range.
Note: See TracChangeset
for help on using the changeset viewer.