Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6456 in orxonox.OLD


Ignore:
Timestamp:
Jan 10, 2006, 12:09:58 AM (18 years ago)
Author:
bensch
Message:

Water draws itself

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/vertex_array_model.cc

    r6453 r6456  
    264264      for (j = 0; j < resolutionX; j++)
    265265        {
    266           this->addVertex((float)i - (float)sizeY/2.0, 0.0, (float)j - (float)sizeX/2.0);
     266          this->addVertex(((float)i - (float)resolutionY/2.0)*sizeY, 0.0, ((float)j - (float)resolutionX/2.0)*sizeX);
    267267          this->addNormal(0.0, 1, 0.0);
    268268          this->addTexCoor((float)i/(float)resolutionY, (float)j/(float)resolutionY);
  • trunk/src/world_entities/environments/water.cc

    r6455 r6456  
    2929Water::Water(const TiXmlElement* root)
    3030{
     31  this->setClassID(CL_WATER, "Water");
     32  this->toList(OM_ENVIRON_NOTICK);
     33
    3134  this->resX = this->resY = 10;
    3235  this->sizeX = this->sizeY = 1.0;
     
    3538  if (root != NULL)
    3639    this->loadParams(root);
     40
     41  this->rebuildGrid();
    3742}
    3843
    3944Water::~Water()
    4045{
     46  delete this->grid;
    4147
    4248}
     
    6167  this->grid = new Grid(this->sizeX, this->sizeY, this->resX, this->resY);
    6268
     69  this->setModel(this->grid, 0);
    6370}
    6471
     
    7178void Water::setSize(float sizeX, float sizeY)
    7279{
     80  printf("%f %f\n", sizeX, sizeY);
     81
    7382  this->sizeX = sizeX;
    7483  this->sizeY = sizeY;
    7584}
    7685
     86
     87void Water::tick(float dt)
     88{
     89
     90}
  • trunk/src/world_entities/environments/water.h

    r6455 r6456  
    3030   void rebuildGrid();
    3131
     32   void tick(float dt);
     33
    3234  private:
    3335    Grid*           grid;            //!< The water-surface-model to render with
Note: See TracChangeset for help on using the changeset viewer.