Changeset 6756 in orxonox.OLD for trunk/src/world_entities/environments
- Timestamp:
- Jan 26, 2006, 1:55:40 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6695 r6756 180 180 4 * this->grid->height(i, j); 181 181 this->velocities[i][j] += dt * this->viscosity * this->viscosity * u / this->height; 182 this->grid->height(i, j) += dt * this->velocities[i][j] ;182 this->grid->height(i, j) += dt * this->velocities[i][j] + dt * this->cohesion * u / this->height;; 183 183 } 184 184 } … … 194 194 this->grid->height(i,this->grid->columns()-1) = this->grid->height(i, this->grid->columns()-2); 195 195 } 196 /* // advect197 196 /* 197 for(j = 1; j < this->grid->rows() - 1; j++) { 198 198 for(i = 1; i < this->grid->columns() - 1; i++) { 199 199 this->grid->height(i, j) += dt * this->velocities[i][j]; 200 200 } 201 201 }*/ 202 // bound203 // unsigned int w = this->grid->columns - 1;204 // for(i = 0; i < this->grid->columns; i++) {205 // _map[i][0].u[1] = _map[i][1 ].u[1];206 // _map[i][w].u[1] = _map[i][w-1].u[1];207 // _map[0][i].u[1] = _map[1 ][i].u[1];208 // _map[w][i].u[1] = _map[w-1][i].u[1];209 // }210 211 // diffusion212 for(j = 1; j < this->grid->rows() - 1; j++)213 {214 for(i = 1; i < this->grid->columns() - 1 ; i++)215 {216 u = this->grid->height(i+1, j) + this->grid->height(i-1, j) +217 this->grid->height(i, j+1) + this->grid->height(i, j-1) -218 4* this->grid->height(i, j);219 this->grid->height(i,j) += dt * this->cohesion * u / this->height;220 }221 }222 202 223 203 // calc normals
Note: See TracChangeset
for help on using the changeset viewer.