Changeset 7687 in orxonox.OLD for branches/water/src/world_entities/environments
- Timestamp:
- May 18, 2006, 3:16:46 PM (19 years ago)
- Location:
- branches/water/src/world_entities/environments
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/world_entities/environments/mapped_water.cc
r7675 r7687 16 16 #include "mapped_water.h" 17 17 #include "util/loading/load_param.h" 18 #include "util/loading/factory.h" 19 #include "material.h" 20 21 22 CREATE_FACTORY(MappedWater, CL_MAPPED_WATER); 23 18 24 19 25 MappedWater::MappedWater(const TiXmlElement* root) 20 26 { 21 27 this->setClassID(CL_MAPPED_WATER, "MappedWater"); 28 this->toList(OM_ENVIRON); 29 22 30 if (root != NULL) 23 31 this->loadParams(root); … … 26 34 MappedWater::~MappedWater() 27 35 { 36 28 37 } 29 38 … … 32 41 WorldEntity::loadParams(root); 33 42 34 LoadParam(root, " height", this, MappedWater, setHeight);43 LoadParam(root, "waterHeight", this, MappedWater, setHeight); 35 44 } 36 45 … … 38 47 void MappedWater::draw() const 39 48 { 49 glPushMatrix(); 50 51 /* 52 glTranslatef (this->getAbsCoor ().x, 53 this->getAbsCoor ().y, 54 this->getAbsCoor ().z); 55 */ 56 glTranslatef(0,this->waterHeight,0); 40 57 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(); 41 84 } 42 85 … … 50 93 this->waterHeight = height; 51 94 } 95 96 void MappedWater::activateReflection() {} 97 void MappedWater::deactivateReflection() {} 98 99 void MappedWater::activateRefraction() {} 100 void MappedWater::deactivateRefraction() {} -
branches/water/src/world_entities/environments/mapped_water.h
r7672 r7687 20 20 void loadParams(const TiXmlElement* root); 21 21 22 void activateReflection(); 23 void deactivateReflection(); 24 25 void activateRefraction(); 26 void deactivateRefraction(); 27 22 28 void draw() const; 23 29 void tick(float dt);
Note: See TracChangeset
for help on using the changeset viewer.