00001 #ifndef TERRAIN_H 00002 #define TERRAIN_H 00003 00004 #include "CGLA/Vec3f.h" 00005 #include "Renderable.h" 00006 00007 class Texture; 00008 00009 #include "GLSLShader.h" 00010 00011 using namespace CGLA; 00012 00013 class Terrain : public Renderable{ 00014 public: 00015 Terrain(); 00016 ~Terrain(); 00017 void render()const; 00018 00019 protected: 00020 Vec3f* vertices; 00021 unsigned int* indices; 00022 Texture* heightMap; 00023 Texture* alphaMap; 00024 Texture* textures[3]; 00025 int nbOfTriangles; 00026 GLSLShader terrainShader; 00027 00028 public : 00029 static const RTTI TYPE; 00030 virtual const RTTI& getType() const{ return TYPE; } 00031 00032 void setHeightMap(Texture * tex); 00033 void setTexture(int i , Texture* tex){ 00034 textures[i] = tex; 00035 } 00036 void setAlphaMap(Texture * tex){ 00037 alphaMap = tex; 00038 } 00039 }; 00040 00041 #endif 00042