Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6756 in orxonox.OLD for trunk/src/world_entities/environments


Ignore:
Timestamp:
Jan 26, 2006, 1:55:40 AM (18 years ago)
Author:
bensch
Message:

trunk: Burst Particles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/environments/water.cc

    r6695 r6756  
    180180           4 * this->grid->height(i, j);
    181181      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;;
    183183    }
    184184  }
     
    194194    this->grid->height(i,this->grid->columns()-1) = this->grid->height(i, this->grid->columns()-2);
    195195  }
    196   /*  // advect
    197     for(j = 1; j < this->grid->rows() - 1; j++) {
     196  /*
     197  for(j = 1; j < this->grid->rows() - 1; j++) {
    198198      for(i = 1; i < this->grid->columns() - 1; i++) {
    199199        this->grid->height(i, j) += dt * this->velocities[i][j];
    200200      }
    201201    }*/
    202   // bound
    203   //   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   // diffusion
    212   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   }
    222202
    223203  // calc normals
Note: See TracChangeset for help on using the changeset viewer.