Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8477 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 15, 2006, 4:08:15 PM (18 years ago)
Author:
stefalie
Message:

water: widths of the water quad are saved in the xml file

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

Legend:

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

    r8473 r8477  
    151151  WorldEntity::loadParams(root);
    152152
    153   LoadParam(root, "waterPos", this, MappedWater, setWaterPos);
    154   LoadParam(root, "lightPos", this, MappedWater, setLightPosition);
     153  LoadParam(root, "waterpos", this, MappedWater, setWaterPos);
     154  LoadParam(root, "watersize", this, MappedWater, setWaterSize);
     155  LoadParam(root, "lightpos", this, MappedWater, setLightPosition);
    155156}
    156157
     
    183184  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                       // DUDV map texture
    184185  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                       // Depth texture
    185   glVertex3f(0.0f, waterPos.y, 0.0f);
     186  glVertex3f(0.0f, this->waterPos.y, 0.0f);
    186187
    187188  // The front left vertice for the water
     
    193194  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
    194195  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
    195   glVertex3f(0.0f, waterPos.y, 1000.0f);
     196  glVertex3f(0.0f, this->waterPos.y, this->zWidth);
    196197
    197198  // The front right vertice for the water
     
    203204  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
    204205  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
    205   glVertex3f(1000.0f, waterPos.y, 1000.0f);
     206  glVertex3f(this->xWidth, this->waterPos.y, this->zWidth);
    206207
    207208  // The back right vertice for the water
     
    213214  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
    214215  //glMultiTexCoord2f(GL_TEXTURE4, 0, 0);                        // Depth texture
    215   glVertex3f(1000.0f, waterPos.y, 0.0f);
     216  glVertex3f(this->xWidth, this->waterPos.y, 0.0f);
    216217  glEnd();
    217218
  • branches/water/src/world_entities/environments/mapped_water.h

    r8473 r8477  
    3434    void setLightPosition(float x, float y, float z) { this->lightPos = Vector(x,y,z); };
    3535    void setWaterPos(float x, float y, float z) { this->waterPos = Vector(x,y,z); };
     36    void setWaterSize(float x, float z) { this->xWidth = x; this->zWidth = z; };
    3637
    3738  private:
    3839    Vector              waterPos;                   //!< position of the water
     40    float               xWidth, zWidth;             //!< size of the water quad
    3941    Vector              lightPos;                   //!< position of the light that is used to render the reflection
    4042
Note: See TracChangeset for help on using the changeset viewer.