OpenMiner/include/world/World.hpp

51 lines
1.0 KiB
C++
Raw Normal View History

2014-12-18 07:02:48 +01:00
/*
* =====================================================================================
*
* Filename: World.hpp
*
2018-06-05 01:24:54 +02:00
* Description:
2014-12-18 07:02:48 +01:00
*
* Created: 16/12/2014 15:28:02
*
* Author: Quentin Bazin, <quent42340@gmail.com>
2014-12-18 07:02:48 +01:00
*
* =====================================================================================
*/
#ifndef WORLD_HPP_
#define WORLD_HPP_
#include <memory>
#include "Chunk.hpp"
#include "TerrainGenerator.hpp"
2014-12-18 07:02:48 +01:00
class Camera;
2014-12-18 07:02:48 +01:00
class World {
public:
World();
2018-06-05 01:24:54 +02:00
void draw(Camera &camera, Shader &shader, const glm::mat4 &projectionMatrix, const glm::mat4 &viewMatrix);
2018-06-05 01:24:54 +02:00
Chunk *getChunk(int cx, int cz);
2018-06-05 01:24:54 +02:00
Block *getBlock(int x, int y, int z);
void setBlock(int x, int y, int z, u32 id);
2014-12-23 16:15:44 +01:00
// Render distance in chunks
2015-02-06 01:44:16 +01:00
static const u16 renderDistance = 8;
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
private:
const s32 m_width = 100;
const s32 m_height = 1; // FIXME: Never used
const s32 m_depth = 100;
2018-06-05 01:24:54 +02:00
2015-02-06 01:44:16 +01:00
Texture m_texture;
2018-06-05 01:24:54 +02:00
2014-12-18 07:02:48 +01:00
std::vector<std::unique_ptr<Chunk>> m_chunks;
TerrainGenerator m_terrainGenerator;
2014-12-18 07:02:48 +01:00
};
#endif // WORLD_HPP_