1 #ifndef BLANK_BLOCK_HPP_
2 #define BLANK_BLOCK_HPP_
4 #include "geometry.hpp"
17 using Type = unsigned short;
18 using Pos = glm::vec3;
22 constexpr explicit Block(Type type = 0)
28 /// attributes of a type of block
33 glm::vec3 outline_color;
50 const glm::vec3 &color = { 1, 1, 1 },
51 const Shape *shape = &DEFAULT_SHAPE
54 static const NullShape DEFAULT_SHAPE;
59 const glm::vec3 &pos_offset = { 0, 0, 0 },
60 Model::Index idx_offset = 0
62 void FillOutlineModel(
64 const glm::vec3 &pos_offset = { 0, 0, 0 },
65 OutlineModel::Index idx_offset = 0
71 class BlockTypeRegistry {
77 Block::Type Add(const BlockType &);
79 size_t Size() const { return types.size(); }
81 BlockType *operator [](Block::Type id) { return &types[id]; }
82 const BlockType *Get(Block::Type id) const { return &types[id]; }
85 std::vector<BlockType> types;