6#include <glm/gtc/matrix_transform.hpp>
7#include <glm/gtc/type_ptr.hpp>
10#include "../rendering/texture.h"
11#include "../rendering/shaderProgram.h"
12#include "../rendering/vao.h"
13#include "../rendering/buffer.h"
14#include "../rendering/camera.h"
16#include "texManager.h"
18#include "../utils/bbox.h"
31 std::vector<glm::vec2>
uvs;
58 Terrain(TexturePtr
heightMap,
int numVertices = 200,
const float xzScale = 50.f,
const float yScale = 10.f,
59 TexturePtr
diffuseMap =
nullptr, TexturePtr
normalMap =
nullptr, TexturePtr roughnessmap =
nullptr);
113 int numVertices = 200;
114 float xzScale = 50.0f;
115 float yScale = 10.0f;
117 std::vector<std::vector<float>> heightData;
A linked OpenGL program.
Definition shaderProgram.h:16
A class that represents a terrain object.
Definition terrain.h:28
float shininessValue
Definition terrain.h:44
glm::mat4 modelMatrix
Definition terrain.h:34
std::vector< Aire::WaterSurface * > waterSurfaces
Definition terrain.h:46
TexturePtr roughnessMap
Definition terrain.h:40
glm::vec3 diffuseColor
Definition terrain.h:42
glm::vec3 specularColor
Definition terrain.h:43
~Terrain()
Destructor for the Terrain object.
Definition terrain.cpp:77
float getYScale() const
Gets the terrain scale factor in the y axis.
Definition terrain.h:92
void render(ShaderProgram &prog, Aire::Camera &camera)
Renders the terrain using a specified shader program and camera.
Definition terrain.cpp:155
Terrain(TexturePtr heightMap, int numVertices=200, const float xzScale=50.f, const float yScale=10.f, TexturePtr diffuseMap=nullptr, TexturePtr normalMap=nullptr, TexturePtr roughnessmap=nullptr)
Constructs a Terrain object with specified parameters.
Definition terrain.cpp:9
std::vector< glm::vec3 > vertices
Definition terrain.h:30
std::vector< glm::vec2 > uvs
Definition terrain.h:31
TexturePtr specularMap
Definition terrain.h:38
TexturePtr heightMap
Definition terrain.h:36
void addWaterSurface(TextureManager *texManager, const Box2D ®ion, float height)
Adds a water surface to the terrain.
Definition terrain.cpp:228
TexturePtr diffuseMap
Definition terrain.h:37
std::vector< unsigned int > indices
Definition terrain.h:32
float getXZScale() const
Gets the terrain scale factor in the x and z axes.
Definition terrain.h:84
TexturePtr normalMap
Definition terrain.h:39
bool saveHeightData()
Loads the height data from the height map texture.
Definition terrain.cpp:82
float getHeightAt(const float x, const float z)
Retrieves the height of the terrain at a given point in world space.
Definition terrain.cpp:114
Texture manager. Handles texture creation, storage, and deletion.
Definition texManager.h:20
Utility struct for a 2D bounding-box.
Definition bbox.h:6