Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7466 in orxonox.OLD


Ignore:
Timestamp:
May 1, 2006, 10:43:09 PM (18 years ago)
Author:
patrick
Message:

orxonox: reformat of the height_map.h header file.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r7221 r7466  
    1111   ### File Specific:
    1212   main-programmer: bottac@ee.ethz.ch
     13
     14   review: patrick boenzli, patrick@orxonox.ethz.ch
    1315*/
    1416
     
    2830class HeightMap;
    2931
     32
     33//!< one part of the height map
    3034class Tile
    3135{
    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 virtual ~Tile();
     36  public:
     37    Tile();
     38    Tile(int i1, int j1, int i2, int j2, HeightMap* hm) ;
     39    virtual ~Tile();
     40
     41    int getRes();
     42    int setHighRes(bool b);
     43
     44    void draw();
     45    void drawHighRes();
     46    void drawLowRes();
    4347
    4448
     49  private:
     50    void load(int i1, int j1, int i2, int i2, HeightMap* hm, VertexArrayModel* model, int Res);
    4551
    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);
     52
     53  public:
     54    float x;
     55    float z;
     56
     57
     58  private:
     59    HeightMap*                                 hmref;                             //!<
     60    VertexArrayModel*                          highResModel;                      //!<
     61    VertexArrayModel*                          lowResModel;                       //!<
     62    int                                        highRes;                           //!<
     63    int                                        lowRes;                            //!<
    5364};
    5465
     66
     67//!< the height map representation itself
    5568class HeightMap : public VertexArrayModel
    5669{
    57 public:
    58 void draw();
    59 void load();
    60 void load(int Mode);
    61 void load(const std::string&, 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);
    66 HeightMap();
    67 HeightMap(const std::string&);
    68 HeightMap(const std::string&, const std::string&);
    69 virtual ~HeightMap();
     70  friend class Tile;
    7071
    71 friend class Tile;
     72  public:
     73    HeightMap();
     74    HeightMap(const std::string&);
     75    HeightMap(const std::string&, const std::string&);
     76    virtual ~HeightMap();
    7277
    73 private:
    74 SDL_Surface* heightMap;
    75 SDL_Surface* colourMap;
    76 unsigned char* heights;
    77 unsigned char* colours;
     78    void setAbsCoor(Vector V);
     79    float getHeight(float x, float y);
     80    float getNormal(float x, float y);
    7881
    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;
     82    void load();
     83    void load(int Mode);
     84    void load(const std::string&, int Mode);
     85    void scale( Vector V);
    10286
    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 }
     87    void draw();
     88
     89
     90  private:
     91    void generateNormalVectorField();
     92    void drawRect(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight );
     93    void fixBoarder(int xBottomLeft, int yBottomLeft, int xTopRight, int yTopRight);
     94
     95    /** helper function absolute value @param val value*/
     96    inline int abs(int val) { return (val<0)?-val:val; }
     97    /** returns the max of two numbers @param x value 1 @param y value 2*/
     98    inline int max(int x, int y) { return (x>y)? x:y; }
     99    /** returns the min of two numbers @param x value 1 @param y value 2*/
     100    inline int min(int x, int y) { return (x<y)? x: y; }
     101
     102
     103  private:
     104    SDL_Surface*                          heightMap;
     105    SDL_Surface*                          colourMap;
     106    unsigned char*                        heights;
     107    unsigned char*                        colours;
     108
     109    Vector**                              normalVectorField;
     110    Tile***                               tiles;
     111    Vector                                camCoords;
     112    Vector                                offsetCoords;
     113    Material*                             tmp_mat;
     114    Material*                             red_mat;
     115    Texture*                              texture;
     116    const PNode*                          camera;
     117
     118    float                                 scaleX ;
     119    float                                 scaleY ;
     120    float                                 scaleZ ;
     121    float                                 shiftX ; // to be removed
     122    float                                 shiftY ; // to be removed
     123    float                                 shiftZ ; // to be removed
     124    float                                 offsetX;
     125    float                                 offsetY;
     126    float                                 offsetZ;
     127    int                                   cmScaleX;
     128    int                                   cmScaleY;
     129    bool                                  hasColourMap;
    116130};
  • trunk/src/story_entities/game_world_data.cc

    r7462 r7466  
    382382    PRINTF(2)("creating %s\n", element->Value());
    383383    BaseObject* created = Factory::fabricate(element);
    384     if (created != NULL /*&& created->isA(CL_GAME_RULES)*/)
     384    if (created != NULL && created->isA(CL_GAME_RULES))
    385385    {
    386386      this->gameRule = dynamic_cast<GameRules*>(created);
  • trunk/src/util/kill_target.cc

    r7464 r7466  
    6161
    6262MissionState KillTarget::checkMissionGoal(float dt)
    63 {}
     63{
    6464
     65}
     66
     67
     68
     69
     70
Note: See TracChangeset for help on using the changeset viewer.