Advertisement
Guest User

Untitled

a guest
Oct 27th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #ifndef TERRAIN_H
  2. #define TERRAIN_H
  3.  
  4. #include "vec3D.h"
  5.  
  6. class Terrain
  7. {
  8. public:
  9.     Terrain(int width, int height);
  10.     ~Terrain();
  11.  
  12.     void setHeight(int x, int z, float y);
  13.  
  14.     int width()  { return _width;  }
  15.     int length() { return _length; }
  16.     float getHeight(int x, int z) { return heights[z][x]; }
  17.  
  18.     void computeNormals();
  19.  
  20.     vec3D getNormals(int x, int z);
  21.  
  22. private:
  23.     int _width;
  24.     int _length;
  25.     float** heights;
  26.     vec3D** normals;
  27.     bool computedNormals;
  28. };
  29.  
  30. #endif // TERRAIN_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement