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"
|
2014-10-20 17:09:45 +00:00
|
|
|
class Terrain {
|
|
|
|
public:
|
2014-11-07 12:11:06 +00:00
|
|
|
Terrain(std::string filePath);
|
2014-11-08 00:17:23 +00:00
|
|
|
Terrain();
|
2014-10-20 17:09:45 +00:00
|
|
|
~Terrain();
|
|
|
|
void load();
|
|
|
|
void render();
|
2014-11-14 16:36:30 +00:00
|
|
|
Model getModel();
|
|
|
|
float** getHeightmap();
|
|
|
|
unsigned int getHeightmapHeight();
|
|
|
|
unsigned int getHeightmapWidth();
|
|
|
|
|
2014-10-20 17:09:45 +00:00
|
|
|
private:
|
2014-11-08 00:17:23 +00:00
|
|
|
Material material;
|
2014-10-20 17:09:45 +00:00
|
|
|
std::string filePath;
|
2014-11-14 16:36:30 +00:00
|
|
|
unsigned int heightmapHeight, heightmapWidth;
|
2014-11-07 12:11:06 +00:00
|
|
|
float** heightmap; //can be accessed like 'float[][]'
|
2014-11-06 18:21:24 +00:00
|
|
|
bool heightmapChanged;
|
2014-11-07 12:11:06 +00:00
|
|
|
ACGL::OpenGL::SharedVertexArrayObject triangleMesh;
|
2014-11-06 18:21:24 +00:00
|
|
|
|
|
|
|
void makeTriangleMesh();
|
2014-11-14 16:36:30 +00:00
|
|
|
void set_abData(float* abData, unsigned int dataCount, unsigned int rowNum, unsigned int columnNum);
|
2014-10-20 17:09:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|