2014-10-20 17:09:45 +00:00
|
|
|
#ifndef TERRAIN_HH_INCLUDED
|
|
|
|
#define TERRAIN_HH_INCLUDED
|
|
|
|
|
|
|
|
#include <string>
|
2014-11-08 00:17:23 +00:00
|
|
|
#include "material.hh"
|
2014-11-07 15:55:56 +00:00
|
|
|
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
|
2014-11-14 16:36:30 +00:00
|
|
|
#include "model.hh"
|
2015-03-17 11:08:49 +00:00
|
|
|
|
|
|
|
using namespace ACGL::OpenGL;
|
|
|
|
|
2014-10-20 17:09:45 +00:00
|
|
|
class Terrain {
|
|
|
|
public:
|
2015-02-27 15:01:59 +00:00
|
|
|
Terrain(std::string heightmapFilePath);
|
2014-11-08 00:17:23 +00:00
|
|
|
Terrain();
|
2014-10-20 17:09:45 +00:00
|
|
|
~Terrain();
|
|
|
|
void load();
|
|
|
|
void render();
|
2015-02-06 17:00:14 +00:00
|
|
|
float** getHeightmap();
|
2015-03-16 14:26:30 +00:00
|
|
|
int getHeightmapHeight();
|
|
|
|
int getHeightmapWidth();
|
2015-03-17 11:08:49 +00:00
|
|
|
SharedVertexArrayObject makeTriangleMesh(int startX, int startZ, int endX, int endZ);
|
2014-10-20 17:09:45 +00:00
|
|
|
private:
|
2014-11-08 00:17:23 +00:00
|
|
|
Material material;
|
2015-02-06 17:00:14 +00:00
|
|
|
std::string heightmapFilePath;
|
2015-03-16 14:26:30 +00:00
|
|
|
int heightmapHeight, heightmapWidth;
|
2015-02-13 12:46:41 +00:00
|
|
|
float** heightmap; //can be accessed like 'float[][]'
|
2015-03-16 14:26:30 +00:00
|
|
|
void set_abData(float* abData, int dataCount, int rowNum, int columnNum);
|
2014-10-20 17:09:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|