9 // terrain 8a ftiaxnei skini k taisma renderer
17 /* parameters needed in terrain generation */
19 struct TerrainParams {
20 float xsz; /* terrain size in x axis */
21 float ysz; /* terrain size in y axis */
22 float max_height; /* max height of the heightfield */
23 int xtiles; /* number of tiles in x axis */
24 int ytiles; /* number of tiles in y axis */
27 int num_octaves; /* Perlin noise sums */
28 float noise_freq; /* Perlin noise scaling factor */
29 Image coarse_heightmap; /* mask for low detail heightmap */
35 mutable Scene *vis_scene; /* set of visible tiles returned by get_visible */
37 std::vector<TerrainTile> tiles;
48 bool generate(const TerrainParams ¶ms);
49 Scene *get_visible(const Camera *camera) const;
51 float get_height(float u, float v) const;
52 float get_height(const Vec3 &pos) const; /* world coordinates */