diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-03-05 19:39:09 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-03-08 21:41:12 +0100 |
commit | a99b10c86eb048c0b0f594029f3de9a3df473aae (patch) | |
tree | d66e0aa673eb049e61d08ac0fda1a591185315a2 /src/RendererSectionData.hpp | |
parent | Simplified Section class (diff) | |
download | AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar.gz AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar.bz2 AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar.lz AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar.xz AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.tar.zst AltCraft-a99b10c86eb048c0b0f594029f3de9a3df473aae.zip |
Diffstat (limited to '')
-rw-r--r-- | src/RendererSectionData.hpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/src/RendererSectionData.hpp b/src/RendererSectionData.hpp index 54b6eea..ca652f4 100644 --- a/src/RendererSectionData.hpp +++ b/src/RendererSectionData.hpp @@ -1,46 +1,20 @@ #pragma once #include <vector> -#include <array> #include <glm/mat4x4.hpp> -#include "Block.hpp" #include "Vector.hpp" class World; -class BlockModel; struct RendererSectionData { std::vector<glm::mat4> models; std::vector<glm::vec4> textures; std::vector<glm::vec3> colors; std::vector<glm::vec2> lights; - size_t hash; + size_t hash = 0; Vector sectionPos; - - RendererSectionData(World *world, Vector sectionPosition); - - ~RendererSectionData() = default; - - RendererSectionData(RendererSectionData &&other) = default; -private: - - void AddFacesByBlockModel(const std::vector<Vector> §ionsList, World *world, Vector blockPos, const BlockModel &model, glm::mat4 transform, unsigned char light, unsigned char skyLight, const std::array<unsigned char, 16 * 16 * 16>& visibility); - - std::array<unsigned char, 16 * 16 * 16> GetBlockVisibilityData(World *world); - - std::vector<std::pair<BlockId, const BlockModel *>> idModels; - const BlockModel* GetInternalBlockModel(const BlockId& id); - - std::array<BlockId, 4096> blockIdData; - void SetBlockIdData(World *world); - - inline const BlockId& GetBlockId(const Vector& pos) { - return blockIdData[pos.y * 256 + pos.z * 16 + pos.x]; - } - - inline const BlockId& GetBlockId(int x, int y, int z) { - return blockIdData[y * 256 + z * 16 + x]; - } }; + +RendererSectionData ParseSection(World *world, Vector sectionPosition);
\ No newline at end of file |