summaryrefslogtreecommitdiff
path: root/game/terrain.h
blob: 4775dff24586134b941d5f7b04a7671b47478c3f (plain)
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
#ifndef TERRAIN_H
#define TERRAIN_H

#include "chronology.hpp"
#include "collection.hpp"
#include "game/worldobject.h"
#include <gfx/models/mesh.h>
#include <gfx/renderable.h>
#include <memory>

class Shader;
class Texture;
class GeoData;

class Terrain : public WorldObject, public Renderable {
public:
	explicit Terrain(std::shared_ptr<GeoData>);

	void render(const Shader & shader) const override;

	void tick(TickDuration) override;
	float waveCycle {0.F};

private:
	void generateMeshes();

	std::shared_ptr<GeoData> geoData;
	Collection<Mesh, false> meshes;
	std::shared_ptr<Texture> grass, water;
};

#endif