1 #ifndef BLANK_BLOCK_HPP_
2 #define BLANK_BLOCK_HPP_
4 #include "geometry.hpp"
14 /// attributes of a type of block
23 glm::vec3 outline_color;
27 const glm::vec3 &color = { 1, 1, 1 },
28 const Shape *shape = &DEFAULT_SHAPE,
29 const glm::vec3 &outline_color = { -1, -1, -1 })
30 : id(-1), visible(v), shape(shape), color(color), outline_color(outline_color) { }
32 static const NullShape DEFAULT_SHAPE;
37 const glm::vec3 &pos_offset = { 0, 0, 0 },
38 Model::Index idx_offset = 0
40 void FillOutlineModel(
42 const glm::vec3 &pos_offset = { 0, 0, 0 },
43 OutlineModel::Index idx_offset = 0
49 class BlockTypeRegistry {
55 int Add(const BlockType &);
57 size_t Size() const { return types.size(); }
59 BlockType *operator [](int id) { return &types[id]; }
60 const BlockType *Get(int id) const { return &types[id]; }
63 std::vector<BlockType> types;
71 using Pos = glm::vec3;
75 constexpr explicit Block(int type = 0)