Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 11, 2006, 5:18:15 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/height_map: copy the heightMap to the trunk_merge-branche

File:
1 edited

Legend:

Unmodified
Added
Removed
  • height_map_merge/src/lib/graphics/importer/height_map.h

    r6100 r6494  
    1414
    1515
    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
    1722
    1823class SDL_Surface;
    1924class Vector;
     25class Material;
     26class PNode;
     27class Texture;
     28class HeightMap;
    2029
    21 class HeightMap : public StaticModel
     30class Tile
    2231{
    2332public:
     33void draw();
     34void drawHighRes();
     35void drawLowRes();
     36int getRes();
     37int setHighRes(bool b);
     38Tile(int i1, int j1, int i2, int j2, HeightMap* hm ) ;
     39Tile();
     40~Tile();
     41
     42
     43
     44private:
     45VertexArrayModel* highResModel;
     46VertexArrayModel* lowResModel;
     47int highRes;
     48int lowRes;
     49void load(int i1, int j1, int i2, int i2, HeightMap* hm, VertexArrayModel* model, int Res);
     50};
     51
     52class HeightMap : public VertexArrayModel
     53{
     54public:
     55void draw();
    2456void load();
    25 void load(const char*, int);
     57void load(int Mode);
     58void load(const char*, int Mode);
     59void scale( Vector V);
     60void shift (Vector V);
     61float getHeight(float x, float y);
    2662HeightMap();
    2763HeightMap(const char*);
     64HeightMap(const char*, const char*);
    2865~HeightMap();
     66
     67friend class Tile;
    2968
    3069private:
    3170SDL_Surface* heightMap;
     71SDL_Surface* colourMap;
     72unsigned char* heights;
     73unsigned char* colours;
    3274
     75void generateNormalVectorField();
     76void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
     77void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
     78Vector  **  normalVectorField ;
     79Tile    ***  tiles;
     80Vector     camCoords;
     81Material * tmp_mat;
     82Material* red_mat;
     83Texture* texture;
     84const PNode* camera;
     85float scaleX ;
     86float scaleY ;
     87float scaleZ ;
     88float shiftX ;
     89float shiftY ;
     90float shiftZ ;
     91int   cmScaleX;
     92int   cmScaleY;
     93bool  hasColourMap;
     94
     95inline int abs(int val)
     96{
     97 if(val < 0) val = -val;
     98 return val;
     99}
     100inline int max(int x, int y)
     101{
     102 return (x>y)? x:y;
     103}
     104inline int min(int x, int y)
     105{
     106return (x<y)? x: y;
     107}
    33108};
Note: See TracChangeset for help on using the changeset viewer.