Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2006, 1:27:38 PM (18 years ago)
Author:
stefalie
Message:

water: cleanup… and hey: the mighty reflection is back :-)

Location:
branches/water/src/world_entities/environments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/water/src/world_entities/environments/mapped_water.cc

    r8617 r8622  
    3232  this->toList(OM_ENVIRON);
    3333
    34   // the NormalMapScale will be overwritten if its also set in the oxw file
     34  // those standardvalues will be overwritten if they're also set in the oxw file
     35  this->setWaterPos(0, 0, 0);
     36  this->setWaterSize(100, 100);
     37  this->setWaterUV(9);
     38  this->setWaterFlow(0.08);
     39  this->setLightPos(0, 10, 0);
     40  this->setWaterAngle(0);
    3541  this->setNormalMapScale(0.25f);
     42
    3643
    3744  if (root != NULL)
     
    178185  LoadParam(root, "waterpos", this, MappedWater, setWaterPos);
    179186  LoadParam(root, "watersize", this, MappedWater, setWaterSize);
    180   LoadParam(root, "lightpos", this, MappedWater, setLightPosition);
     187  LoadParam(root, "lightpos", this, MappedWater, setLightPos);
    181188  LoadParam(root, "wateruv", this, MappedWater, setWaterUV);
    182189  LoadParam(root, "waterflow", this, MappedWater, setWaterFlow);
    183190  LoadParam(root, "normalmapscale", this, MappedWater, setNormalMapScale);
     191  LoadParam(root, "waterangle", this, MappedWater, setWaterAngle);
    184192}
    185193
     
    193201  glPushMatrix();
    194202  glTranslatef(this->waterPos.x ,0 ,this->waterPos.z);
     203  glRotatef(this->waterAngle, 0, 1, 0);
    195204
    196205  mat.select();
  • branches/water/src/world_entities/environments/mapped_water.h

    r8617 r8622  
    33 *
    44*/
    5 /* example input in .oxw file
     5/* example input in .oxw file with the standard values
    66<MappedWater>
    7   <waterpos>-500,0,-500</waterpos>
    8   <watersize>1000,1000</watersize>
    9   <wateruv>10</wateruv>
    10   <waterflow>0.003</waterflow>
    11   <lightpos>100,150,100</lightpos>
    12 </MappedWater> */
     7  <waterpos>0,0,0</waterpos>
     8  <watersize>100,100</watersize>
     9  <wateruv>9</wateruv><!-- size of the waves -->
     10  <waterflow>0.08</waterflow>
     11  <lightpos>0,10,0</lightpos>
     12  <waterangle>0</waterangle>
     13  <normalmapscale>0.25</normalmapscale><!-- you won't see a big differnce if you change that -->
     14</MappedWater>
     15*/
    1316
    1417
     
    4144
    4245    // functions to set parameters for the water, usually they're called through loadparam
    43     void setLightPosition(float x, float y, float z) { this->lightPos = Vector(x,y,z); };
     46    void setLightPos(float x, float y, float z) { this->lightPos = Vector(x,y,z); };
    4447    void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); };
    4548    void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; };
     49    void setWaterAngle(float angle) { this->waterAngle = angle; };
    4650    void setWaterUV(float uv) { this->waterUV = uv; };
    4751    void setWaterFlow(float flow) { this->waterFlow = flow; };
     
    5559    float               xWidth, zWidth;             //!< size of the water quad
    5660    Vector              lightPos;                   //!< position of the light that is used to render the reflection
     61    float               waterAngle;                 //!< defines how much the water will be turned around the point waterPos
    5762
    5863    float               move;                       //!< textures coords, speeds, positions for the shaded textures....
Note: See TracChangeset for help on using the changeset viewer.