mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 22:53:35 +00:00
working on chunk generation
This commit is contained in:
@@ -6,21 +6,22 @@
|
||||
#include <ScopMaths.h>
|
||||
|
||||
constexpr Scop::Vec3ui CHUNK_SIZE = Scop::Vec3ui{ 16, 256, 16 };
|
||||
constexpr std::uint32_t CHUNK_VOLUME = CHUNK_SIZE.x * CHUNK_SIZE.y * CHUNK_SIZE.z;
|
||||
|
||||
class Chunk
|
||||
{
|
||||
public:
|
||||
Chunk(Scop::Scene& world, Scop::Vec2ui offset);
|
||||
Chunk(class World& world, Scop::Vec2i offset);
|
||||
|
||||
void GenerateChunk();
|
||||
std::uint32_t GetBlock(Scop::Vec3i position) const noexcept;
|
||||
|
||||
~Chunk() = default;
|
||||
|
||||
private:
|
||||
std::vector<std::uint32_t> m_data;
|
||||
Scop::Vec2ui m_offset; // In chunks
|
||||
Scop::Vec2ui m_position; // In blocks
|
||||
std::vector<std::vector<std::vector<std::uint32_t>>> m_data; // Should be a flat array but I cannot manage to flatten the 3D coordinates correctly
|
||||
Scop::Vec2i m_offset; // In chunks
|
||||
Scop::Vec2i m_position; // In blocks
|
||||
class World& m_world;
|
||||
Scop::NonOwningPtr<Scop::Actor> p_actor = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user