added function that procedurally generates heightfield
[demo] / src / terrain.cc
1 #include "camera.h"
2 #include "image.h"
3 #include "scene.h"
4 #include "terrain.h"
5
6 Terrain::Terrain() {}
7
8 Terrain::~Terrain()
9 {
10 }
11
12 bool Terrain::generate(const TerrainParams &params)
13 {
14         // if(xsz <= 0 || ysz <=0) {
15         //      fprintf(stderr, "Invalid terrain size.\n");
16         //      return false;
17         // }
18
19         // if(xtiles <= 0 || ytiles <= 0) {
20         //      fprintf(stderr, "Invalid number of terrain tiles.\n");
21         //      return false;
22         // }
23
24         // if(tiles)
25         //      tiles.clear();
26
27         // int tsz = xtiles * ytiles;
28         // tiles.resize(tsz);
29
30         // for(int i=0; i<tsz; i++) {
31
32         // }
33         return true;
34 }
35
36 Scene *Terrain::get_visible(const Camera *camera) const
37 {
38         return 0;
39 }