28 lines
615 B
C++
28 lines
615 B
C++
#ifndef TERRAIN_HH_INCLUDED
|
|
#define TERRAIN_HH_INCLUDED
|
|
|
|
#include <string>
|
|
#include "texture.hh"
|
|
#include <fstream>
|
|
#include "extern/bullet/src/BulletDynamics/Dynamics/btRigidBody.h"
|
|
|
|
class Terrain {
|
|
public:
|
|
Terrain(std::string filePath);
|
|
Terrain();
|
|
~Terrain();
|
|
void load();
|
|
void render();
|
|
private:
|
|
Texture texture;
|
|
std::string filePath;
|
|
unsigned int heightmapWidth, heightmapHeight;
|
|
float** heightmap; //can be accessed like 'float[][]'
|
|
bool heightmapChanged;
|
|
ACGL::OpenGL::SharedVertexArrayObject triangleMesh;
|
|
|
|
void makeTriangleMesh();
|
|
};
|
|
|
|
#endif
|