X-Git-Url: http://git.mutantstargoat.com?p=demo;a=blobdiff_plain;f=src%2Fterrain.h;h=f2ecd693d8ead7afd2134f4fd3386bdba994476e;hp=d6f4844c1f9618c2f0a8bc2a3d68706ae87f365e;hb=197f20b5d4db937029f7b585be23ee7fe5da66dc;hpb=dd0aabd3aed66f9c5d25a9e8bcbbb07c7f886085 diff --git a/src/terrain.h b/src/terrain.h index d6f4844..f2ecd69 100644 --- a/src/terrain.h +++ b/src/terrain.h @@ -1,6 +1,44 @@ #ifndef TERRAIN_H_ #define TERRAIN_H_ +class Camera; +class Image; +class Scene; +// terrain 8a ftiaxnei skini k taisma renderer +class TerrainTile { +private: + Mesh *mesh; + +}; + +/* parameters needed in terrain generation */ + +struct TerrainParams { + float xsz; /* terrain size in x axis */ + float ysz; /* terrain size in y axis */ + float max_height; /* max height of the heightfield */ + int xtiles; /* number of tiles in x axis */ + int ytiles; /* number of tiles in y axis */ + int tile_usub; + int tile_vsub; + int num_octaves; /* Perlin noise sums */ + Image *coarse_heightmap; /* mask for low detail heightmap */ +}; + +class Terrain { +private: + TerrainParams params; + mutable Scene *vis_scene; /* set of visible tiles returned by get_visible */ + + std::vector tiles; + +public: + Terrain(); + ~Terrain(); + + bool generate(const TerrainParams ¶ms); + Scene *get_visible(const Camera *camera) const; +}; #endif // TERRAIN_H_ \ No newline at end of file