Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6956 in orxonox.OLD for trunk/src/lib/graphics/importer/height_map.h


Ignore:
Timestamp:
Feb 1, 2006, 4:37:08 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the HeightMapBranche back to the trunk

File:
1 edited

Legend:

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

    r6100 r6956  
    1010
    1111   ### File Specific:
    12    main-programmer:
     12   main-programmer: bottac@ee.ethz.ch
    1313*/
    1414
    1515
    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
    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();
     40float x;
     41float z;
     42~Tile();
     43
     44
     45
     46private:
     47HeightMap* hmref;
     48VertexArrayModel* highResModel;
     49VertexArrayModel* lowResModel;
     50int highRes;
     51int lowRes;
     52void load(int i1, int j1, int i2, int i2, HeightMap* hm, VertexArrayModel* model, int Res);
     53};
     54
     55class HeightMap : public VertexArrayModel
     56{
     57public:
     58void draw();
    2459void load();
    25 void load(const char*, int);
     60void load(int Mode);
     61void load(const char*, int Mode);
     62void scale( Vector V);
     63void setAbsCoor(Vector V);
     64float getHeight(float x, float y);
     65float getNormal(float x, float y);
    2666HeightMap();
    2767HeightMap(const char*);
     68HeightMap(const char*, const char*);
    2869~HeightMap();
     70
     71friend class Tile;
    2972
    3073private:
    3174SDL_Surface* heightMap;
     75SDL_Surface* colourMap;
     76unsigned char* heights;
     77unsigned char* colours;
    3278
     79void generateNormalVectorField();
     80void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
     81void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
     82Vector  **  normalVectorField ;
     83Tile    ***  tiles;
     84Vector    camCoords;
     85Vector offsetCoords; 
     86Material * tmp_mat;
     87Material* red_mat;
     88Texture* texture;
     89const PNode* camera;
     90float scaleX ;
     91float scaleY ;
     92float scaleZ ;
     93float shiftX ; // to be removed
     94float shiftY ; // to be removed
     95float shiftZ ; // to be removed
     96float offsetX;
     97float offsetY;
     98float offsetZ;
     99int   cmScaleX;
     100int   cmScaleY;
     101bool  hasColourMap;
     102
     103inline int abs(int val)
     104{
     105 if(val < 0) val = -val;
     106 return val;
     107}
     108inline int max(int x, int y)
     109{
     110 return (x>y)? x:y;
     111}
     112inline int min(int x, int y)
     113{
     114return (x<y)? x: y;
     115}
    33116};
Note: See TracChangeset for help on using the changeset viewer.