Changeset 6494 in orxonox.OLD for height_map_merge/src/lib/graphics/importer/height_map.h
- Timestamp:
- Jan 11, 2006, 5:18:15 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
height_map_merge/src/lib/graphics/importer/height_map.h
r6100 r6494 14 14 15 15 16 #include "static_model.h" 16 #include "vertex_array_model.h" 17 18 19 #define texRate 4 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 ~Tile(); 41 42 43 44 private: 45 VertexArrayModel* highResModel; 46 VertexArrayModel* lowResModel; 47 int highRes; 48 int lowRes; 49 void load(int i1, int j1, int i2, int i2, HeightMap* hm, VertexArrayModel* model, int Res); 50 }; 51 52 class HeightMap : public VertexArrayModel 53 { 54 public: 55 void draw(); 24 56 void load(); 25 void load(const char*, int); 57 void load(int Mode); 58 void load(const char*, int Mode); 59 void scale( Vector V); 60 void shift (Vector V); 61 float getHeight(float x, float y); 26 62 HeightMap(); 27 63 HeightMap(const char*); 64 HeightMap(const char*, const char*); 28 65 ~HeightMap(); 66 67 friend class Tile; 29 68 30 69 private: 31 70 SDL_Surface* heightMap; 71 SDL_Surface* colourMap; 72 unsigned char* heights; 73 unsigned char* colours; 32 74 75 void generateNormalVectorField(); 76 void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight ); 77 void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight); 78 Vector ** normalVectorField ; 79 Tile *** tiles; 80 Vector camCoords; 81 Material * tmp_mat; 82 Material* red_mat; 83 Texture* texture; 84 const PNode* camera; 85 float scaleX ; 86 float scaleY ; 87 float scaleZ ; 88 float shiftX ; 89 float shiftY ; 90 float shiftZ ; 91 int cmScaleX; 92 int cmScaleY; 93 bool hasColourMap; 94 95 inline int abs(int val) 96 { 97 if(val < 0) val = -val; 98 return val; 99 } 100 inline int max(int x, int y) 101 { 102 return (x>y)? x:y; 103 } 104 inline int min(int x, int y) 105 { 106 return (x<y)? x: y; 107 } 33 108 };
Note: See TracChangeset
for help on using the changeset viewer.