-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTerrain.h
64 lines (54 loc) · 984 Bytes
/
Terrain.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <math.h>
#include <string>
#include <sstream>
#include <iostream>
#include "SkyBox.h"
#include "RawLoader.h"
#include "Shapes.h"
class Vert{
public:
float x;
float y;
float z;
};
class TexCoord {
public:
float u;
float v;
};
class Normal {
public:
float x;
float y;
float z;
};
class Terrain {
private:
unsigned int hmHeight;
unsigned int hmWidth;
unsigned int terrainList;
unsigned int tID[2];
unsigned int vhVBOVertices;
unsigned int vhVBOTexCoords;
unsigned int vhVBONormals;
int vertexCount;
bool loaded;
GLuint complexity;
GLubyte hHeightField[1024][1024];
GLubyte texture[1024][1024];
Vert *vertices;
TexCoord *texCoords;
Normal *normals;
public:
Terrain(void);
void Display();
void Init();
void DrawDots(void);
void IncreaseComplexity(void);
void DecreaseComplexity(void);
float GetHeightAt(unsigned int x, unsigned int z);
GLuint GetComplexity(void);
};