Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 11, 2006, 2:11:16 PM (18 years ago)
Author:
bottac
Message:

Added Class Tile to HeightMap (allows a primitive LOD Implementation).

File:
1 edited

Legend:

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

    r6329 r6472  
    1616#include "vertex_array_model.h"
    1717
    18 #define sampleRate 4
    19 #define texRate   4
    20 #define texRatef   4.0f
     18
     19#define texRate      4
     20#define texRatef     4.0f
     21#define tileSize     64
    2122
    2223class SDL_Surface;
     
    2526class PNode;
    2627class Texture;
     28class HeightMap;
     29
     30class Tile
     31{
     32public:
     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};
    2751
    2852class HeightMap : public VertexArrayModel
    2953{
    3054public:
    31 
     55void draw();
    3256void load();
    3357void load(int Mode);
     
    4165~HeightMap();
    4266
     67friend class Tile;
    4368
    4469private:
     
    4772unsigned char* heights;
    4873unsigned char* colours;
     74
    4975void generateNormalVectorField();
    5076void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
    5177void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
    5278Vector  **  normalVectorField ;
     79Tile    ***  tiles;
    5380Vector     camCoords;
    5481Material * tmp_mat;
     
    7198 return val;
    7299}
    73 
     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}
    74108};
Note: See TracChangeset for help on using the changeset viewer.