X-Git-Url: http://git.mutantstargoat.com?p=demo;a=blobdiff_plain;f=src%2Fterrain.h;h=db9464dffea1d2307debb0c7453360ca7e347d75;hp=bf9df09d5b4591a9c2a93dfd958e9f9bed2c66b7;hb=0d3454cbd5e803b8dea601110d403cd5563df9be;hpb=fd601d4218b63fdf92c5e4dfa32eac8adbda82fa diff --git a/src/terrain.h b/src/terrain.h index bf9df09..db9464d 100644 --- a/src/terrain.h +++ b/src/terrain.h @@ -1,8 +1,9 @@ #ifndef TERRAIN_H_ #define TERRAIN_H_ +#include "image.h" + class Camera; -class Image; class Scene; // terrain 8a ftiaxnei skini k taisma renderer @@ -25,7 +26,7 @@ struct TerrainParams { int tile_vsub; int num_octaves; /* Perlin noise sums */ float noise_freq; /* Perlin noise scaling factor */ - Image *coarse_heightmap; /* mask for low detail heightmap */ + Image coarse_heightmap; /* mask for low detail heightmap */ }; class Terrain { @@ -46,6 +47,9 @@ public: bool generate(const TerrainParams ¶ms); Scene *get_visible(const Camera *camera) const; + + float get_height(float u, float v) const; + float get_height(const Vec3 &pos) const; /* world coordinates */ }; #endif // TERRAIN_H_ \ No newline at end of file