voxspatium/src/planet/Chunk.h

40 lines
597 B
C++

#ifndef __CHUNK_H__
#define __CHUNK_H__
#include "util/Common.h"
#include "planet/Planet.h"
#include "Camera.h"
#define CHUNK_N 32
struct Cell
{
glm::vec3 position;
GLuint internalId;
};
class Chunk
{
public:
Chunk(Planet* planet, class PlanetFace* face, int x, int y, int z);
~Chunk();
void destroyChunk();
void tick(GLfloat dtime);
void draw(Camera* camera);
private:
Planet* m_planet;
class PlanetFace* m_planetFace;
bool m_dirty;
bool m_active;
int m_cx, m_cy, m_cz;
GLuint m_vao, m_vbo;
Cell* m_cells[CHUNK_N][CHUNK_N][CHUNK_N];
};
#endif // __CHUNK_H__