Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2006, 3:16:46 PM (18 years ago)
Author:
stefalie
Message:

branches/water: activate/deactivate reflection/refraction functions added

File:
1 edited

Legend:

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

    r7675 r7687  
    1616#include "mapped_water.h"
    1717#include "util/loading/load_param.h"
     18#include "util/loading/factory.h"
     19#include "material.h"
     20
     21
     22CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
     23
    1824
    1925MappedWater::MappedWater(const TiXmlElement* root)
    2026{
    21 
     27  this->setClassID(CL_MAPPED_WATER, "MappedWater");
     28  this->toList(OM_ENVIRON);
     29 
    2230  if (root != NULL)
    2331    this->loadParams(root);
     
    2634MappedWater::~MappedWater()
    2735{
     36 
    2837}
    2938
     
    3241  WorldEntity::loadParams(root);
    3342
    34   LoadParam(root, "height", this, MappedWater, setHeight);
     43  LoadParam(root, "waterHeight", this, MappedWater, setHeight);
    3544}
    3645
     
    3847void MappedWater::draw() const
    3948{
     49  glPushMatrix();
     50 
     51  /*
     52  glTranslatef (this->getAbsCoor ().x,
     53                this->getAbsCoor ().y,
     54                this->getAbsCoor ().z);
     55  */
     56  glTranslatef(0,this->waterHeight,0);
    4057
     58  //glEnable(GL_LIGHTING);
     59
     60  Material mat;
     61  mat.setDiffuseMap("pictures/ground.tga", GL_TEXTURE_2D, 0);
     62  //mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 1);
     63  //mat.setTransparency(1.0);
     64  //mat.setDiffuse(1.0, 0, .1);
     65  mat.select();
     66
     67  glBegin(GL_QUADS);
     68    glNormal3f(0,1,0);
     69    glTexCoord2f(0,0);
     70    //glMultiTexCoord2f(GL_TEXTURE1, 0,0);
     71    glVertex3f(0,0,0);
     72    glTexCoord2f(1,0);
     73    //glMultiTexCoord2f(GL_TEXTURE1, 1,0);
     74    glVertex3f(100,0,0);
     75    glTexCoord2f(1,1);
     76    //glMultiTexCoord2f(GL_TEXTURE1, 1,1);
     77    glVertex3f(100,0,-100);
     78    glTexCoord2f(0,1);
     79    //glMultiTexCoord2f(GL_TEXTURE1, 0,1);
     80    glVertex3f(0,0,-100);
     81  glEnd();
     82
     83  glPopMatrix();
    4184}
    4285
     
    5093  this->waterHeight = height;
    5194}
     95
     96void MappedWater::activateReflection() {}
     97void MappedWater::deactivateReflection() {}
     98
     99void MappedWater::activateRefraction() {}
     100void MappedWater::deactivateRefraction() {}
Note: See TracChangeset for help on using the changeset viewer.