Changeset 6519 in orxonox.OLD for trunk/src/world_entities/environments
- Timestamp:
- Jan 18, 2006, 12:38:19 AM (19 years ago)
- File:
-
- 1 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 }
Note: See TracChangeset
for help on using the changeset viewer.