You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.2 KiB
51 lines
1.2 KiB
/* |
|
* ===================================================================================== |
|
* |
|
* Filename: chunk.h |
|
* |
|
* Description: Stores chunk information |
|
* |
|
* Version: 1.0 |
|
* Created: 04/03/2014 07:23:43 PM |
|
* Revision: none |
|
* Compiler: gcc |
|
* |
|
* Author: YOUR NAME (), |
|
* Organization: |
|
* |
|
* ===================================================================================== |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include "voxelutils.h" |
|
#include "chunkrenderer.h" |
|
#include "graphics/chunkmesh.h" |
|
|
|
#include <glm/glm.hpp> |
|
|
|
namespace vtk { |
|
|
|
class World; |
|
|
|
class Chunk { |
|
public: |
|
Chunk(World& world); |
|
bool isVoxelSolid(const int& x, const int& y, const int& z); //Is the voxel not a transparent type? |
|
void setVoxelType(const int& x, const int& y, const int& z, const unsigned& type); |
|
unsigned getVoxelType(const unsigned& x, const unsigned& y, const unsigned& z); |
|
glm::ivec3 getWorldCoords(const int& x, const int& y, const int& z); |
|
|
|
void setPos(const glm::ivec3& pos); |
|
glm::ivec3 getPos(); |
|
World& getWorld(); |
|
|
|
|
|
ChunkRenderer renderer; |
|
protected: |
|
std::array<unsigned, 4096> voxels; |
|
World& mLinkedWorld; |
|
glm::ivec3 mPos; |
|
}; |
|
|
|
}
|
|
|