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
37 glm::vec3 outline_color;
41 const glm::vec3 &color = { 1, 1, 1 },
42 const Shape *shape = &DEFAULT_SHAPE,
43 const glm::vec3 &outline_color = { -1, -1, -1 })
44 : id(0), visible(v), shape(shape), color(color), outline_color(outline_color) { }
46 static const NullShape DEFAULT_SHAPE;
51 const glm::vec3 &pos_offset = { 0, 0, 0 },
52 Model::Index idx_offset = 0
54 void FillOutlineModel(
56 const glm::vec3 &pos_offset = { 0, 0, 0 },
57 OutlineModel::Index idx_offset = 0
63 class BlockTypeRegistry {
69 Block::Type Add(const BlockType &);
71 size_t Size() const { return types.size(); }
73 BlockType *operator [](Block::Type id) { return &types[id]; }
74 const BlockType *Get(Block::Type id) const { return &types[id]; }
77 std::vector<BlockType> types;