Changeset 6956 in orxonox.OLD for trunk/src/lib/graphics/importer/height_map.h
- Timestamp:
- Feb 1, 2006, 4:37:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/height_map.h
r6100 r6956 10 10 11 11 ### File Specific: 12 main-programmer: 12 main-programmer: bottac@ee.ethz.ch 13 13 */ 14 14 15 15 16 #include "static_model.h" 16 #include "vertex_array_model.h" 17 18 19 #define texRate 32 20 #define texRatef 4.0f 21 #define tileSize 64 17 22 18 23 class SDL_Surface; 19 24 class Vector; 25 class Material; 26 class PNode; 27 class Texture; 28 class HeightMap; 20 29 21 class HeightMap : public StaticModel30 class Tile 22 31 { 23 32 public: 33 void draw(); 34 void drawHighRes(); 35 void drawLowRes(); 36 int getRes(); 37 int setHighRes(bool b); 38 Tile(int i1, int j1, int i2, int j2, HeightMap* hm ) ; 39 Tile(); 40 float x; 41 float z; 42 ~Tile(); 43 44 45 46 private: 47 HeightMap* hmref; 48 VertexArrayModel* highResModel; 49 VertexArrayModel* lowResModel; 50 int highRes; 51 int lowRes; 52 void load(int i1, int j1, int i2, int i2, HeightMap* hm, VertexArrayModel* model, int Res); 53 }; 54 55 class HeightMap : public VertexArrayModel 56 { 57 public: 58 void draw(); 24 59 void load(); 25 void load(const char*, int); 60 void load(int Mode); 61 void load(const char*, int Mode); 62 void scale( Vector V); 63 void setAbsCoor(Vector V); 64 float getHeight(float x, float y); 65 float getNormal(float x, float y); 26 66 HeightMap(); 27 67 HeightMap(const char*); 68 HeightMap(const char*, const char*); 28 69 ~HeightMap(); 70 71 friend class Tile; 29 72 30 73 private: 31 74 SDL_Surface* heightMap; 75 SDL_Surface* colourMap; 76 unsigned char* heights; 77 unsigned char* colours; 32 78 79 void generateNormalVectorField(); 80 void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight ); 81 void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight); 82 Vector ** normalVectorField ; 83 Tile *** tiles; 84 Vector camCoords; 85 Vector offsetCoords; 86 Material * tmp_mat; 87 Material* red_mat; 88 Texture* texture; 89 const PNode* camera; 90 float scaleX ; 91 float scaleY ; 92 float scaleZ ; 93 float shiftX ; // to be removed 94 float shiftY ; // to be removed 95 float shiftZ ; // to be removed 96 float offsetX; 97 float offsetY; 98 float offsetZ; 99 int cmScaleX; 100 int cmScaleY; 101 bool hasColourMap; 102 103 inline int abs(int val) 104 { 105 if(val < 0) val = -val; 106 return val; 107 } 108 inline int max(int x, int y) 109 { 110 return (x>y)? x:y; 111 } 112 inline int min(int x, int y) 113 { 114 return (x<y)? x: y; 115 } 33 116 };
Note: See TracChangeset
for help on using the changeset viewer.